From c1a6d65d21545ad1622e2f8041c6a55756b71599 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 10 Jul 2014 16:26:10 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212732 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/AsmWriter.cpp | 5 ----- test/Feature/comdat.ll | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 87d26b164bb..a7499bc09b3 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -1528,11 +1528,6 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) { writeOperand(Aliasee, !isa(Aliasee)); } - if (GA->hasComdat()) { - Out << ", comdat "; - PrintLLVMName(Out, GA->getComdat()->getName(), ComdatPrefix); - } - printInfoComment(*GA); Out << '\n'; } diff --git a/test/Feature/comdat.ll b/test/Feature/comdat.ll index 6b94a418582..05fb87c648e 100644 --- a/test/Feature/comdat.ll +++ b/test/Feature/comdat.ll @@ -9,6 +9,9 @@ $f2 = comdat any @v = global i32 0, comdat $f ; CHECK: @v = global i32 0, comdat $f +@a = alias i32* @v +; CHECK: @a = alias i32* @v{{$}} + define void @f() comdat $f { ret void }