diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-02-20 11:26:25 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-02-20 11:26:25 +0000 |
commit | 07e6e56f57e8781a8d7bc601cc9034a3741d84c2 (patch) | |
tree | 2242da177cc122083043828a10ab51785d5e6b03 /lib/Transforms/IPO/GlobalOpt.cpp | |
parent | d28b57569de19511f63a010a209a08a4e24bfac3 (diff) | |
download | llvm-07e6e56f57e8781a8d7bc601cc9034a3741d84c2.tar.gz llvm-07e6e56f57e8781a8d7bc601cc9034a3741d84c2.tar.bz2 llvm-07e6e56f57e8781a8d7bc601cc9034a3741d84c2.tar.xz |
Make Transforms to be 4.3 warnings-clean
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index ef76a6e42d..452fa9c741 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -178,7 +178,7 @@ static bool AnalyzeGlobal(Value *V, GlobalStatus &GS, // If this is a direct store to the global (i.e., the global is a scalar // value, not an aggregate), keep more specific information about // stores. - if (GS.StoredType != GlobalStatus::isStored) + if (GS.StoredType != GlobalStatus::isStored) { if (GlobalVariable *GV = dyn_cast<GlobalVariable>(SI->getOperand(1))){ Value *StoredVal = SI->getOperand(0); if (StoredVal == GV->getInitializer()) { @@ -201,6 +201,7 @@ static bool AnalyzeGlobal(Value *V, GlobalStatus &GS, } else { GS.StoredType = GlobalStatus::isStored; } + } } else if (isa<GetElementPtrInst>(I)) { if (AnalyzeGlobal(I, GS, PHIUsers)) return true; } else if (isa<SelectInst>(I)) { @@ -531,7 +532,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV) { Value *NewPtr = NewGlobals[Val]; // Form a shorter GEP if needed. - if (GEP->getNumOperands() > 3) + if (GEP->getNumOperands() > 3) { if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) { SmallVector<Constant*, 8> Idxs; Idxs.push_back(NullInt); @@ -548,6 +549,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV) { NewPtr = new GetElementPtrInst(NewPtr, Idxs.begin(), Idxs.end(), GEPI->getName()+"."+utostr(Val), GEPI); } + } GEP->replaceAllUsesWith(NewPtr); if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP)) |