mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Remove ExtractGlobalVariable - use StripPointerCasts
instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2491,27 +2491,10 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ExtractGlobalVariable - If V is a global variable, or a bitcast of one
|
/// ExtractTypeInfo - Returns the type info, possibly bitcast, encoded in V.
|
||||||
/// (possibly constant folded), return it. Otherwise return NULL.
|
|
||||||
static GlobalVariable *ExtractGlobalVariable (Value *V) {
|
|
||||||
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
|
|
||||||
return GV;
|
|
||||||
else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
|
|
||||||
if (CE->getOpcode() == Instruction::BitCast)
|
|
||||||
return dyn_cast<GlobalVariable>(CE->getOperand(0));
|
|
||||||
else if (CE->getOpcode() == Instruction::GetElementPtr) {
|
|
||||||
for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
|
|
||||||
if (!CE->getOperand(i)->isNullValue())
|
|
||||||
return NULL;
|
|
||||||
return dyn_cast<GlobalVariable>(CE->getOperand(0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ExtractTypeInfo - Extracts the type info from a value.
|
|
||||||
static GlobalVariable *ExtractTypeInfo (Value *V) {
|
static GlobalVariable *ExtractTypeInfo (Value *V) {
|
||||||
GlobalVariable *GV = ExtractGlobalVariable(V);
|
V = IntrinsicInst::StripPointerCasts(V);
|
||||||
|
GlobalVariable *GV = dyn_cast<GlobalVariable>(V);
|
||||||
assert (GV || isa<ConstantPointerNull>(V) &&
|
assert (GV || isa<ConstantPointerNull>(V) &&
|
||||||
"TypeInfo must be a global variable or NULL");
|
"TypeInfo must be a global variable or NULL");
|
||||||
return GV;
|
return GV;
|
||||||
|
Reference in New Issue
Block a user