aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
diff options
context:
space:
mode:
authorKarl Schimpf <kschimpf@google.com>2013-08-01 07:12:23 -0700
committerKarl Schimpf <kschimpf@google.com>2013-08-01 07:12:23 -0700
commitb9657234ee8b1951db5977a8ffb55a2e5df6d76c (patch)
treeda9f474ea4b35ff767b93715a13a3933f0355f39 /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
parent365546bcef14965546dc39ebcef35f07a897b9c5 (diff)
Remove the inttoptr dependency from load instructions.
Elides inttoptr casts used (exclusively) in load instructions when PNaClVersion=2. This is an incremental start on removing the inttoptr instruction from the PNaCl wire format (See issue 3544 for more information on the strategy of removing ptrtoint). Also modifies PNaCl bitcode reader/writer to accept PNaClVersion=1 as supported, and PNaClVersion=2 as unsupported but readable (allowing pnacl-freeze and pnacl-thaw to work on such files). Also allows command-line option --pnacl-version for setting 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= https://code.google.com/p/nativeclient/issues/detail?id=3544 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/5812155903377408
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h')
-rw-r--r--lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
index 849ca7e506..805bddf0b2 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
@@ -267,6 +267,17 @@ private:
return getFnValueByID(ValNo);
}
+ /// \brief Add instructions to cast Op to the given type T into block BB.
+ /// Follows rules for pointer conversion as defined in
+ /// llvm/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp.
+ ///
+ /// Returns 0 if unable to generate conversion value (also generates
+ /// an appropriate error message and calls Error).
+ Value *ConvertOpToType(Value *Op, Type *T, BasicBlock *BB);
+
+ /// \brief Install instruction I into basic block BB.
+ bool InstallInstruction(BasicBlock *BB, Instruction *I);
+
bool ParseModule(bool Resume);
bool ParseTypeTable();
bool ParseTypeTableBody();