[all-commits] [llvm/llvm-project] 509efe: [clangd] Add isHeaderFile helper.

Haojian Wu via All-commits all-commits at lists.llvm.org
Fri Nov 15 07:18:39 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 509efe5d8edee5637b26fcb645978325de0a7283
      https://github.com/llvm/llvm-project/commit/509efe5d8edee5637b26fcb645978325de0a7283
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2019-11-15 (Fri, 15 Nov 2019)

  Changed paths:
    M clang-tools-extra/clangd/SourceCode.cpp
    M clang-tools-extra/clangd/SourceCode.h
    M clang-tools-extra/clangd/index/Background.cpp
    M clang-tools-extra/clangd/unittests/SourceCodeTests.cpp

  Log Message:
  -----------
  [clangd] Add isHeaderFile helper.

Summary:
we have a few places using `ASTCtx.getLangOpts().IsHeaderFile` to
determine a header file, but it relies on "-x c-header" compiler flag,
if the compilation command doesn't have this flag, we will get a false
positive. We are encountering this issue in bazel build system.

To solve this problem, we infer the file from file name, actual changes will
come in follow-ups.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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




More information about the All-commits mailing list