|
clang
5.0.0
|
A class holding a PCH and all information to check whether it is valid to reuse the PCH for the subsequent runs. More...
#include "clang/Frontend/PrecompiledPreamble.h"
Public Member Functions | |
| PrecompiledPreamble (PrecompiledPreamble &&)=default | |
| PrecompiledPreamble & | operator= (PrecompiledPreamble &&)=default |
| PreambleBounds | getBounds () const |
| PreambleBounds used to build the preamble. More... | |
| bool | CanReuse (const CompilerInvocation &Invocation, const llvm::MemoryBuffer *MainFileBuffer, PreambleBounds Bounds, vfs::FileSystem *VFS) const |
Check whether PrecompiledPreamble can be reused for the new contents(MainFileBuffer) of the main file. More... | |
| void | AddImplicitPreamble (CompilerInvocation &CI, llvm::MemoryBuffer *MainFileBuffer) const |
Changes options inside CI to use PCH from this preamble. More... | |
Static Public Member Functions | |
| static llvm::ErrorOr < PrecompiledPreamble > | Build (const CompilerInvocation &Invocation, const llvm::MemoryBuffer *MainFileBuffer, PreambleBounds Bounds, DiagnosticsEngine &Diagnostics, IntrusiveRefCntPtr< vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHContainerOps, PreambleCallbacks &Callbacks) |
Try to build PrecompiledPreamble for Invocation. More... | |
A class holding a PCH and all information to check whether it is valid to reuse the PCH for the subsequent runs.
Use BuildPreamble to create PCH and CanReusePreamble + AddImplicitPreamble to make use of it.
Definition at line 64 of file PrecompiledPreamble.h.
|
default |
Referenced by Build().
| void PrecompiledPreamble::AddImplicitPreamble | ( | CompilerInvocation & | CI, |
| llvm::MemoryBuffer * | MainFileBuffer | ||
| ) | const |
Changes options inside CI to use PCH from this preamble.
Also remaps main file to MainFileBuffer.
Definition at line 427 of file PrecompiledPreamble.cpp.
References clang::CompilerInvocation::getFrontendOpts(), clang::CompilerInvocationBase::getPreprocessorOpts(), clang::FrontendOptions::Inputs, and clang::PreprocessorOptions::PrecompiledPreambleBytes.
|
static |
Try to build PrecompiledPreamble for Invocation.
See BuildPreambleError for possible error codes.
| Invocation | Original CompilerInvocation with options to compile the file. |
| MainFileBuffer | Buffer with the contents of the main file. |
| Bounds | Bounds of the preamble, result of calling ComputePreambleBounds. |
| Diagnostics | Diagnostics engine to be used while building the preamble. |
| VFS | An instance of vfs::FileSystem to be used for file accesses. |
| PCHContainerOps | An instance of PCHContainerOperations. |
| Callbacks | A set of callbacks to be executed when building the preamble. |
Definition at line 201 of file PrecompiledPreamble.cpp.
References clang::PreprocessorOptions::addRemappedFile(), clang::PreambleCallbacks::AfterExecute(), clang::BeginSourceFileFailed, Buffer, clang::CouldntCreateTargetInfo, clang::CouldntCreateTempFile, clang::CouldntCreateVFSOverlay, clang::CouldntEmitPCH, clang::TargetInfo::CreateTargetInfo(), clang::createVFSFromCompilerInvocation(), Filename, clang::frontend::GeneratePCH, clang::SourceManager::getFileEntryForID(), clang::SourceManager::getMainFileID(), clang::SourceManager::getMemoryBufferForFile(), clang::FileEntry::getModificationTime(), clang::FileEntry::getName(), clang::FileEntry::getSize(), clang::InputKind::LLVM_IR, clang::PreambleBounds::PreambleEndsAtStartOfLine, clang::PreambleIsEmpty, PrecompiledPreamble(), clang::PreprocessorOptions::PrecompiledPreambleBytes, clang::ProcessWarningOptions(), clang::DiagnosticsEngine::Reset(), clang::PreprocessorOptions::RetainRemappedFileBuffers, clang::PreambleBounds::Size, clang::InputKind::Source, and clang::format::SourceMgr().
| bool PrecompiledPreamble::CanReuse | ( | const CompilerInvocation & | Invocation, |
| const llvm::MemoryBuffer * | MainFileBuffer, | ||
| PreambleBounds | Bounds, | ||
| vfs::FileSystem * | VFS | ||
| ) | const |
Check whether PrecompiledPreamble can be reused for the new contents(MainFileBuffer) of the main file.
Definition at line 347 of file PrecompiledPreamble.cpp.
References clang::vfs::Status::getLastModificationTime(), clang::vfs::Status::getSize(), clang::vfs::Status::getUniqueID(), clang::PreambleBounds::PreambleEndsAtStartOfLine, clang::PreambleBounds::Size, clang::vfs::FileSystem::status(), and Status.
| PreambleBounds PrecompiledPreamble::getBounds | ( | ) | const |
PreambleBounds used to build the preamble.
Definition at line 343 of file PrecompiledPreamble.cpp.
|
default |
1.8.6