[llvm-commits] [llvm] r77679 - in /llvm/trunk: lib/Target/TargetLoweringObjectFile.cpp test/CodeGen/X86/global-sections.ll

Chris Lattner sabre at nondot.org
Fri Jul 31 09:17:13 PDT 2009


Author: lattner
Date: Fri Jul 31 11:17:13 2009
New Revision: 77679

URL: http://llvm.org/viewvc/llvm-project?rev=77679&view=rev
Log:
fix PR4650: we only track sizes for certain objects, so only put something
into the mergable section if it is one of our special cases.  This could
obviously be improved, but this is the minimal fix and restores us to the
previous behavior.

Modified:
    llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
    llvm/trunk/test/CodeGen/X86/global-sections.ll

Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=77679&r1=77678&r2=77679&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Fri Jul 31 11:17:13 2009
@@ -340,7 +340,10 @@
     Str.push_back('x');
   if (Kind.isWriteable())
     Str.push_back('w');
-  if (Kind.isMergeableConst() || Kind.isMergeableCString())
+  if (Kind.isMergeableCString() ||
+      Kind.isMergeableConst4() ||
+      Kind.isMergeableConst8() ||
+      Kind.isMergeableConst16())
     Str.push_back('M');
   if (Kind.isMergeableCString())
     Str.push_back('S');

Modified: llvm/trunk/test/CodeGen/X86/global-sections.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/global-sections.ll?rev=77679&r1=77678&r2=77679&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/X86/global-sections.ll (original)
+++ llvm/trunk/test/CodeGen/X86/global-sections.ll Fri Jul 31 11:17:13 2009
@@ -68,3 +68,20 @@
 ; DARWIN: .globl	"_foo bar"
 ; DARWIN:	.weak_definition "_foo bar"
 ; DARWIN: "_foo bar":
+
+; PR4650
+ at G6 = weak_odr constant [1 x i8] c"\01"
+
+; LINUX:   .type	G6, at object
+; LINUX:   .section	.gnu.linkonce.r.G6,"a", at progbits
+; LINUX:   .weak	G6
+; LINUX: G6:				# G6
+; LINUX:   .size	G6, 1
+; LINUX:   .ascii	"\001"
+
+; DARWIN:  .section __TEXT,__const_coal,coalesced
+; DARWIN:  .globl _G6
+; DARWIN:  .weak_definition _G6
+; DARWIN:_G6:
+; DARWIN:  .ascii "\001"
+





More information about the llvm-commits mailing list