llvm.org GIT mirror llvm / 7ea33e5
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229095 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 4 years ago
6 changed file(s) with 24 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
11211121 /// @param numExceptionsToCatch length of exceptionTypesToCatch array
11221122 /// @param exceptionTypesToCatch array of type info types to "catch"
11231123 /// @returns generated function
1124 static
1125 llvm::Function *createCatchWrappedInvokeFunction(llvm::Module &module,
1126 llvm::IRBuilder<> &builder,
1127 llvm::FunctionPassManager &fpm,
1128 llvm::Function &toInvoke,
1129 std::string ourId,
1130 unsigned numExceptionsToCatch,
1131 unsigned exceptionTypesToCatch[]) {
1124 static llvm::Function *createCatchWrappedInvokeFunction(
1125 llvm::Module &module, llvm::IRBuilder<> &builder,
1126 llvm::legacy::FunctionPassManager &fpm, llvm::Function &toInvoke,
1127 std::string ourId, unsigned numExceptionsToCatch,
1128 unsigned exceptionTypesToCatch[]) {
11321129
11331130 llvm::LLVMContext &context = module.getContext();
11341131 llvm::Function *toPrint32Int = module.getFunction("print32Int");
13881385 /// @param nativeThrowFunct function which will throw a foreign exception
13891386 /// if the above nativeThrowType matches generated function's arg.
13901387 /// @returns generated function
1391 static
1392 llvm::Function *createThrowExceptionFunction(llvm::Module &module,
1393 llvm::IRBuilder<> &builder,
1394 llvm::FunctionPassManager &fpm,
1395 std::string ourId,
1396 int32_t nativeThrowType,
1397 llvm::Function &nativeThrowFunct) {
1388 static llvm::Function *
1389 createThrowExceptionFunction(llvm::Module &module, llvm::IRBuilder<> &builder,
1390 llvm::legacy::FunctionPassManager &fpm,
1391 std::string ourId, int32_t nativeThrowType,
1392 llvm::Function &nativeThrowFunct) {
13981393 llvm::LLVMContext &context = module.getContext();
13991394 namedValues.clear();
14001395 ArgTypes unwindArgTypes;
15071502 /// @param nativeThrowFunctName name of external function which will throw
15081503 /// a foreign exception
15091504 /// @returns outermost generated test function.
1510 llvm::Function *createUnwindExceptionTest(llvm::Module &module,
1511 llvm::IRBuilder<> &builder,
1512 llvm::FunctionPassManager &fpm,
1513 std::string nativeThrowFunctName) {
1505 llvm::Function *
1506 createUnwindExceptionTest(llvm::Module &module, llvm::IRBuilder<> &builder,
1507 llvm::legacy::FunctionPassManager &fpm,
1508 std::string nativeThrowFunctName) {
15141509 // Number of type infos to generate
15151510 unsigned numTypeInfos = 6;
15161511
19701965 llvm::ExecutionEngine *executionEngine = factory.create();
19711966
19721967 {
1973 llvm::FunctionPassManager fpm(module);
1968 llvm::legacy::FunctionPassManager fpm(module);
19741969
19751970 // Set up the optimizer pipeline.
19761971 // Start with registering info about how the
555555 }
556556
557557 // Create a function pass manager for this engine
558 FunctionPassManager *FPM = new FunctionPassManager(OpenModule);
558 auto *FPM = new legacy::FunctionPassManager(OpenModule);
559559
560560 // Set up the optimizer pipeline. Start with registering info about how the
561561 // target lays out data structures.
505505 static Module *TheModule;
506506 static IRBuilder<> Builder(getGlobalContext());
507507 static std::map NamedValues;
508 static FunctionPassManager *TheFPM;
508 static legacy::FunctionPassManager *TheFPM;
509509
510510 Value *ErrorV(const char *Str) {
511511 Error(Str);
907907 exit(1);
908908 }
909909
910 FunctionPassManager OurFPM(TheModule);
910 legacy::FunctionPassManager OurFPM(TheModule);
911911
912912 // Set up the optimizer pipeline. Start with registering info about how the
913913 // target lays out data structures.
593593 static Module *TheModule;
594594 static IRBuilder<> Builder(getGlobalContext());
595595 static std::map NamedValues;
596 static FunctionPassManager *TheFPM;
596 static legacy::FunctionPassManager *TheFPM;
597597
598598 Value *ErrorV(const char *Str) {
599599 Error(Str);
10281028 exit(1);
10291029 }
10301030
1031 FunctionPassManager OurFPM(TheModule);
1031 legacy::FunctionPassManager OurFPM(TheModule);
10321032
10331033 // Set up the optimizer pipeline. Start with registering info about how the
10341034 // target lays out data structures.
664664 static Module *TheModule;
665665 static IRBuilder<> Builder(getGlobalContext());
666666 static std::map NamedValues;
667 static FunctionPassManager *TheFPM;
667 static legacy::FunctionPassManager *TheFPM;
668668
669669 Value *ErrorV(const char *Str) {
670670 Error(Str);
12021202 exit(1);
12031203 }
12041204
1205 FunctionPassManager OurFPM(TheModule);
1205 legacy::FunctionPassManager OurFPM(TheModule);
12061206
12071207 // Set up the optimizer pipeline. Start with registering info about how the
12081208 // target lays out data structures.
854854
855855 static Module *TheModule;
856856 static std::map NamedValues;
857 static FunctionPassManager *TheFPM;
857 static legacy::FunctionPassManager *TheFPM;
858858
859859 Value *ErrorV(const char *Str) {
860860 Error(Str);
14531453 exit(1);
14541454 }
14551455
1456 FunctionPassManager OurFPM(TheModule);
1456 legacy::FunctionPassManager OurFPM(TheModule);
14571457
14581458 // Set up the optimizer pipeline. Start with registering info about how the
14591459 // target lays out data structures.