#include "clang/Frontend/FrontendAction.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclGroup.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileEntry.h"
#include "clang/Basic/LangStandard.h"
#include "clang/Basic/Sarif.h"
#include "clang/Basic/Stack.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/Frontend/LayoutOverrideSource.h"
#include "clang/Frontend/MultiplexConsumer.h"
#include "clang/Frontend/SARIFDiagnosticPrinter.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Parse/ParseAST.h"
#include "clang/Sema/HLSLExternalSemaSource.h"
#include "clang/Sema/MultiplexExternalSemaSource.h"
#include "clang/Serialization/ASTDeserializationListener.h"
#include "clang/Serialization/ASTReader.h"
#include "clang/Serialization/GlobalModuleIndex.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/BuryPointer.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
#include <system_error>
usingnamespaceclang;
LLVM_INSTANTIATE_REGISTRY(…)
namespace {
class DelegatingDeserializationListener : public ASTDeserializationListener { … };
class DeserializedDeclsDumper : public DelegatingDeserializationListener { … };
class DeserializedDeclsChecker : public DelegatingDeserializationListener { … };
}
FrontendAction::FrontendAction() : … { … }
FrontendAction::~FrontendAction() { … }
void FrontendAction::setCurrentInput(const FrontendInputFile &CurrentInput,
std::unique_ptr<ASTUnit> AST) { … }
Module *FrontendAction::getCurrentModule() const { … }
std::unique_ptr<ASTConsumer>
FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
StringRef InFile) { … }
static SourceLocation ReadOriginalFileName(CompilerInstance &CI,
std::string &InputFile,
bool IsModuleMap = false) { … }
static SmallVectorImpl<char> &
operator+=(SmallVectorImpl<char> &Includes, StringRef RHS) { … }
static void addHeaderInclude(StringRef HeaderName,
SmallVectorImpl<char> &Includes,
const LangOptions &LangOpts,
bool IsExternC) { … }
static std::error_code collectModuleHeaderIncludes(
const LangOptions &LangOpts, FileManager &FileMgr, DiagnosticsEngine &Diag,
ModuleMap &ModMap, clang::Module *Module, SmallVectorImpl<char> &Includes) { … }
static bool loadModuleMapForModuleBuild(CompilerInstance &CI, bool IsSystem,
bool IsPreprocessed,
std::string &PresumedModuleMapFile,
unsigned &Offset) { … }
static Module *prepareToBuildModule(CompilerInstance &CI,
StringRef ModuleMapFilename) { … }
static std::unique_ptr<llvm::MemoryBuffer>
getInputBufferForModule(CompilerInstance &CI, Module *M) { … }
bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
const FrontendInputFile &RealInput) { … }
llvm::Error FrontendAction::Execute() { … }
void FrontendAction::EndSourceFile() { … }
bool FrontendAction::shouldEraseOutputFiles() { … }
void ASTFrontendAction::ExecuteAction() { … }
void PluginASTAction::anchor() { … }
std::unique_ptr<ASTConsumer>
PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) { … }
bool WrapperFrontendAction::PrepareToExecuteAction(CompilerInstance &CI) { … }
std::unique_ptr<ASTConsumer>
WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) { … }
bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) { … }
bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI) { … }
void WrapperFrontendAction::ExecuteAction() { … }
void WrapperFrontendAction::EndSourceFile() { … }
void WrapperFrontendAction::EndSourceFileAction() { … }
bool WrapperFrontendAction::shouldEraseOutputFiles() { … }
bool WrapperFrontendAction::usesPreprocessorOnly() const { … }
TranslationUnitKind WrapperFrontendAction::getTranslationUnitKind() { … }
bool WrapperFrontendAction::hasPCHSupport() const { … }
bool WrapperFrontendAction::hasASTFileSupport() const { … }
bool WrapperFrontendAction::hasIRSupport() const { … }
bool WrapperFrontendAction::hasCodeCompletionSupport() const { … }
WrapperFrontendAction::WrapperFrontendAction(
std::unique_ptr<FrontendAction> WrappedAction)
: … { … }