[llvm-commits] [llvm] r54460 - in /llvm/trunk: lib/Target/ELFTargetAsmInfo.cpp test/CodeGen/ARM/section.ll

Anton Korobeynikov asl at math.spbu.ru
Thu Aug 7 02:55:06 PDT 2008


Author: asl
Date: Thu Aug  7 04:55:06 2008
New Revision: 54460

URL: http://llvm.org/viewvc/llvm-project?rev=54460&view=rev
Log:
Print section flags ok on platforms, which use '@' as comment string. Fix test.

Modified:
    llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
    llvm/trunk/test/CodeGen/ARM/section.ll

Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=54460&r1=54459&r2=54460&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Thu Aug  7 04:55:06 2008
@@ -166,13 +166,19 @@
   if (flags & SectionFlags::Small)
     Flags += 's';
 
-  Flags += "\"";
+  Flags += "\",";
+
+  // If comment string is '@', e.g. as on ARM - use '%' instead
+  if (strcmp(CommentString, "@") == 0)
+    Flags += '%';
+  else
+    Flags += '@';
 
   // FIXME: There can be exceptions here
   if (flags & SectionFlags::BSS)
-    Flags += ", at nobits";
+    Flags += "nobits";
   else
-    Flags += ", at progbits";
+    Flags += "progbits";
 
   if (unsigned entitySize = SectionFlags::getEntitySize(flags))
     Flags += "," + utostr(entitySize);

Modified: llvm/trunk/test/CodeGen/ARM/section.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/section.ll?rev=54460&r1=54459&r2=54460&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/ARM/section.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/section.ll Thu Aug  7 04:55:06 2008
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s | llc -mtriple=arm-linux | \
 ; RUN:   grep {__DTOR_END__:}
 ; RUN: llvm-as < %s | llc -mtriple=arm-linux | \
-; RUN:   grep {.section .dtors,"aw",.progbits}
+; RUN:   grep {\\.section.\\.dtors,"aw",.progbits}
 
 @__DTOR_END__ = internal global [1 x i32] zeroinitializer, section ".dtors"       ; <[1 x i32]*> [#uses=0]
 





More information about the llvm-commits mailing list