summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2017-01-20 00:16:19 +0000
committerJustin Bogner <mail@justinbogner.com>2017-01-20 00:16:19 +0000
commit23acaf07dec39bec9938061d62b1880d0e95465c (patch)
treef02cb11a688a3b53d133abccb64b70d04b0ab8d4 /llvm/lib/CodeGen
parent3ffeb68869d91a96ced85b6a6fef9efc5b5d424a (diff)
downloadbcm5719-llvm-23acaf07dec39bec9938061d62b1880d0e95465c.tar.gz
bcm5719-llvm-23acaf07dec39bec9938061d62b1880d0e95465c.zip
GlobalISel: Pass the MachineFunction in to reportSelectionError directly
Rather than trying to find MF based on the possibly-null MI we've passed in here, just pass it in directly. It's already available at all callers anyway. llvm-svn: 292544
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
index 7c621b79477..0db7fd9f1ae 100644
--- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
@@ -44,8 +44,8 @@ void InstructionSelect::getAnalysisUsage(AnalysisUsage &AU) const {
MachineFunctionPass::getAnalysisUsage(AU);
}
-static void reportSelectionError(const MachineInstr *MI, const Twine &Message) {
- const MachineFunction &MF = *MI->getParent()->getParent();
+static void reportSelectionError(const MachineFunction &MF,
+ const MachineInstr *MI, const Twine &Message) {
std::string ErrStorage;
raw_string_ostream Err(ErrStorage);
Err << Message << ":\nIn function: " << MF.getName() << '\n';
@@ -83,7 +83,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
for (const MachineBasicBlock &MBB : MF)
for (const MachineInstr &MI : MBB)
if (isPreISelGenericOpcode(MI.getOpcode()) && !MLI->isLegal(MI, MRI))
- reportSelectionError(&MI, "Instruction is not legal");
+ reportSelectionError(MF, &MI, "Instruction is not legal");
#endif
// FIXME: We could introduce new blocks and will need to fix the outer loop.
@@ -119,7 +119,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
if (TPC.isGlobalISelAbortEnabled())
// FIXME: It would be nice to dump all inserted instructions. It's
// not obvious how, esp. considering select() can insert after MI.
- reportSelectionError(&MI, "Cannot select");
+ reportSelectionError(MF, &MI, "Cannot select");
Failed = true;
break;
}
@@ -146,7 +146,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
: &*MRI.def_instr_begin(VReg);
if (!RC) {
if (TPC.isGlobalISelAbortEnabled())
- reportSelectionError(MI, "VReg as no regclass after selection");
+ reportSelectionError(MF, MI, "VReg as no regclass after selection");
Failed = true;
break;
}
@@ -155,7 +155,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
VRegToType.second.getSizeInBits() > (RC->getSize() * 8)) {
if (TPC.isGlobalISelAbortEnabled())
reportSelectionError(
- MI, "VReg has explicit size different from class size");
+ MF, MI, "VReg has explicit size different from class size");
Failed = true;
break;
}
OpenPOWER on IntegriCloud