diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-24 16:04:22 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-24 16:04:22 +0000 |
commit | 26d481311a6e8c6f347f2fdb259399f60a74209e (patch) | |
tree | f609b3659437ad5c058a142d6b90857bfd948acd /llvm/examples/Kaleidoscope/Orc | |
parent | 0495dbf1e16d5a42434b3e06bc2335c486eb4167 (diff) | |
download | bcm5719-llvm-26d481311a6e8c6f347f2fdb259399f60a74209e.tar.gz bcm5719-llvm-26d481311a6e8c6f347f2fdb259399f60a74209e.zip |
Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.
This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.
Reviewers: echristo
Subscribers: jholewinski, llvm-commits, rafael, yaron.keren
Differential Revision: http://reviews.llvm.org/D11103
(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243114
Diffstat (limited to 'llvm/examples/Kaleidoscope/Orc')
4 files changed, 10 insertions, 10 deletions
diff --git a/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp b/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp index c9b2c6af565..b68f807e3e7 100644 --- a/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp +++ b/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp @@ -717,7 +717,7 @@ public: M(new Module(GenerateUniqueName("jit_module_"), Session.getLLVMContext())), Builder(Session.getLLVMContext()) { - M->setDataLayout(*Session.getTarget().getDataLayout()); + M->setDataLayout(Session.getTarget().createDataLayout()); } SessionContext& getSession() { return Session; } @@ -1179,7 +1179,7 @@ public: { raw_string_ostream MangledNameStream(MangledName); Mangler::getNameWithPrefix(MangledNameStream, Name, - *Session.getTarget().getDataLayout()); + Session.getTarget().createDataLayout()); } return MangledName; } diff --git a/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp b/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp index 7e99c0f5ba5..91290157ace 100644 --- a/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp +++ b/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp @@ -716,7 +716,7 @@ public: M(new Module(GenerateUniqueName("jit_module_"), Session.getLLVMContext())), Builder(Session.getLLVMContext()) { - M->setDataLayout(*Session.getTarget().getDataLayout()); + M->setDataLayout(Session.getTarget().createDataLayout()); } SessionContext& getSession() { return Session; } @@ -1160,7 +1160,7 @@ public: typedef CompileLayerT::ModuleSetHandleT ModuleHandleT; KaleidoscopeJIT(SessionContext &Session) - : DL(*Session.getTarget().getDataLayout()), + : DL(Session.getTarget().createDataLayout()), CompileLayer(ObjectLayer, SimpleCompiler(Session.getTarget())) {} std::string mangle(const std::string &Name) { @@ -1201,7 +1201,7 @@ public: } private: - const DataLayout &DL; + const DataLayout DL; ObjLayerT ObjectLayer; CompileLayerT CompileLayer; }; diff --git a/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp b/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp index 4b4c191171b..17f9dbb6dfa 100644 --- a/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp +++ b/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp @@ -716,7 +716,7 @@ public: M(new Module(GenerateUniqueName("jit_module_"), Session.getLLVMContext())), Builder(Session.getLLVMContext()) { - M->setDataLayout(*Session.getTarget().getDataLayout()); + M->setDataLayout(Session.getTarget().createDataLayout()); } SessionContext& getSession() { return Session; } @@ -1162,7 +1162,7 @@ public: typedef LazyEmitLayerT::ModuleSetHandleT ModuleHandleT; KaleidoscopeJIT(SessionContext &Session) - : DL(*Session.getTarget().getDataLayout()), + : DL(Session.getTarget().createDataLayout()), CompileLayer(ObjectLayer, SimpleCompiler(Session.getTarget())), LazyEmitLayer(CompileLayer) {} @@ -1204,7 +1204,7 @@ public: } private: - const DataLayout &DL; + const DataLayout DL; ObjLayerT ObjectLayer; CompileLayerT CompileLayer; LazyEmitLayerT LazyEmitLayer; diff --git a/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp b/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp index ca34de7e224..7373c99d543 100644 --- a/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp +++ b/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp @@ -716,7 +716,7 @@ public: M(new Module(GenerateUniqueName("jit_module_"), Session.getLLVMContext())), Builder(Session.getLLVMContext()) { - M->setDataLayout(*Session.getTarget().getDataLayout()); + M->setDataLayout(Session.getTarget().createDataLayout()); } SessionContext& getSession() { return Session; } @@ -1170,7 +1170,7 @@ public: { raw_string_ostream MangledNameStream(MangledName); Mangler::getNameWithPrefix(MangledNameStream, Name, - *Session.getTarget().getDataLayout()); + Session.getTarget().createDataLayout()); } return MangledName; } |