use stripPointerCasts to simplify some code.

llvm-svn: 76397
This commit is contained in:
Chris Lattner 2009-07-20 06:05:50 +00:00
parent 36b89d4fb7
commit cbd8366755

View File

@ -96,12 +96,10 @@ void MachineModuleInfo::AnalyzeModule(Module &M) {
ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
if (InitList == 0) return;
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(InitList->getOperand(i)))
if (CE->getOpcode() == Instruction::BitCast)
if (Function *F = dyn_cast<Function>(CE->getOperand(0)))
UsedFunctions.insert(F);
}
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
if (Function *F =
dyn_cast<Function>(InitList->getOperand(i)->stripPointerCasts()))
UsedFunctions.insert(F);
}
//===-EH-------------------------------------------------------------------===//