diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-18 19:56:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-18 19:56:20 +0000 |
commit | d47504d9dbe025f38327c34fc5e1c2c4f678cfbe (patch) | |
tree | 91329aef39c190d4350d5cf014357e44b2620bca /llvm/lib | |
parent | f3edc49ae25a968646d294549cfcfd0c4e0bdc9c (diff) | |
download | bcm5719-llvm-d47504d9dbe025f38327c34fc5e1c2c4f678cfbe.tar.gz bcm5719-llvm-d47504d9dbe025f38327c34fc5e1c2c4f678cfbe.zip |
Strip out and simplify some code. This also fixes the regression last
night compiling cfrac. It did not realize that code like this:
int G; int *H = &G;
takes the address of G.
llvm-svn: 14973
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalConstifier.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalConstifier.cpp b/llvm/lib/Transforms/IPO/GlobalConstifier.cpp index 3478d9de41b..6f01f25f507 100644 --- a/llvm/lib/Transforms/IPO/GlobalConstifier.cpp +++ b/llvm/lib/Transforms/IPO/GlobalConstifier.cpp @@ -44,16 +44,9 @@ Pass *llvm::createGlobalConstifierPass() { return new Constifier(); } /// static bool isStoredThrough(Value *V) { for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI) - if (Constant *C = dyn_cast<Constant>(*UI)) { - if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { - if (isStoredThrough(CE)) - return true; - } else if (GlobalValue *GV = dyn_cast<GlobalValue>(C)) { - if (isStoredThrough(GV)) return true; - } else { - // Must be an element of a constant array or something. + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(*UI)) { + if (isStoredThrough(CE)) return true; - } } else if (Instruction *I = dyn_cast<Instruction>(*UI)) { if (I->getOpcode() == Instruction::GetElementPtr) { if (isStoredThrough(I)) return true; |