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 | 2616560b5e0c80cbdd78a100958d495bdd09a542 (patch) | |
tree | ca84d8351c49cbb5a143d0c0a84ffee22fe6db1a /lib/CodeGen/MachineModuleInfo.cpp | |
parent | 75c24e092345f13c8c42fb21149d58debbe8210b (diff) | |
download | external_llvm-2616560b5e0c80cbdd78a100958d495bdd09a542.tar.gz external_llvm-2616560b5e0c80cbdd78a100958d495bdd09a542.tar.bz2 external_llvm-2616560b5e0c80cbdd78a100958d495bdd09a542.zip |
use stripPointerCasts to simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | lib/CodeGen/MachineModuleInfo.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index f5d92f13b5..66dd8375eb 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/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-------------------------------------------------------------------===// |