summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-12 11:19:24 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-12 11:19:24 +0000
commit6143704ac5bed390db2427527126a00c67bf0913 (patch)
tree185a7f74e7558b59e782ccaa4fbd0f5dd3fcbd00 /llvm/lib/Transforms
parent8629f12bb828b7a5fb65356acd6239092bc288d5 (diff)
downloadbcm5719-llvm-6143704ac5bed390db2427527126a00c67bf0913.tar.gz
bcm5719-llvm-6143704ac5bed390db2427527126a00c67bf0913.zip
cache dereferenced iterators
llvm-svn: 108134
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/StructRetPromotion.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
index 2c52998ff54..a74686f408b 100644
--- a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -171,16 +171,16 @@ bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
// Check FirstArg's users.
for (Value::use_iterator ArgI = FirstArg->use_begin(),
ArgE = FirstArg->use_end(); ArgI != ArgE; ++ArgI) {
-
+ User *U = *ArgI;
// If FirstArg user is a CallInst that does not correspond to current
// call site then this function F is not suitable for sret promotion.
- if (CallInst *CI = dyn_cast<CallInst>(ArgI)) {
+ if (CallInst *CI = dyn_cast<CallInst>(U)) {
if (CI != Call)
return false;
}
// If FirstArg user is a GEP whose all users are not LoadInst then
// this function F is not suitable for sret promotion.
- else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(ArgI)) {
+ else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
// TODO : Use dom info and insert PHINodes to collect get results
// from multiple call sites for this GEP.
if (GEP->getParent() != Call->getParent())
OpenPOWER on IntegriCloud