class ExtractAPIAction
Declaration
class ExtractAPIAction : public ASTFrontendAction { /* full declaration omitted */ };
Description
ExtractAPIAction sets up the output file and creates the ExtractAPIVisitor.
Declared at: clang/include/clang/ExtractAPI/FrontendActions.h:23
Inherits from: ASTFrontendAction
Member Variables
- private std::unique_ptr<extractapi::APISet> API
- A representation of the APIs this action extracts.
- private std::unique_ptr<raw_pwrite_stream> OS
- A stream to the output file of this action.
- private std::string ProductName
- The product this action is extracting API information for.
- private std::unique_ptr<llvm::MemoryBuffer> Buffer
- The synthesized input buffer that contains all the provided input header files.
- private SmallVector<std::pair<SmallString<32>, bool>> KnownInputFiles
- This captures the spelling used to include the file and whether the include is quoted or not.
Method Overview
- protected std::unique_ptr<ASTConsumer> CreateASTConsumer(clang::CompilerInstance & CI, llvm::StringRef InFile)
- private static std::unique_ptr<llvm::raw_pwrite_stream> CreateOutputFile(clang::CompilerInstance & CI, llvm::StringRef InFile)
- private void EndSourceFileAction()
- private bool PrepareToExecuteAction(clang::CompilerInstance & CI)
- private static llvm::StringRef getInputBufferName()
Inherited from ASTFrontendAction:
Inherited from FrontendAction:
- protected BeginInvocation
- public BeginSourceFile
- protected BeginSourceFileAction
- protected CreateASTConsumer
- public EndSourceFile
- protected EndSourceFileAction
- public Execute
- protected ExecuteAction
- public PrepareToExecute
- protected PrepareToExecuteAction
- public getCompilerInstance
- public getCurrentASTUnit
- public getCurrentFile
- public getCurrentFileKind
- public getCurrentFileOrBufferName
- public getCurrentInput
- public getCurrentModule
- public getTranslationUnitKind
- public hasASTFileSupport
- public hasCodeCompletionSupport
- public hasIRSupport
- public hasPCHSupport
- public isCurrentFileAST
- public isModelParsingAction
- public setCompilerInstance
- public setCurrentInput
- protected shouldEraseOutputFiles
- public takeCurrentASTUnit
- public usesPreprocessorOnly
Methods
¶std::unique_ptr<ASTConsumer> CreateASTConsumer(
clang::CompilerInstance& CI,
llvm::StringRef InFile)
std::unique_ptr<ASTConsumer> CreateASTConsumer(
clang::CompilerInstance& CI,
llvm::StringRef InFile)
Description
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.
Declared at: clang/include/clang/ExtractAPI/FrontendActions.h:25
Parameters
- clang::CompilerInstance& CI
- - The current compiler instance, provided as a convenience, see getCompilerInstance().
- llvm::StringRef InFile
- - The current input file, provided as a convenience, see getCurrentFile().
Returns
The new AST consumer, or null on failure.
¶static std::unique_ptr<llvm::raw_pwrite_stream>
CreateOutputFile(clang::CompilerInstance& CI,
llvm::StringRef InFile)
static std::unique_ptr<llvm::raw_pwrite_stream>
CreateOutputFile(clang::CompilerInstance& CI,
llvm::StringRef InFile)
Declared at: clang/include/clang/ExtractAPI/FrontendActions.h:62
Parameters
- clang::CompilerInstance& CI
- llvm::StringRef InFile
¶void EndSourceFileAction()
void EndSourceFileAction()
Description
Called after executing the action on the synthesized input buffer. Note: Now that we have gathered all the API definitions to surface we can emit them in this callback.
Declared at: clang/include/clang/ExtractAPI/FrontendActions.h:59
¶bool PrepareToExecuteAction(
clang::CompilerInstance& CI)
bool PrepareToExecuteAction(
clang::CompilerInstance& CI)
Description
Prepare to execute the action on the given CompilerInstance. This is called before executing the action on any inputs. This generates a single header that includes all of CI's inputs and replaces CI's input list with it before actually executing the action.
Declared at: clang/include/clang/ExtractAPI/FrontendActions.h:53
Parameters
¶static llvm::StringRef getInputBufferName()
static llvm::StringRef getInputBufferName()
Declared at: clang/include/clang/ExtractAPI/FrontendActions.h:64