@@ -1345,10 +1345,6 @@ class ASTReader
1345
1345
};
1346
1346
1347
1347
QualType readTypeRecord (unsigned Index);
1348
- void readExceptionSpec (ModuleFile &ModuleFile,
1349
- SmallVectorImpl<QualType> &ExceptionStorage,
1350
- FunctionProtoType::ExceptionSpecInfo &ESI,
1351
- const RecordData &Record, unsigned &Index);
1352
1348
RecordLocation TypeCursorForIndex (unsigned Index);
1353
1349
void LoadedDecl (unsigned Index, Decl *D);
1354
1350
Decl *ReadDeclRecord (serialization::DeclID ID);
@@ -1781,29 +1777,6 @@ class ASTReader
1781
1777
return Result;
1782
1778
}
1783
1779
1784
- // / Reads a TemplateArgumentLocInfo appropriate for the
1785
- // / given TemplateArgument kind.
1786
- TemplateArgumentLocInfo
1787
- GetTemplateArgumentLocInfo (ModuleFile &F, TemplateArgument::ArgKind Kind,
1788
- const RecordData &Record, unsigned &Idx);
1789
-
1790
- // / Reads a TemplateArgumentLoc.
1791
- TemplateArgumentLoc
1792
- ReadTemplateArgumentLoc (ModuleFile &F,
1793
- const RecordData &Record, unsigned &Idx);
1794
-
1795
- const ASTTemplateArgumentListInfo*
1796
- ReadASTTemplateArgumentListInfo (ModuleFile &F,
1797
- const RecordData &Record, unsigned &Index);
1798
-
1799
- // / Reads a declarator info from the given record.
1800
- TypeSourceInfo *GetTypeSourceInfo (ModuleFile &F,
1801
- const RecordData &Record, unsigned &Idx);
1802
-
1803
- // / Raad the type locations for the given TInfo.
1804
- void ReadTypeLoc (ModuleFile &F, const RecordData &Record, unsigned &Idx,
1805
- TypeLoc TL);
1806
-
1807
1780
// / Resolve a type ID into a type, potentially building a new
1808
1781
// / type.
1809
1782
QualType GetType (serialization::TypeID ID);
@@ -2057,8 +2030,8 @@ class ASTReader
2057
2030
2058
2031
IdentifierInfo *DecodeIdentifierInfo (serialization::IdentifierID ID);
2059
2032
2060
- IdentifierInfo *GetIdentifierInfo (ModuleFile &M, const RecordData &Record,
2061
- unsigned &Idx) {
2033
+ IdentifierInfo *readIdentifier (ModuleFile &M, const RecordData &Record,
2034
+ unsigned &Idx) {
2062
2035
return DecodeIdentifierInfo (getGlobalIdentifierID (M, Record[Idx++]));
2063
2036
}
2064
2037
@@ -2136,58 +2109,6 @@ class ASTReader
2136
2109
serialization::SelectorID getGlobalSelectorID (ModuleFile &F,
2137
2110
unsigned LocalID) const ;
2138
2111
2139
- // / Read a declaration name.
2140
- DeclarationName ReadDeclarationName (ModuleFile &F,
2141
- const RecordData &Record, unsigned &Idx);
2142
- void ReadDeclarationNameLoc (ModuleFile &F,
2143
- DeclarationNameLoc &DNLoc, DeclarationName Name,
2144
- const RecordData &Record, unsigned &Idx);
2145
- void ReadDeclarationNameInfo (ModuleFile &F, DeclarationNameInfo &NameInfo,
2146
- const RecordData &Record, unsigned &Idx);
2147
-
2148
- void ReadQualifierInfo (ModuleFile &F, QualifierInfo &Info,
2149
- const RecordData &Record, unsigned &Idx);
2150
-
2151
- NestedNameSpecifier *ReadNestedNameSpecifier (ModuleFile &F,
2152
- const RecordData &Record,
2153
- unsigned &Idx);
2154
-
2155
- NestedNameSpecifierLoc ReadNestedNameSpecifierLoc (ModuleFile &F,
2156
- const RecordData &Record,
2157
- unsigned &Idx);
2158
-
2159
- // / Read a template name.
2160
- TemplateName ReadTemplateName (ModuleFile &F, const RecordData &Record,
2161
- unsigned &Idx);
2162
-
2163
- // / Read a template argument.
2164
- TemplateArgument ReadTemplateArgument (ModuleFile &F, const RecordData &Record,
2165
- unsigned &Idx,
2166
- bool Canonicalize = false );
2167
-
2168
- // / Read a template parameter list.
2169
- TemplateParameterList *ReadTemplateParameterList (ModuleFile &F,
2170
- const RecordData &Record,
2171
- unsigned &Idx);
2172
-
2173
- // / Read a template argument array.
2174
- void ReadTemplateArgumentList (SmallVectorImpl<TemplateArgument> &TemplArgs,
2175
- ModuleFile &F, const RecordData &Record,
2176
- unsigned &Idx, bool Canonicalize = false );
2177
-
2178
- // / Read a UnresolvedSet structure.
2179
- void ReadUnresolvedSet (ModuleFile &F, LazyASTUnresolvedSet &Set,
2180
- const RecordData &Record, unsigned &Idx);
2181
-
2182
- // / Read a C++ base specifier.
2183
- CXXBaseSpecifier ReadCXXBaseSpecifier (ModuleFile &F,
2184
- const RecordData &Record,unsigned &Idx);
2185
-
2186
- // / Read a CXXCtorInitializer array.
2187
- CXXCtorInitializer **
2188
- ReadCXXCtorInitializers (ModuleFile &F, const RecordData &Record,
2189
- unsigned &Idx);
2190
-
2191
2112
// / Read the contents of a CXXCtorInitializer array.
2192
2113
CXXCtorInitializer **GetExternalCXXCtorInitializers (uint64_t Offset) override ;
2193
2114
@@ -2227,19 +2148,6 @@ class ASTReader
2227
2148
SourceRange ReadSourceRange (ModuleFile &F,
2228
2149
const RecordData &Record, unsigned &Idx);
2229
2150
2230
- // / Read an integral value
2231
- llvm::APInt ReadAPInt (const RecordData &Record, unsigned &Idx);
2232
-
2233
- // / Read a signed integral value
2234
- llvm::APSInt ReadAPSInt (const RecordData &Record, unsigned &Idx);
2235
-
2236
- // / Read a floating-point value
2237
- llvm::APFloat ReadAPFloat (const RecordData &Record,
2238
- const llvm::fltSemantics &Sem, unsigned &Idx);
2239
-
2240
- // / Read an APValue
2241
- APValue ReadAPValue (const RecordData &Record, unsigned &Idx);
2242
-
2243
2151
// Read a string
2244
2152
static std::string ReadString (const RecordData &Record, unsigned &Idx);
2245
2153
@@ -2266,12 +2174,6 @@ class ASTReader
2266
2174
CXXTemporary *ReadCXXTemporary (ModuleFile &F, const RecordData &Record,
2267
2175
unsigned &Idx);
2268
2176
2269
- // / Reads one attribute from the current stream position.
2270
- Attr *ReadAttr (ModuleFile &M, const RecordData &Record, unsigned &Idx);
2271
-
2272
- // / Reads attributes from the current stream position.
2273
- void ReadAttributes (ASTRecordReader &Record, AttrVec &Attrs);
2274
-
2275
2177
// / Reads a statement.
2276
2178
Stmt *ReadStmt (ModuleFile &F);
2277
2179
@@ -2414,15 +2316,21 @@ class ASTRecordReader {
2414
2316
// / An arbitrary index in this record.
2415
2317
const uint64_t &operator [](size_t N) { return Record[N]; }
2416
2318
2417
- // / The last element in this record.
2418
- const uint64_t & back () const { return Record.back (); }
2319
+ // / Returns the last value in this record.
2320
+ uint64_t back () { return Record.back (); }
2419
2321
2420
2322
// / Returns the current value in this record, and advances to the
2421
2323
// / next value.
2422
- const uint64_t &readInt () { return Record[Idx++]; }
2324
+ uint64_t readInt () { return Record[Idx++]; }
2325
+
2326
+ ArrayRef<uint64_t > readIntArray (unsigned Len) {
2327
+ auto Array = llvm::makeArrayRef (Record).slice (Idx, Len);
2328
+ Idx += Len;
2329
+ return Array;
2330
+ }
2423
2331
2424
2332
// / Returns the current value in this record, without advancing.
2425
- const uint64_t & peekInt () { return Record[Idx]; }
2333
+ uint64_t peekInt () { return Record[Idx]; }
2426
2334
2427
2335
// / Skips the specified number of values.
2428
2336
void skipInts (unsigned N) { Idx += N; }
@@ -2459,10 +2367,8 @@ class ASTRecordReader {
2459
2367
static_cast <ExplicitSpecKind>(Kind));
2460
2368
}
2461
2369
2462
- void readExceptionSpec (SmallVectorImpl<QualType> &ExceptionStorage,
2463
- FunctionProtoType::ExceptionSpecInfo &ESI) {
2464
- return Reader->readExceptionSpec (*F, ExceptionStorage, ESI, Record, Idx);
2465
- }
2370
+ FunctionProtoType::ExceptionSpecInfo
2371
+ readExceptionSpecInfo (SmallVectorImpl<QualType> &ExceptionStorage);
2466
2372
2467
2373
// / Get the global offset corresponding to a local offset.
2468
2374
uint64_t getGlobalBitOffset (uint32_t LocalOffset) {
@@ -2492,36 +2398,30 @@ class ASTRecordReader {
2492
2398
// / Reads a TemplateArgumentLocInfo appropriate for the
2493
2399
// / given TemplateArgument kind, advancing Idx.
2494
2400
TemplateArgumentLocInfo
2495
- getTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind) {
2496
- return Reader->GetTemplateArgumentLocInfo (*F, Kind, Record, Idx);
2497
- }
2401
+ readTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind);
2498
2402
2499
2403
// / Reads a TemplateArgumentLoc, advancing Idx.
2500
- TemplateArgumentLoc
2501
- readTemplateArgumentLoc () {
2502
- return Reader->ReadTemplateArgumentLoc (*F, Record, Idx);
2503
- }
2404
+ TemplateArgumentLoc readTemplateArgumentLoc ();
2504
2405
2505
2406
const ASTTemplateArgumentListInfo*
2506
- readASTTemplateArgumentListInfo () {
2507
- return Reader->ReadASTTemplateArgumentListInfo (*F, Record, Idx);
2508
- }
2407
+ readASTTemplateArgumentListInfo ();
2509
2408
2510
2409
// / Reads a declarator info from the given record, advancing Idx.
2511
- TypeSourceInfo *getTypeSourceInfo () {
2512
- return Reader->GetTypeSourceInfo (*F, Record, Idx);
2513
- }
2410
+ TypeSourceInfo *readTypeSourceInfo ();
2514
2411
2515
2412
// / Reads the location information for a type.
2516
- void readTypeLoc (TypeLoc TL) {
2517
- return Reader->ReadTypeLoc (*F, Record, Idx, TL);
2518
- }
2413
+ void readTypeLoc (TypeLoc TL);
2414
+
2519
2415
2520
2416
// / Map a local type ID within a given AST file to a global type ID.
2521
2417
serialization::TypeID getGlobalTypeID (unsigned LocalID) const {
2522
2418
return Reader->getGlobalTypeID (*F, LocalID);
2523
2419
}
2524
2420
2421
+ Qualifiers readQualifiers () {
2422
+ return Qualifiers::fromOpaqueValue (readInt ());
2423
+ }
2424
+
2525
2425
// / Read a type from the current position in the record.
2526
2426
QualType readType () {
2527
2427
return Reader->readType (*F, Record, Idx);
@@ -2550,8 +2450,8 @@ class ASTRecordReader {
2550
2450
return Reader->ReadDeclAs <T>(*F, Record, Idx);
2551
2451
}
2552
2452
2553
- IdentifierInfo *getIdentifierInfo () {
2554
- return Reader->GetIdentifierInfo (*F, Record, Idx);
2453
+ IdentifierInfo *readIdentifier () {
2454
+ return Reader->readIdentifier (*F, Record, Idx);
2555
2455
}
2556
2456
2557
2457
// / Read a selector from the Record, advancing Idx.
@@ -2560,64 +2460,37 @@ class ASTRecordReader {
2560
2460
}
2561
2461
2562
2462
// / Read a declaration name, advancing Idx.
2563
- DeclarationName readDeclarationName () {
2564
- return Reader->ReadDeclarationName (*F, Record, Idx);
2565
- }
2566
- void readDeclarationNameLoc (DeclarationNameLoc &DNLoc, DeclarationName Name) {
2567
- return Reader->ReadDeclarationNameLoc (*F, DNLoc, Name, Record, Idx);
2568
- }
2569
- void readDeclarationNameInfo (DeclarationNameInfo &NameInfo) {
2570
- return Reader->ReadDeclarationNameInfo (*F, NameInfo, Record, Idx);
2571
- }
2463
+ DeclarationName readDeclarationName ();
2464
+ DeclarationNameLoc readDeclarationNameLoc (DeclarationName Name);
2465
+ DeclarationNameInfo readDeclarationNameInfo ();
2572
2466
2573
- void readQualifierInfo (QualifierInfo &Info) {
2574
- return Reader->ReadQualifierInfo (*F, Info, Record, Idx);
2575
- }
2467
+ void readQualifierInfo (QualifierInfo &Info);
2576
2468
2577
- NestedNameSpecifier *readNestedNameSpecifier () {
2578
- return Reader->ReadNestedNameSpecifier (*F, Record, Idx);
2579
- }
2469
+ NestedNameSpecifier *readNestedNameSpecifier ();
2580
2470
2581
- NestedNameSpecifierLoc readNestedNameSpecifierLoc () {
2582
- return Reader->ReadNestedNameSpecifierLoc (*F, Record, Idx);
2583
- }
2471
+ NestedNameSpecifierLoc readNestedNameSpecifierLoc ();
2584
2472
2585
2473
// / Read a template name, advancing Idx.
2586
- TemplateName readTemplateName () {
2587
- return Reader->ReadTemplateName (*F, Record, Idx);
2588
- }
2474
+ TemplateName readTemplateName ();
2589
2475
2590
2476
// / Read a template argument, advancing Idx.
2591
- TemplateArgument readTemplateArgument (bool Canonicalize = false ) {
2592
- return Reader->ReadTemplateArgument (*F, Record, Idx, Canonicalize);
2593
- }
2477
+ TemplateArgument readTemplateArgument (bool Canonicalize = false );
2594
2478
2595
2479
// / Read a template parameter list, advancing Idx.
2596
- TemplateParameterList *readTemplateParameterList () {
2597
- return Reader->ReadTemplateParameterList (*F, Record, Idx);
2598
- }
2480
+ TemplateParameterList *readTemplateParameterList ();
2599
2481
2600
2482
// / Read a template argument array, advancing Idx.
2601
2483
void readTemplateArgumentList (SmallVectorImpl<TemplateArgument> &TemplArgs,
2602
- bool Canonicalize = false ) {
2603
- return Reader->ReadTemplateArgumentList (TemplArgs, *F, Record, Idx,
2604
- Canonicalize);
2605
- }
2484
+ bool Canonicalize = false );
2606
2485
2607
2486
// / Read a UnresolvedSet structure, advancing Idx.
2608
- void readUnresolvedSet (LazyASTUnresolvedSet &Set) {
2609
- return Reader->ReadUnresolvedSet (*F, Set, Record, Idx);
2610
- }
2487
+ void readUnresolvedSet (LazyASTUnresolvedSet &Set);
2611
2488
2612
2489
// / Read a C++ base specifier, advancing Idx.
2613
- CXXBaseSpecifier readCXXBaseSpecifier () {
2614
- return Reader->ReadCXXBaseSpecifier (*F, Record, Idx);
2615
- }
2490
+ CXXBaseSpecifier readCXXBaseSpecifier ();
2616
2491
2617
2492
// / Read a CXXCtorInitializer array, advancing Idx.
2618
- CXXCtorInitializer **readCXXCtorInitializers () {
2619
- return Reader->ReadCXXCtorInitializers (*F, Record, Idx);
2620
- }
2493
+ CXXCtorInitializer **readCXXCtorInitializers ();
2621
2494
2622
2495
CXXTemporary *readCXXTemporary () {
2623
2496
return Reader->ReadCXXTemporary (*F, Record, Idx);
@@ -2633,22 +2506,20 @@ class ASTRecordReader {
2633
2506
return Reader->ReadSourceRange (*F, Record, Idx);
2634
2507
}
2635
2508
2636
- APValue readAPValue () { return Reader->ReadAPValue (Record, Idx); }
2509
+ // / Read an arbitrary constant value, advancing Idx.
2510
+ APValue readAPValue ();
2637
2511
2638
2512
// / Read an integral value, advancing Idx.
2639
- llvm::APInt readAPInt () {
2640
- return Reader->ReadAPInt (Record, Idx);
2641
- }
2513
+ llvm::APInt readAPInt ();
2642
2514
2643
2515
// / Read a signed integral value, advancing Idx.
2644
- llvm::APSInt readAPSInt () {
2645
- return Reader->ReadAPSInt (Record, Idx);
2646
- }
2516
+ llvm::APSInt readAPSInt ();
2647
2517
2648
2518
// / Read a floating-point value, advancing Idx.
2649
- llvm::APFloat readAPFloat (const llvm::fltSemantics &Sem) {
2650
- return Reader->ReadAPFloat (Record, Sem,Idx);
2651
- }
2519
+ llvm::APFloat readAPFloat (const llvm::fltSemantics &Sem);
2520
+
2521
+ // / Read a boolean value, advancing Idx.
2522
+ bool readBool () { return readInt () != 0 ; }
2652
2523
2653
2524
// / Read a string, advancing Idx.
2654
2525
std::string readString () {
@@ -2666,14 +2537,10 @@ class ASTRecordReader {
2666
2537
}
2667
2538
2668
2539
// / Reads one attribute from the current stream position, advancing Idx.
2669
- Attr *readAttr () {
2670
- return Reader->ReadAttr (*F, Record, Idx);
2671
- }
2540
+ Attr *readAttr ();
2672
2541
2673
2542
// / Reads attributes from the current stream position, advancing Idx.
2674
- void readAttributes (AttrVec &Attrs) {
2675
- return Reader->ReadAttributes (*this , Attrs);
2676
- }
2543
+ void readAttributes (AttrVec &Attrs);
2677
2544
2678
2545
// / Reads a token out of a record, advancing Idx.
2679
2546
Token readToken () {
0 commit comments