remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77144 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Sparc/SparcTargetAsmInfo.cpp b/lib/Target/Sparc/SparcTargetAsmInfo.cpp
index 0087c26..7b9f449 100644
--- a/lib/Target/Sparc/SparcTargetAsmInfo.cpp
+++ b/lib/Target/Sparc/SparcTargetAsmInfo.cpp
@@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===//
#include "SparcTargetAsmInfo.h"
-
+#include "llvm/ADT/SmallVector.h"
using namespace llvm;
SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM):
@@ -32,19 +32,22 @@
/* Override */ true);
}
-std::string SparcELFTargetAsmInfo::printSectionFlags(unsigned flags) const {
- if (flags & SectionFlags::Mergeable)
- return ELFTargetAsmInfo::printSectionFlags(flags);
- std::string Flags;
- if (!(flags & SectionFlags::Debug))
- Flags += ",#alloc";
- if (flags & SectionFlags::Code)
- Flags += ",#execinstr";
- if (flags & SectionFlags::Writable)
- Flags += ",#write";
- if (flags & SectionFlags::TLS)
- Flags += ",#tls";
+void SparcELFTargetAsmInfo::getSectionFlags(unsigned Flags,
+ SmallVectorImpl<char> &Str) const {
+ if (Flags & SectionFlags::Mergeable)
+ return ELFTargetAsmInfo::getSectionFlags(Flags, Str);
- return Flags;
+ // FIXME: Inefficient.
+ std::string Res;
+ if (!(Flags & SectionFlags::Debug))
+ Res += ",#alloc";
+ if (Flags & SectionFlags::Code)
+ Res += ",#execinstr";
+ if (Flags & SectionFlags::Writable)
+ Res += ",#write";
+ if (Flags & SectionFlags::TLS)
+ Res += ",#tls";
+
+ Str.append(Res.begin(), Res.end());
}