mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
tools: fix Twine abuse
utohexstr provides a temporary string, making it unsafe to use with the Twine interface which will not copy the string. Switch to using std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a2a6c3911d
commit
0dd6b9b974
@ -317,16 +317,16 @@ void ARMAttributeParser::ABI_align_needed(AttrType Tag, const uint8_t *Data,
|
|||||||
|
|
||||||
uint64_t Value = ParseInteger(Data, Offset);
|
uint64_t Value = ParseInteger(Data, Offset);
|
||||||
|
|
||||||
Twine Description;
|
std::string Description;
|
||||||
if (Value < countof(Strings))
|
if (Value < countof(Strings))
|
||||||
Description = StringRef(Strings[Value]);
|
Description = std::string(Strings[Value]);
|
||||||
else if (Value <= 12)
|
else if (Value <= 12)
|
||||||
Description = Twine("8-byte alignment, ") + utostr(1 << Value)
|
Description = std::string("8-byte alignment, ") + utostr(1 << Value)
|
||||||
+ Twine("-byte extended alignment");
|
+ std::string("-byte extended alignment");
|
||||||
else
|
else
|
||||||
Description = "Invalid";
|
Description = "Invalid";
|
||||||
|
|
||||||
PrintAttribute(Tag, Value, Description.str());
|
PrintAttribute(Tag, Value, Description);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAttributeParser::ABI_align_preserved(AttrType Tag, const uint8_t *Data,
|
void ARMAttributeParser::ABI_align_preserved(AttrType Tag, const uint8_t *Data,
|
||||||
@ -338,16 +338,16 @@ void ARMAttributeParser::ABI_align_preserved(AttrType Tag, const uint8_t *Data,
|
|||||||
|
|
||||||
uint64_t Value = ParseInteger(Data, Offset);
|
uint64_t Value = ParseInteger(Data, Offset);
|
||||||
|
|
||||||
Twine Description;
|
std::string Description;
|
||||||
if (Value < countof(Strings))
|
if (Value < countof(Strings))
|
||||||
Description = StringRef(Strings[Value]);
|
Description = std::string(Strings[Value]);
|
||||||
else if (Value <= 12)
|
else if (Value <= 12)
|
||||||
Description = Twine("8-byte stack alignment, ") + utostr(1 << Value)
|
Description = std::string("8-byte stack alignment, ") + utostr(1 << Value)
|
||||||
+ Twine("-byte data alignment");
|
+ std::string("-byte data alignment");
|
||||||
else
|
else
|
||||||
Description = "Invalid";
|
Description = "Invalid";
|
||||||
|
|
||||||
PrintAttribute(Tag, Value, Description.str());
|
PrintAttribute(Tag, Value, Description);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAttributeParser::ABI_enum_size(AttrType Tag, const uint8_t *Data,
|
void ARMAttributeParser::ABI_enum_size(AttrType Tag, const uint8_t *Data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user