diff options
Diffstat (limited to 'llvm/examples')
10 files changed, 39 insertions, 35 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp index 51457a3..14081fb 100644 --- a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp @@ -203,7 +203,7 @@ class ExprAST { public: ExprAST(SourceLocation Loc = CurLoc) : Loc(Loc) {} - virtual ~ExprAST() {} + virtual ~ExprAST() = default; virtual Value *codegen() = 0; int getLine() const { return Loc.Line; } int getCol() const { return Loc.Col; } diff --git a/llvm/examples/OptSubcommand/llvm-hello-sub.cpp b/llvm/examples/OptSubcommand/llvm-hello-sub.cpp index 8071f56..bcf433f 100644 --- a/llvm/examples/OptSubcommand/llvm-hello-sub.cpp +++ b/llvm/examples/OptSubcommand/llvm-hello-sub.cpp @@ -46,7 +46,7 @@ public: HelloSubOptTable() : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable, /*IgnoreCase=*/false, OptionSubCommands, - OptionSubCommandIDsTable) {} + OptionSubCommandIDsTable) {}; }; } // namespace diff --git a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp index 83c5899..6e2aaf3 100644 --- a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp +++ b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp @@ -9,8 +9,7 @@ #include "RemoteJITUtils.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h" -#include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h" +#include "llvm/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.h" #include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h" #include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h" #include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h" diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c index b51fc93..7c24467 100644 --- a/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c +++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c @@ -28,16 +28,17 @@ LLVMModuleRef createDemoModule(LLVMContextRef Ctx) { // Add a "sum" function": // - Create the function type and function instance. - LLVMTypeRef ParamTypes[] = {LLVMInt32Type(), LLVMInt32Type()}; - LLVMTypeRef SumFunctionType = - LLVMFunctionType(LLVMInt32Type(), ParamTypes, 2, 0); + LLVMTypeRef Int32Type = LLVMInt32TypeInContext(Ctx); + LLVMTypeRef ParamTypes[] = {Int32Type, Int32Type}; + LLVMTypeRef SumFunctionType = LLVMFunctionType(Int32Type, ParamTypes, 2, 0); LLVMValueRef SumFunction = LLVMAddFunction(M, "sum", SumFunctionType); // - Add a basic block to the function. - LLVMBasicBlockRef EntryBB = LLVMAppendBasicBlock(SumFunction, "entry"); + LLVMBasicBlockRef EntryBB = + LLVMAppendBasicBlockInContext(Ctx, SumFunction, "entry"); // - Add an IR builder and point it at the end of the basic block. - LLVMBuilderRef Builder = LLVMCreateBuilder(); + LLVMBuilderRef Builder = LLVMCreateBuilderInContext(Ctx); LLVMPositionBuilderAtEnd(Builder, EntryBB); // - Get the two function arguments and use them co construct an "add" diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c index 30806dc..ae8362a 100644 --- a/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c +++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c @@ -30,16 +30,17 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) { // Add a "sum" function": // - Create the function type and function instance. - LLVMTypeRef ParamTypes[] = {LLVMInt32Type(), LLVMInt32Type()}; - LLVMTypeRef SumFunctionType = - LLVMFunctionType(LLVMInt32Type(), ParamTypes, 2, 0); + LLVMTypeRef Int32Type = LLVMInt32TypeInContext(Ctx); + LLVMTypeRef ParamTypes[] = {Int32Type, Int32Type}; + LLVMTypeRef SumFunctionType = LLVMFunctionType(Int32Type, ParamTypes, 2, 0); LLVMValueRef SumFunction = LLVMAddFunction(M, "sum", SumFunctionType); // - Add a basic block to the function. - LLVMBasicBlockRef EntryBB = LLVMAppendBasicBlock(SumFunction, "entry"); + LLVMBasicBlockRef EntryBB = + LLVMAppendBasicBlockInContext(Ctx, SumFunction, "entry"); // - Add an IR builder and point it at the end of the basic block. - LLVMBuilderRef Builder = LLVMCreateBuilder(); + LLVMBuilderRef Builder = LLVMCreateBuilderInContext(Ctx); LLVMPositionBuilderAtEnd(Builder, EntryBB); // - Get the two function arguments and use them co construct an "add" diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c index 42a27c70..07491c6 100644 --- a/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c +++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c @@ -33,12 +33,13 @@ int handleError(LLVMErrorRef Err) { LLVMOrcThreadSafeModuleRef createDemoModule(void) { LLVMContextRef Ctx = LLVMContextCreate(); LLVMModuleRef M = LLVMModuleCreateWithNameInContext("demo", Ctx); - LLVMTypeRef ParamTypes[] = {LLVMInt32Type(), LLVMInt32Type()}; - LLVMTypeRef SumFunctionType = - LLVMFunctionType(LLVMInt32Type(), ParamTypes, 2, 0); + LLVMTypeRef Int32Type = LLVMInt32TypeInContext(Ctx); + LLVMTypeRef ParamTypes[] = {Int32Type, Int32Type}; + LLVMTypeRef SumFunctionType = LLVMFunctionType(Int32Type, ParamTypes, 2, 0); LLVMValueRef SumFunction = LLVMAddFunction(M, "sum", SumFunctionType); - LLVMBasicBlockRef EntryBB = LLVMAppendBasicBlock(SumFunction, "entry"); - LLVMBuilderRef Builder = LLVMCreateBuilder(); + LLVMBasicBlockRef EntryBB = + LLVMAppendBasicBlockInContext(Ctx, SumFunction, "entry"); + LLVMBuilderRef Builder = LLVMCreateBuilderInContext(Ctx); LLVMPositionBuilderAtEnd(Builder, EntryBB); LLVMValueRef SumArg0 = LLVMGetParam(SumFunction, 0); LLVMValueRef SumArg1 = LLVMGetParam(SumFunction, 1); diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c index 7e4d238..d2d80038 100644 --- a/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c +++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c @@ -34,12 +34,13 @@ int handleError(LLVMErrorRef Err) { LLVMOrcThreadSafeModuleRef createDemoModule(void) { LLVMContextRef Ctx = LLVMContextCreate(); LLVMModuleRef M = LLVMModuleCreateWithNameInContext("demo", Ctx); - LLVMTypeRef ParamTypes[] = {LLVMInt32Type(), LLVMInt32Type()}; - LLVMTypeRef SumFunctionType = - LLVMFunctionType(LLVMInt32Type(), ParamTypes, 2, 0); + LLVMTypeRef Int32Type = LLVMInt32TypeInContext(Ctx); + LLVMTypeRef ParamTypes[] = {Int32Type, Int32Type}; + LLVMTypeRef SumFunctionType = LLVMFunctionType(Int32Type, ParamTypes, 2, 0); LLVMValueRef SumFunction = LLVMAddFunction(M, "sum", SumFunctionType); - LLVMBasicBlockRef EntryBB = LLVMAppendBasicBlock(SumFunction, "entry"); - LLVMBuilderRef Builder = LLVMCreateBuilder(); + LLVMBasicBlockRef EntryBB = + LLVMAppendBasicBlockInContext(Ctx, SumFunction, "entry"); + LLVMBuilderRef Builder = LLVMCreateBuilderInContext(Ctx); LLVMPositionBuilderAtEnd(Builder, EntryBB); LLVMValueRef SumArg0 = LLVMGetParam(SumFunction, 0); LLVMValueRef SumArg1 = LLVMGetParam(SumFunction, 1); diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c index 6962c698..f15a114 100644 --- a/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c +++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c @@ -158,16 +158,17 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) { // Add a "sum" function": // - Create the function type and function instance. - LLVMTypeRef ParamTypes[] = {LLVMInt32Type(), LLVMInt32Type()}; - LLVMTypeRef SumFunctionType = - LLVMFunctionType(LLVMInt32Type(), ParamTypes, 2, 0); + LLVMTypeRef Int32Type = LLVMInt32TypeInContext(Ctx); + LLVMTypeRef ParamTypes[] = {Int32Type, Int32Type}; + LLVMTypeRef SumFunctionType = LLVMFunctionType(Int32Type, ParamTypes, 2, 0); LLVMValueRef SumFunction = LLVMAddFunction(M, "sum", SumFunctionType); // - Add a basic block to the function. - LLVMBasicBlockRef EntryBB = LLVMAppendBasicBlock(SumFunction, "entry"); + LLVMBasicBlockRef EntryBB = + LLVMAppendBasicBlockInContext(Ctx, SumFunction, "entry"); // - Add an IR builder and point it at the end of the basic block. - LLVMBuilderRef Builder = LLVMCreateBuilder(); + LLVMBuilderRef Builder = LLVMCreateBuilderInContext(Ctx); LLVMPositionBuilderAtEnd(Builder, EntryBB); // - Get the two function arguments and use them co construct an "add" diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c index 7f8a9cd..2d3e334 100644 --- a/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c +++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c @@ -30,16 +30,17 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) { // Add a "sum" function": // - Create the function type and function instance. - LLVMTypeRef ParamTypes[] = {LLVMInt32Type(), LLVMInt32Type()}; - LLVMTypeRef SumFunctionType = - LLVMFunctionType(LLVMInt32Type(), ParamTypes, 2, 0); + LLVMTypeRef Int32Type = LLVMInt32TypeInContext(Ctx); + LLVMTypeRef ParamTypes[] = {Int32Type, Int32Type}; + LLVMTypeRef SumFunctionType = LLVMFunctionType(Int32Type, ParamTypes, 2, 0); LLVMValueRef SumFunction = LLVMAddFunction(M, "sum", SumFunctionType); // - Add a basic block to the function. - LLVMBasicBlockRef EntryBB = LLVMAppendBasicBlock(SumFunction, "entry"); + LLVMBasicBlockRef EntryBB = + LLVMAppendBasicBlockInContext(Ctx, SumFunction, "entry"); // - Add an IR builder and point it at the end of the basic block. - LLVMBuilderRef Builder = LLVMCreateBuilder(); + LLVMBuilderRef Builder = LLVMCreateBuilderInContext(Ctx); LLVMPositionBuilderAtEnd(Builder, EntryBB); // - Get the two function arguments and use them co construct an "add" diff --git a/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp b/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp index 15dca0a..6132149 100644 --- a/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp +++ b/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp @@ -20,7 +20,6 @@ #include "llvm/Support/TargetSelect.h" #include "llvm/Support/ThreadPool.h" -#include <list> #include <string> using namespace llvm; |
