From 0f1137ba79c0b3f1ca638e01082443ba5ccde03c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 19 Apr 2021 13:39:20 -0400 Subject: [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 --- clang/lib/CodeGen/CodeGenAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenAction.cpp') 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(); -- cgit v1.1