|
@@ -493,6 +493,8 @@ static codegenoptions::DebugInfoKind DebugLevelToInfoKind(const Arg &A) {
|
|
if (A.getOption().matches(options::OPT_gline_tables_only) ||
|
|
if (A.getOption().matches(options::OPT_gline_tables_only) ||
|
|
A.getOption().matches(options::OPT_ggdb1))
|
|
A.getOption().matches(options::OPT_ggdb1))
|
|
return codegenoptions::DebugLineTablesOnly;
|
|
return codegenoptions::DebugLineTablesOnly;
|
|
|
|
+ if (A.getOption().matches(options::OPT_gline_directives_only))
|
|
|
|
+ return codegenoptions::DebugDirectivesOnly;
|
|
return codegenoptions::LimitedDebugInfo;
|
|
return codegenoptions::LimitedDebugInfo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -889,6 +891,9 @@ static void RenderDebugEnablingArgs(const ArgList &Args, ArgStringList &CmdArgs,
|
|
unsigned DwarfVersion,
|
|
unsigned DwarfVersion,
|
|
llvm::DebuggerKind DebuggerTuning) {
|
|
llvm::DebuggerKind DebuggerTuning) {
|
|
switch (DebugInfoKind) {
|
|
switch (DebugInfoKind) {
|
|
|
|
+ case codegenoptions::DebugDirectivesOnly:
|
|
|
|
+ CmdArgs.push_back("-debug-info-kind=line-directives-only");
|
|
|
|
+ break;
|
|
case codegenoptions::DebugLineTablesOnly:
|
|
case codegenoptions::DebugLineTablesOnly:
|
|
CmdArgs.push_back("-debug-info-kind=line-tables-only");
|
|
CmdArgs.push_back("-debug-info-kind=line-tables-only");
|
|
break;
|
|
break;
|
|
@@ -2928,6 +2933,7 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
|
|
if (SplitDWARFArg) {
|
|
if (SplitDWARFArg) {
|
|
if (A->getIndex() > SplitDWARFArg->getIndex()) {
|
|
if (A->getIndex() > SplitDWARFArg->getIndex()) {
|
|
if (DebugInfoKind == codegenoptions::NoDebugInfo ||
|
|
if (DebugInfoKind == codegenoptions::NoDebugInfo ||
|
|
|
|
+ DebugInfoKind == codegenoptions::DebugDirectivesOnly ||
|
|
(DebugInfoKind == codegenoptions::DebugLineTablesOnly &&
|
|
(DebugInfoKind == codegenoptions::DebugLineTablesOnly &&
|
|
SplitDWARFInlining))
|
|
SplitDWARFInlining))
|
|
SplitDWARFArg = nullptr;
|
|
SplitDWARFArg = nullptr;
|
|
@@ -2979,6 +2985,10 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
|
|
DebugInfoKind != codegenoptions::NoDebugInfo)
|
|
DebugInfoKind != codegenoptions::NoDebugInfo)
|
|
DWARFVersion = TC.GetDefaultDwarfVersion();
|
|
DWARFVersion = TC.GetDefaultDwarfVersion();
|
|
|
|
|
|
|
|
+ // -gline-directives-only supported only for the DWARF debug info.
|
|
|
|
+ if (DWARFVersion == 0 && DebugInfoKind == codegenoptions::DebugDirectivesOnly)
|
|
|
|
+ DebugInfoKind = codegenoptions::NoDebugInfo;
|
|
|
|
+
|
|
// We ignore flag -gstrict-dwarf for now.
|
|
// We ignore flag -gstrict-dwarf for now.
|
|
// And we handle flag -grecord-gcc-switches later with DWARFDebugFlags.
|
|
// And we handle flag -grecord-gcc-switches later with DWARFDebugFlags.
|
|
Args.ClaimAllArgs(options::OPT_g_flags_Group);
|
|
Args.ClaimAllArgs(options::OPT_g_flags_Group);
|
|
@@ -2996,10 +3006,11 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
|
|
CmdArgs.push_back("-dwarf-column-info");
|
|
CmdArgs.push_back("-dwarf-column-info");
|
|
|
|
|
|
// FIXME: Move backend command line options to the module.
|
|
// FIXME: Move backend command line options to the module.
|
|
- // If -gline-tables-only is the last option it wins.
|
|
|
|
|
|
+ // If -gline-tables-only or -gline-directives-only is the last option it wins.
|
|
if (const Arg *A = Args.getLastArg(options::OPT_gmodules))
|
|
if (const Arg *A = Args.getLastArg(options::OPT_gmodules))
|
|
if (checkDebugInfoOption(A, Args, D, TC)) {
|
|
if (checkDebugInfoOption(A, Args, D, TC)) {
|
|
- if (DebugInfoKind != codegenoptions::DebugLineTablesOnly) {
|
|
|
|
|
|
+ if (DebugInfoKind != codegenoptions::DebugLineTablesOnly &&
|
|
|
|
+ DebugInfoKind != codegenoptions::DebugDirectivesOnly) {
|
|
DebugInfoKind = codegenoptions::LimitedDebugInfo;
|
|
DebugInfoKind = codegenoptions::LimitedDebugInfo;
|
|
CmdArgs.push_back("-dwarf-ext-refs");
|
|
CmdArgs.push_back("-dwarf-ext-refs");
|
|
CmdArgs.push_back("-fmodule-format=obj");
|
|
CmdArgs.push_back("-fmodule-format=obj");
|