summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-03-22 17:51:25 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-03-22 17:51:25 +0000
commit6b535630a1222ff1e535989242dbad8513df2eb2 (patch)
treeda6d7317e2299582b1dfdeac9805efadadeb7b63 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent4d511909362fb5c8a8396453fe7e68fe8fa03296 (diff)
downloadbcm5719-llvm-6b535630a1222ff1e535989242dbad8513df2eb2.tar.gz
bcm5719-llvm-6b535630a1222ff1e535989242dbad8513df2eb2.zip
Add a hasOperandBundlesOtherThan helper, and use it; NFC
llvm-svn: 264072
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index d01dd983324..6f653613385 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2127,14 +2127,11 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
MachineBasicBlock *Return = FuncInfo.MBBMap[I.getSuccessor(0)];
const BasicBlock *EHPadBB = I.getSuccessor(1);
-#ifndef NDEBUG
// Deopt bundles are lowered in LowerCallSiteWithDeoptBundle, and we don't
// have to do anything here to lower funclet bundles.
- for (unsigned i = 0, e = I.getNumOperandBundles(); i != e; ++i)
- assert((I.getOperandBundleAt(i).isDeoptOperandBundle() ||
- I.getOperandBundleAt(i).isFuncletOperandBundle()) &&
- "Cannot lower invokes with arbitrary operand bundles yet!");
-#endif
+ assert(!I.hasOperandBundlesOtherThan(
+ {LLVMContext::OB_deopt, LLVMContext::OB_funclet}) &&
+ "Cannot lower invokes with arbitrary operand bundles yet!");
const Value *Callee(I.getCalledValue());
const Function *Fn = dyn_cast<Function>(Callee);
@@ -6116,14 +6113,11 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
RenameFn,
DAG.getTargetLoweringInfo().getPointerTy(DAG.getDataLayout()));
-#ifndef NDEBUG
// Deopt bundles are lowered in LowerCallSiteWithDeoptBundle, and we don't
// have to do anything here to lower funclet bundles.
- for (unsigned i = 0, e = I.getNumOperandBundles(); i != e; ++i)
- assert((I.getOperandBundleAt(i).isDeoptOperandBundle() ||
- I.getOperandBundleAt(i).isFuncletOperandBundle()) &&
- "Cannot lower calls with arbitrary operand bundles!");
-#endif
+ assert(!I.hasOperandBundlesOtherThan(
+ {LLVMContext::OB_deopt, LLVMContext::OB_funclet}) &&
+ "Cannot lower calls with arbitrary operand bundles!");
if (I.countOperandBundlesOfType(LLVMContext::OB_deopt))
LowerCallSiteWithDeoptBundle(&I, Callee, nullptr);
OpenPOWER on IntegriCloud