[all-commits] [llvm/llvm-project] 2cdbc9: [clangd] Use TargetOpts from preamble when buildin...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Thu Apr 18 07:58:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2cdbc9cff3b7ef262c45e749f0a942343a19808a
      https://github.com/llvm/llvm-project/commit/2cdbc9cff3b7ef262c45e749f0a942343a19808a
  Author: kadir çetinkaya <kadircet at google.com>
  Date:   2024-04-18 (Thu, 18 Apr 2024)

  Changed paths:
    M clang-tools-extra/clangd/Preamble.cpp
    M clang-tools-extra/clangd/Preamble.h
    M clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
    M clang-tools-extra/clangd/unittests/ParsedASTTests.cpp

  Log Message:
  -----------
  [clangd] Use TargetOpts from preamble when building ASTs (#88381)

Building ASTs with compile flags that are incompatible to the ones used
for the Preamble are not really supported by clang and can trigger
crashes.

In an ideal world, we should be re-using not only TargetOpts, but the
full ParseInputs from the Preamble to prevent such failures.

Unfortunately current contracts of ThreadSafeFS makes this a non-safe
change for certain implementations. As there are no guarantees that the
same ThreadSafeFS is going to be valid in the Context::current() we're
building the AST in.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list