From: Reid Kleckner Date: Fri, 12 Jul 2019 20:44:57 +0000 (+0000) Subject: Revert driver: Don't warn about assembler flags being unused when not assembling X-Git-Tag: llvmorg-10-init~450 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3aa67b7f915d67ab7244688640d4407b12f632e;p=platform%2Fupstream%2Fllvm.git Revert driver: Don't warn about assembler flags being unused when not assembling This reverts r365703 (git commit 101c1afdfd1c88f05da94c6fd317b489bb704f40) and r365714. This broke some autoconf-style assembler flags checks in the Linux build: https://github.com/ClangBuiltLinux/linux/issues/598 llvm-svn: 365956 --- diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index a1fe39e..c84cb48 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -3535,18 +3535,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Select the appropriate action. RewriteKind rewriteKind = RK_None; - // If CollectArgsForIntegratedAssembler() isn't called below, call it here - // with a dummy args list to mark assembler flags as used even when not - // running an assembler. Otherwise, clang would emit "argument unused" - // warnings for assembler flags when e.g. adding "-E" to flags while debugging - // something. That'd be somewhat inconvenient, and it's also inconsistent with - // most other flags -- we don't warn on -ffunction-sections not being used - // in -E mode either for example, even though it's not really used either. - if (!isa(JA)) { - ArgStringList DummyArgs; - CollectArgsForIntegratedAssembler(C, Args, DummyArgs, D); - } - if (isa(JA)) { assert(JA.getType() == types::TY_Plist && "Invalid output type."); CmdArgs.push_back("-analyze"); diff --git a/clang/test/Driver/as-options.s b/clang/test/Driver/as-options.s index 48f1956..405030f 100644 --- a/clang/test/Driver/as-options.s +++ b/clang/test/Driver/as-options.s @@ -35,26 +35,3 @@ // RUN: | FileCheck %s // CHECK: "-I" "foo_dir" - -// Test that assembler options don't cause warnings when there's no assembler -// stage. - -// RUN: %clang -mincremental-linker-compatible -E \ -// RUN: -o /dev/null -x c++ %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -mincremental-linker-compatible -E \ -// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ -// RUN: -o /dev/null -x c++ %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ -// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E \ -// RUN: -o /dev/null -x c++ %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E \ -// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// WARN-NOT: unused