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/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 5de9d69..b584cb4 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -274,17 +274,18 @@
return ".rdata$linkonce";
}
-std::string X86COFFTargetAsmInfo::printSectionFlags(unsigned flags) const {
- std::string Flags = ",\"";
- if (flags & SectionFlags::Code)
- Flags += 'x';
- if (flags & SectionFlags::Writable)
- Flags += 'w';
+void X86COFFTargetAsmInfo::getSectionFlags(unsigned Flags,
+ SmallVectorImpl<char> &Str) const {
+ // FIXME: Inefficient.
+ std::string Res = ",\"";
+ if (Flags & SectionFlags::Code)
+ Res += 'x';
+ if (Flags & SectionFlags::Writable)
+ Res += 'w';
+ Res += "\"";
- Flags += "\"";
-
- return Flags;
+ Str.append(Res.begin(), Res.end());
}
X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):