TranslationUnit

A single translation unit, which resides in an index.

Constructors

this
this(CXTranslationUnit cx)
Undocumented in source.

Alias This

cx

Members

Functions

extent
SourceRange extent(uint startOffset, uint endOffset)
Undocumented in source. Be warned that the author may not have intended to support it.
file
Nullable!File file(string filename)
Undocumented in source. Be warned that the author may not have intended to support it.
file
File file()
Undocumented in source. Be warned that the author may not have intended to support it.
includeLocations
SourceLocation[] includeLocations()
Undocumented in source. Be warned that the author may not have intended to support it.
includeLocationsImpl
SourceLocation[] includeLocationsImpl(Range cursors)
Undocumented in source. Be warned that the author may not have intended to support it.
isCompiled
bool isCompiled()
isValid
bool isValid()
Undocumented in source. Be warned that the author may not have intended to support it.
location
SourceLocation location(uint offset)
Undocumented in source. Be warned that the author may not have intended to support it.
location
SourceLocation location(string path, uint offset)
Undocumented in source. Be warned that the author may not have intended to support it.
relativeLocationAccessor
size_t delegate(SourceLocation) relativeLocationAccessor()
Undocumented in source. Be warned that the author may not have intended to support it.
relativeLocationAccessorImpl
ulong delegate(SourceLocation) relativeLocationAccessorImpl(Range cursors)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

cursor
Cursor cursor [@property getter]

Trusted: on the assumption that the LLVM team is superb programmers.

declarations
DeclarationVisitor declarations [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
diagnosticSet
DiagnosticSet diagnosticSet [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
diagnostics
DiagnosticVisitor diagnostics [@property getter]

Trusted: on the assumption that accessing the payload of the refcounted TranslationUnit is @safe.

numDiagnostics
size_t numDiagnostics [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
spelling
string spelling [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

parse
TranslationUnit parse(Index index, string sourceFilename, string[] commandLineArgs, CXUnsavedFile[] unsavedFiles, uint options)

Trusted: on the assumption that clang_parseTranslationUnit is implemented by the LLVM team.

parseString
TranslationUnit parseString(Index index, string source, string[] commandLineArgs, CXUnsavedFile[] unsavedFiles, uint options)

Convenient function to create a TranslationUnit from source code via a parameter.

Variables

cx
ContainTU cx;
Undocumented in source.

Meta