mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-07 17:46:05 +00:00
improve EH global handling, patch by Duncan Sands.
llvm-svn: 36499
This commit is contained in:
parent
2c1bba0c0c
commit
784fe9dbbb
@ -2610,14 +2610,18 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
// MachineModuleInfo.
|
// MachineModuleInfo.
|
||||||
std::vector<GlobalVariable *> TyInfo;
|
std::vector<GlobalVariable *> TyInfo;
|
||||||
for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) {
|
for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) {
|
||||||
ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(i));
|
Constant *C = cast<Constant>(I.getOperand(i));
|
||||||
if (CE && CE->getOpcode() == Instruction::BitCast &&
|
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
|
||||||
isa<GlobalVariable>(CE->getOperand(0))) {
|
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)));
|
TyInfo.push_back(cast<GlobalVariable>(CE->getOperand(0)));
|
||||||
} else {
|
} else {
|
||||||
ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i));
|
ConstantInt *CI = dyn_cast<ConstantInt>(C);
|
||||||
assert(CI && CI->getZExtValue() == 0 &&
|
assert(CI && CI->isNullValue() &&
|
||||||
"TypeInfo must be a global variable typeinfo or NULL");
|
"TypeInfo must be a global variable or NULL");
|
||||||
TyInfo.push_back(NULL);
|
TyInfo.push_back(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user