summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/CommonArgs.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-11-14 09:22:16 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-11-14 09:22:16 +0000
commit91829eef650fdad7b2d566bf3f0cb623fd4bad09 (patch)
tree5ac2468deb8c9c32afc4014745f1a6ba9083e5e5 /clang/lib/Driver/ToolChains/CommonArgs.cpp
parent39e86fa5e49005898c47ca6b23bc465f65fe66c7 (diff)
downloadbcm5719-llvm-91829eef650fdad7b2d566bf3f0cb623fd4bad09.tar.gz
bcm5719-llvm-91829eef650fdad7b2d566bf3f0cb623fd4bad09.zip
[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.
The DWARF5 specification says(Appendix F.1): "The sections that do not require relocation, however, can be written to the relocatable object (.o) file but ignored by the linker or they can be written to a separate DWARF object (.dwo) file that need not be accessed by the linker." The first part describes a single file split DWARF feature and there is no way to trigger this behavior atm. Fortunately, no many changes are required to keep *.dwo sections in a .o, the patch does that. Differential revision: https://reviews.llvm.org/D52296 llvm-svn: 346837
Diffstat (limited to 'clang/lib/Driver/ToolChains/CommonArgs.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/CommonArgs.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 3803dde8daf..e802ce7a8c0 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -808,7 +808,12 @@ bool tools::areOptimizationsEnabled(const ArgList &Args) {
return false;
}
-const char *tools::SplitDebugName(const ArgList &Args, const InputInfo &Input) {
+const char *tools::SplitDebugName(const ArgList &Args, const InputInfo &Input,
+ const InputInfo &Output) {
+ 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(FinalOutput->getValue());
OpenPOWER on IntegriCloud