14#ifndef LLVM_CLANG_SERIALIZATION_ASTWRITER_H
15#define LLVM_CLANG_SERIALIZATION_ASTWRITER_H
28#include "llvm/ADT/ArrayRef.h"
29#include "llvm/ADT/DenseMap.h"
30#include "llvm/ADT/DenseSet.h"
31#include "llvm/ADT/MapVector.h"
32#include "llvm/ADT/STLExtras.h"
33#include "llvm/ADT/SetVector.h"
34#include "llvm/ADT/SmallVector.h"
35#include "llvm/ADT/StringRef.h"
36#include "llvm/Bitstream/BitstreamWriter.h"
54class FPOptionsOverride;
57class HeaderSearchOptions;
58class IdentifierResolver;
60class MacroDefinitionRecord;
63class InMemoryModuleCache;
64class ModuleFileExtension;
65class ModuleFileExtensionWriter;
67class ObjCInterfaceDecl;
68class PreprocessingRecord;
114 llvm::BitstreamWriter &Stream;
132 Module *WritingModule =
nullptr;
135 std::pair<uint64_t, uint64_t> UnhashedControlBlockRange;
137 uint64_t ASTBlockHashOffset = 0;
139 uint64_t SignatureOffset = 0;
142 uint64_t ASTBlockStartOffset = 0;
145 std::pair<uint64_t, uint64_t> ASTBlockRange;
148 std::string BaseDirectory;
154 bool IncludeTimestamps;
159 bool BuildingImplicitModule =
false;
163 bool WritingAST =
false;
167 bool DoneWritingDeclsAndTypes =
false;
170 bool ASTHasCompilerErrors =
false;
174 bool GeneratingReducedBMI =
false;
178 llvm::DenseMap<const FileEntry *, uint32_t> InputFileIDs;
183 DeclOrType(
Decl *
D) : Stored(
D), IsType(
false) {}
184 DeclOrType(
QualType T) : Stored(
T.getAsOpaquePtr()), IsType(
true) {}
186 bool isType()
const {
return IsType; }
187 bool isDecl()
const {
return !IsType; }
190 assert(isType() &&
"Not a type!");
194 Decl *getDecl()
const {
195 assert(isDecl() &&
"Not a decl!");
196 return static_cast<Decl *
>(Stored);
205 std::queue<DeclOrType> DeclTypesToEmit;
229 llvm::DenseMap<const Decl *, LocalDeclID> DeclIDs;
238 std::vector<serialization::DeclOffset> DeclOffsets;
242 uint64_t DeclTypesBlockStartOffset = 0;
246 struct DeclIDInFileInfo {
247 LocDeclIDsTy DeclIDs;
251 unsigned FirstDeclIndex;
253 using FileDeclIDsTy =
254 llvm::DenseMap<FileID, std::unique_ptr<DeclIDInFileInfo>>;
258 FileDeclIDsTy FileDeclIDs;
260 void associateDeclWithFile(
const Decl *
D, LocalDeclID);
281 std::vector<serialization::UnalignedUInt64> TypeOffsets;
295 llvm::MapVector<const IdentifierInfo *, serialization::IdentifierID> IdentifierIDs;
304 llvm::DenseMap<MacroInfo *, serialization::MacroID> MacroIDs;
306 struct MacroInfoToEmitData {
307 const IdentifierInfo *Name;
313 std::vector<MacroInfoToEmitData> MacroInfosToEmit;
315 llvm::DenseMap<const IdentifierInfo *, uint32_t>
316 IdentMacroDirectivesOffsetMap;
322 llvm::DenseSet<Stmt *> ParentStmts;
326 llvm::DenseMap<Stmt *, uint64_t> SubStmtEntries;
332 std::vector<uint32_t> IdentifierOffsets;
349 llvm::MapVector<Selector, serialization::SelectorID> SelectorIDs;
353 std::vector<uint32_t> SelectorOffsets;
357 llvm::DenseMap<
const MacroDefinitionRecord *,
362 llvm::DenseMap<const Decl *, unsigned> AnonymousDeclarationNumbers;
369 llvm::DenseSet<Module *> TouchedTopLevelModules;
381 const Attr *Attribute;
385 DeclUpdate(
unsigned Kind) :
Kind(
Kind), Dcl(nullptr) {}
386 DeclUpdate(
unsigned Kind,
const Decl *Dcl) :
Kind(
Kind), Dcl(Dcl) {}
387 DeclUpdate(
unsigned Kind, QualType Type)
389 DeclUpdate(
unsigned Kind, SourceLocation Loc)
391 DeclUpdate(
unsigned Kind,
unsigned Val) :
Kind(
Kind), Val(Val) {}
392 DeclUpdate(
unsigned Kind, Module *M) :
Kind(
Kind), Mod(M) {}
393 DeclUpdate(
unsigned Kind,
const Attr *Attribute)
394 :
Kind(
Kind), Attribute(Attribute) {}
396 unsigned getKind()
const {
return Kind; }
397 const Decl *getDecl()
const {
return Dcl; }
400 SourceLocation getLoc()
const {
404 unsigned getNumber()
const {
return Val; }
405 Module *getModule()
const {
return Mod; }
406 const Attr *getAttr()
const {
return Attribute; }
409 using UpdateRecord = SmallVector<DeclUpdate, 1>;
410 using DeclUpdateMap = llvm::MapVector<const Decl *, UpdateRecord>;
414 DeclUpdateMap DeclUpdates;
419 DeclUpdateMap DeclUpdatesFromGMF;
421 using FirstLatestDeclMap = llvm::DenseMap<Decl *, Decl *>;
425 FirstLatestDeclMap FirstLatestDecls;
453 SmallVector<const Decl *, 16> DeclsToEmitEvenIfUnreferenced;
457 llvm::SetVector<ObjCInterfaceDecl *> ObjCClassesWithCategories;
465 llvm::DenseMap<const Decl *, const Decl *> FirstLocalDeclCache;
468 llvm::DenseMap<SwitchCase *, unsigned> SwitchCaseIDs;
471 unsigned NumStatements = 0;
474 unsigned NumMacros = 0;
478 unsigned NumLexicalDeclContexts = 0;
482 unsigned NumVisibleDeclContexts = 0;
486 llvm::DenseMap<const Module *, unsigned> SubmoduleIDs;
489 std::vector<std::unique_ptr<ModuleFileExtensionWriter>>
490 ModuleFileExtensionWriters;
493 llvm::BitVector IsSLocAffecting;
496 std::vector<FileID> NonAffectingFileIDs;
497 std::vector<unsigned> NonAffectingFileIDAdjustments;
500 std::vector<SourceRange> NonAffectingRanges;
501 std::vector<SourceLocation::UIntTy> NonAffectingOffsetAdjustments;
510 void computeNonAffectingInputFiles();
514 SourceLocation getAffectingIncludeLoc(
const SourceManager &SourceMgr,
515 const SrcMgr::FileInfo &
File);
519 FileID getAdjustedFileID(FileID FID)
const;
522 unsigned getAdjustedNumCreatedFIDs(FileID FID)
const;
525 SourceLocation getAdjustedLocation(SourceLocation
Loc)
const;
528 SourceRange getAdjustedRange(SourceRange
Range)
const;
537 unsigned getSubmoduleID(Module *Mod);
540 void WriteSubStmt(Stmt *S);
542 void WriteBlockInfoBlock();
543 void WriteControlBlock(Preprocessor &PP, ASTContext &Context,
547 void writeUnhashedControlBlock(Preprocessor &PP, ASTContext &Context);
548 ASTFileSignature backpatchSignature();
551 std::pair<ASTFileSignature, ASTFileSignature> createSignature()
const;
552 ASTFileSignature createSignatureForNamedModule()
const;
554 void WriteInputFiles(SourceManager &SourceMgr, HeaderSearchOptions &HSOpts);
555 void WriteSourceManagerBlock(SourceManager &SourceMgr,
556 const Preprocessor &PP);
557 void WritePreprocessor(
const Preprocessor &PP,
bool IsModule);
558 void WriteHeaderSearch(
const HeaderSearch &HS);
559 void WritePreprocessorDetail(PreprocessingRecord &PPRec,
560 uint64_t MacroOffsetsBase);
561 void WriteSubmodules(Module *WritingModule);
563 void WritePragmaDiagnosticMappings(
const DiagnosticsEngine &
Diag,
566 unsigned TypeExtQualAbbrev = 0;
567 void WriteTypeAbbrevs();
568 void WriteType(QualType
T);
570 bool isLookupResultExternal(StoredDeclsList &
Result, DeclContext *DC);
572 void GenerateNameLookupTable(
const DeclContext *DC,
574 uint64_t WriteDeclContextLexicalBlock(ASTContext &Context,
575 const DeclContext *DC);
576 uint64_t WriteDeclContextVisibleBlock(ASTContext &Context, DeclContext *DC);
577 void WriteTypeDeclOffsets();
578 void WriteFileDeclIDsMap();
579 void WriteComments();
580 void WriteSelectors(Sema &SemaRef);
581 void WriteReferencedSelectorsPool(Sema &SemaRef);
582 void WriteIdentifierTable(Preprocessor &PP, IdentifierResolver &IdResolver,
584 void WriteDeclAndTypes(ASTContext &Context);
585 void PrepareWritingSpecialDecls(Sema &SemaRef);
586 void WriteSpecialDeclRecords(Sema &SemaRef);
588 void WriteDeclContextVisibleUpdate(
const DeclContext *DC);
589 void WriteFPPragmaOptions(
const FPOptionsOverride &Opts);
590 void WriteOpenCLExtensions(Sema &SemaRef);
591 void WriteCUDAPragmas(Sema &SemaRef);
592 void WriteObjCCategories();
593 void WriteLateParsedTemplates(Sema &SemaRef);
594 void WriteOptimizePragmaOptions(Sema &SemaRef);
595 void WriteMSStructPragmaOptions(Sema &SemaRef);
596 void WriteMSPointersToMembersPragmaOptions(Sema &SemaRef);
597 void WritePackPragmaOptions(Sema &SemaRef);
598 void WriteFloatControlPragmaOptions(Sema &SemaRef);
599 void WriteModuleFileExtension(Sema &SemaRef,
600 ModuleFileExtensionWriter &Writer);
602 unsigned DeclParmVarAbbrev = 0;
603 unsigned DeclContextLexicalAbbrev = 0;
604 unsigned DeclContextVisibleLookupAbbrev = 0;
605 unsigned UpdateVisibleAbbrev = 0;
606 unsigned DeclRecordAbbrev = 0;
607 unsigned DeclTypedefAbbrev = 0;
608 unsigned DeclVarAbbrev = 0;
609 unsigned DeclFieldAbbrev = 0;
610 unsigned DeclEnumAbbrev = 0;
611 unsigned DeclObjCIvarAbbrev = 0;
612 unsigned DeclCXXMethodAbbrev = 0;
613 unsigned DeclDependentNonTemplateCXXMethodAbbrev = 0;
614 unsigned DeclTemplateCXXMethodAbbrev = 0;
615 unsigned DeclMemberSpecializedCXXMethodAbbrev = 0;
616 unsigned DeclTemplateSpecializedCXXMethodAbbrev = 0;
617 unsigned DeclDependentSpecializationCXXMethodAbbrev = 0;
618 unsigned DeclTemplateTypeParmAbbrev = 0;
619 unsigned DeclUsingShadowAbbrev = 0;
621 unsigned DeclRefExprAbbrev = 0;
622 unsigned CharacterLiteralAbbrev = 0;
623 unsigned IntegerLiteralAbbrev = 0;
624 unsigned ExprImplicitCastAbbrev = 0;
625 unsigned BinaryOperatorAbbrev = 0;
626 unsigned CompoundAssignOperatorAbbrev = 0;
627 unsigned CallExprAbbrev = 0;
628 unsigned CXXOperatorCallExprAbbrev = 0;
629 unsigned CXXMemberCallExprAbbrev = 0;
631 unsigned CompoundStmtAbbrev = 0;
633 void WriteDeclAbbrevs();
634 void WriteDecl(ASTContext &Context, Decl *
D);
636 ASTFileSignature WriteASTCore(Sema &SemaRef, StringRef isysroot,
637 Module *WritingModule);
642 ASTWriter(llvm::BitstreamWriter &Stream, SmallVectorImpl<char> &Buffer,
643 InMemoryModuleCache &ModuleCache,
644 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
645 bool IncludeTimestamps =
true,
bool BuildingImplicitModule =
false,
646 bool GeneratingReducedBMI =
false);
650 assert(Context &&
"requested AST context when not writing AST");
676 Module *WritingModule, StringRef isysroot,
677 bool ShouldCacheASTInMemory =
false);
691 LocSeq *
Seq =
nullptr);
699 LocSeq *
Seq =
nullptr);
732 if (
D->isFromASTFile())
734 auto I = DeclIDs.find(
D);
801 return TypeExtQualAbbrev;
814 return DeclCXXMethodAbbrev;
816 return DeclTemplateCXXMethodAbbrev;
818 return DeclMemberSpecializedCXXMethodAbbrev;
820 return DeclTemplateSpecializedCXXMethodAbbrev;
822 return DeclDependentNonTemplateCXXMethodAbbrev;
824 return DeclDependentSpecializationCXXMethodAbbrev;
826 llvm_unreachable(
"Unknwon Template Kind!");
829 return DeclTemplateTypeParmAbbrev;
839 return CompoundAssignOperatorAbbrev;
861 return PredefinedDecls.count(
D);
868 void ReaderInitialized(
ASTReader *Reader)
override;
879 void CompletedTagDefinition(
const TagDecl *
D)
override;
882 void AddedCXXTemplateSpecialization(
885 void AddedCXXTemplateSpecialization(
890 void ResolvedExceptionSpec(
const FunctionDecl *FD)
override;
894 Expr *ThisArg)
override;
895 void CompletedImplicitDefinition(
const FunctionDecl *
D)
override;
896 void InstantiationRequested(
const ValueDecl *
D)
override;
897 void VariableDefinitionInstantiated(
const VarDecl *
D)
override;
898 void FunctionDefinitionInstantiated(
const FunctionDecl *
D)
override;
899 void DefaultArgumentInstantiated(
const ParmVarDecl *
D)
override;
900 void DefaultMemberInitializerInstantiated(
const FieldDecl *
D)
override;
903 void DeclarationMarkedUsed(
const Decl *
D)
override;
904 void DeclarationMarkedOpenMPThreadPrivate(
const Decl *
D)
override;
905 void DeclarationMarkedOpenMPDeclareTarget(
const Decl *
D,
907 void DeclarationMarkedOpenMPAllocate(
const Decl *
D,
const Attr *A)
override;
909 void AddedAttributeToRecord(
const Attr *
Attr,
911 void EnteringModulePurview()
override;
912 void AddedManglingNumber(
const Decl *
D,
unsigned)
override;
913 void AddedStaticLocalNumbers(
const Decl *
D,
unsigned)
override;
921 void anchor()
override;
924 std::string OutputFile;
925 std::string isysroot;
927 std::shared_ptr<PCHBuffer> Buffer;
928 llvm::BitstreamWriter Stream;
930 bool AllowASTWithErrors;
931 bool ShouldCacheASTInMemory;
950 StringRef OutputFile, StringRef isysroot,
951 std::shared_ptr<PCHBuffer> Buffer,
952 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
953 bool AllowASTWithErrors =
false,
bool IncludeTimestamps =
true,
954 bool BuildingImplicitModule =
false,
955 bool ShouldCacheASTInMemory =
false,
956 bool GeneratingReducedBMI =
false);
968 void anchor()
override;
974 StringRef OutputFile,
bool GeneratingReducedBMI);
978 StringRef OutputFile)
986 void anchor()
override;
990 StringRef OutputFile)
1004 constexpr static uint32_t BitIndexUpbound = 32u;
1015 return CurrentBitIndex + BitsWidth < BitIndexUpbound;
1019 UnderlyingValue =
Value;
1020 CurrentBitIndex = 0;
1025 assert(BitsWidth < BitIndexUpbound);
1026 assert((
Value < (1u << BitsWidth)) &&
"Passing narrower bit width!");
1028 "Inserting too much bits into a value!");
1030 UnderlyingValue |=
Value << CurrentBitIndex;
1031 CurrentBitIndex += BitsWidth;
1034 operator uint32_t() {
return UnderlyingValue; }
1037 uint32_t UnderlyingValue = 0;
1038 uint32_t CurrentBitIndex = 0;
enum clang::sema::@1653::IndirectLocalPathEntry::EntryKind Kind
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
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::Record Record
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
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.
An object for streaming information to a record.
Writes an AST file containing the contents of a translation unit.
serialization::MacroID getMacroID(MacroInfo *MI)
Determine the ID of an already-emitted macro.
ASTFileSignature WriteAST(Sema &SemaRef, StringRef OutputFile, Module *WritingModule, StringRef isysroot, bool ShouldCacheASTInMemory=false)
Write a precompiled header for the given semantic analysis.
unsigned getDeclParmVarAbbrev() const
void AddEmittedDeclRef(const Decl *D, RecordDataImpl &Record)
void AddSourceRange(SourceRange Range, RecordDataImpl &Record, LocSeq *Seq=nullptr)
Emit a source range.
unsigned getBinaryOperatorAbbrev() const
unsigned getDeclTemplateTypeParmAbbrev() const
bool isWritingStdCXXNamedModules() const
ArrayRef< uint64_t > RecordDataRef
void EmitRecordWithPath(unsigned Abbrev, RecordDataRef Record, StringRef Path)
Emit the current record with the given path as a blob.
void AddFileID(FileID FID, RecordDataImpl &Record)
Emit a FileID.
unsigned getDeclObjCIvarAbbrev() const
unsigned getExprImplicitCastAbbrev() const
bool isDeclPredefined(const Decl *D) const
unsigned getDeclTypedefAbbrev() const
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
void AddPath(StringRef Path, RecordDataImpl &Record)
Add a path to the given record.
SmallVectorImpl< uint64_t > RecordDataImpl
unsigned getDeclUsingShadowAbbrev() const
unsigned getTypeExtQualAbbrev() const
void AddVersionTuple(const VersionTuple &Version, RecordDataImpl &Record)
Add a version tuple to the given record.
bool isGeneratingReducedBMI() const
uint32_t getMacroDirectivesOffset(const IdentifierInfo *Name)
unsigned getDeclVarAbbrev() const
unsigned getDeclEnumAbbrev() const
void AddAlignPackInfo(const Sema::AlignPackInfo &Info, RecordDataImpl &Record)
Emit a AlignPackInfo.
bool IsLocalDecl(const Decl *D)
Is this a local declaration (that is, one that will be written to our AST file)? This is the case for...
unsigned getDeclRefExprAbbrev() const
unsigned getCXXOperatorCallExprAbbrev()
bool wasDeclEmitted(const Decl *D) const
Whether or not the declaration got emitted.
void AddString(StringRef Str, RecordDataImpl &Record)
Add a string to the given record.
time_t getTimestampForOutput(const FileEntry *E) const
Get a timestamp for output into the AST file.
void ClearSwitchCaseIDs()
bool isWritingModule() const
LocalDeclID GetDeclRef(const Decl *D)
Force a declaration to be emitted and get its local ID to the module file been writing.
LocalDeclID getDeclID(const Decl *D)
Determine the local declaration ID of an already-emitted declaration.
void AddIdentifierRef(const IdentifierInfo *II, RecordDataImpl &Record)
Emit a reference to an identifier.
serialization::TypeID GetOrCreateTypeID(QualType T)
Force a type to be emitted and get its ID.
serialization::MacroID getMacroRef(MacroInfo *MI, const IdentifierInfo *Name)
Get the unique number used to refer to the given macro.
void AddSourceLocation(SourceLocation Loc, RecordDataImpl &Record, LocSeq *Seq=nullptr)
Emit a source location.
void AddTypeRef(QualType T, RecordDataImpl &Record)
Emit a reference to a type.
ASTContext & getASTContext() const
unsigned getCXXMemberCallExprAbbrev()
ASTReader * getChain() const
unsigned getCompoundAssignOperatorAbbrev() const
bool getDoneWritingDeclsAndTypes() const
serialization::IdentifierID getIdentifierRef(const IdentifierInfo *II)
Get the unique number used to refer to the given identifier.
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
unsigned getCharacterLiteralAbbrev() const
unsigned getDeclCXXMethodAbbrev(FunctionDecl::TemplatedKind Kind) const
void handleVTable(CXXRecordDecl *RD)
unsigned getCompoundStmtAbbrev() const
unsigned getLocalOrImportedSubmoduleID(const Module *Mod)
Retrieve or create a submodule ID for this module, or return 0 if the submodule is neither local (a s...
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
serialization::SelectorID getSelectorRef(Selector Sel)
Get the unique number used to refer to the given selector.
SourceLocationEncoding::RawLocEncoding getRawSourceLocationEncoding(SourceLocation Loc, LocSeq *Seq=nullptr)
Return the raw encodings for source locations.
ASTWriter(llvm::BitstreamWriter &Stream, SmallVectorImpl< char > &Buffer, InMemoryModuleCache &ModuleCache, ArrayRef< std::shared_ptr< ModuleFileExtension > > Extensions, bool IncludeTimestamps=true, bool BuildingImplicitModule=false, bool GeneratingReducedBMI=false)
Create a new precompiled header writer that outputs to the given bitstream.
SmallVector< uint64_t, 64 > RecordData
unsigned getAnonymousDeclarationNumber(const NamedDecl *D)
unsigned getDeclFieldAbbrev() const
const LangOptions & getLangOpts() const
void SetSelectorOffset(Selector Sel, uint32_t Offset)
Note that the selector Sel occurs at the given offset within the method pool/selector table.
bool PreparePathForOutput(SmallVectorImpl< char > &Path)
Convert a path from this build process into one that is appropriate for emission in the module file.
unsigned getCallExprAbbrev() const
void SetIdentifierOffset(const IdentifierInfo *II, uint32_t Offset)
Note that the identifier II occurs at the given offset within the identifier table.
unsigned getDeclRecordAbbrev() const
void AddDeclRef(const Decl *D, RecordDataImpl &Record)
Emit a reference to a declaration.
unsigned getIntegerLiteralAbbrev() const
Attr - This represents one attribute.
A simple helper class to pack several bits in order into (a) 32 bit integer(s).
bool canWriteNextNBits(uint32_t BitsWidth) const
BitsPacker operator=(BitsPacker &&)=delete
BitsPacker(BitsPacker &&)=delete
void addBits(uint32_t Value, uint32_t BitsWidth)
void reset(uint32_t Value)
BitsPacker(const BitsPacker &)=delete
BitsPacker operator=(const BitsPacker &)=delete
void HandleTranslationUnit(ASTContext &Ctx) override
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been par...
virtual Module * getEmittingModule(ASTContext &Ctx) override
CXX20ModulesGenerator(Preprocessor &PP, InMemoryModuleCache &ModuleCache, StringRef OutputFile)
Represents a C++ destructor within a class.
Represents a C++ struct/union/class.
Declaration of a class template.
Represents a class template specialization, which refers to a class template with a given set of temp...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
Concrete class used by the front-end to report problems and issues.
This represents one expression.
Represents a member of a struct/union/class.
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...
Represents a function declaration or definition.
TemplatedKind
The kind of templated function a FunctionDecl can be.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
Declaration of a template function.
One of these records is kept for each identifier that is lexed.
In-memory cache for modules.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Record the location of a macro definition.
Encapsulates the data about a macro definition (e.g.
Describes a module or submodule.
bool isNamedModule() const
Does this Module is a named module of a standard named module?
This represents a decl that may have a name.
Represent a C++ namespace.
ObjCCategoryDecl - Represents a category declaration.
Represents an ObjC class declaration.
AST and semantic-analysis consumer that generates a precompiled header from the parsed source code.
ASTMutationListener * GetASTMutationListener() override
If the consumer is interested in entities getting modified after their initial creation,...
PCHBuffer * getBufferPtr()
Preprocessor & getPreprocessor()
virtual Module * getEmittingModule(ASTContext &Ctx)
SmallVectorImpl< char > & getPCH() const
void InitializeSema(Sema &S) override
Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on th...
StringRef getOutputFile() const
void HandleVTable(CXXRecordDecl *RD) override
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given...
ASTDeserializationListener * GetASTDeserializationListener() override
If the consumer is interested in entities being deserialized from AST files, it should return a point...
const ASTWriter & getWriter() const
void HandleTranslationUnit(ASTContext &Ctx) override
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been par...
bool hasEmittedPCH() const
DiagnosticsEngine & getDiagnostics() const
Represents a parameter to a function.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
A (possibly-)qualified type.
static QualType getFromOpaquePtr(const void *Ptr)
Represents a struct/union/class.
ReducedBMIGenerator(Preprocessor &PP, InMemoryModuleCache &ModuleCache, StringRef OutputFile)
Smart pointer class that efficiently represents Objective-C method names.
An abstract interface that should be implemented by clients that read ASTs and then require further s...
Sema - This implements semantic analysis and AST building for C.
DiagnosticsEngine & getDiagnostics() const
Serialized encoding of a sequence of SourceLocations.
Encodes a location in the source.
static SourceLocation getFromRawEncoding(UIntTy Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
A trivial tuple used to represent a source range.
Represents the declaration of a struct/union/class/enum.
Token - This structure provides full information about a lexed token.
The top declaration context.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
Declaration of a variable template.
Represents a variable template specialization, which refers to a variable template with a given set o...
A type index; the type ID with the qualifier bits removed.
const unsigned NUM_PREDEF_TYPE_IDS
The number of predefined type IDs that are reserved for the PREDEF_TYPE_* constants.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
uint64_t TypeID
An ID number that refers to a type in an AST file.
const unsigned int NUM_PREDEF_IDENT_IDS
The number of predefined identifier IDs.
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
uint32_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
const unsigned int NUM_PREDEF_SUBMODULE_IDS
The number of predefined submodule IDs.
const unsigned int NUM_PREDEF_SELECTOR_IDS
The number of predefined selector IDs.
uint64_t IdentifierID
An ID number that refers to an identifier in an AST file.
const unsigned int NUM_PREDEF_MACRO_IDS
The number of predefined macro IDs.
uint32_t MacroID
An ID number that refers to a macro in an AST file.
The JSON file list parser is used to communicate input to InstallAPI.
@ Seq
'seq' clause, allowed on 'loop' and 'routine' directives.
@ Delete
'delete' clause, allowed on the 'exit data' construct.
const unsigned int NUM_PREDEF_DECL_IDS
The number of declaration IDs that are predefined.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
PredefinedDeclIDs
Predefined declaration IDs.
@ Result
The result type of a method or function.
bool CanElideDeclDef(const Decl *D)
If we can elide the definition of.
const FunctionProtoType * T
The signature of a module, which is a hash of the AST content.
A structure for putting "fast"-unqualified QualTypes into a DenseMap.