mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-28 07:44:59 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b59aee170f
commit
6279aae989
@ -236,7 +236,6 @@ namespace llvm {
|
||||
MCSymbol *getOrCreateFrameAllocSymbol(StringRef FuncName, unsigned Idx);
|
||||
|
||||
/// Get the symbol for \p Name, or null.
|
||||
MCSymbol *LookupSymbol(StringRef Name) const;
|
||||
MCSymbol *LookupSymbol(const Twine &Name) const;
|
||||
|
||||
/// getSymbols - Get a reference for the symbol table for clients that
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user