Skip to content

Commit 8400679

Browse files
committed
Revert "[Driver] Error for -gsplit-dwarf with RISC-V linker relaxation"
This reverts commit 80a4e6f.
1 parent 9b9eefa commit 8400679

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,6 @@ def warn_drv_sarif_format_unstable : Warning<
833833
"diagnostic formatting in SARIF mode is currently unstable">,
834834
InGroup<DiagGroup<"sarif-format-unstable">>;
835835

836-
def err_drv_riscv_unsupported_with_linker_relaxation : Error<
837-
"%0 is unsupported with RISC-V linker relaxation (-mrelax)">;
838-
839836
def warn_drv_loongarch_conflicting_implied_val : Warning<
840837
"ignoring '%0' as it conflicts with that implied by '%1' (%2)">,
841838
InGroup<OptionIgnored>;

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple,
130130
#undef RESERVE_REG
131131

132132
// -mrelax is default, unless -mno-relax is specified.
133-
if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) {
133+
if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true))
134134
Features.push_back("+relax");
135-
// -gsplit-dwarf -mrelax requires DW_AT_high_pc/DW_AT_ranges/... indexing
136-
// into .debug_addr, which is currently not implemented.
137-
Arg *A;
138-
if (getDebugFissionKind(D, Args, A) != DwarfFissionKind::None)
139-
D.Diag(clang::diag::err_drv_riscv_unsupported_with_linker_relaxation)
140-
<< A->getAsString(Args);
141-
} else {
135+
else
142136
Features.push_back("-relax");
143-
}
144137

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

clang/test/Driver/riscv-features.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@
6868
// DEFAULT-LINUX-SAME: "-target-feature" "+d"
6969
// DEFAULT-LINUX-SAME: "-target-feature" "+c"
7070

71-
// RUN: not %clang -c --target=riscv64-linux-gnu -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefix=ERR-SPLIT-DWARF
72-
// RUN: not %clang -c --target=riscv64 -gsplit-dwarf=single %s 2>&1 | FileCheck %s --check-prefix=ERR-SPLIT-DWARF
73-
// RUN: %clang -### -c --target=riscv64 -mno-relax -g -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefix=SPLIT-DWARF
74-
75-
// ERR-SPLIT-DWARF: error: -gsplit-dwarf{{.*}} is unsupported with RISC-V linker relaxation (-mrelax)
76-
// SPLIT-DWARF: "-split-dwarf-file"
77-
7871
// RUN: %clang -mabi=lp64d --target=riscv64-unknown-fuchsia -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=FUCHSIA
7972
// FUCHSIA: "-target-feature" "+m"
8073
// FUCHSIA-SAME: "-target-feature" "+a"

0 commit comments

Comments
 (0)