aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-05-29 22:47:23 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-05-29 22:47:23 -0700
commit614c108c60ef2ea51d0e5d4db871a5d954f4ecda (patch)
treed8d65d244ab1c7481ae61f8be5a3e9199f4bf32a /include/llvm/Transforms
parentcfcccc95343088d7d73e0d7be1da5d4c5de57e49 (diff)
PNaCl: Add ExpandSmallArguments pass to widen parameters to 32 bits
This widens i1, i8 and i16 function arguments and return types. Factor out RecreateFunction() helper function from existing PNaCl passes since this is a reoccurring code fragment. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3342 TEST=*.ll tests + PNaCl toolchain trybots + GCC torture tests + LLVM test suite Review URL: https://codereview.chromium.org/15971007
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/NaCl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Transforms/NaCl.h b/include/llvm/Transforms/NaCl.h
index 92838e5fc7..cfd4c6e51d 100644
--- a/include/llvm/Transforms/NaCl.h
+++ b/include/llvm/Transforms/NaCl.h
@@ -13,7 +13,9 @@
namespace llvm {
class BasicBlockPass;
+class Function;
class FunctionPass;
+class FunctionType;
class Instruction;
class ModulePass;
class PassManager;
@@ -26,6 +28,7 @@ ModulePass *createExpandByValPass();
FunctionPass *createExpandConstantExprPass();
ModulePass *createExpandCtorsPass();
BasicBlockPass *createExpandGetElementPtrPass();
+ModulePass *createExpandSmallArgumentsPass();
ModulePass *createExpandTlsPass();
ModulePass *createExpandTlsConstantExprPass();
ModulePass *createExpandVarArgsPass();
@@ -48,6 +51,13 @@ void PhiSafeReplaceUses(Use *U, Value *NewVal);
// Copy debug information from Original to NewInst, and return NewInst.
Instruction *CopyDebug(Instruction *NewInst, Instruction *Original);
+// In order to change a function's type, the function must be
+// recreated. RecreateFunction() recreates Func with type NewType.
+// It copies or moves across everything except the argument values,
+// which the caller must update because the argument types might be
+// different.
+Function *RecreateFunction(Function *Func, FunctionType *NewType);
+
}
#endif