summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ARMAttributeParser.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-01-30 06:19:27 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-01-30 06:19:27 +0000
commited0d1ccc953c6097de29850b1e803646b1898d6b (patch)
treec556852a93f5b61aaaff88d81bca142560af7e12 /llvm/tools/llvm-readobj/ARMAttributeParser.cpp
parent036bc255cedc2e6c38bc3b0e8e4a5782ce707912 (diff)
downloadbcm5719-llvm-ed0d1ccc953c6097de29850b1e803646b1898d6b.tar.gz
bcm5719-llvm-ed0d1ccc953c6097de29850b1e803646b1898d6b.zip
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. llvm-svn: 200457
Diffstat (limited to 'llvm/tools/llvm-readobj/ARMAttributeParser.cpp')
-rw-r--r--llvm/tools/llvm-readobj/ARMAttributeParser.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/tools/llvm-readobj/ARMAttributeParser.cpp b/llvm/tools/llvm-readobj/ARMAttributeParser.cpp
index 26b8f6e91ac..5857547be78 100644
--- a/llvm/tools/llvm-readobj/ARMAttributeParser.cpp
+++ b/llvm/tools/llvm-readobj/ARMAttributeParser.cpp
@@ -317,16 +317,16 @@ void ARMAttributeParser::ABI_align_needed(AttrType Tag, const uint8_t *Data,
uint64_t Value = ParseInteger(Data, Offset);
- Twine Description;
+ std::string Description;
if (Value < countof(Strings))
- Description = StringRef(Strings[Value]);
+ Description = std::string(Strings[Value]);
else if (Value <= 12)
- Description = Twine("8-byte alignment, ") + utostr(1 << Value)
- + Twine("-byte extended alignment");
+ Description = std::string("8-byte alignment, ") + utostr(1 << Value)
+ + std::string("-byte extended alignment");
else
Description = "Invalid";
- PrintAttribute(Tag, Value, Description.str());
+ PrintAttribute(Tag, Value, Description);
}
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);
- Twine Description;
+ std::string Description;
if (Value < countof(Strings))
- Description = StringRef(Strings[Value]);
+ Description = std::string(Strings[Value]);
else if (Value <= 12)
- Description = Twine("8-byte stack alignment, ") + utostr(1 << Value)
- + Twine("-byte data alignment");
+ Description = std::string("8-byte stack alignment, ") + utostr(1 << Value)
+ + std::string("-byte data alignment");
else
Description = "Invalid";
- PrintAttribute(Tag, Value, Description.str());
+ PrintAttribute(Tag, Value, Description);
}
void ARMAttributeParser::ABI_enum_size(AttrType Tag, const uint8_t *Data,
OpenPOWER on IntegriCloud