aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp
diff options
context:
space:
mode:
authorKarl Schimpf <kschimpf@google.com>2013-07-22 13:36:16 -0700
committerKarl Schimpf <kschimpf@google.com>2013-07-22 13:36:16 -0700
commit0b41f88a8de25db50e1a57645a6e132954a6dcd2 (patch)
tree059d73d19b2f788ce145d90015dd53b091095f28 /lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp
parent208b40ed21d78767d9d1c3c855cbd2e3a3c02451 (diff)
Enable ability to have multiple PNaCl wire format versions.
Modifies PNaCl bitcode reader/writer to accept PNaClVersion=1 as supported, and all other versions are unsupported and unreadable. The PNaCl bitcode reader/writer will generate appropriate messages (including what version is unsupported if applicable). Also allows command-line option --pnacl-version for setting the PNaClVersion in the PNaCl bitcode writer. Also fixes some problems on PNaCl bitcode headers, using common support to determine when the read/written PNaCl bitcode file is valid. BUG=None R=jvoung@chromium.org Review URL: https://codereview.chromium.org/19400002
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp')
-rw-r--r--lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp
index aa73b9cffa..2dd2af5dc3 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp
@@ -249,8 +249,12 @@ void NaClBitcodeHeader::InstallFields() {
if (PNaClVersion != 1) {
IsSupportedFlag = false;
IsReadableFlag = false;
- UnsupportedMessage = "Unsupported Version";
UpdatedUnsupportedMessage = true;
+ UnsupportedMessage.clear();
+ raw_string_ostream UnsupportedStream(UnsupportedMessage);
+ UnsupportedStream << "Unsupported PNaCl bitcode version: "
+ << PNaClVersion << "\n";
+ UnsupportedStream.flush();
}
if (Fields.size() != 1) {
IsSupportedFlag = false;