[all-commits] [llvm/llvm-project] d48ef7: [lldb] Print full Clang diagnostics when the Clang...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Fri May 15 01:11:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d48ef7cab55878fbb598e7a968b6073f9c7aa9ed
      https://github.com/llvm/llvm-project/commit/d48ef7cab55878fbb598e7a968b6073f9c7aa9ed
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-05-15 (Fri, 15 May 2020)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    A lldb/test/API/lang/objc/modules-compile-error/Makefile
    A lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py
    A lldb/test/API/lang/objc/modules-compile-error/main.m
    A lldb/test/API/lang/objc/modules-compile-error/module.h
    A lldb/test/API/lang/objc/modules-compile-error/module.modulemap

  Log Message:
  -----------
  [lldb] Print full Clang diagnostics when the ClangModulesDeclVendor fails to compile a module

Summary:
When the ClangModulesDeclVendor currently fails it just prints very basic and often incomplete diagnostics without any source locations:
```
(lldb) p @import Foundation
error: while importing modules:
'foo/bar.h' file not found
could not build module 'Darwin'
[...]
```
or even just
```
(lldb) p @import Foundation
error: while importing modules:
could not build module 'Darwin'
[...]
```

These diagnostics help neither the user nor us with figuring out what is the reason for the failure.

This patch wires up a full TextDiagnosticPrinter in the ClangModulesDeclVendor and makes
sure we always return the error stream to the user when we fail to compile our modules.

Fixes rdar://63216849

Reviewers: aprantl, jdoerfert

Reviewed By: aprantl

Subscribers: JDevlieghere

Differential Revision: https://reviews.llvm.org/D79947




More information about the All-commits mailing list