aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.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/CodeGenAction.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/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index ff56b29..d33a479 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -332,7 +332,7 @@ namespace clang {
EmbedBitcode(getModule(), CodeGenOpts, llvm::MemoryBufferRef());
EmitBackendOutput(Diags, HeaderSearchOpts, CodeGenOpts, TargetOpts,
- LangOpts, C.getTargetInfo().getDataLayout(),
+ LangOpts, C.getTargetInfo().getDataLayoutString(),
getModule(), Action, std::move(AsmOutStream));
Ctx.setDiagnosticHandler(std::move(OldDiagnosticHandler));
@@ -1105,7 +1105,7 @@ void CodeGenAction::ExecuteAction() {
EmitBackendOutput(Diagnostics, CI.getHeaderSearchOpts(), CodeGenOpts,
TargetOpts, CI.getLangOpts(),
- CI.getTarget().getDataLayout(), TheModule.get(), BA,
+ CI.getTarget().getDataLayoutString(), TheModule.get(), BA,
std::move(OS));
if (OptRecordFile)
OptRecordFile->keep();