search for: commonfunctype

Displaying 1 result from an estimated 1 matches for "commonfunctype".

2017 Mar 31
2
How to write the same things as `opt` command in C++ API
...lt;llvm::Module>("my module", context); llvm::PassManagerBuilder pm_builder; llvm::legacy::PassManager pm; pm_builder.Inliner = llvm::createFunctionInliningPass(); pm_builder.populateModulePassManager(pm); /// @brief Create function type (void) => i32 llvm::FunctionType *commonfuncType = llvm::FunctionType::get(llvm::Type::getInt32Ty(context), {}, false); /// @brief Create a function (define i32 a()) llvm::Function *aFun = llvm::Function::Create(commonfuncType, llvm::Function::PrivateLinkage, "a", module.get()); /// @brief Create a function (define i32 b(...