diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-20 06:05:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-20 06:05:50 +0000 |
commit | 029380fad72bfc7583d6a66bc3e394fb48f3cacb (patch) | |
tree | 410936c7fb912872755f09acfa67c2e575f1cbdd /llvm/lib/CodeGen/MachineModuleInfo.cpp | |
parent | ae76db5edd9251d76af488d601be01d903805f8e (diff) | |
download | bcm5719-llvm-029380fad72bfc7583d6a66bc3e394fb48f3cacb.tar.gz bcm5719-llvm-029380fad72bfc7583d6a66bc3e394fb48f3cacb.zip |
use stripPointerCasts to simplify some code.
llvm-svn: 76397
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index f5d92f13b52..66dd8375eb5 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -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-------------------------------------------------------------------===// |