aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
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/NaClBitcodeReader.h
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/NaClBitcodeReader.h')
-rw-r--r--lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
index 3b9d8982d5..fe7b5c1e9e 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
@@ -207,15 +207,11 @@ public:
virtual bool MaterializeModule(Module *M, std::string *ErrInfo = 0);
virtual void Dematerialize(GlobalValue *GV);
- bool Error(const char *Str) {
- ErrorString = Str;
- return true;
- }
bool Error(const std::string &Str) {
ErrorString = Str;
return true;
}
- const char *getErrorString() const { return ErrorString.c_str(); }
+ const std::string &getErrorString() const { return ErrorString; }
/// @brief Main interface to parsing a bitcode buffer.
/// @returns true if an error occurred.
@@ -227,6 +223,9 @@ private:
return !(Header.IsSupported() ||
(!AcceptSupportedBitcodeOnly && Header.IsReadable()));
}
+ uint32_t GetPNaClVersion() const {
+ return Header.GetPNaClVersion();
+ }
Type *getTypeByID(unsigned ID);
// Returns the value associated with ID. The value must already exist,
// or a forward referenced value created by getOrCreateFnVaueByID.