clang: include/clang/Frontend/ASTUnit.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_FRONTEND_ASTUNIT_H

14#define LLVM_CLANG_FRONTEND_ASTUNIT_H

15

31#include "llvm/ADT/ArrayRef.h"

32#include "llvm/ADT/DenseMap.h"

33#include "llvm/ADT/IntrusiveRefCntPtr.h"

34#include "llvm/ADT/STLExtras.h"

35#include "llvm/ADT/SmallVector.h"

36#include "llvm/ADT/StringMap.h"

37#include "llvm/ADT/StringRef.h"

38#include "llvm/ADT/iterator_range.h"

39#include

40#include

41#include

42#include

43#include

44#include

45#include

46#include

47

48namespace llvm {

49

50class MemoryBuffer;

51

52namespace vfs {

53

54class FileSystem;

55

56}

57}

58

60

61class ASTContext;

62class ASTDeserializationListener;

63class ASTMutationListener;

64class ASTReader;

65class CompilerInstance;

66class CompilerInvocation;

68class FileEntry;

69class FileManager;

70class FrontendAction;

72class InputKind;

73class InMemoryModuleCache;

74class PCHContainerOperations;

75class PCHContainerReader;

76class Preprocessor;

77class PreprocessorOptions;

78class Sema;

79class TargetInfo;

80class SyntaxOnlyAction;

81

82

84

85

87

88

90public:

96 };

97

104 std::vector<std::pair<unsigned, unsigned>> Ranges;

105 std::vector FixIts;

106 };

107

108private:

109 std::shared_ptr LangOpts;

114 std::unique_ptr HeaderInfo;

116 std::shared_ptr PP;

118 std::shared_ptr TargetOpts;

119 std::shared_ptr HSOpts;

120 std::shared_ptr PPOpts;

122 bool HadModuleLoaderFatalFailure = false;

123 bool StorePreamblesInMemory = false;

124

126 std::unique_ptr WriterData;

127

129 std::string PreambleStoragePath;

130

131

132

133 std::unique_ptr Consumer;

134

135

136

137 std::unique_ptr TheSema;

138

139

140

141 std::shared_ptr Invocation;

142

143

145

146

147

148

149 bool OnlyLocalDecls = false;

150

151

153

154

155 bool MainFileIsAST;

156

157

159

160

161 bool WantTiming;

162

163

164 bool OwnsRemappedFileBuffers = true;

165

166

167

168

169

170

171

172

173 std::vector<Decl*> TopLevelDecls;

174

175

177 using FileDeclsTy = llvm::DenseMap<FileID, std::unique_ptr>;

178

179

180

181 FileDeclsTy FileDecls;

182

183

184 std::string OriginalSourceFile;

185

186

188

189

190

192

193

194

196

197

198

199

200

201

202 unsigned NumStoredDiagnosticsFromDriver = 0;

203

204

205

206

207

208

209

210

211

212

213 unsigned PreambleRebuildCountdown = 0;

214

215

216 unsigned PreambleCounter = 0;

217

218

219

220

221

222

223

224 llvm::StringMap PreambleSrcLocCache;

225

226

227 std::optional Preamble;

228

229

230

231

232 std::unique_ptrllvm::MemoryBuffer SavedMainFileBuffer;

233

234

235

236

237

238

239

240 unsigned NumWarningsInPreamble = 0;

241

242

243

244 std::vector TopLevelDeclsInPreamble;

245

246

247 bool ShouldCacheCodeCompletionResults : 1;

248

249

250

251 bool IncludeBriefCommentsInCodeCompletion : 1;

252

253

254

255 bool UserFilesAreVolatile : 1;

256

259

260 void TranslateStoredDiagnostics(FileManager &FileMgr,

264

265 void clearFileLevelDecls();

266

267public:

268

269

271

272

274

275

276

277

278

279

280

281

283

284

286

287

288

290

291

293

294

296

297

298

299

300

301

302

304 };

305

306

307

309 return CachedCompletionTypes;

310 }

311

312

313 std::shared_ptr

315 return CachedCompletionAllocator;

316 }

317

319 if (!CCTUInfo)

320 CCTUInfo = std::make_unique(

321 std::make_shared());

322 return *CCTUInfo;

323 }

324

325private:

326

327 std::shared_ptr CachedCompletionAllocator;

328

329 std::unique_ptr CCTUInfo;

