[all-commits] [llvm/llvm-project] bff0c5: [clangd] Copy existing includes in ReplayPreamble

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Tue Jun 2 04:38:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bff0c56ff92106afad22b54a90e1c612da4d6f99
      https://github.com/llvm/llvm-project/commit/bff0c56ff92106afad22b54a90e1c612da4d6f99
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-06-02 (Tue, 02 Jun 2020)

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

  Log Message:
  -----------
  [clangd] Copy existing includes in ReplayPreamble

ReplayPreamble was just grabbing the reference of IncludeStructure
passed to it and then replayed any includes seen so while exiting
built-in file.

This implies any include seen in built-in files being replayed as part
of preamble, even though they are not. This wasn't an issue until we've
started patching preambles, as includes from built-in files were not
mapped back to main-file.

This patch copies over existing includes at the time of
ReplayPreamble::attach and only replies those to prevent any includes
from the preamble patch getting mixed-in.




More information about the All-commits mailing list