[llvm] r297535 - [IRTranslator] Simplify error handling for translating constants. NFC.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 16:28:33 PST 2017
Author: qcolombet
Date: Fri Mar 10 18:28:33 2017
New Revision: 297535
URL: http://llvm.org/viewvc/llvm-project?rev=297535&view=rev
Log:
[IRTranslator] Simplify error handling for translating constants. NFC.
We don't need to check whether the fallback path is enabled to return
false. Just do that all the time on error cases, the caller knows (or
at least should know!) how to handle the failing case.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=297535&r1=297534&r2=297535&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Mar 10 18:28:33 2017
@@ -1050,9 +1050,7 @@ bool IRTranslator::translate(const Instr
case Instruction::OPCODE: return translate##OPCODE(Inst, CurBuilder);
#include "llvm/IR/Instruction.def"
default:
- if (!TPC->isGlobalISelAbortEnabled())
- return false;
- llvm_unreachable("unknown opcode");
+ return false;
}
}
@@ -1082,14 +1080,10 @@ bool IRTranslator::translate(const Const
case Instruction::OPCODE: return translate##OPCODE(*CE, EntryBuilder);
#include "llvm/IR/Instruction.def"
default:
- if (!TPC->isGlobalISelAbortEnabled())
- return false;
- llvm_unreachable("unknown opcode");
+ return false;
}
- } else if (!TPC->isGlobalISelAbortEnabled())
+ } else
return false;
- else
- llvm_unreachable("unhandled constant kind");
return true;
}
More information about the llvm-commits
mailing list