[llvm-commits] [llvm] r80265 - /llvm/trunk/lib/VMCore/Value.cpp

Dan Gohman gohman at apple.com
Thu Aug 27 10:55:13 PDT 2009


Author: djg
Date: Thu Aug 27 12:55:13 2009
New Revision: 80265

URL: http://llvm.org/viewvc/llvm-project?rev=80265&view=rev
Log:
Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.

Modified:
    llvm/trunk/lib/VMCore/Value.cpp

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=80265&r1=80264&r2=80265&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Thu Aug 27 12:55:13 2009
@@ -340,6 +340,10 @@
       V = GEP->getPointerOperand();
     } else if (Operator::getOpcode(V) == Instruction::BitCast) {
       V = cast<Operator>(V)->getOperand(0);
+    } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
+      if (GA->mayBeOverridden())
+        return V;
+      V = GA->getAliasee();
     } else {
       return V;
     }
@@ -357,6 +361,10 @@
       V = GEP->getPointerOperand();
     } else if (Operator::getOpcode(V) == Instruction::BitCast) {
       V = cast<Operator>(V)->getOperand(0);
+    } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
+      if (GA->mayBeOverridden())
+        return V;
+      V = GA->getAliasee();
     } else {
       return V;
     }





More information about the llvm-commits mailing list