clang 20.0.0git
|
Provides support for incremental compilation. More...
Public Member Functions | |
IncrementalParser (Interpreter &Interp, std::unique_ptr< CompilerInstance > Instance, llvm::LLVMContext &LLVMCtx, llvm::Error &Err) | |
virtual | ~IncrementalParser () |
CompilerInstance * | getCI () |
CodeGenerator * | getCodeGen () 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< IncrementalAction > | Act |
Long-lived, incremental parsing action. | |
std::unique_ptr< CompilerInstance > | CI |
Compiler instance performing the incremental compilation. | |
std::unique_ptr< Parser > | P |
Parser. | |
ASTConsumer * | Consumer = 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< PartialTranslationUnit > | PTUs |
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. | |
Provides support for incremental compilation.
Keeps track of the state changes between the subsequent incremental input.
Definition at line 40 of file IncrementalParser.h.
|
protected |
Definition at line 200 of file IncrementalParser.cpp.
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.
|
virtual |
Definition at line 237 of file IncrementalParser.cpp.
void clang::IncrementalParser::CleanUpPTU | ( | PartialTranslationUnit & | PTU | ) |
Definition at line 388 of file IncrementalParser.cpp.
References D, clang::DeclContext::decls(), getCI(), clang::DeclContext::getLookupPtr(), clang::DeclContext::getPrimaryContext(), clang::CompilerInstance::getSema(), clang::Sema::IdResolver, clang::IdentifierResolver::RemoveDecl(), and clang::PartialTranslationUnit::TUPart.
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().
|
inline |
Definition at line 73 of file IncrementalParser.h.
References CI.
Referenced by CleanUpPTU(), clang::IncrementalCUDADeviceParser::GeneratePTX(), and clang::IncrementalCUDADeviceParser::Parse().
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().
llvm::StringRef clang::IncrementalParser::GetMangledName | ( | GlobalDecl | GD | ) | const |
Uses the CodeGenModule mangled name cache and avoids recomputing.
GD
. Definition at line 422 of file IncrementalParser.cpp.
References getCodeGen(), and clang::CodeGenerator::GetMangledName().
|
inline |
Definition at line 87 of file IncrementalParser.h.
References PTUs.
|
virtual |
Parses incremental input by creating an in-memory file.
PartialTranslationUnit
which holds information about the TranslationUnitDecl
and llvm::Module
corresponding to the input. Reimplemented in clang::IncrementalCUDADeviceParser.
Definition at line 306 of file IncrementalParser.cpp.
References clang::SrcMgr::C_User, CI, clang::Preprocessor::EnterSourceFile(), GenModule(), clang::Preprocessor::getLangOpts(), InputCount, clang::Token::is(), clang::Preprocessor::isIncrementalProcessingEnabled(), clang::Token::isNot(), clang::Preprocessor::Lex(), memcpy(), and SM.
Referenced by clang::IncrementalCUDADeviceParser::Parse().
|
protected |
Long-lived, incremental parsing action.
Definition at line 43 of file IncrementalParser.h.
Referenced by getCodeGen(), IncrementalParser(), and ~IncrementalParser().
|
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().
|
protected |
Compiler instance performing the incremental compilation.
Definition at line 46 of file IncrementalParser.h.
Referenced by getCI(), clang::IncrementalCUDADeviceParser::IncrementalCUDADeviceParser(), IncrementalParser(), and Parse().
|
protected |
Consumer to process the produced top level decls. Owned by Act.
Definition at line 52 of file IncrementalParser.h.
Referenced by IncrementalParser().
|
protected |
Counts the number of direct user input lines that have been parsed.
Definition at line 55 of file IncrementalParser.h.
Referenced by Parse().
|
protected |
Definition at line 49 of file IncrementalParser.h.
Referenced by IncrementalParser(), and ~IncrementalParser().
|
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().