[PATCH] D11958: Add a -gmodules option to the clang driver.

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 13:49:25 PDT 2015


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.

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).

Repository:
  rL LLVM

http://reviews.llvm.org/D11958

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11958.31851.patch
Type: text/x-patch
Size: 5911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150811/84dff2a8/attachment-0001.bin>


More information about the cfe-commits mailing list