aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/NaCl/ExpandUtils.cpp
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/Transforms/NaCl/ExpandUtils.cpp
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/Transforms/NaCl/ExpandUtils.cpp')
-rw-r--r--lib/Transforms/NaCl/ExpandUtils.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/ExpandUtils.cpp b/lib/Transforms/NaCl/ExpandUtils.cpp
index 0670ff75ce..507760603f 100644
--- a/lib/Transforms/NaCl/ExpandUtils.cpp
+++ b/lib/Transforms/NaCl/ExpandUtils.cpp
@@ -38,3 +38,8 @@ void llvm::PhiSafeReplaceUses(Use *U, Value *NewVal) {
U->getUser()->replaceUsesOfWith(U->get(), NewVal);
}
}
+
+Instruction *llvm::CopyDebug(Instruction *NewInst, Instruction *Original) {
+ NewInst->setDebugLoc(Original->getDebugLoc());
+ return NewInst;
+}