From d757d21cef07ba8f7af9e97aa9d28b3d1a316a25 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. llvm-svn: 212732 --- 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 }