13#ifndef LLVM_CLANG_FRONTEND_ASTUNIT_H
14#define LLVM_CLANG_FRONTEND_ASTUNIT_H
33#include "llvm/ADT/ArrayRef.h"
34#include "llvm/ADT/DenseMap.h"
35#include "llvm/ADT/IntrusiveRefCntPtr.h"
36#include "llvm/ADT/STLExtras.h"
37#include "llvm/ADT/SmallVector.h"
38#include "llvm/ADT/StringMap.h"
39#include "llvm/ADT/StringRef.h"
40#include "llvm/ADT/iterator_range.h"
41#include "llvm/Bitstream/BitstreamWriter.h"
42#include "llvm/Support/VirtualFileSystemFwd.h"
90 std::unique_ptr<LangOptions> LangOpts;
91 std::unique_ptr<CodeGenOptions> CodeGenOpts;
96 std::shared_ptr<DiagnosticOptions> DiagOpts;
100 std::shared_ptr<ModuleCache> ModCache;
101 std::unique_ptr<HeaderSearch> HeaderInfo;
103 std::shared_ptr<Preprocessor> PP;
105 std::shared_ptr<TargetOptions> TargetOpts;
106 std::unique_ptr<HeaderSearchOptions> HSOpts;
107 std::shared_ptr<PreprocessorOptions> PPOpts;
109 bool HadModuleLoaderFatalFailure =
false;
110 bool StorePreamblesInMemory =
false;
113 struct ASTWriterData {
115 llvm::BitstreamWriter Stream;
119 : Stream(Buffer), Writer(Stream, Buffer, ModCache, CGOpts, {}) {}
121 std::unique_ptr<ASTWriterData> WriterData;
124 std::string PreambleStoragePath;
128 std::unique_ptr<ASTConsumer> Consumer;
132 std::unique_ptr<Sema> TheSema;
136 std::shared_ptr<CompilerInvocation> Invocation;
139 std::shared_ptr<CompilerInvocation> CCInvocation;
143 std::shared_ptr<CompilerInvocation> ModifiedInvocation;
151 bool OnlyLocalDecls =
false;
166 bool OwnsRemappedFileBuffers =
true;
175 std::vector<Decl*> TopLevelDecls;
179 using FileDeclsTy = llvm::DenseMap<FileID, std::unique_ptr<LocDeclsTy>>;
183 FileDeclsTy FileDecls;
186 std::string OriginalSourceFile;
204 unsigned NumStoredDiagnosticsFromDriver = 0;
215 unsigned PreambleRebuildCountdown = 0;
218 unsigned PreambleCounter = 0;
226 llvm::StringMap<SourceLocation> PreambleSrcLocCache;
229 std::optional<PrecompiledPreamble> Preamble;
234 std::unique_ptr<llvm::MemoryBuffer> SavedMainFileBuffer;
242 unsigned NumWarningsInPreamble = 0;
246 std::vector<LocalDeclID> TopLevelDeclsInPreamble;
249 bool ShouldCacheCodeCompletionResults : 1;
253 bool IncludeBriefCommentsInCodeCompletion : 1;
257 bool UserFilesAreVolatile : 1;
262 void clearFileLevelDecls();
306 return CachedCompletionTypes;
310 std::shared_ptr<GlobalCodeCompletionAllocator>
312 return CachedCompletionAllocator;
317 CCTUInfo = std::make_unique<CodeCompletionTUInfo>(
318 std::make_shared<GlobalCodeCompletionAllocator>());
324 std::shared_ptr<GlobalCodeCompletionAllocator> CachedCompletionAllocator;
326 std::unique_ptr<CodeCompletionTUInfo> CCTUInfo;
329 std::vector<CachedCodeCompletionResult> CachedCompletionResults;
333 llvm::StringMap<unsigned> CachedCompletionTypes;
340 unsigned CompletionCacheTopLevelHashValue = 0;
347 unsigned PreambleTopLevelHashValue = 0;
351 unsigned CurrentTopLevelHashValue = 0;
355 LLVM_PREFERRED_TYPE(
bool)
356 unsigned UnsafeToFree : 1;
363 void CacheCodeCompletionResults();
366 void ClearCachedCompletionResults();
368 explicit ASTUnit(
bool MainFileIsAST);
370 bool Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
371 std::unique_ptr<llvm::MemoryBuffer> OverrideMainBuffer,
374 std::unique_ptr<llvm::MemoryBuffer> getMainBufferWithPrecompiledPreamble(
375 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
378 unsigned MaxLines = 0);
379 void RealizeTopLevelDeclsFromPreamble();
392 class ConcurrencyState {
398 ConcurrencyState(
const ConcurrencyState &) =
delete;
399 ConcurrencyState &operator=(
const ConcurrencyState &) =
delete;
404 ConcurrencyState ConcurrencyCheckValue;
414 Self.ConcurrencyCheckValue.start();
418 Self.ConcurrencyCheckValue.finish();
452 Ctx = std::move(ctx);
465 bool hasSema()
const {
return (
bool)TheSema; }
468 assert(TheSema &&
"ASTUnit does not have a Sema object!");
473 assert(LangOpts &&
"ASTUnit does not have language options");
478 assert(CodeGenOpts &&
"ASTUnit does not have codegen options");
483 assert(HSOpts &&
"ASTUnit does not have header search options");
488 assert(PPOpts &&
"ASTUnit does not have preprocessor options");
494 return FileMgr->getVirtualFileSystemPtr();
506 return OriginalSourceFile;
525 assert(!
isMainFileAST() &&
"Invalid call for AST based ASTUnit!");
526 if (!TopLevelDeclsInPreamble.empty())
527 RealizeTopLevelDeclsFromPreamble();
528 return TopLevelDecls.begin();
532 assert(!
isMainFileAST() &&
"Invalid call for AST based ASTUnit!");
533 if (!TopLevelDeclsInPreamble.empty())
534 RealizeTopLevelDeclsFromPreamble();
535 return TopLevelDecls.end();
539 assert(!
isMainFileAST() &&
"Invalid call for AST based ASTUnit!");
540 return TopLevelDeclsInPreamble.size() + TopLevelDecls.size();
544 assert(!
isMainFileAST() &&
"Invalid call for AST based ASTUnit!");
545 return TopLevelDeclsInPreamble.empty() && TopLevelDecls.empty();
550 TopLevelDecls.push_back(D);
573 unsigned Line,
unsigned Col)
const;
612 return StoredDiagnostics.begin();
616 return StoredDiagnostics.begin();
620 return StoredDiagnostics.end();
624 return StoredDiagnostics.end();
641 if (NumStoredDiagnosticsFromDriver > StoredDiagnostics.size())
642 NumStoredDiagnosticsFromDriver = 0;
643 return StoredDiagnostics.begin() + NumStoredDiagnosticsFromDriver;
647 std::vector<CachedCodeCompletionResult>::iterator;
650 return CachedCompletionResults.begin();
654 return CachedCompletionResults.end();
658 return CachedCompletionResults.size();
664 llvm::iterator_range<PreprocessingRecord::iterator>
684 std::unique_ptr<llvm::MemoryBuffer>
698 static std::unique_ptr<ASTUnit>
699 create(std::shared_ptr<CompilerInvocation> CI,
700 std::shared_ptr<DiagnosticOptions> DiagOpts,
728 std::shared_ptr<DiagnosticOptions> DiagOpts,
732 bool OnlyLocalDecls =
false,
734 bool AllowASTWithCompilerErrors =
false,
735 bool UserFilesAreVolatile =
false);
752 bool LoadFromCompilerInvocation(
753 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
754 unsigned PrecompilePreambleAfterNParses,
787 std::shared_ptr<CompilerInvocation> CI,
788 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
789 std::shared_ptr<DiagnosticOptions> DiagOpts,
792 bool Persistent =
true, StringRef ResourceFilesPath = StringRef(),
793 bool OnlyLocalDecls =
false,
795 unsigned PrecompilePreambleAfterNParses = 0,
796 bool CacheCodeCompletionResults =
false,
797 bool UserFilesAreVolatile =
false,
798 std::unique_ptr<ASTUnit> *ErrAST =
nullptr);
814 static std::unique_ptr<ASTUnit> LoadFromCompilerInvocation(
815 std::shared_ptr<CompilerInvocation> CI,
816 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
817 std::shared_ptr<DiagnosticOptions> DiagOpts,
821 unsigned PrecompilePreambleAfterNParses = 0,
823 bool CacheCodeCompletionResults =
false,
824 bool IncludeBriefCommentsInCodeCompletion =
false,
825 bool UserFilesAreVolatile =
false);
828 const char **ArgBegin,
const char **ArgEnd,
829 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
830 std::shared_ptr<DiagnosticOptions> DiagOpts,
832 bool StorePreamblesInMemory, StringRef PreambleStoragePath,
835 bool RemappedFilesKeepOriginalName,
837 bool CacheCodeCompletionResults,
838 bool IncludeBriefCommentsInCodeCompletion,
839 bool AllowPCHWithCompilerErrors,
841 bool UserFilesAreVolatile,
bool ForSerialization,
842 bool RetainExcludedConditionalBlocks,
843 std::optional<StringRef> ModuleFormat, std::unique_ptr<ASTUnit> *ErrAST,
857 bool Reparse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
892 bool IncludeCodePatterns,
bool IncludeBriefComments,
894 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
901 std::unique_ptr<SyntaxOnlyAction> Act);
919 bool CaptureNonErrorsFromIncludes =
true;
927 bool CaptureNonErrorsFromIncludes);
942 std::unique_ptr<DiagnosticConsumer> OwningPreviousClient;
Defines the clang::ASTContext interface.
Defines the Diagnostic-related interfaces.
Defines the clang::FileSystemOptions interface.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Defines the clang::SourceLocation class and associated facilities.
Defines the SourceManager interface.
Defines the clang::TargetOptions class.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Reads an AST files chain containing the contents of a translation unit.
ConcurrencyCheck(ASTUnit &Self)
Utility class for loading a ASTContext from an AST file.
const PreprocessorOptions & getPreprocessorOpts() const
unsigned & getCurrentTopLevelHashValue()
Retrieve a reference to the current top-level name hash value.
ASTContext & getASTContext()
CodeCompletionTUInfo & getCodeCompletionTUInfo()
void enableSourceFileDiagnostics()
Enable source-range based diagnostic messages.
stored_diag_iterator stored_diag_end()
void addFileLevelDecl(Decl *D)
Add a new local file-level declaration.
const FileManager & getFileManager() const
void setOwnsRemappedFileBuffers(bool val)
bool isUnsafeToFree() const
void CodeComplete(StringRef File, unsigned Line, unsigned Column, ArrayRef< RemappedFile > RemappedFiles, bool IncludeMacros, bool IncludeCodePatterns, bool IncludeBriefComments, CodeCompleteConsumer &Consumer, std::shared_ptr< PCHContainerOperations > PCHContainerOps, llvm::IntrusiveRefCntPtr< DiagnosticsEngine > Diag, LangOptions &LangOpts, llvm::IntrusiveRefCntPtr< SourceManager > SourceMgr, llvm::IntrusiveRefCntPtr< FileManager > FileMgr, SmallVectorImpl< StoredDiagnostic > &StoredDiagnostics, SmallVectorImpl< const llvm::MemoryBuffer * > &OwnedBuffers, std::unique_ptr< SyntaxOnlyAction > Act)
Perform code completion at the given file, line, and column within this translation unit.
cached_completion_iterator cached_completion_end()
SourceRange mapRangeFromPreamble(SourceRange R) const
static std::unique_ptr< ASTUnit > LoadFromASTFile(StringRef Filename, const PCHContainerReader &PCHContainerRdr, WhatToLoad ToLoad, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< DiagnosticOptions > DiagOpts, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, const FileSystemOptions &FileSystemOpts, const HeaderSearchOptions &HSOpts, const LangOptions *LangOpts=nullptr, bool OnlyLocalDecls=false, CaptureDiagsKind CaptureDiagnostics=CaptureDiagsKind::None, bool AllowASTWithCompilerErrors=false, bool UserFilesAreVolatile=false)
Create a ASTUnit from an AST file.
bool top_level_empty() const
llvm::IntrusiveRefCntPtr< ASTContext > getASTContextPtr()
bool serialize(raw_ostream &OS)
Serialize this translation unit with the given output stream.
llvm::iterator_range< stored_diag_iterator > diags_range
bool getOwnsRemappedFileBuffers() const
const CodeGenOptions & getCodeGenOpts() const
const FileSystemOptions & getFileSystemOpts() const
ASTDeserializationListener * getDeserializationListener()
stored_diag_const_iterator stored_diag_end() const
bool Reparse(std::shared_ptr< PCHContainerOperations > PCHContainerOps, ArrayRef< RemappedFile > RemappedFiles={}, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS=nullptr)
Reparse the source files using the same command-line options that were originally used to produce thi...
void setUnsafeToFree(bool Value)
std::unique_ptr< llvm::MemoryBuffer > getBufferForFile(StringRef Filename, std::string *ErrorStr=nullptr)
llvm::StringMap< unsigned > & getCachedCompletionTypes()
Retrieve the mapping from formatted type names to unique type identifiers.
const DiagnosticsEngine & getDiagnostics() const
SourceLocation getLocation(const FileEntry *File, unsigned Line, unsigned Col) const
Get the source location for the given file:line:col triplet.
void ResetForParse()
Free data that will be re-generated on the next parse.
llvm::IntrusiveRefCntPtr< SourceManager > getSourceManagerPtr()
bool getOnlyLocalDecls() const
InputKind getInputKind() const
Determine the input kind this AST unit represents.
std::optional< StringRef > getPCHFile()
Get the PCH file if one was included.
StringRef getMainFileName() const
ASTUnit(const ASTUnit &)=delete
stored_diag_const_iterator stored_diag_begin() const
SourceLocation mapLocationToPreamble(SourceLocation Loc) const
If Loc is a local location of the main file but inside the preamble chunk, returns the corresponding ...
cached_completion_iterator cached_completion_begin()
const LangOptions & getLangOpts() const
bool isMainFileAST() const
std::vector< Decl * >::iterator top_level_iterator
const SourceManager & getSourceManager() const
ASTUnit & operator=(const ASTUnit &)=delete
unsigned stored_diag_size() const
const_diags_range storedDiagnostics() const
Preprocessor & getPreprocessor()
DiagnosticsEngine & getDiagnostics()
const StoredDiagnostic * stored_diag_const_iterator
SourceLocation getEndOfPreambleFileID() const
std::vector< CachedCodeCompletionResult >::iterator cached_completion_iterator
stored_diag_iterator stored_diag_afterDriver_begin()
llvm::IntrusiveRefCntPtr< DiagnosticsEngine > getDiagnosticsPtr()
static ASTUnit * LoadFromCompilerInvocationAction(std::shared_ptr< CompilerInvocation > CI, std::shared_ptr< PCHContainerOperations > PCHContainerOps, std::shared_ptr< DiagnosticOptions > DiagOpts, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, FrontendAction *Action=nullptr, ASTUnit *Unit=nullptr, bool Persistent=true, StringRef ResourceFilesPath=StringRef(), bool OnlyLocalDecls=false, CaptureDiagsKind CaptureDiagnostics=CaptureDiagsKind::None, unsigned PrecompilePreambleAfterNParses=0, bool CacheCodeCompletionResults=false, bool UserFilesAreVolatile=false, std::unique_ptr< ASTUnit > *ErrAST=nullptr)
Create an ASTUnit from a source file, via a CompilerInvocation object, by invoking the optionally pro...
@ LoadPreprocessorOnly
Load options and the preprocessor state.
@ LoadASTOnly
Load the AST, but do not restore Sema state.
@ LoadEverything
Load everything, including Sema.
top_level_iterator top_level_end()
SourceLocation getStartOfMainFileID() const
SourceRange mapRangeToPreamble(SourceRange R) const
diags_range storedDiagnostics()
FileManager & getFileManager()
IntrusiveRefCntPtr< ASTReader > getASTReader() const
IntrusiveRefCntPtr< FileManager > getFileManagerPtr()
bool(*)(void *context, const Decl *D) DeclVisitorFn
Type for a function iterating over a number of declarations.
StoredDiagnostic * stored_diag_iterator
bool visitLocalTopLevelDecls(void *context, DeclVisitorFn Fn)
Iterate over local declarations (locally parsed if this is a parsed source file or the loaded declara...
IntrusiveRefCntPtr< llvm::vfs::FileSystem > getVirtualFileSystemPtr()
llvm::iterator_range< PreprocessingRecord::iterator > getLocalPreprocessingEntities() const
Returns an iterator range for the local preprocessing entities of the local Preprocessor,...
StringRef getOriginalSourceFileName() const
top_level_iterator top_level_begin()
ASTMutationListener * getASTMutationListener()
stored_diag_iterator stored_diag_begin()
TranslationUnitKind getTranslationUnitKind() const
Determine what kind of translation unit this AST represents.
std::shared_ptr< Preprocessor > getPreprocessorPtr() const
void setPreprocessor(std::shared_ptr< Preprocessor > pp)
StringRef getASTFileName() const
If this ASTUnit came from an AST file, returns the filename for it.
bool Save(StringRef File)
Save this translation unit to a file with the given name.
SourceManager & getSourceManager()
const HeaderSearchOptions & getHeaderSearchOpts() const
friend std::unique_ptr< ASTUnit > CreateASTUnitFromCommandLine(const char **ArgBegin, const char **ArgEnd, std::shared_ptr< PCHContainerOperations > PCHContainerOps, std::shared_ptr< DiagnosticOptions > DiagOpts, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, StringRef ResourceFilesPath, bool StorePreamblesInMemory, StringRef PreambleStoragePath, bool OnlyLocalDecls, CaptureDiagsKind CaptureDiagnostics, ArrayRef< ASTUnit::RemappedFile > RemappedFiles, bool RemappedFilesKeepOriginalName, unsigned PrecompilePreambleAfterNParses, TranslationUnitKind TUKind, bool CacheCodeCompletionResults, bool IncludeBriefCommentsInCodeCompletion, bool AllowPCHWithCompilerErrors, SkipFunctionBodiesScope SkipFunctionBodies, bool SingleFileParse, bool UserFilesAreVolatile, bool ForSerialization, bool RetainExcludedConditionalBlocks, std::optional< StringRef > ModuleFormat, std::unique_ptr< ASTUnit > *ErrAST, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS)
Create an ASTUnit from a vector of command line arguments, which must specify exactly one source file...
void setASTContext(llvm::IntrusiveRefCntPtr< ASTContext > ctx)
unsigned getPreambleCounterForTests() const
unsigned cached_completion_size() const
static std::unique_ptr< ASTUnit > create(std::shared_ptr< CompilerInvocation > CI, std::shared_ptr< DiagnosticOptions > DiagOpts, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, CaptureDiagsKind CaptureDiagnostics, bool UserFilesAreVolatile)
Create a ASTUnit. Gets ownership of the passed CompilerInvocation.
void addTopLevelDecl(Decl *D)
Add a new top-level declaration.
const Preprocessor & getPreprocessor() const
std::shared_ptr< GlobalCodeCompletionAllocator > getCachedCompletionAllocator()
Retrieve the allocator used to cache global code completions.
llvm::iterator_range< stored_diag_const_iterator > const_diags_range
bool isInMainFileID(SourceLocation Loc) const
bool isModuleFile() const
Returns true if the ASTUnit was constructed from a serialized module file.
void findFileRegionDecls(FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls)
Get the decls that are contained in a file in the Offset/Length range.
const ASTContext & getASTContext() const
bool isInPreambleFileID(SourceLocation Loc) const
SourceLocation mapLocationFromPreamble(SourceLocation Loc) const
If Loc is a loaded location from the preamble, returns the corresponding local location of the main f...
std::pair< std::string, llvm::MemoryBuffer * > RemappedFile
A mapping from a file name to the memory buffer that stores the remapped contents of that file.
std::size_t top_level_size() const
Writes an AST file containing the contents of a translation unit.
CaptureDroppedDiagnostics(const CaptureDroppedDiagnostics &)=delete
~CaptureDroppedDiagnostics()
CaptureDroppedDiagnostics(CaptureDiagsKind CaptureDiagnostics, DiagnosticsEngine &Diags, SmallVectorImpl< StoredDiagnostic > *StoredDiags, SmallVectorImpl< StandaloneDiagnostic > *StandaloneDiags)
CaptureDroppedDiagnostics & operator=(const CaptureDroppedDiagnostics &)=delete
Abstract interface for a consumer of code-completion information.
A "string" used to describe how code completion can be performed for an entity.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Helper class for holding the data necessary to invoke the compiler.
Decl - This represents one declaration (or definition), e.g.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
DiagnosticConsumer()=default
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine a...
Concrete class used by the front-end to report problems and issues.
Level
The level of the diagnostic, after it has been through mapping.
Cached information about one file (either on disk or in the virtual file system).
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Implements support for file system lookup, file system caching, and directory search management.
Keeps track of options that affect how file operations are performed.
Diagnostic consumer that saves each diagnostic it is given.
void BeginSourceFile(const LangOptions &LangOpts, const Preprocessor *PP=nullptr) override
Callback to inform the diagnostic client that processing of a source file is beginning.
FilterAndStoreDiagnosticConsumer(SmallVectorImpl< StoredDiagnostic > *StoredDiags, SmallVectorImpl< StandaloneDiagnostic > *StandaloneDiags, bool CaptureNonErrorsFromIncludes)
void HandleDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info) override
Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
Abstract base class for actions which can be performed by the frontend.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
The module cache used for compiling modules implicitly.
A registry of PCHContainerWriter and -Reader objects for different formats.
This abstract interface provides operations for unwrapping containers for serialized ASTs (precompile...
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
Exposes information about the current target.
A module loader that doesn't know how to create or load modules.
CXCursorKind
Describes the kind of entity that a cursor refers to.
CXAvailabilityKind
Describes the availability of a particular entity, which indicates whether the use of this entity wil...
Top level wrappers for InstallAPI frontend operations.
SkipFunctionBodiesScope
Enumerates the available scopes for skipping function bodies.
@ Parse
Parse the block; this code is always used.
SimplifiedTypeClass
A simplified classification of types used when determining "similar" types for code completion.
CaptureDiagsKind
Enumerates the available kinds for capturing diagnostics.
@ AllWithoutNonErrorsFromIncludes
TranslationUnitKind
Describes the kind of translation unit being processed.
@ TU_Complete
The translation unit is a complete translation unit.
@ None
The alignment was not explicit in code.
Diagnostic wrappers for TextAPI types for error reporting.
A cached code-completion result, which may be introduced in one of many different contexts.
unsigned Type
The type of a non-macro completion result, stored as a unique integer used by the string map of cache...
CXCursorKind Kind
The libclang cursor kind corresponding to this code-completion result.
CXAvailabilityKind Availability
The availability of this code-completion result.
unsigned Priority
The priority given to this code-completion result.
SimplifiedTypeClass TypeClass
The simplified type class for a non-macro completion result.
uint64_t ShowInContexts
A bitmask that indicates which code-completion contexts should contain this completion result.
CodeCompletionString * Completion
The code-completion string corresponding to this completion result.