forked from OSchip/llvm-project
Re-land "Emit proper CodeView when -gcodeview is passed without the cl driver."
Reverts r326116 and re-lands r326113 with a fix to ASan so that it enables column info in its test suite. llvm-svn: 326141
This commit is contained in:
parent
87a000dae3
commit
54af3e7e14
|
@ -2968,7 +2968,7 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
|
||||||
|
|
||||||
// Forward -gcodeview. EmitCodeView might have been set by CL-compatibility
|
// Forward -gcodeview. EmitCodeView might have been set by CL-compatibility
|
||||||
// argument parsing.
|
// argument parsing.
|
||||||
if (Args.hasArg(options::OPT_gcodeview) || EmitCodeView) {
|
if (EmitCodeView) {
|
||||||
// DWARFVersion remains at 0 if no explicit choice was made.
|
// DWARFVersion remains at 0 if no explicit choice was made.
|
||||||
CmdArgs.push_back("-gcodeview");
|
CmdArgs.push_back("-gcodeview");
|
||||||
} else if (DWARFVersion == 0 &&
|
} else if (DWARFVersion == 0 &&
|
||||||
|
@ -3567,6 +3567,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
types::ID InputType = Input.getType();
|
types::ID InputType = Input.getType();
|
||||||
if (D.IsCLMode())
|
if (D.IsCLMode())
|
||||||
AddClangCLArgs(Args, InputType, CmdArgs, &DebugInfoKind, &EmitCodeView);
|
AddClangCLArgs(Args, InputType, CmdArgs, &DebugInfoKind, &EmitCodeView);
|
||||||
|
else
|
||||||
|
EmitCodeView = Args.hasArg(options::OPT_gcodeview);
|
||||||
|
|
||||||
const Arg *SplitDWARFArg = nullptr;
|
const Arg *SplitDWARFArg = nullptr;
|
||||||
RenderDebugOptions(getToolChain(), D, RawTriple, Args, EmitCodeView,
|
RenderDebugOptions(getToolChain(), D, RawTriple, Args, EmitCodeView,
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Check that -dwarf-column-info does not get added to the cc1 line:
|
||||||
|
// 1) When -gcodeview is present via the clang or clang++ driver
|
||||||
|
// 2) When /Z7 is present via the cl driver.
|
||||||
|
|
||||||
|
// RUN: %clang -### -c -g -gcodeview %s 2> %t1
|
||||||
|
// RUN: FileCheck < %t1 %s
|
||||||
|
// RUN: %clangxx -### -c -g -gcodeview %s 2> %t2
|
||||||
|
// RUN: FileCheck < %t2 %s
|
||||||
|
// RUN: %clang_cl -### /c /Z7 %s 2> %t2
|
||||||
|
// RUN: FileCheck < %t2 %s
|
||||||
|
|
||||||
|
// CHECK: "-cc1"
|
||||||
|
// CHECK-NOT: "-dwarf-column-info"
|
|
@ -37,7 +37,11 @@ if compiler_id == "Clang":
|
||||||
# reports and stack traces even with minimal debug info.
|
# reports and stack traces even with minimal debug info.
|
||||||
config.debug_info_flags = ["-gline-tables-only"]
|
config.debug_info_flags = ["-gline-tables-only"]
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
|
# On Windows, use CodeView with column info instead of DWARF. Both VS and
|
||||||
|
# windbg do not behave well when column info is enabled, but users have
|
||||||
|
# requested it because it makes ASan reports more precise.
|
||||||
config.debug_info_flags.append("-gcodeview")
|
config.debug_info_flags.append("-gcodeview")
|
||||||
|
config.debug_info_flags.append("-gcolumn-info")
|
||||||
elif compiler_id == 'GNU':
|
elif compiler_id == 'GNU':
|
||||||
config.cxx_mode_flags = ["-x c++"]
|
config.cxx_mode_flags = ["-x c++"]
|
||||||
config.debug_info_flags = ["-g"]
|
config.debug_info_flags = ["-g"]
|
||||||
|
|
Loading…
Reference in New Issue