[llvm] r212732 - IR: Aliases don't belong to an explicit comdat

David Majnemer david.majnemer at gmail.com
Thu Jul 10 09:26:10 PDT 2014


Author: majnemer
Date: Thu Jul 10 11:26:10 2014
New Revision: 212732

URL: http://llvm.org/viewvc/llvm-project?rev=212732&view=rev
Log:
IR: Aliases don't belong to an explicit comdat

Aliases inherit their comdat from their aliasee, they don't have an
explicit comdat.

This fixes PR20279.

Modified:
    llvm/trunk/lib/IR/AsmWriter.cpp
    llvm/trunk/test/Feature/comdat.ll

Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=212732&r1=212731&r2=212732&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Thu Jul 10 11:26:10 2014
@@ -1528,11 +1528,6 @@ void AssemblyWriter::printAlias(const Gl
     writeOperand(Aliasee, !isa<ConstantExpr>(Aliasee));
   }
 
-  if (GA->hasComdat()) {
-    Out << ", comdat ";
-    PrintLLVMName(Out, GA->getComdat()->getName(), ComdatPrefix);
-  }
-
   printInfoComment(*GA);
   Out << '\n';
 }

Modified: llvm/trunk/test/Feature/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/comdat.ll?rev=212732&r1=212731&r2=212732&view=diff
==============================================================================
--- llvm/trunk/test/Feature/comdat.ll (original)
+++ llvm/trunk/test/Feature/comdat.ll Thu Jul 10 11:26:10 2014
@@ -9,6 +9,9 @@ $f2 = comdat any
 @v = global i32 0, comdat $f
 ; CHECK: @v = global i32 0, comdat $f
 
+ at a = alias i32* @v
+; CHECK: @a = alias i32* @v{{$}}
+
 define void @f() comdat $f {
   ret void
 }





More information about the llvm-commits mailing list