summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-27 01:20:11 +0000
committerChris Lattner <sabre@nondot.org>2007-04-27 01:20:11 +0000
commit784fe9dbbbb51e7bfe03313f84d80411700ab05c (patch)
tree9f8230add2757a9fc34e5896bec1e11bc37cf896
parent2c1bba0c0ca8e6e1324f1b5121681bc43df21a34 (diff)
downloadbcm5719-llvm-784fe9dbbbb51e7bfe03313f84d80411700ab05c.tar.gz
bcm5719-llvm-784fe9dbbbb51e7bfe03313f84d80411700ab05c.zip
improve EH global handling, patch by Duncan Sands.
llvm-svn: 36499
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index db9bf0d0df1..ac3eedfa3a1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2610,14 +2610,18 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
// MachineModuleInfo.
std::vector<GlobalVariable *> TyInfo;
for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) {
- ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(i));
- if (CE && CE->getOpcode() == Instruction::BitCast &&
- isa<GlobalVariable>(CE->getOperand(0))) {
+ Constant *C = cast<Constant>(I.getOperand(i));
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
+ TyInfo.push_back(GV);
+ } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
+ assert(CE->getOpcode() == Instruction::BitCast &&
+ isa<GlobalVariable>(CE->getOperand(0))
+ && "TypeInfo must be a global variable or NULL");
TyInfo.push_back(cast<GlobalVariable>(CE->getOperand(0)));
} else {
- ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i));
- assert(CI && CI->getZExtValue() == 0 &&
- "TypeInfo must be a global variable typeinfo or NULL");
+ ConstantInt *CI = dyn_cast<ConstantInt>(C);
+ assert(CI && CI->isNullValue() &&
+ "TypeInfo must be a global variable or NULL");
TyInfo.push_back(NULL);
}
}
OpenPOWER on IntegriCloud