330

331

332 std::vector CachedCompletionResults;

333

334

335

336 llvm::StringMap CachedCompletionTypes;

337

338

339

340

341

342

343 unsigned CompletionCacheTopLevelHashValue = 0;

344

345

346

347

348

349

350 unsigned PreambleTopLevelHashValue = 0;

351

352

353

354 unsigned CurrentTopLevelHashValue = 0;

355

356

357

358 LLVM_PREFERRED_TYPE(bool)

359 unsigned UnsafeToFree : 1;

360

361

363

364

365

366 void CacheCodeCompletionResults();

367

368

369 void ClearCachedCompletionResults();

370

371 explicit ASTUnit(bool MainFileIsAST);

372

373 bool Parse(std::shared_ptr PCHContainerOps,

374 std::unique_ptrllvm::MemoryBuffer OverrideMainBuffer,

376

377 std::unique_ptrllvm::MemoryBuffer getMainBufferWithPrecompiledPreamble(

378 std::shared_ptr PCHContainerOps,

381 unsigned MaxLines = 0);

382 void RealizeTopLevelDeclsFromPreamble();

383

384

385

386 void transferASTDataFromCompilerInstance(CompilerInstance &CI);

387

388

389

390

391

392

393

394

395 class ConcurrencyState {

396 void *Mutex;

397

398 public:

399 ConcurrencyState();

400 ~ConcurrencyState();

401

402 void start();

403 void finish();

404 };

405 ConcurrencyState ConcurrencyCheckValue;

406

407public:

409

412

413 public:

415 Self.ConcurrencyCheckValue.start();

416 }

417

419 Self.ConcurrencyCheckValue.finish();

420 }

421 };

422

426

428

431

434

437

441

444

447

448

449

450

451

452

453

454

456

457 bool hasSema() const { return (bool)TheSema; }

458

460 assert(TheSema && "ASTUnit does not have a Sema object!");

461 return *TheSema;

462 }

463

465 assert(LangOpts && "ASTUnit does not have language options");

466 return *LangOpts;

467 }

468

470 assert(HSOpts && "ASTUnit does not have header search options");

471 return *HSOpts;

472 }

473

475 assert(PPOpts && "ASTUnit does not have preprocessor options");

476 return *PPOpts;

477 }

478

481

483

485

487 return OriginalSourceFile;

488 }

489

492

494

497

499

500

502

504

506 assert(isMainFileAST() && "Invalid call for AST based ASTUnit!");

507 if (!TopLevelDeclsInPreamble.empty())

508 RealizeTopLevelDeclsFromPreamble();

509 return TopLevelDecls.begin();

510 }

511

513 assert(isMainFileAST() && "Invalid call for AST based ASTUnit!");

514 if (!TopLevelDeclsInPreamble.empty())

515 RealizeTopLevelDeclsFromPreamble();

516 return TopLevelDecls.end();

517 }

518

520 assert(isMainFileAST() && "Invalid call for AST based ASTUnit!");

521 return TopLevelDeclsInPreamble.size() + TopLevelDecls.size();

522 }

523

525 assert(isMainFileAST() && "Invalid call for AST based ASTUnit!");

526 return TopLevelDeclsInPreamble.empty() && TopLevelDecls.empty();

527 }

528

529

531 TopLevelDecls.push_back(D);

532 }

533

534

536

537

538

539

542

543

544

545

547

548

549

550

551

552

554 unsigned Line, unsigned Col) const;

555

556

558

559

560

561

563

564

565

566

568

573

574

578 }

579

580

584 }

585

587

588

591

593 return StoredDiagnostics.begin();

594 }

595

597 return StoredDiagnostics.begin();

598 }

599

601 return StoredDiagnostics.end();

602 }

603

605 return StoredDiagnostics.end();

606 }

607

609

611 if (NumStoredDiagnosticsFromDriver > StoredDiagnostics.size())

612 NumStoredDiagnosticsFromDriver = 0;

613 return StoredDiagnostics.begin() + NumStoredDiagnosticsFromDriver;

614 }

615

617 std::vector::iterator;

618

620 return CachedCompletionResults.begin();

621 }

622

624 return CachedCompletionResults.end();

625 }

626

628 return CachedCompletionResults.size();

629 }

630

631

632

633

634 llvm::iterator_rangePreprocessingRecord::iterator

636

637

638

640

641

642

643

644

