//===-- CompilerInstance.h - Clang Compiler Instance ------------*- 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 // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_ #define LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_ #include "clang/AST/ASTConsumer.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" #include "clang/Frontend/CompilerInvocation.h" #include "clang/Frontend/PCHContainerOperations.h" #include "clang/Frontend/Utils.h" #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/ModuleLoader.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/BuryPointer.h" #include "llvm/Support/FileSystem.h" #include <cassert> #include <list> #include <memory> #include <optional> #include <string> #include <utility> namespace llvm { class raw_fd_ostream; class Timer; class TimerGroup; } namespace clang { class ASTContext; class ASTReader; namespace serialization { class ModuleFile; } class CodeCompleteConsumer; class DiagnosticsEngine; class DiagnosticConsumer; class FileManager; class FrontendAction; class InMemoryModuleCache; class Module; class Preprocessor; class Sema; class SourceManager; class TargetInfo; enum class DisableValidationForModuleKind; /// CompilerInstance - Helper class for managing a single instance of the Clang /// compiler. /// /// The CompilerInstance serves two purposes: /// (1) It manages the various objects which are necessary to run the compiler, /// for example the preprocessor, the target information, and the AST /// context. /// (2) It provides utility routines for constructing and manipulating the /// common Clang objects. /// /// The compiler instance generally owns the instance of all the objects that it /// manages. However, clients can still share objects by manually setting the /// object and retaking ownership prior to destroying the CompilerInstance. /// /// The compiler instance is intended to simplify clients, but not to lock them /// in to the compiler instance for everything. When possible, utility functions /// come in two forms; a short form that reuses the CompilerInstance objects, /// and a long form that takes explicit instances of any required objects. class CompilerInstance : public ModuleLoader { … }; } // end namespace clang #endif