[all-commits] [llvm/llvm-project] a62579: [clangd][nfc] Show more information in logs when c...

Aleksandr Platonov via All-commits all-commits at lists.llvm.org
Wed Jun 30 13:59:18 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a62579fc008e22b6c9e1544788644f5fceef15ce
      https://github.com/llvm/llvm-project/commit/a62579fc008e22b6c9e1544788644f5fceef15ce
  Author: Aleksandr Platonov <platonov.aleksandr at huawei.com>
  Date:   2021-06-30 (Wed, 30 Jun 2021)

  Changed paths:
    M clang-tools-extra/clangd/ParsedAST.cpp
    M clang-tools-extra/clangd/Preamble.cpp

  Log Message:
  -----------
  [clangd][nfc] Show more information in logs when compiler instance prepare fails

Without this patch clangd silently process compiler instance prepare failure and only LSP errors "Invalid AST" could be found in logs.
E.g. the reason of the problem https://github.com/clangd/clangd/issues/734 is impossible to understand without verbose logs or with disabled background index.
This patch adds more information into logs to help understand the reason of such failures.

Logs without this patch:
```
E[...] Could not build a preamble for file test.cpp version 1
```

Logs with this patch:
```
E[...] Could not build a preamble for file test.cpp version 1: CreateTargetInfo() return null
..
E[...] Failed to prepare a compiler instance: unknown target ABI 'lp64'
```

Reviewed By: sammccall

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




More information about the All-commits mailing list