[llvm-commits] [llvm] r77083 - in /llvm/trunk: lib/Target/TargetAsmInfo.cpp test/CodeGen/X86/global-sections.ll
Chris Lattner
sabre at nondot.org
Sat Jul 25 10:57:37 PDT 2009
Author: lattner
Date: Sat Jul 25 12:57:37 2009
New Revision: 77083
URL: http://llvm.org/viewvc/llvm-project?rev=77083&view=rev
Log:
add the most expedient hack to fix PR4619, along with a testcase.
Thanks to Rafael for the great example.
Added:
llvm/trunk/test/CodeGen/X86/global-sections.ll
Modified:
llvm/trunk/lib/Target/TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77083&r1=77082&r2=77083&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Sat Jul 25 12:57:37 2009
@@ -326,6 +326,11 @@
// FIXME: Use mangler interface (PR4584).
std::string Name = Prefix+GV->getNameStr();
+
+ // Pick up the flags for the uniquing section.
+ // FIXME: HACK.
+ Flags |= getFlagsForNamedSection(Name.c_str());
+
return getNamedSection(Name.c_str(), Flags);
}
}
Added: llvm/trunk/test/CodeGen/X86/global-sections.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/global-sections.ll?rev=77083&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/global-sections.ll (added)
+++ llvm/trunk/test/CodeGen/X86/global-sections.ll Sat Jul 25 12:57:37 2009
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
+
+ at G1 = common global i32 0
+
+; LINUX: .type G1, at object
+; LINUX: .section .gnu.linkonce.b.G1,"aw", at nobits
+; LINUX: .comm G1,4,4
+
More information about the llvm-commits
mailing list