[PATCH] D11103: Remove access to the DataLayout in the TargetMachine
Rafael Ávila de Espíndola
rafael.espindola at gmail.com
Thu Jul 16 08:41:00 PDT 2015
rafael added inline comments.
================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:143
@@ +142,3 @@
+// Do not use the cached DataLayout because some client use it without a Module
+// (llmv-dsymutil, llvm-dwarfdump).
+unsigned AsmPrinter::getPointerSize() const { return TM.getPointerSize(); }
----------------
For another patch, but could the AsmPrinter constructor take the pointer size?
================
Comment at: lib/ExecutionEngine/MCJIT/MCJIT.cpp:71
@@ -70,3 +70,3 @@
std::shared_ptr<RuntimeDyld::SymbolResolver> Resolver)
- : ExecutionEngine(*TM->getDataLayout(), std::move(M)), TM(std::move(TM)),
+ : ExecutionEngine(TM->createDataLayout(), std::move(M)), TM(std::move(TM)),
Ctx(nullptr), MemMgr(std::move(MemMgr)),
----------------
Can't it use the DL from the module?
================
Comment at: lib/ExecutionEngine/Orc/OrcMCJITReplacement.h:143
@@ -142,3 +142,3 @@
std::unique_ptr<TargetMachine> TM)
- : ExecutionEngine(*TM->getDataLayout()), TM(std::move(TM)),
+ : ExecutionEngine(TM->createDataLayout()), TM(std::move(TM)),
MemMgr(*this, std::move(MemMgr)), Resolver(*this),
----------------
same here.
================
Comment at: lib/ExecutionEngine/Orc/OrcMCJITReplacement.h:160
@@ -159,2 +159,3 @@
}
+
Modules.push_back(std::move(M));
----------------
whitespace change.
================
Comment at: lib/LTO/LTOCodeGenerator.cpp:524
@@ -523,3 +523,3 @@
// Add an appropriate DataLayout instance for this module...
- mergedModule->setDataLayout(*TargetMach->getDataLayout());
+ mergedModule->setDataLayout(TargetMach->createDataLayout());
----------------
I think this is from the days when we supported the module not having a DL. We should probably try to remove it in another patch.
================
Comment at: lib/LTO/LTOModule.cpp:235
@@ -234,3 +234,3 @@
options);
- M->setDataLayout(*target->getDataLayout());
+ M->setDataLayout(target->createDataLayout());
----------------
same here.
http://reviews.llvm.org/D11103
More information about the llvm-commits
mailing list