diff options
author | Lang Hames <lhames@gmail.com> | 2015-02-21 20:44:36 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-02-21 20:44:36 +0000 |
commit | e738061c4900016238adf741e37dae099afe7c65 (patch) | |
tree | 5aa02ee105c792fd3959002f907ad99a1d39edc5 /llvm/lib/ExecutionEngine | |
parent | 60c5bbff29731d46df8aaf7c806993351ca4aa57 (diff) | |
download | bcm5719-llvm-e738061c4900016238adf741e37dae099afe7c65.tar.gz bcm5719-llvm-e738061c4900016238adf741e37dae099afe7c65.zip |
[Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.
NFC.
llvm-svn: 230143
Diffstat (limited to 'llvm/lib/ExecutionEngine')
5 files changed, 29 insertions, 14 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/CloneSubModule.cpp b/llvm/lib/ExecutionEngine/Orc/CloneSubModule.cpp index 64a33c80f20..a3196ad2f78 100644 --- a/llvm/lib/ExecutionEngine/Orc/CloneSubModule.cpp +++ b/llvm/lib/ExecutionEngine/Orc/CloneSubModule.cpp @@ -4,15 +4,16 @@ #include "llvm/IR/Module.h" #include "llvm/Transforms/Utils/Cloning.h" -using namespace llvm; +namespace llvm { +namespace orc { -void llvm::copyGVInitializer(GlobalVariable &New, const GlobalVariable &Orig, +void copyGVInitializer(GlobalVariable &New, const GlobalVariable &Orig, ValueToValueMapTy &VMap) { if (Orig.hasInitializer()) New.setInitializer(MapValue(Orig.getInitializer(), VMap)); } -void llvm::copyFunctionBody(Function &New, const Function &Orig, +void copyFunctionBody(Function &New, const Function &Orig, ValueToValueMapTy &VMap) { if (!Orig.isDeclaration()) { Function::arg_iterator DestI = New.arg_begin(); @@ -27,9 +28,9 @@ void llvm::copyFunctionBody(Function &New, const Function &Orig, } } -void llvm::CloneSubModule(llvm::Module &Dst, const Module &Src, - HandleGlobalVariableFtor HandleGlobalVariable, - HandleFunctionFtor HandleFunction, bool CloneInlineAsm) { +void CloneSubModule(llvm::Module &Dst, const Module &Src, + HandleGlobalVariableFtor HandleGlobalVariable, + HandleFunctionFtor HandleFunction, bool CloneInlineAsm) { ValueToValueMapTy VMap; @@ -102,3 +103,6 @@ void llvm::CloneSubModule(llvm::Module &Dst, const Module &Src, } } + +} // End namespace orc. +} // End namespace llvm. diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp index 57616a54840..11deb4acbeb 100644 --- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -8,6 +8,7 @@ using namespace llvm; namespace llvm { +namespace orc { GlobalVariable* createImplPointer(Function &F, const Twine &Name, Constant *Initializer) { @@ -106,4 +107,5 @@ FullyPartitionedModule fullyPartition(Module &M) { return MP; } -} +} // End namespace orc. +} // End namespace llvm. diff --git a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.cpp b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.cpp index 75d1b1f7431..48fd31e51a6 100644 --- a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.cpp +++ b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.cpp @@ -13,7 +13,7 @@ namespace { static struct RegisterJIT { - RegisterJIT() { llvm::OrcMCJITReplacement::Register(); } + RegisterJIT() { llvm::orc::OrcMCJITReplacement::Register(); } } JITRegistrator; } @@ -21,6 +21,7 @@ static struct RegisterJIT { extern "C" void LLVMLinkInOrcMCJITReplacement() {} namespace llvm { +namespace orc { GenericValue OrcMCJITReplacement::runFunction(Function *F, @@ -122,4 +123,6 @@ OrcMCJITReplacement::runFunction(Function *F, llvm_unreachable("Full-featured argument passing not supported yet!"); } -} + +} // End namespace orc. +} // End namespace llvm. diff --git a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h index f09d13e87bd..1b7b16187c8 100644 --- a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h +++ b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h @@ -22,6 +22,7 @@ #include "llvm/Object/Archive.h" namespace llvm { +namespace orc { class OrcMCJITReplacement : public ExecutionEngine { @@ -104,11 +105,12 @@ class OrcMCJITReplacement : public ExecutionEngine { }; private: + static ExecutionEngine * createOrcMCJITReplacement(std::string *ErrorMsg, std::unique_ptr<RTDyldMemoryManager> OrcJMM, - std::unique_ptr<llvm::TargetMachine> TM) { - return new llvm::OrcMCJITReplacement(std::move(OrcJMM), std::move(TM)); + std::unique_ptr<TargetMachine> TM) { + return new OrcMCJITReplacement(std::move(OrcJMM), std::move(TM)); } public: @@ -323,6 +325,8 @@ private: std::vector<object::OwningBinary<object::Archive>> Archives; }; -} + +} // End namespace orc. +} // End namespace llvm. #endif // LLVM_LIB_EXECUTIONENGINE_ORC_MCJITREPLACEMENT_H diff --git a/llvm/lib/ExecutionEngine/Orc/OrcTargetSupport.cpp b/llvm/lib/ExecutionEngine/Orc/OrcTargetSupport.cpp index e71fc65ce24..b5dda8e4ee5 100644 --- a/llvm/lib/ExecutionEngine/Orc/OrcTargetSupport.cpp +++ b/llvm/lib/ExecutionEngine/Orc/OrcTargetSupport.cpp @@ -2,7 +2,7 @@ #include "llvm/ExecutionEngine/Orc/OrcTargetSupport.h" #include <array> -using namespace llvm; +using namespace llvm::orc; namespace { @@ -47,6 +47,7 @@ uint64_t executeCompileCallback(JITCompileCallbackManagerBase<TargetT> *JCBM, } namespace llvm { +namespace orc { const char* OrcX86_64::ResolverBlockName = "orc_resolver_block"; @@ -123,4 +124,5 @@ OrcX86_64::insertCompileCallbackTrampolines(Module &M, return GetLabelName; } -} +} // End namespace orc. +} // End namespace llvm. |