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.
 
std::unique_ptr< llvm::Module > CachedInCodeGenModule
 When CodeGen is created the first llvm::Module gets cached in many places and we must keep it alive.
 

Detailed Description

Provides support for incremental compilation.

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

Definition at line 40 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, CachedInCodeGenModule, CI, Consumer, E, GenModule(), getCodeGen(), and P.

◆ ~IncrementalParser()

clang::IncrementalParser::~IncrementalParser ( )
virtual

Definition at line 237 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 365 of file IncrementalParser.cpp.

References CachedInCodeGenModule, getCodeGen(), and ID.

Referenced by IncrementalParser(), and 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 422 of file IncrementalParser.cpp.

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

◆ getPTUs()

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

Definition at line 87 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 43 of file IncrementalParser.h.

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

◆ CachedInCodeGenModule

std::unique_ptr<llvm::Module> clang::IncrementalParser::CachedInCodeGenModule
protected

When CodeGen is created the first llvm::Module gets cached in many places and we must keep it alive.

Definition at line 63 of file IncrementalParser.h.

Referenced by GenModule(), and IncrementalParser().

◆ CI

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

Compiler instance performing the incremental compilation.

Definition at line 46 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 52 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 55 of file IncrementalParser.h.

Referenced by Parse().

◆ P

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

Parser.

Definition at line 49 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 59 of file IncrementalParser.h.

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


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