mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Avoid buffer copies when a Twine already is a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196301 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
822a02fb4c
commit
445cfd70b9
@ -157,8 +157,7 @@ MCSymbol *MCContext::CreateSymbol(StringRef Name) {
|
||||
|
||||
MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) {
|
||||
SmallString<128> NameSV;
|
||||
Name.toVector(NameSV);
|
||||
return GetOrCreateSymbol(NameSV.str());
|
||||
return GetOrCreateSymbol(Name.toStringRef(NameSV));
|
||||
}
|
||||
|
||||
MCSymbol *MCContext::CreateTempSymbol() {
|
||||
|
@ -291,8 +291,7 @@ void ArgList::ClaimAllArgs() const {
|
||||
|
||||
const char *ArgList::MakeArgString(const Twine &T) const {
|
||||
SmallString<256> Str;
|
||||
T.toVector(Str);
|
||||
return MakeArgString(Str.str());
|
||||
return MakeArgString(T.toStringRef(Str));
|
||||
}
|
||||
|
||||
const char *ArgList::GetOrMakeJoinedArgString(unsigned Index,
|
||||
|
Loading…
Reference in New Issue
Block a user