aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-15 12:46:56 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-15 12:46:56 +0000
commit9ee17208115482441953127615231c59a2f4d052 (patch)
treefea1c2465e14ae8c3d89e0cf07588155acf8a23d /lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent45d95a1ad5eb72c65db8cc691a10339aa7c9c024 (diff)
downloadexternal_llvm-9ee17208115482441953127615231c59a2f4d052.zip
external_llvm-9ee17208115482441953127615231c59a2f4d052.tar.gz
external_llvm-9ee17208115482441953127615231c59a2f4d052.tar.bz2
back out r101364, as it trips the linux nightlybot on some clang C++ tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index dc04ca1..7ecaabb 100644
--- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -31,6 +31,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/Target/TargetIntrinsicInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/Compiler.h"
@@ -309,7 +310,7 @@ GlobalVariable *llvm::ExtractTypeInfo(Value *V) {
void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI,
MachineBasicBlock *MBB) {
// Inform the MachineModuleInfo of the personality for this landing pad.
- const ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(1));
+ const ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(2));
assert(CE->getOpcode() == Instruction::BitCast &&
isa<Function>(CE->getOperand(0)) &&
"Personality should be a function");
@@ -318,9 +319,9 @@ void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI,
// Gather all the type infos for this landing pad and pass them along to
// MachineModuleInfo.
std::vector<const GlobalVariable *> TyInfo;
- unsigned N = I.getNumOperands() - 1;
+ unsigned N = I.getNumOperands();
- for (unsigned i = N - 1; i > 1; --i) {
+ for (unsigned i = N - 1; i > 2; --i) {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i))) {
unsigned FilterLength = CI->getZExtValue();
unsigned FirstCatch = i + FilterLength + !FilterLength;
@@ -350,9 +351,9 @@ void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI,
}
}
- if (N > 2) {
- TyInfo.reserve(N - 2);
- for (unsigned j = 2; j < N - 1; ++j)
+ if (N > 3) {
+ TyInfo.reserve(N - 3);
+ for (unsigned j = 3; j < N; ++j)
TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
MMI->addCatchTypeInfo(MBB, TyInfo);
}