summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-26 07:33:58 +0000
committerChris Lattner <sabre@nondot.org>2009-07-26 07:33:58 +0000
commit1db210322aee38cd93a5489996e251072461f1ff (patch)
treef20488bc741c9d5b0fa0a560b7c15d114d5f9c68 /llvm/lib/Target/X86
parentd2e0220cb411126637d0f9ff3262a33201d37385 (diff)
downloadbcm5719-llvm-1db210322aee38cd93a5489996e251072461f1ff.tar.gz
bcm5719-llvm-1db210322aee38cd93a5489996e251072461f1ff.zip
remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead. llvm-svn: 77144
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86TargetAsmInfo.cpp21
-rw-r--r--llvm/lib/Target/X86/X86TargetAsmInfo.h4
2 files changed, 14 insertions, 11 deletions
diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
index 5de9d696147..b584cb49c3c 100644
--- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -274,17 +274,18 @@ getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
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';
-
- Flags += "\"";
-
- return Flags;
+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 += "\"";
+
+ Str.append(Res.begin(), Res.end());
}
X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):
diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.h b/llvm/lib/Target/X86/X86TargetAsmInfo.h
index af1ee2d1473..75cd04c51d8 100644
--- a/llvm/lib/Target/X86/X86TargetAsmInfo.h
+++ b/llvm/lib/Target/X86/X86TargetAsmInfo.h
@@ -55,7 +55,9 @@ namespace llvm {
bool Global) const;
virtual const char *
getSectionPrefixForUniqueGlobal(SectionKind kind) const;
- virtual std::string printSectionFlags(unsigned flags) const;
+
+ virtual void getSectionFlags(unsigned Flags,
+ SmallVectorImpl<char> &Str) const;
};
struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
OpenPOWER on IntegriCloud