This patch implements several improvements to the
authorSean Callanan <scallanan@apple.com>
Mon, 20 Apr 2015 16:31:29 +0000 (16:31 +0000)
committerSean Callanan <scallanan@apple.com>
Mon, 20 Apr 2015 16:31:29 +0000 (16:31 +0000)
commitf0c5aeb69011197d1ef1bbed7ba363d52e95c5d8
treea9ad4361dfe9cdc044504cafed3af7dc215ff5c7
parent2cc2b63f533cfbda9753711cdf3414f6c26cbe6a
This patch implements several improvements to the
module-loading support for the expression parser.

- It adds support for auto-loading modules referred
  to by a compile unit.  These references are
  currently in the form of empty translation units.
  This functionality is gated by the setting

  target.auto-import-clang-modules (boolean) = false

- It improves and corrects support for loading
  macros from modules, currently by textually
  pasting all #defines into the user's expression.
  The improvements center around including only those
  modules that are relevant to the current context -
  hand-loaded modules and the modules that are imported
  from the current compile unit.

- It adds an "opt-in" mechanism for all of this
  functionality.  Modules have to be explicitly
  imported (via @import) or auto-loaded (by enabling
  the above setting) to enable any of this
  functionality.

It also adds support to the compile unit and symbol
file code to deal with empty translation units that
indicate module imports, and plumbs this through to
the CompileUnit interface.

Finally, it makes the following changes to the test
suite:

- It adds a testcase that verifies that modules are
  automatically loaded when the appropriate setting
  is enabled (lang/objc/modules-auto-import); and

- It modifies lanb/objc/modules-incomplete to test
  the case where a module #undefs something that is
  #defined in another module.

<rdar://problem/20299554>

llvm-svn: 235313
25 files changed:
lldb/include/lldb/Expression/ClangModulesDeclVendor.h
lldb/include/lldb/Expression/ClangPersistentVariables.h
lldb/include/lldb/Symbol/CompileUnit.h
lldb/include/lldb/Symbol/SymbolFile.h
lldb/include/lldb/Symbol/SymbolVendor.h
lldb/include/lldb/Target/Target.h
lldb/source/Expression/ClangExpressionParser.cpp
lldb/source/Expression/ClangModulesDeclVendor.cpp
lldb/source/Expression/ClangUserExpression.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/source/Symbol/CompileUnit.cpp
lldb/source/Symbol/SymbolVendor.cpp
lldb/source/Target/Target.cpp
lldb/test/functionalities/data-formatter/typedef_array/Makefile
lldb/test/lang/objc/modules-auto-import/Makefile [new file with mode: 0644]
lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py [new file with mode: 0644]
lldb/test/lang/objc/modules-auto-import/main.m [new file with mode: 0644]
lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py
lldb/test/lang/objc/modules-incomplete/myModule.h