> On Aug 19, 2015, at 1:12 PM, David Blaikie <dblai...@gmail.com> wrote:
> 
> 
> 
> On Tue, Aug 11, 2015 at 1:49 PM, Adrian Prantl <apra...@apple.com 
> <mailto:apra...@apple.com>> wrote:
> aprantl created this revision.
> aprantl added reviewers: dblaikie, echristo.
> aprantl added a subscriber: cfe-commits.
> aprantl set the repository for this revision to rL LLVM.
> 
> This patch adds a -gmodules option to the driver and a -dwarf-ext-refs to cc1 
> to enable the use of external type references in the debug info (a.k.a. 
> module debugging).
> 
> The driver expands -gmodules to "-g -fmodule-format=obj -dwarf-ext-refs" and 
> passes that to cc1.
> Most options that start with -g (e.g., -gdwarf-2) also turn on -g, and module 
> requires object-container-wrapped modules, "-dwarf-ext-refs" been the actual 
> low-level option for turning on external type references.
> 
> Rationale for the choice of names (and this is really all there is to review 
> in this patch):
> "-gmodules": is meant to pair nicely with "-fmodules"
> "-dwarf-ext-refs": Fits into the naming scheme of similar options like 
> "-dwarf-column-info" and "-dwarf-debug-flags". Spelling out the option 
> "-dwarf-external-type-references" seemed to be overkill.
> 
> Sounds reasonable - and the flag will be for more than just types eventually 
> anyway (specifically references to members (functions, etc) of types too).
>  
> All this does at the moment is set a flag codegenopts. Having this flag in 
> place is a prerequisite for emitting debug info into modules: The debug info 
> for a module needs to use external type references for types defined in 
> (other) modules or we would violate the minimal deserialization requirements 
> (cf. test/PCH/check-deserializations.cpp).
> 
> Could you explain what you mean by "violate the minimal deserialization 
> requirements”

There are tests in the testsuite to ensure that when deserializing a type from 
a module, only the bare minimum is actually deserialized. For example:

a.h
class A {};

b.h
class B { A a; };

When emitting debug info for B we need to emit an external reference for A 
instead of recursively emitting A (and thus “illegally” deserializing A from 
a.pcm).

> 
> Mechanically, the patch looks fine/exactly what you'd expect. Feel free to 
> commit whenever you're ready.

thanks,
adrian

>  
> 
> Repository:
>   rL LLVM
> 
> http://reviews.llvm.org/D11958 
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11958&d=BQMFaQ&c=eEvniauFctOgLOKGJOplqw&r=cTx6f1tAfqPeajYunFWp7_8ot79RnHyNteqzig4fXmA&m=OYlTn71sx_aJ_kkl6dcJDmmGe2SZ2AOMtPSiptwqe3M&s=9Oww56T9mtLMfzpO0B3gFzdboCnRX1kVMs8QUq18Tpw&e=>
> 
> Files:
>   docs/CommandGuide/clang.rst
>   include/clang/Driver/CC1Options.td
>   include/clang/Driver/Options.td
>   include/clang/Frontend/CodeGenOptions.def
>   lib/CodeGen/CGDebugInfo.cpp
>   lib/CodeGen/CGDebugInfo.h
>   lib/CodeGen/ObjectFilePCHContainerOperations.cpp
>   lib/Driver/Tools.cpp
>   lib/Frontend/CompilerInvocation.cpp
>   test/Driver/debug-options.c

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

Reply via email to