2 Commits

Author SHA1 Message Date
Michael Buch
74e34eff3f
[lldb][ClangModulesDeclVendor] Don't stop loading Clang modules if an individual import failed (#166940)
Depends on:
* https://github.com/llvm/llvm-project/pull/166917

When loading all Clang modules for a CU, we stop on first error. This
means benign module loading errors may stop us from importing actually
useful modules. There's no good reason to bail on the first one. The
pathological case would be if we try to load a large number of Clang
modules
but all fail to load for the same reason. That could happen, but in
practice I've always seen only a handful of modules failing to load out
of a large number. Particularly system modules are useful and usually
don't fail to load. Whereas project-specific Clang modules are more
likely to fail because the build system moves the modulemap/sources
around.

This patch accumulates all module loading errors and doesn't stop when
an error is encountered.
2025-11-07 23:11:48 +00:00
Michael Buch
7f55f264ec
[lldb][ClangModulesDeclVendor] Revamp error handling when loading Clang modules (#166917)
Instead of propagating the errors as a `bool`+`Stream` we change the
`ClangModulesDeclVendor` module loading APIs to use `llvm::Error`. We
also reword some of the diagnostics (notably removing the hardcoded
`error:` prefix). A follow-up patch will further make the module loading
errors less noisy.

See the new tests for what the errors look like.

rdar://164002569
2025-11-07 22:48:48 +00:00