//===--- Record.h - Record compiler events ------------------------- C++-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Where Analysis.h analyzes AST nodes and recorded preprocessor events, this // file defines ways to capture AST and preprocessor information from a parse. // // These are the simplest way to connect include-cleaner logic to the parser, // but other ways are possible (for example clangd records includes separately). // //===----------------------------------------------------------------------===// #ifndef CLANG_INCLUDE_CLEANER_RECORD_H #define CLANG_INCLUDE_CLEANER_RECORD_H #include "clang-include-cleaner/Types.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/FileSystem/UniqueID.h" #include <memory> #include <vector> namespace clang { class ASTConsumer; class ASTContext; class CompilerInstance; class Decl; class FileEntry; class Preprocessor; class PPCallbacks; class FileManager; namespace include_cleaner { /// Captures #include mapping information. It analyses IWYU Pragma comments and /// other use-instead-like mechanisms (#pragma include_instead) on included /// files. /// /// This is a low-level piece being used in the "Location => Header" analysis /// step to determine the final public header rather than the header directly /// defines the symbol. class PragmaIncludes { … }; /// Recorded main-file parser events relevant to include-cleaner. struct RecordedAST { … }; /// Recorded main-file preprocessor events relevant to include-cleaner. /// /// This doesn't include facts that we record globally for the whole TU, even /// when they occur in the main file (e.g. IWYU pragmas). struct RecordedPP { … }; } // namespace include_cleaner } // namespace clang #endif