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 | 1d5c49327b81fe99295dc55d3be80a229f214da3 (patch) | |
tree | ca84d8351c49cbb5a143d0c0a84ffee22fe6db1a /lib/CodeGen/MachineModuleInfo.cpp | |
parent | 857755c2a57562e050f11d84ff1658c6175ed813 (diff) |
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-------------------------------------------------------------------===// |