Properly print flags on Sparc
authorAnton Korobeynikov <asl@math.spbu.ru>
Fri, 8 Aug 2008 18:26:10 +0000 (18:26 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Fri, 8 Aug 2008 18:26:10 +0000 (18:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54543 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcTargetAsmInfo.cpp

index 39c7442474d8951383a622eab5ac2a0d172baeb7..c81b9e1f73ded97409c31816124226a96db4b66b 100644 (file)
@@ -28,19 +28,18 @@ SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM):
 }
 
 std::string SparcELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const {
-  std::string Flags = ",";
-
   if (flags & SectionFlags::Mergeable)
     return ELFTargetAsmInfo::PrintSectionFlags(flags);
 
+  std::string Flags;
   if (!(flags & SectionFlags::Debug))
-    Flags += "#alloc";
+    Flags += ",#alloc";
   if (flags & SectionFlags::Code)
-    Flags += "#execinstr";
+    Flags += ",#execinstr";
   if (flags & SectionFlags::Writeable)
-    Flags += "#write";
+    Flags += ",#write";
   if (flags & SectionFlags::TLS)
-    Flags += "#tls";
+    Flags += ",#tls";
 
   return Flags;
 }