[llvm] r261918 - Fix endianness issue on BE machines introduced by r261907
Hemant Kulkarni via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 10:56:01 PST 2016
Author: khemant
Date: Thu Feb 25 12:56:01 2016
New Revision: 261918
URL: http://llvm.org/viewvc/llvm-project?rev=261918&view=rev
Log:
Fix endianness issue on BE machines introduced by r261907
Modified:
llvm/trunk/tools/llvm-readobj/StreamWriter.cpp
Modified: llvm/trunk/tools/llvm-readobj/StreamWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/StreamWriter.cpp?rev=261918&r1=261917&r2=261918&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/StreamWriter.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/StreamWriter.cpp Thu Feb 25 12:56:01 2016
@@ -27,9 +27,10 @@ const std::string to_string(uint64_t Val
}
const std::string to_hexString(const format_object_base &obj) {
- char number[20] = {'0'};
- obj.print(number, 20);
- return std::string(number);
+ std::string number;
+ llvm::raw_string_ostream stream(number);
+ stream << obj;
+ return stream.str();
}
void StreamWriter::printBinaryImpl(StringRef Label, StringRef Str,
More information about the llvm-commits
mailing list