| OLD | NEW |
| 1 //===-- NaCl.h - NaCl Transformations ---------------------------*- C++ -*-===// | 1 //===-- NaCl.h - NaCl Transformations ---------------------------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 | 9 |
| 10 #ifndef LLVM_TRANSFORMS_NACL_H | 10 #ifndef LLVM_TRANSFORMS_NACL_H |
| 11 #define LLVM_TRANSFORMS_NACL_H | 11 #define LLVM_TRANSFORMS_NACL_H |
| 12 | 12 |
| 13 namespace llvm { | 13 namespace llvm { |
| 14 | 14 |
| 15 class BasicBlockPass; | 15 class BasicBlockPass; |
| 16 class Function; | 16 class Function; |
| 17 class FunctionPass; | 17 class FunctionPass; |
| 18 class FunctionType; | 18 class FunctionType; |
| 19 class Instruction; | 19 class Instruction; |
| 20 class ModulePass; | 20 class ModulePass; |
| 21 class PassManager; | 21 class PassManager; |
| 22 class Use; | 22 class Use; |
| 23 class Value; | 23 class Value; |
| 24 | 24 |
| 25 BasicBlockPass *createExpandGetElementPtrPass(); |
| 26 BasicBlockPass *createPromoteI1OpsPass(); |
| 27 FunctionPass *createExpandConstantExprPass(); |
| 28 FunctionPass *createExpandStructRegsPass(); |
| 29 FunctionPass *createInsertDivideCheckPass(); |
| 30 FunctionPass *createPromoteIntegersPass(); |
| 31 FunctionPass *createPromoteIntegersPass(); |
| 32 FunctionPass *createResolvePNaClIntrinsicsPass(); |
| 25 ModulePass *createAddPNaClExternalDeclsPass(); | 33 ModulePass *createAddPNaClExternalDeclsPass(); |
| 26 ModulePass *createCanonicalizeMemIntrinsicsPass(); | 34 ModulePass *createCanonicalizeMemIntrinsicsPass(); |
| 27 ModulePass *createExpandArithWithOverflowPass(); | 35 ModulePass *createExpandArithWithOverflowPass(); |
| 28 ModulePass *createExpandByValPass(); | 36 ModulePass *createExpandByValPass(); |
| 29 FunctionPass *createExpandConstantExprPass(); | |
| 30 ModulePass *createExpandCtorsPass(); | 37 ModulePass *createExpandCtorsPass(); |
| 31 BasicBlockPass *createExpandGetElementPtrPass(); | |
| 32 ModulePass *createExpandSmallArgumentsPass(); | 38 ModulePass *createExpandSmallArgumentsPass(); |
| 33 FunctionPass *createExpandStructRegsPass(); | 39 ModulePass *createExpandTlsConstantExprPass(); |
| 34 ModulePass *createExpandTlsPass(); | 40 ModulePass *createExpandTlsPass(); |
| 35 ModulePass *createExpandTlsConstantExprPass(); | |
| 36 ModulePass *createExpandVarArgsPass(); | 41 ModulePass *createExpandVarArgsPass(); |
| 37 ModulePass *createFlattenGlobalsPass(); | 42 ModulePass *createFlattenGlobalsPass(); |
| 38 ModulePass *createGlobalCleanupPass(); | 43 ModulePass *createGlobalCleanupPass(); |
| 39 BasicBlockPass *createPromoteI1OpsPass(); | |
| 40 FunctionPass *createPromoteIntegersPass(); | |
| 41 ModulePass *createReplacePtrsWithIntsPass(); | 44 ModulePass *createReplacePtrsWithIntsPass(); |
| 42 ModulePass *createResolveAliasesPass(); | 45 ModulePass *createResolveAliasesPass(); |
| 43 FunctionPass *createResolvePNaClIntrinsicsPass(); | 46 ModulePass *createRewriteAtomicsPass(); |
| 44 ModulePass *createRewriteLLVMIntrinsicsPass(); | 47 ModulePass *createRewriteLLVMIntrinsicsPass(); |
| 45 ModulePass *createRewritePNaClLibraryCallsPass(); | 48 ModulePass *createRewritePNaClLibraryCallsPass(); |
| 46 ModulePass *createStripAttributesPass(); | 49 ModulePass *createStripAttributesPass(); |
| 47 ModulePass *createStripMetadataPass(); | 50 ModulePass *createStripMetadataPass(); |
| 48 FunctionPass *createInsertDivideCheckPass(); | |
| 49 | 51 |
| 50 void PNaClABISimplifyAddPreOptPasses(PassManager &PM); | 52 void PNaClABISimplifyAddPreOptPasses(PassManager &PM); |
| 51 void PNaClABISimplifyAddPostOptPasses(PassManager &PM); | 53 void PNaClABISimplifyAddPostOptPasses(PassManager &PM); |
| 52 | 54 |
| 53 Instruction *PhiSafeInsertPt(Use *U); | 55 Instruction *PhiSafeInsertPt(Use *U); |
| 54 void PhiSafeReplaceUses(Use *U, Value *NewVal); | 56 void PhiSafeReplaceUses(Use *U, Value *NewVal); |
| 55 | 57 |
| 56 // Copy debug information from Original to NewInst, and return NewInst. | 58 // Copy debug information from Original to NewInst, and return NewInst. |
| 57 Instruction *CopyDebug(Instruction *NewInst, Instruction *Original); | 59 Instruction *CopyDebug(Instruction *NewInst, Instruction *Original); |
| 58 | 60 |
| 59 template <class InstType> | 61 template <class InstType> |
| 60 static void CopyLoadOrStoreAttrs(InstType *Dest, InstType *Src) { | 62 static void CopyLoadOrStoreAttrs(InstType *Dest, InstType *Src) { |
| 61 Dest->setVolatile(Src->isVolatile()); | 63 Dest->setVolatile(Src->isVolatile()); |
| 62 Dest->setAlignment(Src->getAlignment()); | 64 Dest->setAlignment(Src->getAlignment()); |
| 63 Dest->setOrdering(Src->getOrdering()); | 65 Dest->setOrdering(Src->getOrdering()); |
| 64 Dest->setSynchScope(Src->getSynchScope()); | 66 Dest->setSynchScope(Src->getSynchScope()); |
| 65 } | 67 } |
| 66 | 68 |
| 67 // In order to change a function's type, the function must be | 69 // In order to change a function's type, the function must be |
| 68 // recreated. RecreateFunction() recreates Func with type NewType. | 70 // recreated. RecreateFunction() recreates Func with type NewType. |
| 69 // It copies or moves across everything except the argument values, | 71 // It copies or moves across everything except the argument values, |
| 70 // which the caller must update because the argument types might be | 72 // which the caller must update because the argument types might be |
| 71 // different. | 73 // different. |
| 72 Function *RecreateFunction(Function *Func, FunctionType *NewType); | 74 Function *RecreateFunction(Function *Func, FunctionType *NewType); |
| 73 | 75 |
| 74 } | 76 } |
| 75 | 77 |
| 76 #endif | 78 #endif |
| OLD | NEW |