mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 06:04:47 +00:00
Avoid buffer copies when a Twine already is a StringRef.
llvm-svn: 196301
This commit is contained in:
parent
05c1966c8c
commit
ad61b972a6
@ -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…
x
Reference in New Issue
Block a user