v.g.vassilev added inline comments.

================
Comment at: clang/lib/CodeGen/ModuleBuilder.cpp:39
     const PreprocessorOptions &PreprocessorOpts; // Only used for debug info.
-    const CodeGenOptions CodeGenOpts;  // Intentionally copied in.
+    CodeGenOptions CodeGenOpts;  // Intentionally copied in.
 
----------------
argentite wrote:
> v.g.vassilev wrote:
> > IIUC history correctly, here the intentional copy was to prevent some 
> > layering violation for what was called in 2009 `CompileOpts`. I believe 
> > that is not the case, can you check if we can take a const reference here? 
> I don't understand how the reference causes layering violation but if I 
> change it to a const reference instead, the option modification code becomes 
> slightly less awkward and all tests seem to be fine.
Let's try that then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146389

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

Reply via email to