1 /*===-- llvm-c/Transform/PassManagerBuilder.h - PMB C Interface ---*- 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 |* This header declares the C interface to the PassManagerBuilder class. *| 11 |* *| 12 \*===----------------------------------------------------------------------===*/ 13 14 #ifndef LLVM_C_PASSMANAGERBUILDER 15 #define LLVM_C_PASSMANAGERBUILDER 16 17 #include "llvm-c/Core.h" 18 19 typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef; 20 21 #ifdef __cplusplus 22 #include "llvm/Transforms/IPO/PassManagerBuilder.h" 23 extern "C" { 24 #endif 25 26 /** See llvm::PassManagerBuilder. */ 27 LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate(void); 28 void LLVMPassManagerBuilderDispose(LLVMPassManagerBuilderRef PMB); 29 30 /** See llvm::PassManagerBuilder::OptLevel. */ 31 void 32 LLVMPassManagerBuilderSetOptLevel(LLVMPassManagerBuilderRef PMB, 33 unsigned OptLevel); 34 35 /** See llvm::PassManagerBuilder::SizeLevel. */ 36 void 37 LLVMPassManagerBuilderSetSizeLevel(LLVMPassManagerBuilderRef PMB, 38 unsigned SizeLevel); 39 40 /** See llvm::PassManagerBuilder::DisableUnitAtATime. */ 41 void 42 LLVMPassManagerBuilderSetDisableUnitAtATime(LLVMPassManagerBuilderRef PMB, 43 LLVMBool Value); 44 45 /** See llvm::PassManagerBuilder::DisableUnrollLoops. */ 46 void 47 LLVMPassManagerBuilderSetDisableUnrollLoops(LLVMPassManagerBuilderRef PMB, 48 LLVMBool Value); 49 50 /** See llvm::PassManagerBuilder::DisableSimplifyLibCalls */ 51 void 52 LLVMPassManagerBuilderSetDisableSimplifyLibCalls(LLVMPassManagerBuilderRef PMB, 53 LLVMBool Value); 54 55 /** See llvm::PassManagerBuilder::Inliner. */ 56 void 57 LLVMPassManagerBuilderUseInlinerWithThreshold(LLVMPassManagerBuilderRef PMB, 58 unsigned Threshold); 59 60 /** See llvm::PassManagerBuilder::populateFunctionPassManager. */ 61 void 62 LLVMPassManagerBuilderPopulateFunctionPassManager(LLVMPassManagerBuilderRef PMB, 63 LLVMPassManagerRef PM); 64 65 /** See llvm::PassManagerBuilder::populateModulePassManager. */ 66 void 67 LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB, 68 LLVMPassManagerRef PM); 69 70 /** See llvm::PassManagerBuilder::populateLTOPassManager. */ 71 void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB, 72 LLVMPassManagerRef PM, 73 bool Internalize, 74 bool RunInliner); 75 76 #ifdef __cplusplus 77 } 78 79 namespace llvm { unwrap(LLVMPassManagerBuilderRef P)80 inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) { 81 return reinterpret_cast<PassManagerBuilder*>(P); 82 } 83 wrap(PassManagerBuilder * P)84 inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) { 85 return reinterpret_cast<LLVMPassManagerBuilderRef>(P); 86 } 87 } 88 #endif 89 90 #endif 91