clang API Documentation
#include <FrontendActions.h>
Public Member Functions | |
GenerateModuleAction (const FileEntry *ModuleMap=nullptr, bool IsSystem=false) | |
bool | BeginSourceFileAction (CompilerInstance &CI, StringRef Filename) override |
Callback at the start of processing a single input. | |
bool | ComputeASTConsumerArguments (CompilerInstance &CI, StringRef InFile, std::string &Sysroot, std::string &OutputFile, raw_ostream *&OS) |
Compute the AST consumer arguments that will be used to create the PCHGenerator instance returned by CreateASTConsumer. | |
Protected Member Functions | |
std::unique_ptr< ASTConsumer > | CreateASTConsumer (CompilerInstance &CI, StringRef InFile) override |
Create the AST consumer object for this action, if supported. | |
TranslationUnitKind | getTranslationUnitKind () override |
For AST-based actions, the kind of translation unit we're handling. | |
bool | hasASTFileSupport () const override |
Does this action support use with AST files? |
Definition at line 95 of file Frontend/FrontendActions.h.
clang::GenerateModuleAction::GenerateModuleAction | ( | const FileEntry * | ModuleMap = nullptr , |
bool | IsSystem = false |
||
) | [inline] |
Definition at line 111 of file Frontend/FrontendActions.h.
bool GenerateModuleAction::BeginSourceFileAction | ( | CompilerInstance & | CI, |
StringRef | Filename | ||
) | [override, virtual] |
Callback at the start of processing a single input.
Reimplemented from clang::FrontendAction.
Definition at line 246 of file Frontend/FrontendActions.cpp.
References addHeaderInclude(), collectModuleHeaderIncludes(), clang::LangOptions::CurrentModule, clang::Module::HeaderDirective::FileName, clang::Module::HeaderDirective::FileNameLoc, clang::FrontendAction::getCurrentFileKind(), clang::CompilerInstance::getDiagnostics(), clang::FileManager::getFile(), clang::CompilerInstance::getFileManager(), clang::Module::getFullModuleName(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInstance::getLangOpts(), clang::SourceManager::getModuleBuildStack(), clang::Module::getModuleInputBufferName(), clang::HeaderSearch::getModuleMap(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::getSourceManager(), clang::CompilerInstance::getTarget(), clang::Module::getUmbrellaHeader(), clang::Module::isAvailable(), clang::Module::IsExternC, clang::Module::IsInferred, clang::Module::IsSystem, clang::Module::HeaderDirective::IsUmbrella, clang::SourceLocation::isValid(), clang::HeaderSearch::loadModuleMapFile(), clang::HeaderSearch::lookupModule(), clang::SourceManager::pushModuleBuildStack(), clang::DiagnosticsEngine::Report(), clang::FrontendAction::setCurrentInput(), clang::ModuleMap::setInferredModuleAllowedBy(), and SourceMgr.
bool GenerateModuleAction::ComputeASTConsumerArguments | ( | CompilerInstance & | CI, |
StringRef | InFile, | ||
std::string & | Sysroot, | ||
std::string & | OutputFile, | ||
raw_ostream *& | OS | ||
) |
Compute the AST consumer arguments that will be used to create the PCHGenerator instance returned by CreateASTConsumer.
Definition at line 343 of file Frontend/FrontendActions.cpp.
References clang::CompilerInstance::createOutputFile(), clang::LangOptions::CurrentModule, clang::CompilerInstance::getFrontendOpts(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInstance::getLangOpts(), clang::HeaderSearch::getModuleFileName(), clang::FileEntry::getName(), clang::CompilerInstance::getPreprocessor(), and clang::FrontendOptions::OutputFile.
Referenced by CreateASTConsumer().
std::unique_ptr< ASTConsumer > GenerateModuleAction::CreateASTConsumer | ( | CompilerInstance & | CI, |
StringRef | InFile | ||
) | [override, protected, virtual] |
Create the AST consumer object for this action, if supported.
This routine is called as part of BeginSourceFile(), which will fail if the AST consumer cannot be created. This will not be called if the action has indicated that it only uses the preprocessor.
CI | - The current compiler instance, provided as a convenience, see getCompilerInstance(). |
InFile | - The current input file, provided as a convenience, see getCurrentFile(). |
Implements clang::FrontendAction.
Definition at line 117 of file Frontend/FrontendActions.cpp.
References ComputeASTConsumerArguments(), and clang::CompilerInstance::getPreprocessor().
TranslationUnitKind clang::GenerateModuleAction::getTranslationUnitKind | ( | ) | [inline, override, protected, virtual] |
For AST-based actions, the kind of translation unit we're handling.
Reimplemented from clang::FrontendAction.
Definition at line 104 of file Frontend/FrontendActions.h.
References clang::TU_Module.
bool clang::GenerateModuleAction::hasASTFileSupport | ( | ) | const [inline, override, protected, virtual] |
Does this action support use with AST files?
Reimplemented from clang::FrontendAction.
Definition at line 108 of file Frontend/FrontendActions.h.