diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-24 01:44:39 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-24 01:44:39 +0000 |
commit | b4bc424c9acd787fbfcd1506aadd6e49113f6b1c (patch) | |
tree | 9c2ce064903e369eb131334f15d93d259e2a7bbd /llvm/lib/CodeGen/AsmPrinter | |
parent | f95da49f25fcccc9a3dd515d0ef0d6493e5f5e2a (diff) | |
download | bcm5719-llvm-b4bc424c9acd787fbfcd1506aadd6e49113f6b1c.tar.gz bcm5719-llvm-b4bc424c9acd787fbfcd1506aadd6e49113f6b1c.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: 243083
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index ecdc7fa8b35..8a0854628a6 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -139,9 +139,9 @@ const DataLayout &AsmPrinter::getDataLayout() const { return MMI->getModule()->getDataLayout(); } -unsigned AsmPrinter::getPointerSize() const { - return TM.getDataLayout()->getPointerSize(); -} +// 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(); } const MCSubtargetInfo &AsmPrinter::getSubtargetInfo() const { assert(MF && "getSubtargetInfo requires a valid MachineFunction!"); |