thegameg updated this revision to Diff 233459. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71325/new/
https://reviews.llvm.org/D71325 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/debug-options.c Index: clang/test/Driver/debug-options.c =================================================================== --- clang/test/Driver/debug-options.c +++ clang/test/Driver/debug-options.c @@ -64,6 +64,12 @@ // RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \ // RUN: | FileCheck -check-prefix=G_STANDALONE \ // RUN: -check-prefix=G_DWARF4 %s +// RUN: %clang -### -c -fsave-optimization-record %s \ +// RUN: -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=GLTO_ONLY %s +// RUN: %clang -### -c -g -fsave-optimization-record %s \ +// RUN: -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE %s // FreeBSD. // RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \ Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3717,6 +3717,11 @@ // Adjust the debug info kind for the given toolchain. TC.adjustDebugInfoKind(DebugInfoKind, Args); + // When emitting remarks, we need at least debug lines in the output. + if (shouldEmitRemarks(Args) && + DebugInfoKind <= codegenoptions::DebugDirectivesOnly) + DebugInfoKind = codegenoptions::DebugLineTablesOnly; + RenderDebugEnablingArgs(Args, CmdArgs, DebugInfoKind, DWARFVersion, DebuggerTuning);
Index: clang/test/Driver/debug-options.c =================================================================== --- clang/test/Driver/debug-options.c +++ clang/test/Driver/debug-options.c @@ -64,6 +64,12 @@ // RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \ // RUN: | FileCheck -check-prefix=G_STANDALONE \ // RUN: -check-prefix=G_DWARF4 %s +// RUN: %clang -### -c -fsave-optimization-record %s \ +// RUN: -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=GLTO_ONLY %s +// RUN: %clang -### -c -g -fsave-optimization-record %s \ +// RUN: -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE %s // FreeBSD. // RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \ Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3717,6 +3717,11 @@ // Adjust the debug info kind for the given toolchain. TC.adjustDebugInfoKind(DebugInfoKind, Args); + // When emitting remarks, we need at least debug lines in the output. + if (shouldEmitRemarks(Args) && + DebugInfoKind <= codegenoptions::DebugDirectivesOnly) + DebugInfoKind = codegenoptions::DebugLineTablesOnly; + RenderDebugEnablingArgs(Args, CmdArgs, DebugInfoKind, DWARFVersion, DebuggerTuning);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits