summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/iMemory.cpp
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2004-05-06 22:15:47 +0000
committerJohn Criswell <criswell@uiuc.edu>2004-05-06 22:15:47 +0000
commit2af0fd3ca85465b4d7deb9db7dffed15b3067c3d (patch)
tree44397660df01aead15b0282bec0f09a8ac361172 /llvm/lib/VMCore/iMemory.cpp
parent6aee736d1b5ee335bf9a8616200fa8b3b02b2649 (diff)
downloadbcm5719-llvm-2af0fd3ca85465b4d7deb9db7dffed15b3067c3d.tar.gz
bcm5719-llvm-2af0fd3ca85465b4d7deb9db7dffed15b3067c3d.zip
Don't call getForwardedType() twice, as recommended by Chris.
llvm-svn: 13391
Diffstat (limited to 'llvm/lib/VMCore/iMemory.cpp')
-rw-r--r--llvm/lib/VMCore/iMemory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/iMemory.cpp b/llvm/lib/VMCore/iMemory.cpp
index 32fe71a0862..da4cc7483f0 100644
--- a/llvm/lib/VMCore/iMemory.cpp
+++ b/llvm/lib/VMCore/iMemory.cpp
@@ -161,8 +161,8 @@ const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,
// of being refined to another type (and hence, may have dropped all
// references to what it was using before). So, use the new forwarded
// type.
- if (Ptr->getForwardedType()) {
- Ptr = Ptr->getForwardedType();
+ if (const Type * Ty = Ptr->getForwardedType()) {
+ Ptr = Ty;
}
}
return CurIdx == Idx.size() ? Ptr : 0;
OpenPOWER on IntegriCloud