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"
55class FPOptionsOverride;
58class HeaderSearchOptions;
59class IdentifierResolver;
61class MacroDefinitionRecord;
65class ModuleFileExtension;
66class ModuleFileExtensionWriter;
68class ObjCInterfaceDecl;
69class PreprocessingRecord;
79struct VisibleLookupBlockOffsets;
80struct LookupBlockOffsets;
82namespace serialization {
120 llvm::BitstreamWriter &Stream;
137 Module *WritingModule =
nullptr;
140 std::pair<uint64_t, uint64_t> UnhashedControlBlockRange;
142 uint64_t ASTBlockHashOffset = 0;
144 uint64_t SignatureOffset = 0;
147 uint64_t ASTBlockStartOffset = 0;
150 std::pair<uint64_t, uint64_t> ASTBlockRange;
153 std::string BaseDirectory;
159 bool IncludeTimestamps;
164 bool BuildingImplicitModule =
false;
168 bool WritingAST =
false;
172 bool DoneWritingDeclsAndTypes =
false;
175 bool ASTHasCompilerErrors =
false;
179 bool GeneratingReducedBMI =
false;
183 llvm::DenseMap<const FileEntry *, uint32_t> InputFileIDs;
188 DeclOrType(
Decl *
D) : Stored(
D), IsType(
false) {}
189 DeclOrType(
QualType T) : Stored(
T.getAsOpaquePtr()), IsType(
true) {}
191 bool isType()
const {
return IsType; }
192 bool isDecl()
const {
return !IsType; }
195 assert(isType() &&
"Not a type!");
199 Decl *getDecl()
const {
200 assert(isDecl() &&
"Not a decl!");
201 return static_cast<Decl *
>(Stored);
210 std::queue<DeclOrType> DeclTypesToEmit;
234 llvm::DenseMap<const Decl *, LocalDeclID> DeclIDs;
246 llvm::DenseMap<LocalDeclID, SmallVector<LocalDeclID, 4>> RelatedDeclsMap;
250 std::vector<serialization::DeclOffset> DeclOffsets;
254 uint64_t DeclTypesBlockStartOffset = 0;
258 struct DeclIDInFileInfo {
259 LocDeclIDsTy DeclIDs;
263 unsigned FirstDeclIndex;
265 using FileDeclIDsTy =
266 llvm::DenseMap<FileID, std::unique_ptr<DeclIDInFileInfo>>;
270 FileDeclIDsTy FileDeclIDs;
272 void associateDeclWithFile(
const Decl *
D, LocalDeclID);
293 std::vector<serialization::UnalignedUInt64> TypeOffsets;
307 llvm::MapVector<const IdentifierInfo *, serialization::IdentifierID> IdentifierIDs;
316 llvm::DenseMap<MacroInfo *, serialization::MacroID> MacroIDs;
318 struct MacroInfoToEmitData {
319 const IdentifierInfo *Name;
325 std::vector<MacroInfoToEmitData> MacroInfosToEmit;
327 llvm::DenseMap<const IdentifierInfo *, uint32_t>
328 IdentMacroDirectivesOffsetMap;
334 llvm::DenseSet<Stmt *> ParentStmts;
338 llvm::DenseMap<Stmt *, uint64_t> SubStmtEntries;
344 std::vector<uint32_t> IdentifierOffsets;
361 llvm::MapVector<Selector, serialization::SelectorID> SelectorIDs;
365 std::vector<uint32_t> SelectorOffsets;
369 llvm::DenseMap<
const MacroDefinitionRecord *,
374 llvm::DenseMap<const Decl *, unsigned> AnonymousDeclarationNumbers;
381 llvm::SetVector<Module *> TouchedTopLevelModules;
382 llvm::SetVector<serialization::ModuleFile *> TouchedModuleFiles;
393 const Attr *Attribute;
409 :
Kind(
Kind), Attribute(Attribute) {}
412 const Decl *getDecl()
const {
return Dcl; }
415 SourceLocation getLoc()
const {
419 unsigned getNumber()
const {
return Val; }
420 Module *getModule()
const {
return Mod; }
421 const Attr *getAttr()
const {
return Attribute; }
424 using UpdateRecord = SmallVector<DeclUpdate, 1>;
425 using DeclUpdateMap = llvm::MapVector<const Decl *, UpdateRecord>;
429 DeclUpdateMap DeclUpdates;
434 DeclUpdateMap DeclUpdatesFromGMF;
438 using SpecializationUpdateMap =
439 llvm::MapVector<const NamedDecl *, SmallVector<const Decl *>>;
440 SpecializationUpdateMap SpecializationsUpdates;
441 SpecializationUpdateMap PartialSpecializationsUpdates;
443 using FirstLatestDeclMap = llvm::DenseMap<Decl *, Decl *>;
447 FirstLatestDeclMap FirstLatestDecls;
475 SmallVector<const Decl *, 16> DeclsToEmitEvenIfUnreferenced;
479 llvm::SetVector<ObjCInterfaceDecl *> ObjCClassesWithCategories;
487 llvm::DenseMap<const Decl *, const Decl *> FirstLocalDeclCache;
490 llvm::DenseMap<SwitchCase *, unsigned> SwitchCaseIDs;
493 unsigned NumStatements = 0;
496 unsigned NumMacros = 0;
500 unsigned NumLexicalDeclContexts = 0;
504 unsigned NumVisibleDeclContexts = 0;
508 unsigned NumModuleLocalDeclContexts = 0;
511 unsigned NumTULocalDeclContexts = 0;
515 llvm::DenseMap<const Module *, unsigned> SubmoduleIDs;
518 std::vector<std::unique_ptr<ModuleFileExtensionWriter>>
519 ModuleFileExtensionWriters;
522 llvm::BitVector IsSLocAffecting;
525 llvm::BitVector IsSLocFileEntryAffecting;
528 std::vector<FileID> NonAffectingFileIDs;
529 std::vector<unsigned> NonAffectingFileIDAdjustments;
532 std::vector<SourceRange> NonAffectingRanges;
533 std::vector<SourceLocation::UIntTy> NonAffectingOffsetAdjustments;
542 void computeNonAffectingInputFiles();
546 SourceLocation getAffectingIncludeLoc(
const SourceManager &SourceMgr,
547 const SrcMgr::FileInfo &
File);
551 FileID getAdjustedFileID(FileID FID)
const;
554 unsigned getAdjustedNumCreatedFIDs(FileID FID)
const;
557 SourceLocation getAdjustedLocation(SourceLocation
Loc)
const;
560 SourceRange getAdjustedRange(SourceRange
Range)
const;
569 unsigned getSubmoduleID(Module *Mod);
572 void WriteSubStmt(ASTContext &Context, Stmt *S);
574 void WriteBlockInfoBlock();
575 void WriteControlBlock(Preprocessor &PP, StringRef isysroot);
578 void writeUnhashedControlBlock(Preprocessor &PP);
579 ASTFileSignature backpatchSignature();
582 std::pair<ASTFileSignature, ASTFileSignature> createSignature()
const;
583 ASTFileSignature createSignatureForNamedModule()
const;
585 void WriteInputFiles(SourceManager &SourceMgr);
586 void WriteSourceManagerBlock(SourceManager &SourceMgr);
587 void WritePreprocessor(
const Preprocessor &PP,
bool IsModule);
588 void WriteHeaderSearch(
const HeaderSearch &HS);
589 void WritePreprocessorDetail(PreprocessingRecord &PPRec,
590 uint64_t MacroOffsetsBase);
591 void WriteSubmodules(Module *WritingModule, ASTContext *Context);
593 void WritePragmaDiagnosticMappings(
const DiagnosticsEngine &
Diag,
596 unsigned TypeExtQualAbbrev = 0;
597 void WriteTypeAbbrevs();
598 void WriteType(ASTContext &Context, QualType
T);
600 void GenerateSpecializationInfoLookupTable(
603 uint64_t WriteSpecializationInfoLookupTable(
607 GenerateNameLookupTable(ASTContext &Context,
const DeclContext *DC,
611 uint64_t WriteDeclContextLexicalBlock(ASTContext &Context,
612 const DeclContext *DC);
613 void WriteDeclContextVisibleBlock(ASTContext &Context, DeclContext *DC,
614 VisibleLookupBlockOffsets &Offsets);
615 void WriteTypeDeclOffsets();
616 void WriteFileDeclIDsMap();
617 void WriteComments(ASTContext &Context);
618 void WriteSelectors(Sema &SemaRef);
619 void WriteReferencedSelectorsPool(Sema &SemaRef);
620 void WriteIdentifierTable(Preprocessor &PP, IdentifierResolver *IdResolver,
622 void WriteDeclAndTypes(ASTContext &Context);
623 void PrepareWritingSpecialDecls(Sema &SemaRef);
624 void WriteSpecialDeclRecords(Sema &SemaRef);
625 void WriteSpecializationsUpdates(
bool IsPartial);
626 void WriteDeclUpdatesBlocks(ASTContext &Context,
628 void WriteDeclContextVisibleUpdate(ASTContext &Context,
629 const DeclContext *DC);
630 void WriteFPPragmaOptions(
const FPOptionsOverride &Opts);
631 void WriteOpenCLExtensions(Sema &SemaRef);
632 void WriteCUDAPragmas(Sema &SemaRef);
633 void WriteObjCCategories();
634 void WriteLateParsedTemplates(Sema &SemaRef);
635 void WriteOptimizePragmaOptions(Sema &SemaRef);
636 void WriteMSStructPragmaOptions(Sema &SemaRef);
637 void WriteMSPointersToMembersPragmaOptions(Sema &SemaRef);
638 void WritePackPragmaOptions(Sema &SemaRef);
639 void WriteFloatControlPragmaOptions(Sema &SemaRef);
640 void WriteDeclsWithEffectsToVerify(Sema &SemaRef);
641 void WriteModuleFileExtension(Sema &SemaRef,
642 ModuleFileExtensionWriter &Writer);
644 unsigned DeclParmVarAbbrev = 0;
645 unsigned DeclContextLexicalAbbrev = 0;
646 unsigned DeclContextVisibleLookupAbbrev = 0;
647 unsigned DeclModuleLocalVisibleLookupAbbrev = 0;
648 unsigned DeclTULocalLookupAbbrev = 0;
649 unsigned UpdateVisibleAbbrev = 0;
650 unsigned ModuleLocalUpdateVisibleAbbrev = 0;
651 unsigned TULocalUpdateVisibleAbbrev = 0;
652 unsigned DeclRecordAbbrev = 0;
653 unsigned DeclTypedefAbbrev = 0;
654 unsigned DeclVarAbbrev = 0;
655 unsigned DeclFieldAbbrev = 0;
656 unsigned DeclEnumAbbrev = 0;
657 unsigned DeclObjCIvarAbbrev = 0;
658 unsigned DeclCXXMethodAbbrev = 0;
659 unsigned DeclSpecializationsAbbrev = 0;
660 unsigned DeclPartialSpecializationsAbbrev = 0;
662 unsigned DeclDependentNonTemplateCXXMethodAbbrev = 0;
663 unsigned DeclTemplateCXXMethodAbbrev = 0;
664 unsigned DeclMemberSpecializedCXXMethodAbbrev = 0;
665 unsigned DeclTemplateSpecializedCXXMethodAbbrev = 0;
666 unsigned DeclDependentSpecializationCXXMethodAbbrev = 0;
667 unsigned DeclTemplateTypeParmAbbrev = 0;
668 unsigned DeclUsingShadowAbbrev = 0;
670 unsigned DeclRefExprAbbrev = 0;
671 unsigned CharacterLiteralAbbrev = 0;
672 unsigned IntegerLiteralAbbrev = 0;
673 unsigned ExprImplicitCastAbbrev = 0;
674 unsigned BinaryOperatorAbbrev = 0;
675 unsigned CompoundAssignOperatorAbbrev = 0;
676 unsigned CallExprAbbrev = 0;
677 unsigned CXXOperatorCallExprAbbrev = 0;
678 unsigned CXXMemberCallExprAbbrev = 0;
680 unsigned CompoundStmtAbbrev = 0;
682 void WriteDeclAbbrevs();
683 void WriteDecl(ASTContext &Context, Decl *
D);
685 ASTFileSignature WriteASTCore(Sema *SemaPtr, StringRef isysroot,
686 Module *WritingModule);
691 ASTWriter(llvm::BitstreamWriter &Stream, SmallVectorImpl<char> &Buffer,
692 ModuleCache &ModCache,
const CodeGenOptions &CodeGenOpts,
693 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
694 bool IncludeTimestamps =
true,
bool BuildingImplicitModule =
false,
695 bool GeneratingReducedBMI =
false);
724 StringRef OutputFile,
Module *WritingModule,
726 bool ShouldCacheASTInMemory =
false);
776 if (
D->isFromASTFile())
778 auto I = DeclIDs.find(
D);
852 return TypeExtQualAbbrev;
865 return DeclCXXMethodAbbrev;
867 return DeclTemplateCXXMethodAbbrev;
869 return DeclMemberSpecializedCXXMethodAbbrev;
871 return DeclTemplateSpecializedCXXMethodAbbrev;
873 return DeclDependentNonTemplateCXXMethodAbbrev;
875 return DeclDependentSpecializationCXXMethodAbbrev;
877 llvm_unreachable(
"Unknwon Template Kind!");
880 return DeclTemplateTypeParmAbbrev;
890 return CompoundAssignOperatorAbbrev;
916 return PredefinedDecls.count(
D);
925 void ReaderInitialized(
ASTReader *Reader)
override;
936 void CompletedTagDefinition(
const TagDecl *
D)
override;
939 void AddedCXXTemplateSpecialization(
942 void AddedCXXTemplateSpecialization(
947 void ResolvedExceptionSpec(
const FunctionDecl *FD)
override;
951 Expr *ThisArg)
override;
952 void CompletedImplicitDefinition(
const FunctionDecl *
D)
override;
953 void InstantiationRequested(
const ValueDecl *
D)
override;
954 void VariableDefinitionInstantiated(
const VarDecl *
D)
override;
955 void FunctionDefinitionInstantiated(
const FunctionDecl *
D)
override;
956 void DefaultArgumentInstantiated(
const ParmVarDecl *
D)
override;
957 void DefaultMemberInitializerInstantiated(
const FieldDecl *
D)
override;
960 void DeclarationMarkedUsed(
const Decl *
D)
override;
961 void DeclarationMarkedOpenMPThreadPrivate(
const Decl *
D)
override;
962 void DeclarationMarkedOpenMPDeclareTarget(
const Decl *
D,
964 void DeclarationMarkedOpenMPAllocate(
const Decl *
D,
const Attr *A)
override;
966 void AddedAttributeToRecord(
const Attr *
Attr,
968 void EnteringModulePurview()
override;
969 void AddedManglingNumber(
const Decl *
D,
unsigned)
override;
970 void AddedStaticLocalNumbers(
const Decl *
D,
unsigned)
override;
978 void anchor()
override;
981 llvm::PointerUnion<Sema *, Preprocessor *> Subject;
982 std::string OutputFile;
983 std::string isysroot;
984 std::shared_ptr<PCHBuffer> Buffer;
985 llvm::BitstreamWriter Stream;
987 bool AllowASTWithErrors;
988 bool ShouldCacheASTInMemory;
1005 StringRef isysroot, std::shared_ptr<PCHBuffer> Buffer,
1007 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
1008 bool AllowASTWithErrors =
false,
bool IncludeTimestamps =
true,
1009 bool BuildingImplicitModule =
false,
1010 bool ShouldCacheASTInMemory =
false,
1011 bool GeneratingReducedBMI =
false);
1023 void anchor()
override;
1030 bool GeneratingReducedBMI,
bool AllowASTWithErrors);
1035 bool AllowASTWithErrors =
false)
1038 AllowASTWithErrors) {}
1044 void anchor()
override;
1049 bool AllowASTWithErrors =
false)
1052 AllowASTWithErrors) {}
1064 constexpr static uint32_t BitIndexUpbound = 32u;
1075 return CurrentBitIndex + BitsWidth < BitIndexUpbound;
1079 UnderlyingValue =
Value;
1080 CurrentBitIndex = 0;
1085 assert(BitsWidth < BitIndexUpbound);
1086 assert((
Value < (1u << BitsWidth)) &&
"Passing narrower bit width!");
1088 "Inserting too much bits into a value!");
1090 UnderlyingValue |=
Value << CurrentBitIndex;
1091 CurrentBitIndex += BitsWidth;
1094 operator uint32_t() {
return UnderlyingValue; }
1097 uint32_t UnderlyingValue = 0;
1098 uint32_t CurrentBitIndex = 0;
enum clang::sema::@1840::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.
unsigned getDeclParmVarAbbrev() const
void AddEmittedDeclRef(const Decl *D, RecordDataImpl &Record)
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.
void AddPathBlob(StringRef Str, RecordDataImpl &Record, SmallVectorImpl< char > &Blob)
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
void AddTypeRef(ASTContext &Context, QualType T, RecordDataImpl &Record)
Emit a reference to a type.
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.
void AddSourceRange(SourceRange Range, RecordDataImpl &Record)
Emit a source range.
LocalDeclID getDeclID(const Decl *D)
Determine the local declaration ID of an already-emitted declaration.
void AddSourceLocation(SourceLocation Loc, RecordDataImpl &Record)
Emit a source location.
void addTouchedModuleFile(serialization::ModuleFile *)
void AddIdentifierRef(const IdentifierInfo *II, RecordDataImpl &Record)
Emit a reference to an identifier.
const CodeGenOptions & getCodeGenOpts() const
serialization::MacroID getMacroRef(MacroInfo *MI, const IdentifierInfo *Name)
Get the unique number used to refer to the given macro.
SourceLocationEncoding::RawLocEncoding getRawSourceLocationEncoding(SourceLocation Loc)
Return the raw encodings for source locations.
unsigned getCXXMemberCallExprAbbrev()
ASTFileSignature WriteAST(llvm::PointerUnion< Sema *, Preprocessor * > Subject, StringRef OutputFile, Module *WritingModule, StringRef isysroot, bool ShouldCacheASTInMemory=false)
Write a precompiled header or a module with the AST produced by the Sema object, or a dependency scan...
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.
ASTWriter(llvm::BitstreamWriter &Stream, SmallVectorImpl< char > &Buffer, ModuleCache &ModCache, const CodeGenOptions &CodeGenOpts, 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.
unsigned getCharacterLiteralAbbrev() const
unsigned getDeclCXXMethodAbbrev(FunctionDecl::TemplatedKind Kind) const
void handleVTable(CXXRecordDecl *RD)
bool isWritingStdCXXHeaderUnit() const
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.
void AddLookupOffsets(const LookupBlockOffsets &Offsets, RecordDataImpl &Record)
serialization::SelectorID getSelectorRef(Selector Sel)
Get the unique number used to refer to the given selector.
SmallVector< uint64_t, 64 > RecordData
serialization::TypeID GetOrCreateTypeID(ASTContext &Context, QualType T)
Force a type to be emitted and get its ID.
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.
void AddStringBlob(StringRef Str, RecordDataImpl &Record, SmallVectorImpl< char > &Blob)
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, ModuleCache &ModCache, StringRef OutputFile, const CodeGenOptions &CodeGenOpts, bool AllowASTWithErrors=false)
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...
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
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.
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.
The module cache used for compiling modules implicitly.
Describes a module or submodule.
bool isHeaderUnit() const
Is this module a header unit.
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,...
void InitializeSema(Sema &S) override
Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on th...
PCHBuffer * getBufferPtr()
Preprocessor & getPreprocessor()
virtual Module * getEmittingModule(ASTContext &Ctx)
SmallVectorImpl< char > & getPCH() const
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, ModuleCache &ModCache, StringRef OutputFile, const CodeGenOptions &CodeGenOpts, bool AllowASTWithErrors=false)
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.
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...
Information about a module that has been loaded by the ASTReader.
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.
std::variant< struct RequiresDecl, struct HeaderDecl, struct UmbrellaDirDecl, struct ModuleDecl, struct ExcludeDecl, struct ExportDecl, struct ExportAsDecl, struct ExternModuleDecl, struct UseDecl, struct LinkDecl, struct ConfigMacrosDecl, struct ConflictDecl > Decl
All declarations that can appear in a module declaration.
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.
@ Delete
'delete' clause, allowed on the 'exit data' construct.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
PredefinedDeclIDs
Predefined declaration IDs.
@ NUM_PREDEF_DECL_IDS
The number of declaration IDs that are predefined.
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.