diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-05-22 11:34:44 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-05-22 11:34:44 -0700 |
commit | 9f0ec130483d6bfb0357dcf05b49fa91d6c265f5 (patch) | |
tree | 73f90e24d6442aa9127efcbf99d1755bd23b35ba /include/llvm/Transforms | |
parent | 099f6bfc79eb94351dfe006eeaea24983f8b12a4 (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 'include/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/NaCl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Transforms/NaCl.h b/include/llvm/Transforms/NaCl.h index b2c012f08d..c324fa8c0c 100644 --- a/include/llvm/Transforms/NaCl.h +++ b/include/llvm/Transforms/NaCl.h @@ -29,6 +29,7 @@ ModulePass *createExpandVarArgsPass(); ModulePass *createFlattenGlobalsPass(); ModulePass *createGlobalCleanupPass(); FunctionPass *createPromoteIntegersPass(); +ModulePass *createReplacePtrsWithIntsPass(); ModulePass *createResolveAliasesPass(); ModulePass *createRewritePNaClLibraryCallsPass(); ModulePass *createStripMetadataPass(); @@ -37,6 +38,9 @@ FunctionPass *createInsertDivideCheckPass(); Instruction *PhiSafeInsertPt(Use *U); void PhiSafeReplaceUses(Use *U, Value *NewVal); +// Copy debug information from Original to NewInst, and return NewInst. +Instruction *CopyDebug(Instruction *NewInst, Instruction *Original); + } #endif |