summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-03-17 18:55:30 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-03-17 18:55:30 +0000
commitd7c546c9352be6914a055e6ab4784d8a8b22b331 (patch)
tree08953b871e7c13928187ee0e0f56845abba44ec1 /llvm/lib/MC/MCContext.cpp
parentd2647eaae6836202ea9790f9727fd7e0ea2c5092 (diff)
downloadbcm5719-llvm-d7c546c9352be6914a055e6ab4784d8a8b22b331.tar.gz
bcm5719-llvm-d7c546c9352be6914a055e6ab4784d8a8b22b331.zip
Remove LookupSymbol(StringRef) and optimize LookupSymbol(Twine).
Same as MakeArgString in r232465, keep only LookupSymbol(Twine) while making sure it handles the StringRef like cases efficiently using twine::toStringRef. llvm-svn: 232517
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 608d958fc8e..b0e7cf50d69 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -219,14 +219,10 @@ MCSymbol *MCContext::GetDirectionalLocalSymbol(unsigned LocalLabelVal,
return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
}
-MCSymbol *MCContext::LookupSymbol(StringRef Name) const {
- return Symbols.lookup(Name);
-}
-
MCSymbol *MCContext::LookupSymbol(const Twine &Name) const {
SmallString<128> NameSV;
- Name.toVector(NameSV);
- return LookupSymbol(NameSV.str());
+ StringRef NameRef = Name.toStringRef(NameSV);
+ return Symbols.lookup(NameRef);
}
//===----------------------------------------------------------------------===//
@@ -249,7 +245,7 @@ MCContext::getMachOSection(StringRef Segment, StringRef Section,
Name += Section;
// Do the lookup, if we have a hit, return it.
- const MCSectionMachO *&Entry = MachOUniquingMap[Name.str()];
+ const MCSectionMachO *&Entry = MachOUniquingMap[Name];
if (Entry)
return Entry;
OpenPOWER on IntegriCloud