diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-02-13 10:21:05 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-02-13 10:21:05 +0000 |
| commit | 7ecd99163c4ab06768f7987a32b921f8e15efa31 (patch) | |
| tree | 78c19870a3881daea1ec7b6495d19a99626e87ea /llvm/examples | |
| parent | 30d69c2e3681f2a422032bfaa3e085b17e948663 (diff) | |
| download | bcm5719-llvm-7ecd99163c4ab06768f7987a32b921f8e15efa31.tar.gz bcm5719-llvm-7ecd99163c4ab06768f7987a32b921f8e15efa31.zip | |
[PM] Update the examples to reflect the removal of the
llvm/PassManager.h wrapper header and its using declarations. These now
directly use the legacy namespace.
I had updated the #include lines in my large commit but forgot that the
examples weren't being built and didn't update the code to use the
correct namespace. Sorry for the noise here.
llvm-svn: 229095
Diffstat (limited to 'llvm/examples')
| -rw-r--r-- | llvm/examples/ExceptionDemo/ExceptionDemo.cpp | 35 | ||||
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter4/toy.cpp | 2 | ||||
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter5/toy.cpp | 4 | ||||
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter6/toy.cpp | 4 | ||||
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter7/toy.cpp | 4 | ||||
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter8/toy.cpp | 4 |
6 files changed, 24 insertions, 29 deletions
diff --git a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp index 6822152a5f5..317a326cb9f 100644 --- a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1122,14 +1122,11 @@ static llvm::BasicBlock *createCatchBlock(llvm::LLVMContext &context, /// @param numExceptionsToCatch length of exceptionTypesToCatch array /// @param exceptionTypesToCatch array of type info types to "catch" /// @returns generated function -static -llvm::Function *createCatchWrappedInvokeFunction(llvm::Module &module, - llvm::IRBuilder<> &builder, - llvm::FunctionPassManager &fpm, - llvm::Function &toInvoke, - std::string ourId, - unsigned numExceptionsToCatch, - unsigned exceptionTypesToCatch[]) { +static llvm::Function *createCatchWrappedInvokeFunction( + llvm::Module &module, llvm::IRBuilder<> &builder, + llvm::legacy::FunctionPassManager &fpm, llvm::Function &toInvoke, + std::string ourId, unsigned numExceptionsToCatch, + unsigned exceptionTypesToCatch[]) { llvm::LLVMContext &context = module.getContext(); llvm::Function *toPrint32Int = module.getFunction("print32Int"); @@ -1389,13 +1386,11 @@ llvm::Function *createCatchWrappedInvokeFunction(llvm::Module &module, /// @param nativeThrowFunct function which will throw a foreign exception /// if the above nativeThrowType matches generated function's arg. /// @returns generated function -static -llvm::Function *createThrowExceptionFunction(llvm::Module &module, - llvm::IRBuilder<> &builder, - llvm::FunctionPassManager &fpm, - std::string ourId, - int32_t nativeThrowType, - llvm::Function &nativeThrowFunct) { +static llvm::Function * +createThrowExceptionFunction(llvm::Module &module, llvm::IRBuilder<> &builder, + llvm::legacy::FunctionPassManager &fpm, + std::string ourId, int32_t nativeThrowType, + llvm::Function &nativeThrowFunct) { llvm::LLVMContext &context = module.getContext(); namedValues.clear(); ArgTypes unwindArgTypes; @@ -1508,10 +1503,10 @@ static void createStandardUtilityFunctions(unsigned numTypeInfos, /// @param nativeThrowFunctName name of external function which will throw /// a foreign exception /// @returns outermost generated test function. -llvm::Function *createUnwindExceptionTest(llvm::Module &module, - llvm::IRBuilder<> &builder, - llvm::FunctionPassManager &fpm, - std::string nativeThrowFunctName) { +llvm::Function * +createUnwindExceptionTest(llvm::Module &module, llvm::IRBuilder<> &builder, + llvm::legacy::FunctionPassManager &fpm, + std::string nativeThrowFunctName) { // Number of type infos to generate unsigned numTypeInfos = 6; @@ -1971,7 +1966,7 @@ int main(int argc, char *argv[]) { llvm::ExecutionEngine *executionEngine = factory.create(); { - llvm::FunctionPassManager fpm(module); + llvm::legacy::FunctionPassManager fpm(module); // Set up the optimizer pipeline. // Start with registering info about how the diff --git a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp index ae52db82db3..f70c836ddb1 100644 --- a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp @@ -556,7 +556,7 @@ void *MCJITHelper::getPointerToFunction(Function *F) { } // Create a function pass manager for this engine - FunctionPassManager *FPM = new FunctionPassManager(OpenModule); + auto *FPM = new legacy::FunctionPassManager(OpenModule); // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. diff --git a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp index db3efdce3d1..728a2f5d4cf 100644 --- a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp @@ -506,7 +506,7 @@ static PrototypeAST *ParseExtern() { static Module *TheModule; static IRBuilder<> Builder(getGlobalContext()); static std::map<std::string, Value *> NamedValues; -static FunctionPassManager *TheFPM; +static legacy::FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); @@ -908,7 +908,7 @@ int main() { exit(1); } - FunctionPassManager OurFPM(TheModule); + legacy::FunctionPassManager OurFPM(TheModule); // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. diff --git a/llvm/examples/Kaleidoscope/Chapter6/toy.cpp b/llvm/examples/Kaleidoscope/Chapter6/toy.cpp index c64120d7cea..8131aa1077b 100644 --- a/llvm/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter6/toy.cpp @@ -594,7 +594,7 @@ static PrototypeAST *ParseExtern() { static Module *TheModule; static IRBuilder<> Builder(getGlobalContext()); static std::map<std::string, Value *> NamedValues; -static FunctionPassManager *TheFPM; +static legacy::FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); @@ -1029,7 +1029,7 @@ int main() { exit(1); } - FunctionPassManager OurFPM(TheModule); + legacy::FunctionPassManager OurFPM(TheModule); // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. diff --git a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp index 07b53add3b7..82f083ac6e1 100644 --- a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp @@ -665,7 +665,7 @@ static PrototypeAST *ParseExtern() { static Module *TheModule; static IRBuilder<> Builder(getGlobalContext()); static std::map<std::string, AllocaInst *> NamedValues; -static FunctionPassManager *TheFPM; +static legacy::FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); @@ -1203,7 +1203,7 @@ int main() { exit(1); } - FunctionPassManager OurFPM(TheModule); + legacy::FunctionPassManager OurFPM(TheModule); // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp index 4cdadfba6a4..30d4669e19c 100644 --- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp @@ -855,7 +855,7 @@ static DICompositeType CreateFunctionType(unsigned NumArgs, DIFile Unit) { static Module *TheModule; static std::map<std::string, AllocaInst *> NamedValues; -static FunctionPassManager *TheFPM; +static legacy::FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); @@ -1454,7 +1454,7 @@ int main() { exit(1); } - FunctionPassManager OurFPM(TheModule); + legacy::FunctionPassManager OurFPM(TheModule); // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. |

