[llvm-commits] [llvm] r76397 - /llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
Chris Lattner
sabre at nondot.org
Sun Jul 19 23:05:50 PDT 2009
Author: lattner
Date: Mon Jul 20 01:05:50 2009
New Revision: 76397
URL: http://llvm.org/viewvc/llvm-project?rev=76397&view=rev
Log:
use stripPointerCasts to simplify some code.
Modified:
llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=76397&r1=76396&r2=76397&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Mon Jul 20 01:05:50 2009
@@ -96,12 +96,10 @@
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-------------------------------------------------------------------===//
More information about the llvm-commits
mailing list