aboutsummaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-05-22 11:34:44 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-05-22 11:34:44 -0700
commit9f0ec130483d6bfb0357dcf05b49fa91d6c265f5 (patch)
tree73f90e24d6442aa9127efcbf99d1755bd23b35ba /lib/IR
parent099f6bfc79eb94351dfe006eeaea24983f8b12a4 (diff)
PNaCl: Add ReplacePtrsWithInts pass for stripping out pointer types
ReplacePtrsWithInts converts IR to a normal form in which functions don't reference any aggregate pointer types and pointer types only appear inside a few instructions. Change BlockAddress::replaceUsesOfWithOnConstant() to handle changing a function's type by replacing a function with a bitcast ConstantExpr of a new function. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343 TEST=replace-ptrs-with-ints.ll + PNaCl toolchain trybots, torture tests, etc. Review URL: https://codereview.chromium.org/14262011
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/Constants.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp
index 8093a09749..027946efd1 100644
--- a/lib/IR/Constants.cpp
+++ b/lib/IR/Constants.cpp
@@ -1371,7 +1371,7 @@ void BlockAddress::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) {
BasicBlock *NewBB = getBasicBlock();
if (U == &Op<0>())
- NewF = cast<Function>(To);
+ NewF = cast<Function>(To->stripPointerCasts()); // @LOCALMOD
else
NewBB = cast<BasicBlock>(To);