[llvm-branch-commits] [llvm-branch] r134502 - in /llvm/branches/type-system-rewrite/lib/VMCore: AsmWriter.cpp Module.cpp

Chris Lattner sabre at nondot.org
Wed Jul 6 10:29:13 PDT 2011


Author: lattner
Date: Wed Jul  6 12:29:13 2011
New Revision: 134502

URL: http://llvm.org/viewvc/llvm-project?rev=134502&view=rev
Log:
make asmprinter able to print out partially constructed aliases (which don't have
their aliasee set yet).

Modified:
    llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp
    llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp

Modified: llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp?rev=134502&r1=134501&r2=134502&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp Wed Jul  6 12:29:13 2011
@@ -1359,7 +1359,10 @@
 
   const Constant *Aliasee = GA->getAliasee();
 
-  if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Aliasee)) {
+  if (Aliasee == 0) {
+    TypePrinter.print(GA->getType(), Out);
+    Out << " <<NULL ALIASEE>>";
+  } else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Aliasee)) {
     TypePrinter.print(GV->getType(), Out);
     Out << ' ';
     PrintLLVMName(Out, GV);

Modified: llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp?rev=134502&r1=134501&r2=134502&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp Wed Jul  6 12:29:13 2011
@@ -456,7 +456,8 @@
       for (Module::const_alias_iterator I = M.alias_begin(),
            E = M.alias_end(); I != E; ++I) {
         incorporateType(I->getType());
-        incorporateValue(I->getAliasee());
+        if (const Value *Aliasee = I->getAliasee())
+          incorporateValue(Aliasee);
       }
       
       // Get types from functions.





More information about the llvm-branch-commits mailing list