mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
improve EH global handling, patch by Duncan Sands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6e21ff0b0a
commit
99f9a77c49
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user