From 671f0e2e189c561512511331d95de382e2d6d15d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 20 Apr 2021 10:58:19 -0400 Subject: [clang] Make libBasic not depend on MC Reduces numbers of files built for clang-format from 575 to 449. Requires two small changes: 1. Don't use llvm::ExceptionHandling in LangOptions. This isn't even quite the right type since we don't use all of its values. Tweaks the changes made in: - https://reviews.llvm.org/D93215 - https://reviews.llvm.org/D93216 2. Move section name validation code added (long ago) in commit 30ba67439 out of libBasic into Sema and base the check on the triple. This is a bit less OOP-y, but completely in line with what we do in many other places in Sema. No behavior change. Differential Revision: https://reviews.llvm.org/D101463 --- clang/lib/Frontend/CompilerInvocation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 36d2fe3..2578c8c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -463,7 +463,8 @@ static bool FixupInvocation(CompilerInvocation &Invocation, CodeGenOpts.CodeModel = TargetOpts.CodeModel; - if (LangOpts.getExceptionHandling() != llvm::ExceptionHandling::None && + if (LangOpts.getExceptionHandling() != + LangOptions::ExceptionHandlingKind::None && T.isWindowsMSVCEnvironment()) Diags.Report(diag::err_fe_invalid_exception_model) << static_cast(LangOpts.getExceptionHandling()) << T.str(); -- cgit v1.1