Skip to content

Commit a3aa67b

Browse files
committed
Revert driver: Don't warn about assembler flags being unused when not assembling
This reverts r365703 (git commit 101c1af) and r365714. This broke some autoconf-style assembler flags checks in the Linux build: ClangBuiltLinux/linux#598 llvm-svn: 365956
1 parent 697de1c commit a3aa67b

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,18 +3535,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
35353535
// Select the appropriate action.
35363536
RewriteKind rewriteKind = RK_None;
35373537

3538-
// If CollectArgsForIntegratedAssembler() isn't called below, call it here
3539-
// with a dummy args list to mark assembler flags as used even when not
3540-
// running an assembler. Otherwise, clang would emit "argument unused"
3541-
// warnings for assembler flags when e.g. adding "-E" to flags while debugging
3542-
// something. That'd be somewhat inconvenient, and it's also inconsistent with
3543-
// most other flags -- we don't warn on -ffunction-sections not being used
3544-
// in -E mode either for example, even though it's not really used either.
3545-
if (!isa<AssembleJobAction>(JA)) {
3546-
ArgStringList DummyArgs;
3547-
CollectArgsForIntegratedAssembler(C, Args, DummyArgs, D);
3548-
}
3549-
35503538
if (isa<AnalyzeJobAction>(JA)) {
35513539
assert(JA.getType() == types::TY_Plist && "Invalid output type.");
35523540
CmdArgs.push_back("-analyze");

clang/test/Driver/as-options.s

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,3 @@
3535
// RUN: | FileCheck %s
3636

3737
// CHECK: "-I" "foo_dir"
38-
39-
// Test that assembler options don't cause warnings when there's no assembler
40-
// stage.
41-
42-
// RUN: %clang -mincremental-linker-compatible -E \
43-
// RUN: -o /dev/null -x c++ %s 2>&1 \
44-
// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
45-
// RUN: %clang -mincremental-linker-compatible -E \
46-
// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
47-
// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
48-
// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \
49-
// RUN: -o /dev/null -x c++ %s 2>&1 \
50-
// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
51-
// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \
52-
// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
53-
// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
54-
// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E \
55-
// RUN: -o /dev/null -x c++ %s 2>&1 \
56-
// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
57-
// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E \
58-
// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
59-
// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
60-
// WARN-NOT: unused

0 commit comments

Comments
 (0)