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