forked from OSchip/llvm-project
Avoid buffer copies when a Twine already is a StringRef.
llvm-svn: 196301
This commit is contained in:
parent
9163e8bce6
commit
8e5283ad1d
|
@ -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