[clang] 2819cea - Revert "[HIP] Fix -gsplit-dwarf option"
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 19 07:17:54 PDT 2020
Author: Yaxun (Sam) Liu
Date: 2020-09-19T10:15:27-04:00
New Revision: 2819cea2ef8aab9d7ef8ba29feec9cb58cc942f6
URL: https://github.com/llvm/llvm-project/commit/2819cea2ef8aab9d7ef8ba29feec9cb58cc942f6
DIFF: https://github.com/llvm/llvm-project/commit/2819cea2ef8aab9d7ef8ba29feec9cb58cc942f6.diff
LOG: Revert "[HIP] Fix -gsplit-dwarf option"
This reverts commit e50465ecefc964e5700df26fc7e02a673eed085a
due to regression in lldb tests.
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/CommonArgs.h
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/MinGW.cpp
Removed:
clang/test/Driver/hip-gsplit-dwarf-options.hip
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1b7476d8ffd2..0c03a90b8566 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4810,7 +4810,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(isa<AssembleJobAction>(JA) || isa<CompileJobAction>(JA) ||
isa<BackendJobAction>(JA));
if (SplitDWARF) {
- const char *SplitDWARFOut = SplitDebugName(JA, Args, Input, Output);
+ const char *SplitDWARFOut = SplitDebugName(Args, Input, Output);
CmdArgs.push_back("-split-dwarf-file");
CmdArgs.push_back(SplitDWARFOut);
if (DwarfFission == DwarfFissionKind::Split) {
@@ -7047,7 +7047,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
if (getDebugFissionKind(D, Args, A) == DwarfFissionKind::Split &&
T.isOSBinFormatELF()) {
CmdArgs.push_back("-split-dwarf-output");
- CmdArgs.push_back(SplitDebugName(JA, Args, Input, Output));
+ CmdArgs.push_back(SplitDebugName(Args, Input, Output));
}
assert(Input.isFilename() && "Invalid input.");
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 151d5893961e..5dc5d834136e 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -902,23 +902,15 @@ bool tools::areOptimizationsEnabled(const ArgList &Args) {
return false;
}
-const char *tools::SplitDebugName(const JobAction &JA, const ArgList &Args,
- const InputInfo &Input,
+const char *tools::SplitDebugName(const ArgList &Args, const InputInfo &Input,
const InputInfo &Output) {
- // Adds '_' and GPU arch to the stem of .dwo file for HIP, which is
- // expected by gdb.
- auto AddPostfix = [JA](auto &F) {
- if (JA.getOffloadingDeviceKind() == Action::OFK_HIP)
- F += (Twine("_") + JA.getOffloadingArch()).str();
- };
if (Arg *A = Args.getLastArg(options::OPT_gsplit_dwarf_EQ))
if (StringRef(A->getValue()) == "single")
return Args.MakeArgString(Output.getFilename());
Arg *FinalOutput = Args.getLastArg(options::OPT_o);
if (FinalOutput && Args.hasArg(options::OPT_c)) {
- SmallString<128> T(llvm::sys::path::stem(FinalOutput->getValue()));
- AddPostfix(T);
+ SmallString<128> T(FinalOutput->getValue());
llvm::sys::path::replace_extension(T, "dwo");
return Args.MakeArgString(T);
} else {
@@ -926,7 +918,6 @@ const char *tools::SplitDebugName(const JobAction &JA, const ArgList &Args,
SmallString<128> T(
Args.getLastArgValue(options::OPT_fdebug_compilation_dir));
SmallString<128> F(llvm::sys::path::stem(Input.getBaseInput()));
- AddPostfix(F);
llvm::sys::path::replace_extension(F, "dwo");
T += F;
return Args.MakeArgString(F);
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.h b/clang/lib/Driver/ToolChains/CommonArgs.h
index 4947c33b6224..0028ea0ca337 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.h
+++ b/clang/lib/Driver/ToolChains/CommonArgs.h
@@ -49,7 +49,7 @@ void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
llvm::opt::ArgStringList &CmdArgs,
const llvm::opt::ArgList &Args);
-const char *SplitDebugName(const JobAction &JA, const llvm::opt::ArgList &Args,
+const char *SplitDebugName(const llvm::opt::ArgList &Args,
const InputInfo &Input, const InputInfo &Output);
void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T,
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 68a75db0b92a..7f7a3956781a 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -939,7 +939,7 @@ void tools::gnutools::Assembler::ConstructJob(Compilation &C,
if (Args.hasArg(options::OPT_gsplit_dwarf) &&
getToolChain().getTriple().isOSLinux())
SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
- SplitDebugName(JA, Args, Inputs[0], Output));
+ SplitDebugName(Args, Inputs[0], Output));
}
namespace {
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 7738029e0c28..a1a1b413fb6c 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -55,7 +55,7 @@ void tools::MinGW::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasArg(options::OPT_gsplit_dwarf))
SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
- SplitDebugName(JA, Args, Inputs[0], Output));
+ SplitDebugName(Args, Inputs[0], Output));
}
void tools::MinGW::Linker::AddLibGCC(const ArgList &Args,
diff --git a/clang/test/Driver/hip-gsplit-dwarf-options.hip b/clang/test/Driver/hip-gsplit-dwarf-options.hip
deleted file mode 100644
index 9f735c048cee..000000000000
--- a/clang/test/Driver/hip-gsplit-dwarf-options.hip
+++ /dev/null
@@ -1,25 +0,0 @@
-// REQUIRES: zlib, clang-driver, amdgpu-registered-target
-
-// RUN: %clang -### -target x86_64-unknown-linux-gnu -c \
-// RUN: --offload-arch=gfx906:xnack+ %s -nogpulib -nogpuinc \
-// RUN: --offload-arch=gfx900 \
-// RUN: -ggdb -gsplit-dwarf 2>&1 | FileCheck %s
-
-// RUN: %clang -### -target x86_64-unknown-linux-gnu -c \
-// RUN: -fgpu-rdc --offload-arch=gfx906:xnack+ %s -nogpulib -nogpuinc \
-// RUN: --offload-arch=gfx900 \
-// RUN: -ggdb -gsplit-dwarf 2>&1 | FileCheck %s
-
-// RUN: %clang -### -target x86_64-unknown-linux-gnu \
-// RUN: --offload-arch=gfx906:xnack+ %s -nogpulib -nogpuinc \
-// RUN: --offload-arch=gfx900 \
-// RUN: -ggdb -gsplit-dwarf 2>&1 | FileCheck %s
-
-// RUN: %clang -### -target x86_64-unknown-linux-gnu \
-// RUN: -fgpu-rdc --offload-arch=gfx906:xnack+ %s -nogpulib -nogpuinc \
-// RUN: --offload-arch=gfx900 \
-// RUN: -ggdb -gsplit-dwarf 2>&1 | FileCheck %s
-
-// CHECK-DAG: {{".*clang.*".* "-target-cpu" "gfx906".* "-split-dwarf-output" "hip-gsplit-dwarf-options_gfx906:xnack\+.dwo"}}
-// CHECK-DAG: {{".*clang.*".* "-target-cpu" "gfx900".* "-split-dwarf-output" "hip-gsplit-dwarf-options_gfx900.dwo"}}
-// CHECK-DAG: {{".*clang.*".* "-target-cpu" "x86-64".* "-split-dwarf-output" "hip-gsplit-dwarf-options.dwo"}}
More information about the cfe-commits
mailing list