646

647

649

650

651

653

654 std::unique_ptrllvm::MemoryBuffer

656

657

659

660

662

663

664

665 using RemappedFile = std::pair<std::string, llvm::MemoryBuffer *>;

666

667

668 static std::unique_ptr

669 create(std::shared_ptr CI,

671 CaptureDiagsKind CaptureDiagnostics, bool UserFilesAreVolatile);

672

674

676

677

679

680

683

684

685

686

687

688

689

690

691

692

693

694 static std::unique_ptr

699 std::shared_ptr HSOpts,

700 std::shared_ptr LangOpts = nullptr,

701 bool OnlyLocalDecls = false,

703 bool AllowASTWithCompilerErrors = false,

704 bool UserFilesAreVolatile = false,

706 llvm::vfs::getRealFileSystem());

707

708private:

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723 bool LoadFromCompilerInvocation(

724 std::shared_ptr PCHContainerOps,

725 unsigned PrecompilePreambleAfterNParses,

727

728public:

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

758 std::shared_ptr CI,

759 std::shared_ptr PCHContainerOps,

762 bool Persistent = true, StringRef ResourceFilesPath = StringRef(),

763 bool OnlyLocalDecls = false,

765 unsigned PrecompilePreambleAfterNParses = 0,

766 bool CacheCodeCompletionResults = false,

767 bool UserFilesAreVolatile = false,

768 std::unique_ptr *ErrAST = nullptr);

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784 static std::unique_ptr LoadFromCompilerInvocation(

785 std::shared_ptr CI,

786 std::shared_ptr PCHContainerOps,

788 bool OnlyLocalDecls = false,

790 unsigned PrecompilePreambleAfterNParses = 0,

792 bool CacheCodeCompletionResults = false,

793 bool IncludeBriefCommentsInCodeCompletion = false,

794 bool UserFilesAreVolatile = false);

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

833 const char **ArgBegin, const char **ArgEnd,

834 std::shared_ptr PCHContainerOps,

836 bool StorePreamblesInMemory = false,

837 StringRef PreambleStoragePath = StringRef(), bool OnlyLocalDecls = false,

840 bool RemappedFilesKeepOriginalName = true,

841 unsigned PrecompilePreambleAfterNParses = 0,

843 bool CacheCodeCompletionResults = false,

844 bool IncludeBriefCommentsInCodeCompletion = false,

845 bool AllowPCHWithCompilerErrors = false,

848 bool SingleFileParse = false, bool UserFilesAreVolatile = false,

849 bool ForSerialization = false,

850 bool RetainExcludedConditionalBlocks = false,

851 std::optional ModuleFormat = std::nullopt,

852 std::unique_ptr *ErrAST = nullptr,

853 IntrusiveRefCntPtrllvm::vfs::FileSystem VFS = nullptr);

854

855

856

857

858

859

860

861

862

863

864

865

866 bool Reparse(std::shared_ptr PCHContainerOps,

867 ArrayRef RemappedFiles = {},

868 IntrusiveRefCntPtrllvm::vfs::FileSystem VFS = nullptr);

869

870

871

872

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

900 ArrayRef RemappedFiles, bool IncludeMacros,

901 bool IncludeCodePatterns, bool IncludeBriefComments,

902 CodeCompleteConsumer &Consumer,

903 std::shared_ptr PCHContainerOps,

904 DiagnosticsEngine &Diag, LangOptions &LangOpts,

905 SourceManager &SourceMgr, FileManager &FileMgr,

906 SmallVectorImpl &StoredDiagnostics,

907 SmallVectorImpl<const llvm::MemoryBuffer *> &OwnedBuffers,

908 std::unique_ptr Act);

909

910

911

912

913

915

916

917

918

920};

921

922}

923

924#endif

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.

llvm::MachO::Target Target

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...

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, DiagnosticsEngine &Diag, LangOptions &LangOpts, SourceManager &SourceMgr, 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

bool top_level_empty() const

bool serialize(raw_ostream &OS)

Serialize this translation unit with the given output stream.

bool getOwnsRemappedFileBuffers() 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.

bool getOnlyLocalDecls() const

InputKind getInputKind() const

Determine the input kind this AST unit represents.

OptionalFileEntryRef 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

