@@ -1573,6 +1573,7 @@ class ASTVisitor
1573
1573
}
1574
1574
1575
1575
// #define CHECK_IN_FILE_FILTER
1576
+
1576
1577
// This also sets IsFileInRootDir
1577
1578
bool
1578
1579
inExtractedFile (
@@ -1629,18 +1630,10 @@ class ASTVisitor
1629
1630
1630
1631
file_ = files::makePosixStyle (loc.getFilename ());
1631
1632
1632
- #ifdef CHECK_IN_FILE_FILTER
1633
- // skip system header
1634
- if (currentMode () == ExtractMode::Normal &&
1635
- source_.isInSystemHeader (D->getLocation ()))
1636
- #else
1637
-
1638
1633
// skip system header
1639
1634
if (source_.isInSystemHeader (D->getLocation ()))
1640
- #endif
1641
1635
return false ;
1642
1636
1643
-
1644
1637
auto [it, inserted] = fileFilter_.emplace (
1645
1638
loc.getIncludeLoc ().getRawEncoding (),
1646
1639
FileFilter ());
@@ -1653,12 +1646,7 @@ class ASTVisitor
1653
1646
1654
1647
// don't extract if the declaration is in a file
1655
1648
// that should not be visited
1656
- #ifdef CHECK_IN_FILE_FILTER
1657
- if (currentMode () == ExtractMode::Normal &&
1658
- ! ff.include )
1659
- #else
1660
1649
if (! ff.include )
1661
- #endif
1662
1650
return false ;
1663
1651
// VFALCO we could assert that the prefix
1664
1652
// matches and just lop off the
@@ -1675,12 +1663,6 @@ class ASTVisitor
1675
1663
shouldExtract (
1676
1664
const Decl* D)
1677
1665
{
1678
- #ifdef CHECK_IN_FILE_FILTER
1679
- return inExtractedFile (D);
1680
- #elif 0
1681
- return inExtractedFile (D) ||
1682
- currentMode () != ExtractMode::Normal;
1683
- #elif 1
1684
1666
bool extract = inExtractedFile (D);
1685
1667
// if we're extracting a declaration as a dependency,
1686
1668
// override the current extraction mode if
@@ -1689,7 +1671,6 @@ class ASTVisitor
1689
1671
mode = ExtractMode::Normal;
1690
1672
1691
1673
return extract || currentMode () != ExtractMode::Normal;
1692
- #endif
1693
1674
}
1694
1675
1695
1676
std::string
@@ -2271,7 +2252,6 @@ class ASTVisitor
2271
2252
parent->Implicit &= currentMode () != ExtractMode::Normal;
2272
2253
static_cast <RecordInfo*>(parent)->Friends .emplace_back (I.id );
2273
2254
}
2274
-
2275
2255
return ;
2276
2256
}
2277
2257
if (FunctionTemplateDecl* FT = dyn_cast<FunctionTemplateDecl>(ND))
@@ -2396,9 +2376,6 @@ traverse(EnumDecl* D)
2396
2376
if (! shouldExtract (D))
2397
2377
return true ;
2398
2378
2399
- // MRDOX_ASSERT(! D->getDeclContext()->isRecord() ||
2400
- // A != AccessSpecifier::AS_none);
2401
-
2402
2379
SymbolID id;
2403
2380
if (! extractSymbolID (D, id))
2404
2381
return false ;
@@ -2419,9 +2396,6 @@ traverse(FieldDecl* D)
2419
2396
if (! shouldExtract (D))
2420
2397
return true ;
2421
2398
2422
- // MRDOX_ASSERT(D->getDeclContext()->isRecord() &&
2423
- // A != AccessSpecifier::AS_none);
2424
-
2425
2399
SymbolID id;
2426
2400
if (! extractSymbolID (D, id))
2427
2401
return false ;
@@ -2622,6 +2596,10 @@ traverse(TypedefNameTy* D,
2622
2596
2623
2597
// ------------------------------------------------
2624
2598
2599
+ /* * This function will be unnecessary once ClassScopeFunctionSpecializationDecl is
2600
+ removed (see https://github.com/llvm/llvm-project/pull/66636). For now we approximate
2601
+ its changes by building a DependentFunctionTemplateSpecializationInfo from scratch.
2602
+ */
2625
2603
bool
2626
2604
ASTVisitor::
2627
2605
traverse (ClassScopeFunctionSpecializationDecl* D)
@@ -2633,12 +2611,8 @@ traverse(ClassScopeFunctionSpecializationDecl* D)
2633
2611
are members of class templates, it is impossible to know what the
2634
2612
primary template is until the enclosing class template is instantiated.
2635
2613
while such declarations are valid C++ (see CWG 727, N4090, and [temp.expl.spec] p3),
2636
- GCC does not consider them to be valid. Consequently, we do not extract the SymbolID
2637
- of the primary template. In the future, we could take a best-effort approach to find
2638
- the primary template, but this is only possible when none of the candidates are dependent
2639
- upon a template parameter of the enclosing class template.
2614
+ GCC does not consider them to be valid.
2640
2615
*/
2641
-
2642
2616
DeclContext* DC = D->getDeclContext ();
2643
2617
CXXMethodDecl* MD = D->getSpecialization ();
2644
2618
@@ -2880,9 +2854,7 @@ class ASTVisitorConsumer
2880
2854
*sema_);
2881
2855
2882
2856
// traverse the translation unit
2883
- // visitor.traverseContext(
2884
- visitor.traverseDecl (
2885
- Context.getTranslationUnitDecl ());
2857
+ visitor.traverseDecl (Context.getTranslationUnitDecl ());
2886
2858
2887
2859
// VFALCO If we returned from the function early
2888
2860
// then this line won't execute, which means we
@@ -2902,13 +2874,13 @@ class ASTVisitorConsumer
2902
2874
nor one that introduces a new type via returning a local class.
2903
2875
*/
2904
2876
bool
2905
- shouldSkipFunctionBody (Decl* D ) override
2877
+ shouldSkipFunctionBody (Decl*) override
2906
2878
{
2907
2879
return true ;
2908
2880
}
2909
2881
2910
2882
bool
2911
- HandleTopLevelDecl (DeclGroupRef DG ) override
2883
+ HandleTopLevelDecl (DeclGroupRef) override
2912
2884
{
2913
2885
return true ;
2914
2886
}
@@ -2935,16 +2907,16 @@ class ASTVisitorConsumer
2935
2907
D->setImplicit ();
2936
2908
}
2937
2909
2938
- void HandleInlineFunctionDefinition (FunctionDecl* D ) override { }
2939
- void HandleTagDeclDefinition (TagDecl* D ) override { }
2940
- void HandleTagDeclRequiredDefinition (const TagDecl* D ) override { }
2941
- void HandleInterestingDecl (DeclGroupRef DG ) override { }
2942
- void CompleteTentativeDefinition (VarDecl* D ) override { }
2943
- void CompleteExternalDeclaration (VarDecl* D ) override { }
2944
- void AssignInheritanceModel (CXXRecordDecl* D ) override { }
2945
- void HandleVTable (CXXRecordDecl* D ) override { }
2946
- void HandleImplicitImportDecl (ImportDecl* D ) override { }
2947
- void HandleTopLevelDeclInObjCContainer (DeclGroupRef DG ) override { }
2910
+ void HandleInlineFunctionDefinition (FunctionDecl*) override { }
2911
+ void HandleTagDeclDefinition (TagDecl*) override { }
2912
+ void HandleTagDeclRequiredDefinition (const TagDecl*) override { }
2913
+ void HandleInterestingDecl (DeclGroupRef) override { }
2914
+ void CompleteTentativeDefinition (VarDecl*) override { }
2915
+ void CompleteExternalDeclaration (VarDecl*) override { }
2916
+ void AssignInheritanceModel (CXXRecordDecl*) override { }
2917
+ void HandleVTable (CXXRecordDecl*) override { }
2918
+ void HandleImplicitImportDecl (ImportDecl*) override { }
2919
+ void HandleTopLevelDeclInObjCContainer (DeclGroupRef) override { }
2948
2920
2949
2921
public:
2950
2922
ASTVisitorConsumer (
0 commit comments