[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Justin Bogner via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf58330cbe445: [Driver] Make /Zi and /Z7 aliases of -g rather 
than handling them specially (authored by bogner).

Changed prior to commit:
  https://reviews.llvm.org/D157794?vs=549643=550053#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Clang.h
  clang/test/Driver/cl-options.c
  clang/test/Driver/working-directory.c

Index: clang/test/Driver/working-directory.c
===
--- clang/test/Driver/working-directory.c
+++ clang/test/Driver/working-directory.c
@@ -6,6 +6,6 @@
 
 // CHECK_NO_FILE: no such file or directory: 'no_such_file.cpp'
 
+// CHECK_WORKS: "-fdebug-compilation-dir={{[^"]+}}test{{/|}}Driver{{/|}}Inputs"
 // CHECK_WORKS: "-coverage-notes-file" "{{[^"]+}}test{{/|}}Driver{{/|}}Inputs{{/|}}pchfile.gcno"
 // CHECK_WORKS: "-working-directory" "{{[^"]+}}test{{/|}}Driver{{/|}}Inputs"
-// CHECK_WORKS: "-fdebug-compilation-dir={{[^"]+}}test{{/|}}Driver{{/|}}Inputs"
Index: clang/test/Driver/cl-options.c
===
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -564,16 +564,10 @@
 // RUN: %clang_cl /Brepro /Brepro- /c '-###' -- %s 2>&1 | FileCheck -check-prefix=Brepro_ %s
 // Brepro_: "-mincremental-linker-compatible"
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
-// Z7_gdwarf: "-gcodeview"
+// RUN: %clang_cl -gdwarf /Z7 /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
+// Z7_gdwarf-NOT: "-gcodeview"
 // Z7_gdwarf: "-debug-info-kind=constructor"
 // Z7_gdwarf: "-dwarf-version=
 
Index: clang/lib/Driver/ToolChains/Clang.h
===
--- clang/lib/Driver/ToolChains/Clang.h
+++ clang/lib/Driver/ToolChains/Clang.h
@@ -90,9 +90,7 @@
  RewriteKind rewrite) const;
 
   void AddClangCLArgs(const llvm::opt::ArgList , types::ID InputType,
-  llvm::opt::ArgStringList ,
-  llvm::codegenoptions::DebugInfoKind *DebugInfoKind,
-  bool *EmitCodeView) const;
+  llvm::opt::ArgStringList ) const;
 
   mutable std::unique_ptr CompilationDatabase = nullptr;
   void DumpCompilationDatabase(Compilation , StringRef Filename,
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4204,8 +4204,8 @@
 
 static void
 renderDebugOptions(const ToolChain , const Driver , const llvm::Triple ,
-   const ArgList , bool EmitCodeView, bool IRInput,
-   ArgStringList ,
+   const ArgList , bool IRInput, ArgStringList ,
+   const InputInfo ,
llvm::codegenoptions::DebugInfoKind ,
DwarfFissionKind ) {
   if (Args.hasFlag(options::OPT_fdebug_info_for_profiling,
@@ -4282,6 +4282,7 @@
   if (const Arg *A = getDwarfNArg(Args))
 EmitDwarf = checkDebugInfoOption(A, Args, D, TC);
 
+  bool EmitCodeView = false;
   if (const Arg *A = Args.getLastArg(options::OPT_gcodeview))
 EmitCodeView = checkDebugInfoOption(A, Args, D, TC);
 
@@ -4518,6 +4519,33 @@
 
   renderDwarfFormat(D, T, Args, CmdArgs, EffectiveDWARFVersion);
   RenderDebugInfoCompressionArgs(Args, CmdArgs, D, TC);
+
+  // This controls whether or not we perform JustMyCode instrumentation.
+  if (Args.hasFlag(options::OPT_fjmc, options::OPT_fno_jmc, false)) {
+if (TC.getTriple().isOSBinFormatELF() || D.IsCLMode()) {
+  if (DebugInfoKind >= llvm::codegenoptions::DebugInfoConstructor)
+CmdArgs.push_back("-fjmc");
+  else if (D.IsCLMode())
+D.Diag(clang::diag::warn_drv_jmc_requires_debuginfo) << "/JMC"
+ << "'/Zi', '/Z7'";
+  else
+

[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments.



Comment at: clang/test/Driver/cl-options.c:567
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck 
-check-prefix=Z7_gdwarf %s

smeenai wrote:
> bogner wrote:
> > smeenai wrote:
> > > bogner wrote:
> > > > rnk wrote:
> > > > > I think Meta folks depend on a mode that emits both codeview and 
> > > > > DWARF. +@smeenai
> > > > Hopefully if that's the case there's a better test somewhere than this 
> > > > one that discusses in detail how `/Z7` is an alias for 
> > > > `-gline-tables-only`, which hasn't been true since 2017.
> > > Thanks for the headers up :) We don't depend on that mode any more 
> > > though, so no problems on our end.
> > Also note that this change does not affect what happens if we specify both 
> > `-gcodeview` and `-gdwarf` together. That continues to pass both 
> > `-gcodeview` and `-dwarf-version=...` to `clang -cc1`. However, I don't see 
> > any tests that actually check that behaviour, so if that is a mode that's 
> > useful to keep working we definitely have some gaps there.
> > 
> > This change means that if you want to ask `-cc1` for dwarf *and* codeview 
> > with `/Z7` or `/Zi`, you'll need to specify `-gdwarf` and `-gcodeview` now. 
> > This matches how you would get both sets of options to render with `-g`, 
> > which I think makes sense.
> Yeah, that sounds good. IIRC when we were using the joint codeview + DWARF 
> mode it was with the gcc-style Clang driver and not clang-cl, and we passed 
> `-gdwarf -gcodeview` or similar to enable it anyway. We don't need that 
> anymore though; @mstorsjo would know if there's anything on the MinGW side 
> that cares for it.
I'm not aware of mingw usecases of using both codeview and DWARF at the same 
time - I've occasionally mentioned that I know some people do use that, but I 
haven't actually guided anybody into doing it.

For mingw, as long as `-g -gcodeview` on the driver level generates codeview 
(and not DWARF) like it used to, mingw should be fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision.
MaskRay added inline comments.



Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4522
   RenderDebugInfoCompressionArgs(Args, CmdArgs, D, TC);
+
+

Keep just one blank line.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

So, as I understand the discussion, after this patch, it will still be possible 
to get dwarf and codeview in the same compile, but users will have to resort to 
cc1 flags.

I think that's a good end state. I would like to retain the ability to generate 
both, but the driver should make it very hard to enable this mode. Burying it 
in cc1 flags seems like a good end state. Comments about lack of testing are 
valid.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a subscriber: mstorsjo.
smeenai added inline comments.



Comment at: clang/test/Driver/cl-options.c:567
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck 
-check-prefix=Z7_gdwarf %s

bogner wrote:
> smeenai wrote:
> > bogner wrote:
> > > rnk wrote:
> > > > I think Meta folks depend on a mode that emits both codeview and DWARF. 
> > > > +@smeenai
> > > Hopefully if that's the case there's a better test somewhere than this 
> > > one that discusses in detail how `/Z7` is an alias for 
> > > `-gline-tables-only`, which hasn't been true since 2017.
> > Thanks for the headers up :) We don't depend on that mode any more though, 
> > so no problems on our end.
> Also note that this change does not affect what happens if we specify both 
> `-gcodeview` and `-gdwarf` together. That continues to pass both `-gcodeview` 
> and `-dwarf-version=...` to `clang -cc1`. However, I don't see any tests that 
> actually check that behaviour, so if that is a mode that's useful to keep 
> working we definitely have some gaps there.
> 
> This change means that if you want to ask `-cc1` for dwarf *and* codeview 
> with `/Z7` or `/Zi`, you'll need to specify `-gdwarf` and `-gcodeview` now. 
> This matches how you would get both sets of options to render with `-g`, 
> which I think makes sense.
Yeah, that sounds good. IIRC when we were using the joint codeview + DWARF mode 
it was with the gcc-style Clang driver and not clang-cl, and we passed `-gdwarf 
-gcodeview` or similar to enable it anyway. We don't need that anymore though; 
@mstorsjo would know if there's anything on the MinGW side that cares for it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Justin Bogner via Phabricator via cfe-commits
bogner added inline comments.



Comment at: clang/test/Driver/cl-options.c:567
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck 
-check-prefix=Z7_gdwarf %s

smeenai wrote:
> bogner wrote:
> > rnk wrote:
> > > I think Meta folks depend on a mode that emits both codeview and DWARF. 
> > > +@smeenai
> > Hopefully if that's the case there's a better test somewhere than this one 
> > that discusses in detail how `/Z7` is an alias for `-gline-tables-only`, 
> > which hasn't been true since 2017.
> Thanks for the headers up :) We don't depend on that mode any more though, so 
> no problems on our end.
Also note that this change does not affect what happens if we specify both 
`-gcodeview` and `-gdwarf` together. That continues to pass both `-gcodeview` 
and `-dwarf-version=...` to `clang -cc1`. However, I don't see any tests that 
actually check that behaviour, so if that is a mode that's useful to keep 
working we definitely have some gaps there.

This change means that if you want to ask `-cc1` for dwarf *and* codeview with 
`/Z7` or `/Zi`, you'll need to specify `-gdwarf` and `-gcodeview` now. This 
matches how you would get both sets of options to render with `-g`, which I 
think makes sense.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-14 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added inline comments.



Comment at: clang/test/Driver/cl-options.c:567
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck 
-check-prefix=Z7_gdwarf %s

bogner wrote:
> rnk wrote:
> > I think Meta folks depend on a mode that emits both codeview and DWARF. 
> > +@smeenai
> Hopefully if that's the case there's a better test somewhere than this one 
> that discusses in detail how `/Z7` is an alias for `-gline-tables-only`, 
> which hasn't been true since 2017.
Thanks for the headers up :) We don't depend on that mode any more though, so 
no problems on our end.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-13 Thread Justin Bogner via Phabricator via cfe-commits
bogner added inline comments.



Comment at: clang/test/Driver/cl-options.c:567
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck 
-check-prefix=Z7_gdwarf %s

rnk wrote:
> I think Meta folks depend on a mode that emits both codeview and DWARF. 
> +@smeenai
Hopefully if that's the case there's a better test somewhere than this one that 
discusses in detail how `/Z7` is an alias for `-gline-tables-only`, which 
hasn't been true since 2017.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-12 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a subscriber: smeenai.
rnk added inline comments.



Comment at: clang/test/Driver/cl-options.c:567
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck 
-check-prefix=Z7_gdwarf %s

I think Meta folks depend on a mode that emits both codeview and DWARF. 
+@smeenai


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157794/new/

https://reviews.llvm.org/D157794

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

2023-08-12 Thread Justin Bogner via Phabricator via cfe-commits
bogner created this revision.
bogner added reviewers: rnk, jansvoboda11, MaskRay.
Herald added subscribers: jeroen.dobbelaere, mcrosier.
Herald added a project: All.
bogner requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The -g flag has been selecting whether to emit dwarf or codeview based
on the target ABI since 2018, so simply aliasing these flags does the
right thing for clang-cl.

This moves some code from Clang::ConstructJob to renderDebugOptions to
make things a little clearer now that we don't need to keep track of
whether we're doing codeview or not in multiple places, and also
combines the duplicate handling of the cl vs clang handling of jmc
flags as a result.

This is mostly NFC, but some -cc1 flags may be rendered in a slightly
different order because of the code that was moved around.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157794

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Clang.h
  clang/test/Driver/cl-options.c
  clang/test/Driver/working-directory.c

Index: clang/test/Driver/working-directory.c
===
--- clang/test/Driver/working-directory.c
+++ clang/test/Driver/working-directory.c
@@ -6,6 +6,6 @@
 
 // CHECK_NO_FILE: no such file or directory: 'no_such_file.cpp'
 
+// CHECK_WORKS: "-fdebug-compilation-dir={{[^"]+}}test{{/|}}Driver{{/|}}Inputs"
 // CHECK_WORKS: "-coverage-notes-file" "{{[^"]+}}test{{/|}}Driver{{/|}}Inputs{{/|}}pchfile.gcno"
 // CHECK_WORKS: "-working-directory" "{{[^"]+}}test{{/|}}Driver{{/|}}Inputs"
-// CHECK_WORKS: "-fdebug-compilation-dir={{[^"]+}}test{{/|}}Driver{{/|}}Inputs"
Index: clang/test/Driver/cl-options.c
===
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -564,16 +564,10 @@
 // RUN: %clang_cl /Brepro /Brepro- /c '-###' -- %s 2>&1 | FileCheck -check-prefix=Brepro_ %s
 // Brepro_: "-mincremental-linker-compatible"
 
-// This test was super sneaky: "/Z7" means "line-tables", but "-gdwarf" occurs
-// later on the command line, so it should win. Interestingly the cc1 arguments
-// came out right, but had wrong semantics, because an invariant assumed by
-// CompilerInvocation was violated: it expects that at most one of {gdwarfN,
-// line-tables-only} appear. If you assume that, then you can safely use
-// Args.hasArg to test whether a boolean flag is present without caring
-// where it appeared. And for this test, it appeared to the left of -gdwarf
-// which made it "win". This test could not detect that bug.
+// If We specify both /Z7 and -gdwarf we should get dwarf, not codeview.
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
-// Z7_gdwarf: "-gcodeview"
+// RUN: %clang_cl -gdwarf /Z7 /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
+// Z7_gdwarf-NOT: "-gcodeview"
 // Z7_gdwarf: "-debug-info-kind=constructor"
 // Z7_gdwarf: "-dwarf-version=
 
Index: clang/lib/Driver/ToolChains/Clang.h
===
--- clang/lib/Driver/ToolChains/Clang.h
+++ clang/lib/Driver/ToolChains/Clang.h
@@ -90,9 +90,7 @@
  RewriteKind rewrite) const;
 
   void AddClangCLArgs(const llvm::opt::ArgList , types::ID InputType,
-  llvm::opt::ArgStringList ,
-  llvm::codegenoptions::DebugInfoKind *DebugInfoKind,
-  bool *EmitCodeView) const;
+  llvm::opt::ArgStringList ) const;
 
   mutable std::unique_ptr CompilationDatabase = nullptr;
   void DumpCompilationDatabase(Compilation , StringRef Filename,
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4204,8 +4204,8 @@
 
 static void
 renderDebugOptions(const ToolChain , const Driver , const llvm::Triple ,
-   const ArgList , bool EmitCodeView, bool IRInput,
-   ArgStringList ,
+   const ArgList , bool IRInput, ArgStringList ,
+   const InputInfo ,
llvm::codegenoptions::DebugInfoKind ,
DwarfFissionKind ) {
   if (Args.hasFlag(options::OPT_fdebug_info_for_profiling,
@@ -4282,6 +4282,7 @@
   if (const Arg *A = getDwarfNArg(Args))
 EmitDwarf = checkDebugInfoOption(A, Args, D, TC);
 
+  bool EmitCodeView = false;
   if (const Arg *A = Args.getLastArg(options::OPT_gcodeview))
 EmitCodeView = checkDebugInfoOption(A, Args, D, TC);
 
@@ -4518,6 +4519,34 @@
 
   renderDwarfFormat(D, T, Args, CmdArgs, EffectiveDWARFVersion);
   RenderDebugInfoCompressionArgs(Args, CmdArgs, D, TC);
+
+
+  // This controls whether or not we perform JustMyCode