static std::unique_ptr< ASTUnit > LoadFromCommandLine(const char **ArgBegin, const char **ArgEnd, std::shared_ptr< PCHContainerOperations > PCHContainerOps, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, StringRef ResourceFilesPath, bool StorePreamblesInMemory=false, StringRef PreambleStoragePath=StringRef(), bool OnlyLocalDecls=false, CaptureDiagsKind CaptureDiagnostics=CaptureDiagsKind::None, ArrayRef< RemappedFile > RemappedFiles={}, bool RemappedFilesKeepOriginalName=true, unsigned PrecompilePreambleAfterNParses=0, TranslationUnitKind TUKind=TU_Complete, bool CacheCodeCompletionResults=false, bool IncludeBriefCommentsInCodeCompletion=false, bool AllowPCHWithCompilerErrors=false, SkipFunctionBodiesScope SkipFunctionBodies=SkipFunctionBodiesScope::None, bool SingleFileParse=false, bool UserFilesAreVolatile=false, bool ForSerialization=false, bool RetainExcludedConditionalBlocks=false, std::optional< StringRef > ModuleFormat=std::nullopt, std::unique_ptr< ASTUnit > *ErrAST=nullptr, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS=nullptr)

LoadFromCommandLine - Create an ASTUnit from a vector of command line arguments, which must specify e...

bool isMainFileAST() const

std::vector< Decl * >::iterator top_level_iterator

const SourceManager & getSourceManager() const

ASTUnit & operator=(const ASTUnit &)=delete

unsigned stored_diag_size() const

Preprocessor & getPreprocessor()

DiagnosticsEngine & getDiagnostics()

SourceLocation getEndOfPreambleFileID() const

stored_diag_iterator stored_diag_afterDriver_begin()

@ 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

FileManager & getFileManager()

IntrusiveRefCntPtr< ASTReader > getASTReader() const

bool(*)(void *context, const Decl *D) DeclVisitorFn

Type for a function iterating over a number of declarations.

bool visitLocalTopLevelDecls(void *context, DeclVisitorFn Fn)

Iterate over local declarations (locally parsed if this is a parsed source file or the loaded declara...

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()

std::vector< CachedCodeCompletionResult >::iterator cached_completion_iterator

ASTMutationListener * getASTMutationListener()

static std::unique_ptr< ASTUnit > LoadFromASTFile(StringRef Filename, const PCHContainerReader &PCHContainerRdr, WhatToLoad ToLoad, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, const FileSystemOptions &FileSystemOpts, std::shared_ptr< HeaderSearchOptions > HSOpts, std::shared_ptr< LangOptions > LangOpts=nullptr, bool OnlyLocalDecls=false, CaptureDiagsKind CaptureDiagnostics=CaptureDiagsKind::None, bool AllowASTWithCompilerErrors=false, bool UserFilesAreVolatile=false, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS=llvm::vfs::getRealFileSystem())

Create a ASTUnit from an AST file.

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)

void setASTContext(ASTContext *ctx)

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.

static std::unique_ptr< ASTUnit > create(std::shared_ptr< CompilerInvocation > CI, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, CaptureDiagsKind CaptureDiagnostics, bool UserFilesAreVolatile)

Create a ASTUnit. Gets ownership of the passed CompilerInvocation.

SourceManager & getSourceManager()

const HeaderSearchOptions & getHeaderSearchOpts() const

unsigned getPreambleCounterForTests() const

unsigned cached_completion_size() const

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.

static ASTUnit * LoadFromCompilerInvocationAction(std::shared_ptr< CompilerInvocation > CI, std::shared_ptr< PCHContainerOperations > PCHContainerOps, 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...

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

A "string" used to describe how code completion can be performed for an entity.

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.

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.

Abstract base class for actions which can be performed by the frontend.

The kind of a file that we've been handed as an input.

Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...

Abstract interface for a module loader.

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.

SourceLocation getEnd() const

SourceLocation getBegin() const

Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...

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...

@ Decl

The l-value was an access to a declared entity or something equivalently strong, like the address of ...

The JSON file list parser is used to communicate input to InstallAPI.

SkipFunctionBodiesScope

Enumerates the available scopes for skipping function bodies.

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.

DiagnosticsEngine::Level Level

std::vector< std::pair< unsigned, unsigned > > Ranges

std::vector< StandaloneFixIt > FixIts

std::pair< unsigned, unsigned > InsertFromRange

std::pair< unsigned, unsigned > RemoveRange

bool BeforePreviousInsertions