Inferred submodule declarations are emitted in DWARF as `DW_TAG_module`s without `DW_AT_LLVM_include_path`s. Instead the parent DIE will have the include path. This patch adds support for such setups. Without this, the `ClangModulesDeclVendor` would fail to `AddModule` the submodules (i.e., compile and load the submodules). This would cause errors such as: ``` note: error: Header search couldn't locate module 'TopLevel' ``` The test added here also tests https://github.com/llvm/llvm-project/pull/141220. Without that patch we'd fail with: ``` note: error: No module map file in /Users/jonas/Git/llvm-worktrees/llvm-project/lldb/test/API/lang/cpp/decl-from-submodule ``` Unfortunately the embedded clang instance doesn't allow us to use the decls we find in the modules. But we'll try to fix that in a separate patch. rdar://151022173
10 lines
114 B
C++
10 lines
114 B
C++
#include "TopLevel/module1.h"
|
|
#include "TopLevel/module2.h"
|
|
|
|
int main() {
|
|
func(1);
|
|
func(2, 3);
|
|
|
|
return 0;
|
|
}
|