aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-04-19 13:39:20 -0400
committerNico Weber <thakis@chromium.org>2021-04-27 22:26:10 -0400
commit0f1137ba79c0b3f1ca638e01082443ba5ccde03c (patch)
tree23708767073c3cc358e9c147411927cae2184235 /clang/lib/CodeGen/ModuleBuilder.cpp
parentc35fadceab382a30f4f2f0023fb688d31af58feb (diff)
downloadllvm-0f1137ba79c0b3f1ca638e01082443ba5ccde03c.zip
llvm-0f1137ba79c0b3f1ca638e01082443ba5ccde03c.tar.gz
llvm-0f1137ba79c0b3f1ca638e01082443ba5ccde03c.tar.bz2
[clang/Basic] Make TargetInfo.h not use DataLayout again
Reverts parts of https://reviews.llvm.org/D17183, but keeps the resetDataLayout() API and adds an assert that checks that datalayout string and user label prefix are in sync. Approach 1 in https://reviews.llvm.org/D17183#2653279 Reduces number of TUs build for 'clang-format' from 689 to 575. I also implemented approach 2 in D100764. If someone feels motivated to make us use DataLayout more, it's easy to revert this change here and go with D100764 instead. I don't plan on doing more work in this area though, so I prefer going with the smaller, more self-consistent change. Differential Revision: https://reviews.llvm.org/D100776
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r--clang/lib/CodeGen/ModuleBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp
index 01093cf..b63f756 100644
--- a/clang/lib/CodeGen/ModuleBuilder.cpp
+++ b/clang/lib/CodeGen/ModuleBuilder.cpp
@@ -138,7 +138,7 @@ namespace {
Ctx = &Context;
M->setTargetTriple(Ctx->getTargetInfo().getTriple().getTriple());
- M->setDataLayout(Ctx->getTargetInfo().getDataLayout());
+ M->setDataLayout(Ctx->getTargetInfo().getDataLayoutString());
const auto &SDKVersion = Ctx->getTargetInfo().getSDKVersion();
if (!SDKVersion.empty())
M->setSDKVersion(SDKVersion);