Skip to content

Commit 3544707

Browse files
committed
making the default case command line shorter, not add -no-fence-tso
1 parent 1714ccb commit 3544707

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,8 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple,
143143
}
144144

145145
// -mfence-tso is default, unless -mno-fence-tso is specified.
146-
if (Args.hasFlag(options::OPT_mfence_tso, options::OPT_mno_fence_tso, true)) {
147-
Features.push_back("-no-fence-tso");
148-
} else {
146+
if (Args.hasFlag(options::OPT_mno_fence_tso, options::OPT_mfence_tso, false))
149147
Features.push_back("+no-fence-tso");
150-
}
151148

152149
// If -mstrict-align, -mno-strict-align, -mscalar-strict-align, or
153150
// -mno-scalar-strict-align is passed, use it. Otherwise, the

clang/test/Driver/riscv-features.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
// RUN: %clang --target=riscv32-unknown-elf -### %s -mfence-tso 2>&1 | FileCheck %s -check-prefix=FENCE-TSO
3333
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-fence-tso 2>&1 | FileCheck %s -check-prefix=NO-FENCE-TSO
3434

35-
// FENCE-TSO: "-target-feature" "-no-fence-tso"
35+
// FENCE-TSO-NOT: "-target-feature" "-no-fence-tso"
3636
// NO-FENCE-TSO: "-target-feature" "+no-fence-tso"
37-
// DEFAULT: "-target-feature" "-no-fence-tso"
37+
// DEFAULT-NOT: "-target-feature" "-no-fence-tso"
3838
// DEFAULT-NOT: "-target-feature" "+no-fence-tso"
3939

4040
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-strict-align 2>&1 | FileCheck %s -check-prefixes=FAST-SCALAR-UNALIGNED-ACCESS,FAST-VECTOR-UNALIGNED-ACCESS

0 commit comments

Comments
 (0)