From 820e0c49fc48024d8b426f4b10b50b5b5659a705 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 22 Feb 2021 09:54:16 +0100 Subject: [clang][cli] Pass '-Wspir-compat' to cc1 from driver This patch moves the creation of the '-Wspir-compat' argument from cc1 to the driver. Without this change, generating command line arguments from `CompilerInvocation` cannot be done reliably: there's no way to distinguish whether '-Wspir-compat' was passed to cc1 on the command line (should be generated), or if it was created within `CompilerInvocation::CreateFromArgs` (should not be generated). This is also in line with how other '-W' flags are handled. (This was introduced in D21567.) Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D97041 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 45fb4f6..a870940 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -4628,10 +4628,6 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, Success = false; } - // Turn on -Wspir-compat for SPIR target. - if (T.isSPIR()) - Res.getDiagnosticOpts().Warnings.push_back("spir-compat"); - // If sanitizer is enabled, disable OPT_ffine_grained_bitfield_accesses. if (Res.getCodeGenOpts().FineGrainedBitfieldAccesses && !Res.getLangOpts()->Sanitize.empty()) { -- cgit v1.1