mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 07:31:47 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9db07b9307
commit
96940cb522
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user