14 #ifndef LLVM_CLANG_SERIALIZATION_ASTWRITER_H
15 #define LLVM_CLANG_SERIALIZATION_ASTWRITER_H
25 #include "llvm/ADT/DenseMap.h"
26 #include "llvm/ADT/DenseSet.h"
27 #include "llvm/ADT/MapVector.h"
28 #include "llvm/ADT/SetVector.h"
29 #include "llvm/ADT/SmallPtrSet.h"
30 #include "llvm/ADT/SmallVector.h"
31 #include "llvm/Bitcode/BitstreamWriter.h"
39 class BitstreamWriter;
46 class NestedNameSpecifier;
47 class CXXBaseSpecifier;
48 class CXXCtorInitializer;
52 class HeaderSearchOptions;
53 class IdentifierResolver;
54 class MacroDefinitionRecord;
57 class OpaqueValueExpr;
61 class ModuleFileExtension;
62 class ModuleFileExtensionWriter;
63 class PreprocessedEntity;
64 class PreprocessingRecord;
69 struct StoredDeclsList;
74 class ASTUnresolvedSet;
76 namespace SrcMgr {
class SLocEntry; }
110 llvm::BitstreamWriter &Stream;
125 std::string BaseDirectory;
131 bool IncludeTimestamps;
139 bool DoneWritingDeclsAndTypes;
142 bool ASTHasCompilerErrors;
146 llvm::DenseMap<const FileEntry *, uint32_t> InputFileIDs;
151 DeclOrType(
Decl *D) : Stored(D), IsType(
false) { }
152 DeclOrType(
QualType T) : Stored(T.getAsOpaquePtr()), IsType(
true) { }
154 bool isType()
const {
return IsType; }
155 bool isDecl()
const {
return !IsType; }
157 QualType getType()
const {
158 assert(isType() &&
"Not a type!");
162 Decl *getDecl()
const {
163 assert(isDecl() &&
"Not a decl!");
164 return static_cast<Decl *
>(Stored);
173 std::queue<DeclOrType> DeclTypesToEmit;
187 llvm::DenseMap<const Decl *, serialization::DeclID> DeclIDs;
191 std::vector<serialization::DeclOffset> DeclOffsets;
194 typedef SmallVector<std::pair<unsigned, serialization::DeclID>, 64>
196 struct DeclIDInFileInfo {
197 LocDeclIDsTy DeclIDs;
200 unsigned FirstDeclIndex;
202 typedef llvm::DenseMap<FileID, DeclIDInFileInfo *> FileDeclIDsTy;
206 FileDeclIDsTy FileDeclIDs;
229 std::vector<uint32_t> TypeOffsets;
243 llvm::MapVector<const IdentifierInfo *, serialization::IdentID> IdentifierIDs;
252 llvm::DenseMap<MacroInfo *, serialization::MacroID> MacroIDs;
254 struct MacroInfoToEmitData {
255 const IdentifierInfo *
Name;
260 std::vector<MacroInfoToEmitData> MacroInfosToEmit;
262 llvm::DenseMap<const IdentifierInfo *, uint64_t> IdentMacroDirectivesOffsetMap;
272 llvm::DenseMap<Stmt *, uint64_t> SubStmtEntries;
278 std::vector<uint32_t> IdentifierOffsets;
293 llvm::MapVector<Selector, serialization::SelectorID> SelectorIDs;
297 std::vector<uint32_t> SelectorOffsets;
301 llvm::DenseMap<
const MacroDefinitionRecord *,
306 llvm::DenseMap<const Decl *, unsigned> AnonymousDeclarationNumbers;
318 const Attr *Attribute;
322 DeclUpdate(
unsigned Kind) : Kind(Kind), Dcl(nullptr) {}
323 DeclUpdate(
unsigned Kind,
const Decl *Dcl) : Kind(Kind), Dcl(Dcl) {}
324 DeclUpdate(
unsigned Kind, QualType Type)
325 : Kind(Kind), Type(Type.getAsOpaquePtr()) {}
326 DeclUpdate(
unsigned Kind, SourceLocation Loc)
327 : Kind(Kind), Loc(Loc.getRawEncoding()) {}
328 DeclUpdate(
unsigned Kind,
unsigned Val)
329 : Kind(Kind), Val(Val) {}
330 DeclUpdate(
unsigned Kind, Module *M)
331 : Kind(Kind), Mod(M) {}
332 DeclUpdate(
unsigned Kind,
const Attr *Attribute)
333 : Kind(Kind), Attribute(Attribute) {}
336 const Decl *getDecl()
const {
return Dcl; }
338 SourceLocation getLoc()
const {
341 unsigned getNumber()
const {
return Val; }
342 Module *getModule()
const {
return Mod; }
343 const Attr *getAttr()
const {
return Attribute; }
346 typedef SmallVector<DeclUpdate, 1> UpdateRecord;
347 typedef llvm::MapVector<const Decl *, UpdateRecord> DeclUpdateMap;
350 DeclUpdateMap DeclUpdates;
352 typedef llvm::DenseMap<Decl *, Decl *> FirstLatestDeclMap;
355 FirstLatestDeclMap FirstLatestDecls;
368 SmallVector<uint64_t, 16> EagerlyDeserializedDecls;
381 SmallVector<const Decl *, 16> UpdatingVisibleDecls;
385 llvm::SetVector<ObjCInterfaceDecl *> ObjCClassesWithCategories;
393 llvm::DenseMap<const Decl *, const Decl *> FirstLocalDeclCache;
396 llvm::DenseMap<SwitchCase *, unsigned> SwitchCaseIDs;
399 unsigned NumStatements;
406 unsigned NumLexicalDeclContexts;
410 unsigned NumVisibleDeclContexts;
414 llvm::DenseMap<Module *, unsigned> SubmoduleIDs;
417 std::vector<std::unique_ptr<ModuleFileExtensionWriter>>
418 ModuleFileExtensionWriters;
421 unsigned getSubmoduleID(Module *Mod);
424 void WriteSubStmt(
Stmt *
S);
426 void WriteBlockInfoBlock();
427 uint64_t WriteControlBlock(Preprocessor &PP,
ASTContext &Context,
428 StringRef isysroot,
const std::string &OutputFile);
429 void WriteInputFiles(SourceManager &SourceMgr, HeaderSearchOptions &HSOpts,
431 void WriteSourceManagerBlock(SourceManager &SourceMgr,
432 const Preprocessor &PP);
433 void WritePreprocessor(
const Preprocessor &PP,
bool IsModule);
434 void WriteHeaderSearch(
const HeaderSearch &HS);
435 void WritePreprocessorDetail(PreprocessingRecord &PPRec);
436 void WriteSubmodules(Module *WritingModule);
438 void WritePragmaDiagnosticMappings(
const DiagnosticsEngine &
Diag,
441 unsigned TypeExtQualAbbrev;
442 unsigned TypeFunctionProtoAbbrev;
443 void WriteTypeAbbrevs();
444 void WriteType(QualType T);
446 bool isLookupResultExternal(StoredDeclsList &
Result, DeclContext *DC);
447 bool isLookupResultEntirelyExternal(StoredDeclsList &
Result, DeclContext *DC);
449 void GenerateNameLookupTable(
const DeclContext *DC,
451 uint64_t WriteDeclContextLexicalBlock(
ASTContext &Context, DeclContext *DC);
452 uint64_t WriteDeclContextVisibleBlock(
ASTContext &Context, DeclContext *DC);
453 void WriteTypeDeclOffsets();
454 void WriteFileDeclIDsMap();
455 void WriteComments();
456 void WriteSelectors(Sema &SemaRef);
457 void WriteReferencedSelectorsPool(Sema &SemaRef);
458 void WriteIdentifierTable(Preprocessor &PP, IdentifierResolver &IdResolver,
461 void WriteDeclContextVisibleUpdate(
const DeclContext *DC);
462 void WriteFPPragmaOptions(
const FPOptions &Opts);
463 void WriteOpenCLExtensions(Sema &SemaRef);
464 void WriteObjCCategories();
465 void WriteLateParsedTemplates(Sema &SemaRef);
466 void WriteOptimizePragmaOptions(Sema &SemaRef);
467 void WriteMSStructPragmaOptions(Sema &SemaRef);
468 void WriteMSPointersToMembersPragmaOptions(Sema &SemaRef);
469 void WriteModuleFileExtension(Sema &SemaRef,
470 ModuleFileExtensionWriter &Writer);
472 unsigned DeclParmVarAbbrev;
473 unsigned DeclContextLexicalAbbrev;
474 unsigned DeclContextVisibleLookupAbbrev;
475 unsigned UpdateVisibleAbbrev;
476 unsigned DeclRecordAbbrev;
477 unsigned DeclTypedefAbbrev;
478 unsigned DeclVarAbbrev;
479 unsigned DeclFieldAbbrev;
480 unsigned DeclEnumAbbrev;
481 unsigned DeclObjCIvarAbbrev;
482 unsigned DeclCXXMethodAbbrev;
484 unsigned DeclRefExprAbbrev;
485 unsigned CharacterLiteralAbbrev;
486 unsigned IntegerLiteralAbbrev;
487 unsigned ExprImplicitCastAbbrev;
489 void WriteDeclAbbrevs();
492 uint64_t WriteASTCore(Sema &SemaRef,
493 StringRef isysroot,
const std::string &OutputFile,
494 Module *WritingModule);
501 bool IncludeTimestamps =
true);
525 uint64_t
WriteAST(Sema &SemaRef,
const std::string &OutputFile,
526 Module *WritingModule, StringRef isysroot,
527 bool hasErrors =
false);
572 if (D->isFromASTFile())
574 auto I = DeclIDs.find(D);
575 return (
I == DeclIDs.end() ||
635 return TypeExtQualAbbrev;
638 return TypeFunctionProtoAbbrev;
660 void ReaderInitialized(
ASTReader *Reader)
override;
670 void CompletedTagDefinition(
const TagDecl *D)
override;
673 void ResolvedExceptionSpec(
const FunctionDecl *FD)
override;
677 void CompletedImplicitDefinition(
const FunctionDecl *D)
override;
678 void StaticDataMemberInstantiated(
const VarDecl *D)
override;
679 void DefaultArgumentInstantiated(
const ParmVarDecl *D)
override;
680 void FunctionDefinitionInstantiated(
const FunctionDecl *D)
override;
683 void DeclarationMarkedUsed(
const Decl *D)
override;
684 void DeclarationMarkedOpenMPThreadPrivate(
const Decl *D)
override;
685 void DeclarationMarkedOpenMPDeclareTarget(
const Decl *D,
687 void RedefinedHiddenDefinition(
const NamedDecl *D,
Module *M)
override;
688 void AddedAttributeToRecord(
const Attr *
Attr,
709 void FlushSubStmts();
711 void PrepareToEmit(uint64_t MyOffset) {
713 for (
unsigned I : OffsetIndices) {
714 auto &StoredOffset = (*Record)[
I];
715 assert(StoredOffset < MyOffset &&
"invalid offset");
717 StoredOffset = MyOffset - StoredOffset;
719 OffsetIndices.clear();
725 : Writer(&Writer), Record(&Record) {}
730 : Writer(Parent.Writer), Record(&Record) {}
742 template<
typename InputIterator>
744 Record->append(begin, end);
746 bool empty()
const {
return Record->empty(); }
747 size_t size()
const {
return Record->size(); }
754 uint64_t
Emit(
unsigned Code,
unsigned Abbrev = 0) {
755 uint64_t
Offset = Writer->Stream.GetCurrentBitNo();
756 PrepareToEmit(Offset);
757 Writer->Stream.EmitRecord(Code, *Record, Abbrev);
763 uint64_t
EmitStmt(
unsigned Code,
unsigned Abbrev = 0) {
765 PrepareToEmit(Writer->Stream.GetCurrentBitNo());
766 Writer->Stream.EmitRecord(Code, *Record, Abbrev);
767 return Writer->Stream.GetCurrentBitNo();
773 OffsetIndices.push_back(Record->size());
774 Record->push_back(BitOffset);
785 StmtsToEmit.push_back(S);
897 return Writer->
AddPath(Path, *Record);
913 std::string OutputFile;
915 std::string isysroot;
917 std::shared_ptr<PCHBuffer> Buffer;
918 llvm::BitstreamWriter Stream;
920 bool AllowASTWithErrors;
931 std::shared_ptr<PCHBuffer> Buffer,
933 bool AllowASTWithErrors =
false,
934 bool IncludeTimestamps =
true);
unsigned getDeclParmVarAbbrev() const
unsigned getAnonymousDeclarationNumber(const NamedDecl *D)
uint64_t getMacroDirectivesOffset(const IdentifierInfo *Name)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
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.
Smart pointer class that efficiently represents Objective-C method names.
A (possibly-)qualified type.
Represents a version number in the form major[.minor[.subminor[.build]]].
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
A structure for putting "fast"-unqualified QualTypes into a DenseMap.
unsigned getTypeExtQualAbbrev() const
void AddUnresolvedSet(const ASTUnresolvedSet &Set)
Emit a UnresolvedSet structure.
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
uint32_t IdentID
An ID number that refers to an identifier in an AST file.
const LangOptions & getLangOpts() const
void InitializeSema(Sema &S) override
Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on th...
uint64_t & operator[](size_t N)
unsigned getDeclRefExprAbbrev() const
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
serialization::DeclID GetDeclRef(const Decl *D)
Force a declaration to be emitted and get its ID.
A container of type source information.
void AddTypeRef(QualType T, RecordDataImpl &Record)
Emit a reference to a type.
uint64_t Emit(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, followed by its substatements, and return its offset.
serialization::MacroID getMacroRef(MacroInfo *MI, const IdentifierInfo *Name)
Get the unique number used to refer to the given macro.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
const unsigned int NUM_PREDEF_DECL_IDS
The number of declaration IDs that are predefined.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Stores a list of template parameters for a TemplateDecl and its derived classes.
serialization::IdentID getIdentifierRef(const IdentifierInfo *II)
Get the unique number used to refer to the given identifier.
ParmVarDecl - Represents a parameter to a function.
void AddString(StringRef Str)
Emit a string.
void AddSourceRange(SourceRange Range)
Emit a source range.
void AddIdentifierRef(const IdentifierInfo *II, RecordDataImpl &Record)
Emit a reference to an identifier.
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Base wrapper for a particular "section" of type source info.
RecordDecl - Represents a struct/union/class.
One of these records is kept for each identifier that is lexed.
ASTRecordWriter(ASTRecordWriter &Parent, ASTWriter::RecordDataImpl &Record)
Construct a ASTRecordWriter that uses the same encoding scheme as another ASTRecordWriter.
unsigned getDeclVarAbbrev() const
time_t getTimestampForOutput(const FileEntry *E) const
Get a timestamp for output into the AST file.
void AddTypeRef(QualType T)
Emit a reference to a type.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
unsigned getDeclRecordAbbrev() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
Record the location of a macro definition.
void HandleTranslationUnit(ASTContext &Ctx) override
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been par...
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
unsigned getDeclEnumAbbrev() const
void AddTemplateParameterList(const TemplateParameterList *TemplateParams)
Emit a template parameter list.
Describes a module or submodule.
void AddIdentifierRef(const IdentifierInfo *II)
Emit a reference to an identifier.
An abstract interface that should be implemented by clients that read ASTs and then require further s...
serialization::MacroID getMacroID(MacroInfo *MI)
Determine the ID of an already-emitted macro.
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
SmallVector< uint64_t, 64 > RecordData
void append(InputIterator begin, InputIterator end)
PCHGenerator(const Preprocessor &PP, StringRef OutputFile, clang::Module *Module, StringRef isysroot, std::shared_ptr< PCHBuffer > Buffer, ArrayRef< llvm::IntrusiveRefCntPtr< ModuleFileExtension >> Extensions, bool AllowASTWithErrors=false, bool IncludeTimestamps=true)
void AddSourceRange(SourceRange Range, RecordDataImpl &Record)
Emit a source range.
void AddCXXCtorInitializers(ArrayRef< CXXCtorInitializer * > CtorInits)
Emit a CXXCtorInitializer array.
void AddTypeLoc(TypeLoc TL)
Emits a type with source-location information.
void AddAttributes(ArrayRef< const Attr * > Attrs)
Emit a list of attributes.
unsigned getDeclObjCIvarAbbrev() const
Represents an ObjC class declaration.
detail::InMemoryDirectory::const_iterator I
serialization::TypeID getTypeID(QualType T) const
Determine the type ID of an already-emitted type.
serialization::SubmoduleID inferSubmoduleIDFromLocation(SourceLocation Loc)
Infer the submodule ID that contains an entity at the given source location.
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
Sema - This implements semantic analysis and AST building for C.
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
unsigned getCharacterLiteralAbbrev() 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.
ASTDeserializationListener * GetASTDeserializationListener() override
If the consumer is interested in entities being deserialized from AST files, it should return a point...
bool hasEmittedPCH() const
void AddCXXDefinitionData(const CXXRecordDecl *D)
unsigned getExprImplicitCastAbbrev() const
Represents a C++ destructor within a class.
ArgKind
The kind of template argument we're storing.
serialization::TypeID GetOrCreateTypeID(QualType T)
Force a type to be emitted and get its ID.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Represents a C++ template name within the type system.
void AddString(StringRef Str, RecordDataImpl &Record)
Add a string to the given record.
unsigned getLocalOrImportedSubmoduleID(Module *Mod)
Retrieve or create a submodule ID for this module, or return 0 if the submodule is neither local (a s...
void AddPath(StringRef Path)
Emit a path.
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
unsigned getDeclFieldAbbrev() const
void AddQualifierInfo(const QualifierInfo &Info)
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
void AddSelectorRef(Selector S)
Emit a Selector (which is a smart pointer reference).
The result type of a method or function.
SmallVectorImpl< char > & getPCH() const
The l-value was considered opaque, so the alignment was determined from a type.
void AddSourceLocation(SourceLocation Loc, RecordDataImpl &Record)
Emit a source location.
void push_back(uint64_t N)
Minimal vector-like interface.
QualifierInfo - A struct with extended info about a syntactic name qualifier, to be used for the case...
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
Encodes a location in the source.
void AddTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind, const TemplateArgumentLocInfo &Arg)
Emits a template argument location info.
Represents a C++ temporary.
void AddDeclarationName(DeclarationName Name)
Emit a declaration name.
void AddOffset(uint64_t BitOffset)
Add a bit offset into the record.
TagDecl - Represents the declaration of a struct/union/class/enum.
void AddTemplateArgument(const TemplateArgument &Arg)
Emit a template argument.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ObjCCategoryDecl - Represents a category declaration.
unsigned getIntegerLiteralAbbrev() const
void AddNestedNameSpecifier(NestedNameSpecifier *NNS)
Emit a nested name specifier.
uint32_t MacroID
An ID number that refers to a macro in an AST file.
void AddVersionTuple(const VersionTuple &Version, RecordDataImpl &Record)
Add a version tuple to the given record.
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
void AddDeclRef(const Decl *D, RecordDataImpl &Record)
Emit a reference to a declaration.
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
bool PreparePathForOutput(SmallVectorImpl< char > &Path)
Convert a path from this build process into one that is appropriate for emission in the module file...
static QualType getFromOpaquePtr(const void *Ptr)
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
SmallVectorImpl< uint64_t > RecordDataImpl
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
ASTMutationListener * GetASTMutationListener() override
If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here.
void SetIdentifierOffset(const IdentifierInfo *II, uint32_t Offset)
Note that the identifier II occurs at the given offset within the identifier table.
Represents a template argument.
const ASTWriter & getWriter() const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
unsigned getDeclCXXMethodAbbrev() const
void AddCXXBaseSpecifiers(ArrayRef< CXXBaseSpecifier > Bases)
Emit a set of C++ base specifiers.
Reads an AST files chain containing the contents of a translation unit.
DeclarationName - The name of a declaration.
detail::InMemoryDirectory::const_iterator E
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
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...
Encapsulates the data about a macro definition (e.g.
unsigned getTypeFunctionProtoAbbrev() const
Location wrapper for a TemplateArgument.
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
An UnresolvedSet-like class which uses the ASTContext's allocator.
void AddAPSInt(const llvm::APSInt &Value)
Emit a signed integral value.
uint64_t EmitStmt(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, preceded by its substatements.
serialization::SelectorID getSelectorRef(Selector Sel)
Get the unique number used to refer to the given selector.
void EmitRecordWithPath(unsigned Abbrev, RecordDataRef Record, StringRef Path)
Emit the current record with the given path as a blob.
Represents a base class of a C++ class.
A template argument list.
uint32_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
void SetSelectorOffset(Selector Sel, uint32_t Offset)
Note that the selector Sel occurs at the given offset within the method pool/selector table...
Represents a C++ struct/union/class.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
An object for streaming information to a record.
Location information for a TemplateArgument.
void operator=(const ASTRecordWriter &)=delete
ASTReader * getChain() const
Writes an AST file containing the contents of a translation unit.
ArrayRef< uint64_t > RecordDataRef
serialization::DeclID getDeclID(const Decl *D)
Determine the declaration ID of an already-emitted declaration.
void AddCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Emit a C++ base specifier.
void AddASTTemplateArgumentListInfo(const ASTTemplateArgumentListInfo *ASTTemplArgList)
Emits an AST template argument list info.
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
uint64_t WriteAST(Sema &SemaRef, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, bool hasErrors=false)
Write a precompiled header for the given semantic analysis.
static Decl::Kind getKind(const Decl *D)
void ClearSwitchCaseIDs()
unsigned getDeclTypedefAbbrev() const
void AddTemplateArgumentList(const TemplateArgumentList *TemplateArgs)
Emit a template argument list.
AST and semantic-analysis consumer that generates a precompiled header from the parsed source code...
void AddTemplateName(TemplateName Name)
Emit a template name.
void AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg)
Emits a template argument location.
uint32_t TypeID
An ID number that refers to a type in an AST file.
A trivial tuple used to represent a source range.
NamedDecl - This represents a decl with a name.
ASTRecordWriter(ASTWriter &Writer, ASTWriter::RecordDataImpl &Record)
Construct a ASTRecordWriter that uses the default encoding scheme.
A type index; the type ID with the qualifier bits removed.
Attr - This represents one attribute.
ASTWriter(llvm::BitstreamWriter &Stream, ArrayRef< llvm::IntrusiveRefCntPtr< ModuleFileExtension >> Extensions, bool IncludeTimestamps=true)
Create a new precompiled header writer that outputs to the given bitstream.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.