clang 20.0.0git
|
#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>
Go to the source code of this file.
Functions | |
static SourceLocation | ReadOriginalFileName (CompilerInstance &CI, std::string &InputFile, bool IsModuleMap=false) |
For preprocessed files, if the first line is the linemarker and specifies the original source file name, use that name as the input file name. | |
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) |
Collect the set of header includes needed to construct the given module and update the TopHeaders file set of the module. | |
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) |
Compute the input buffer that should be used to build the specified module. | |
|
static |
Definition at line 312 of file FrontendAction.cpp.
Referenced by collectModuleHeaderIncludes(), and getInputBufferForModule().
|
static |
Collect the set of header includes needed to construct the given module and update the TopHeaders file set of the module.
Module | The module we're collecting includes from. |
Includes | Will be augmented with the set of #includes or #imports needed to load all of the named headers. |
Definition at line 337 of file FrontendAction.cpp.
References addHeaderInclude(), clang::Module::addTopHeader(), collectModuleHeaderIncludes(), Diag(), clang::Module::getHeaders(), clang::FileManager::getOptionalFileRef(), clang::Module::getUmbrellaDirAsWritten(), clang::Module::getUmbrellaHeaderAsWritten(), clang::FileManager::getVirtualFileSystem(), clang::Module::HK_Normal, clang::Module::HK_Private, clang::Module::isAvailable(), clang::Module::IsExternC, clang::ModuleMap::isHeaderUnavailableInModule(), clang::Module::MissingHeaders, clang::Module::Parent, clang::ModuleMap::resolveHeaderDirectives(), and clang::Module::submodules().
Referenced by collectModuleHeaderIncludes(), and getInputBufferForModule().
|
static |
Compute the input buffer that should be used to build the specified module.
Definition at line 560 of file FrontendAction.cpp.
References addHeaderInclude(), collectModuleHeaderIncludes(), clang::CompilerInstance::getDiagnostics(), clang::CompilerInstance::getFileManager(), clang::Module::getFullModuleName(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInstance::getLangOpts(), clang::Module::getModuleInputBufferName(), clang::HeaderSearch::getModuleMap(), clang::CompilerInstance::getPreprocessor(), clang::Module::getUmbrellaHeaderAsWritten(), clang::Module::IsExternC, and clang::DiagnosticsEngine::Report().
Referenced by clang::FrontendAction::BeginSourceFile().
|
static |
Definition at line 446 of file FrontendAction.cpp.
References clang::ModuleMap::canInferFrameworkModule(), clang::SourceManager::getDecomposedLoc(), clang::CompilerInstance::getFileManager(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInstance::getLangOpts(), clang::HeaderSearch::getModuleMap(), clang::FileManager::getOptionalDirectoryRef(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::getSourceManager(), clang::SourceLocation::isValid(), clang::HeaderSearch::loadModuleMapFile(), clang::LangOptions::ModuleName, and ReadOriginalFileName().
Referenced by clang::FrontendAction::BeginSourceFile().
|
static |
Definition at line 307 of file FrontendAction.cpp.
|
static |
Definition at line 489 of file FrontendAction.cpp.
References clang::SrcMgr::C_System_ModuleMap, clang::SrcMgr::C_User_ModuleMap, clang::Preprocessor::checkModuleIsAvailable(), clang::LangOptions::CurrentModule, clang::Module::Directory, clang::CompilerInstance::getDiagnostics(), clang::SourceManager::getFileEntryRefForID(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getFrontendOpts(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInstance::getLangOpts(), clang::SourceManager::getMainFileID(), clang::SourceManager::getModuleBuildStack(), clang::HeaderSearch::getModuleMap(), clang::FileManager::getOptionalFileRef(), clang::SourceManager::getOrCreateFileID(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::getSourceManager(), clang::CompilerInstance::getTarget(), clang::Module::IsSystem, clang::HeaderSearch::lookupModule(), clang::FrontendOptions::OriginalModuleMap, clang::SourceManager::pushModuleBuildStack(), clang::DiagnosticsEngine::Report(), clang::ModuleMap::setInferredModuleAllowedBy(), and clang::Preprocessor::setMainFileDir().
Referenced by clang::FrontendAction::BeginSourceFile().
|
static |
For preprocessed files, if the first line is the linemarker and specifies the original source file name, use that name as the input file name.
Returns the location of the first token after the line marker directive.
CI | The compiler instance. |
InputFile | Populated with the filename from the line marker. |
IsModuleMap | If true , add a line note corresponding to this line directive. (We need to do this because the directive will not be visited by the preprocessor.) |
Definition at line 252 of file FrontendAction.cpp.
References clang::SourceManager::AddLineNote(), clang::SrcMgr::C_User_ModuleMap, clang::CompilerInstance::getLangOpts(), clang::SourceManager::getMainFileID(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::getSourceManager(), clang::Lexer::getSpelling(), and clang::T.
Referenced by clang::FrontendAction::BeginSourceFile(), and loadModuleMapForModuleBuild().