2 Commits

Author SHA1 Message Date
Michael Buch
d5b62fabd1
[lldb][ClangModulesDeclVendor] Print Clang module loading errors to expression log instead of console (#166964)
Depends on:
* https://github.com/llvm/llvm-project/pull/166917
* https://github.com/llvm/llvm-project/pull/166940

While these errors can contribute to an expression failing, they are
never *the* reason the expression failed. I.e., they are always just
'note:' diagnostics that we hand-emit. Because they are quite noisy (and
we potentially have many of them if we auto-load all modules in a CU),
this patch logs the errors to the `expr` log, instead of the console.

Previously these errors would only get omitted when the expression
itself failed. Meaning if the expression failed, we'd dump these 'note'
module load errors in next to the actual expression error, obscuring the
output. Moreover, if the expression succeeded, any module load errors
would be dropped. Now we always log all module loading errors to the
expression log, regardless of whether the expression fails or not.
2025-11-08 00:21:03 +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