diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-03 11:33:57 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-03 11:33:57 -0700 |
commit | eedf1e284837398d8eeaf0972e906236380378dd (patch) | |
tree | 2cf8257943d6270930e2a6bf9eb1f1138e84245e /lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp | |
parent | 4358dd390dc7f621a5ce427a2d1fc3577ac70ef5 (diff) |
PNaCl: Fix ReplacePtrsWithInts so that ptrtoint always casts to i32
The normal form introduced by ReplacePtrsWithInts (as documented in
the comments) is intended to have the property that ptrtoint and
inttoptr only convert to/from i32, not other size types.
Using IRBuilder's CreateZExtOrTrunc() broke that, though, because it
performs some constant folding on global variable references. Fix
this by creating CastInsts directly.
I found this via the ABI checks I've been writing, which gave this
error when building the sandboxed translator:
non-i32 ptrtoint: %expanded1 = ptrtoint void ()* @ARMCompilationCallback to i8
LLVM ERROR: PNaCl ABI verification failed
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=*.ll tests + tested full PNaCl build with ABI checks applied too
Review URL: https://codereview.chromium.org/15955012
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp')
0 files changed, 0 insertions, 0 deletions