diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp --- a/clang-tools-extra/clangd/IncludeCleaner.cpp +++ b/clang-tools-extra/clangd/IncludeCleaner.cpp @@ -133,7 +133,7 @@ void add(SourceLocation Loc) { add(SM.getFileID(Loc), Loc); } void add(FileID FID, SourceLocation Loc) { - if (FID.isInvalid()) + if (FID.isInvalid() || SM.isWrittenInBuiltinFile(Loc)) return; assert(SM.isInFileID(Loc, FID)); if (Loc.isFileID()) {