clang 19.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::IncrementalParser Class Reference

Provides support for incremental compilation. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Interpreter/IncrementalParser.h"

Inheritance diagram for clang::IncrementalParser:
Inheritance graph
[legend]

Public Member Functions

 IncrementalParser (Interpreter &Interp, std::unique_ptr< CompilerInstance > Instance, llvm::LLVMContext &LLVMCtx, llvm::Error &Err)
 
virtual ~IncrementalParser ()
 
CompilerInstancegetCI ()
 
CodeGeneratorgetCodeGen () const
 
virtual llvm::Expected< PartialTranslationUnit & > Parse (llvm::StringRef Input)
 Parses incremental input by creating an in-memory file.
 
llvm::StringRef GetMangledName (GlobalDecl GD) const
 Uses the CodeGenModule mangled name cache and avoids recomputing.
 
void CleanUpPTU (PartialTranslationUnit &PTU)
 
std::list< PartialTranslationUnit > & getPTUs ()
 
std::unique_ptr< llvm::Module > GenModule ()
 

Protected Member Functions

 IncrementalParser ()
 

Protected Attributes

std::unique_ptr< IncrementalActionAct
 Long-lived, incremental parsing action.
 
std::unique_ptr< CompilerInstanceCI
 Compiler instance performing the incremental compilation.
 
std::unique_ptr< ParserP
 Parser.
 
ASTConsumerConsumer = nullptr
 Consumer to process the produced top level decls. Owned by Act.
 
unsigned InputCount = 0
 Counts the number of direct user input lines that have been parsed.
 
std::list< PartialTranslationUnitPTUs
 List containing every information about every incrementally parsed piece of code.
 

Detailed Description

Provides support for incremental compilation.

Keeps track of the state changes between the subsequent incremental input.

Definition at line 39 of file IncrementalParser.h.

Constructor & Destructor Documentation

◆ IncrementalParser() [1/2]

clang::IncrementalParser::IncrementalParser ( )
protected

Definition at line 200 of file IncrementalParser.cpp.

◆ IncrementalParser() [2/2]

clang::IncrementalParser::IncrementalParser ( Interpreter Interp,
std::unique_ptr< CompilerInstance Instance,
llvm::LLVMContext &  LLVMCtx,
llvm::Error &  Err 
)

Definition at line 202 of file IncrementalParser.cpp.

References Act, CI, Consumer, getCodeGen(), P, and PTUs.

◆ ~IncrementalParser()

clang::IncrementalParser::~IncrementalParser ( )
virtual

Definition at line 236 of file IncrementalParser.cpp.

References Act, and P.

Member Function Documentation

◆ CleanUpPTU()

void clang::IncrementalParser::CleanUpPTU ( PartialTranslationUnit PTU)

◆ GenModule()

std::unique_ptr< llvm::Module > clang::IncrementalParser::GenModule ( )

Definition at line 364 of file IncrementalParser.cpp.

References getCodeGen(), and ID.

Referenced by Parse().

◆ getCI()

CompilerInstance * clang::IncrementalParser::getCI ( )
inline

◆ getCodeGen()

CodeGenerator * clang::IncrementalParser::getCodeGen ( ) const

Definition at line 193 of file IncrementalParser.cpp.

References Act, and clang::FrontendAction::hasIRSupport().

Referenced by GenModule(), GetMangledName(), and IncrementalParser().

◆ GetMangledName()

llvm::StringRef clang::IncrementalParser::GetMangledName ( GlobalDecl  GD) const

Uses the CodeGenModule mangled name cache and avoids recomputing.

Returns
the mangled name of a GD.

Definition at line 398 of file IncrementalParser.cpp.

References getCodeGen(), and clang::CodeGenerator::GetMangledName().

◆ getPTUs()

std::list< PartialTranslationUnit > & clang::IncrementalParser::getPTUs ( )
inline

Definition at line 82 of file IncrementalParser.h.

References PTUs.

◆ Parse()

llvm::Expected< PartialTranslationUnit & > clang::IncrementalParser::Parse ( llvm::StringRef  Input)
virtual

Member Data Documentation

◆ Act

std::unique_ptr<IncrementalAction> clang::IncrementalParser::Act
protected

Long-lived, incremental parsing action.

Definition at line 42 of file IncrementalParser.h.

Referenced by getCodeGen(), IncrementalParser(), and ~IncrementalParser().

◆ CI

std::unique_ptr<CompilerInstance> clang::IncrementalParser::CI
protected

Compiler instance performing the incremental compilation.

Definition at line 45 of file IncrementalParser.h.

Referenced by getCI(), clang::IncrementalCUDADeviceParser::IncrementalCUDADeviceParser(), IncrementalParser(), and Parse().

◆ Consumer

ASTConsumer* clang::IncrementalParser::Consumer = nullptr
protected

Consumer to process the produced top level decls. Owned by Act.

Definition at line 51 of file IncrementalParser.h.

Referenced by IncrementalParser().

◆ InputCount

unsigned clang::IncrementalParser::InputCount = 0
protected

Counts the number of direct user input lines that have been parsed.

Definition at line 54 of file IncrementalParser.h.

Referenced by Parse().

◆ P

std::unique_ptr<Parser> clang::IncrementalParser::P
protected

Parser.

Definition at line 48 of file IncrementalParser.h.

Referenced by IncrementalParser(), and ~IncrementalParser().

◆ PTUs

std::list<PartialTranslationUnit> clang::IncrementalParser::PTUs
protected

List containing every information about every incrementally parsed piece of code.

Definition at line 58 of file IncrementalParser.h.

Referenced by clang::IncrementalCUDADeviceParser::GeneratePTX(), getPTUs(), IncrementalParser(), and clang::IncrementalCUDADeviceParser::Parse().


The documentation for this class was generated from the following files: