diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-09-06 14:56:16 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-09-06 14:56:16 -0700 |
commit | 68cb3f7eca7536d85301f92314dbb5db6757cd94 (patch) | |
tree | 85cfa713f9f2304e419a744eaa11fd5f519034d9 /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | |
parent | 45f9be95ab8e334e7e4b4328ee297d032e64b788 (diff) |
PNaCl bitcode: Strip pointer types from intrinsic declarations' parameters
Change the writer to strip pointer types from intrinsics' argument and
return types, replacing them with i32. This simplifies the PNaCl
bitcode format so that pointer types don't need to be represented
here.
Change the reader to restore the pointer types so that the intrinsic
declarations pass the LLVM and PNaCl verifiers.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671
TEST=intrinsic tests in call-elide.ll
+ intrinsic-pointer-args.ll
+ run small_tests with bitcode v2 enabled
Review URL: https://codereview.chromium.org/23793005
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h')
-rw-r--r-- | lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h index 318fcb1470..56a894c7d4 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h @@ -130,6 +130,10 @@ public: // replaces uses of the global variable forward reference with the // value GV. void AssignGlobalVar(GlobalVariable *GV, unsigned Idx); + + // Assigns Idx to the given value, overwriting the existing entry + // and possibly modifying the type of the entry. + void OverwriteValue(Value *V, unsigned Idx); }; @@ -333,6 +337,9 @@ private: /// \brief Install instruction I into basic block BB. bool InstallInstruction(BasicBlock *BB, Instruction *I); + FunctionType *AddPointerTypesToIntrinsicType(StringRef Name, + FunctionType *FTy); + void AddPointerTypesToIntrinsicParams(); bool ParseModule(bool Resume); bool ParseTypeTable(); bool ParseTypeTableBody(); |