@@ -1953,10 +1953,6 @@ class CaseStmt final
1953
1953
return NumMandatoryStmtPtr + caseStmtIsGNURange ();
1954
1954
}
1955
1955
1956
- unsigned numTrailingObjects (OverloadToken<SourceLocation>) const {
1957
- return caseStmtIsGNURange ();
1958
- }
1959
-
1960
1956
unsigned lhsOffset () const { return LhsOffset; }
1961
1957
unsigned rhsOffset () const { return LhsOffset + caseStmtIsGNURange (); }
1962
1958
unsigned subStmtOffset () const { return rhsOffset () + SubStmtOffsetFromRhs; }
@@ -2228,10 +2224,8 @@ class AttributedStmt final
2228
2224
std::fill_n (getAttrArrayPtr (), NumAttrs, nullptr );
2229
2225
}
2230
2226
2231
- const Attr *const *getAttrArrayPtr () const {
2232
- return getTrailingObjects<const Attr *>();
2233
- }
2234
- const Attr **getAttrArrayPtr () { return getTrailingObjects<const Attr *>(); }
2227
+ const Attr *const *getAttrArrayPtr () const { return getTrailingObjects (); }
2228
+ const Attr **getAttrArrayPtr () { return getTrailingObjects (); }
2235
2229
2236
2230
public:
2237
2231
static AttributedStmt *Create (const ASTContext &C, SourceLocation Loc,
@@ -2543,7 +2537,7 @@ class SwitchStmt final : public Stmt,
2543
2537
SourceLocation LParenLoc;
2544
2538
SourceLocation RParenLoc;
2545
2539
2546
- unsigned numTrailingObjects (OverloadToken<Stmt *> ) const {
2540
+ unsigned numTrailingStatements ( ) const {
2547
2541
return NumMandatoryStmtPtr + hasInitStorage () + hasVarStorage ();
2548
2542
}
2549
2543
@@ -2579,40 +2573,34 @@ class SwitchStmt final : public Stmt,
2579
2573
bool hasVarStorage () const { return SwitchStmtBits.HasVar ; }
2580
2574
2581
2575
Expr *getCond () {
2582
- return reinterpret_cast <Expr *>(getTrailingObjects<Stmt *> ()[condOffset ()]);
2576
+ return reinterpret_cast <Expr *>(getTrailingObjects ()[condOffset ()]);
2583
2577
}
2584
2578
2585
2579
const Expr *getCond () const {
2586
- return reinterpret_cast <Expr *>(getTrailingObjects<Stmt *> ()[condOffset ()]);
2580
+ return reinterpret_cast <Expr *>(getTrailingObjects ()[condOffset ()]);
2587
2581
}
2588
2582
2589
2583
void setCond (Expr *Cond) {
2590
- getTrailingObjects<Stmt *> ()[condOffset ()] = reinterpret_cast <Stmt *>(Cond);
2584
+ getTrailingObjects ()[condOffset ()] = reinterpret_cast <Stmt *>(Cond);
2591
2585
}
2592
2586
2593
- Stmt *getBody () { return getTrailingObjects<Stmt *>()[bodyOffset ()]; }
2594
- const Stmt *getBody () const {
2595
- return getTrailingObjects<Stmt *>()[bodyOffset ()];
2596
- }
2587
+ Stmt *getBody () { return getTrailingObjects ()[bodyOffset ()]; }
2588
+ const Stmt *getBody () const { return getTrailingObjects ()[bodyOffset ()]; }
2597
2589
2598
- void setBody (Stmt *Body) {
2599
- getTrailingObjects<Stmt *>()[bodyOffset ()] = Body;
2600
- }
2590
+ void setBody (Stmt *Body) { getTrailingObjects ()[bodyOffset ()] = Body; }
2601
2591
2602
2592
Stmt *getInit () {
2603
- return hasInitStorage () ? getTrailingObjects<Stmt *>()[initOffset ()]
2604
- : nullptr ;
2593
+ return hasInitStorage () ? getTrailingObjects ()[initOffset ()] : nullptr ;
2605
2594
}
2606
2595
2607
2596
const Stmt *getInit () const {
2608
- return hasInitStorage () ? getTrailingObjects<Stmt *>()[initOffset ()]
2609
- : nullptr ;
2597
+ return hasInitStorage () ? getTrailingObjects ()[initOffset ()] : nullptr ;
2610
2598
}
2611
2599
2612
2600
void setInit (Stmt *Init) {
2613
2601
assert (hasInitStorage () &&
2614
2602
" This switch statement has no storage for an init statement!" );
2615
- getTrailingObjects<Stmt *> ()[initOffset ()] = Init;
2603
+ getTrailingObjects ()[initOffset ()] = Init;
2616
2604
}
2617
2605
2618
2606
// / Retrieve the variable declared in this "switch" statement, if any.
@@ -2636,20 +2624,20 @@ class SwitchStmt final : public Stmt,
2636
2624
// / If this SwitchStmt has a condition variable, return the faux DeclStmt
2637
2625
// / associated with the creation of that condition variable.
2638
2626
DeclStmt *getConditionVariableDeclStmt () {
2639
- return hasVarStorage () ? static_cast <DeclStmt *>(
2640
- getTrailingObjects<Stmt *>()[varOffset ()])
2641
- : nullptr ;
2627
+ return hasVarStorage ()
2628
+ ? static_cast <DeclStmt *>( getTrailingObjects ()[varOffset ()])
2629
+ : nullptr ;
2642
2630
}
2643
2631
2644
2632
const DeclStmt *getConditionVariableDeclStmt () const {
2645
- return hasVarStorage () ? static_cast <DeclStmt *>(
2646
- getTrailingObjects<Stmt *>()[varOffset ()])
2647
- : nullptr ;
2633
+ return hasVarStorage ()
2634
+ ? static_cast <DeclStmt *>( getTrailingObjects ()[varOffset ()])
2635
+ : nullptr ;
2648
2636
}
2649
2637
2650
2638
void setConditionVariableDeclStmt (DeclStmt *CondVar) {
2651
2639
assert (hasVarStorage ());
2652
- getTrailingObjects<Stmt *> ()[varOffset ()] = CondVar;
2640
+ getTrailingObjects ()[varOffset ()] = CondVar;
2653
2641
}
2654
2642
2655
2643
SwitchCase *getSwitchCaseList () { return FirstCase; }
@@ -2693,15 +2681,13 @@ class SwitchStmt final : public Stmt,
2693
2681
2694
2682
// Iterators
2695
2683
child_range children () {
2696
- return child_range (getTrailingObjects<Stmt *>(),
2697
- getTrailingObjects<Stmt *>() +
2698
- numTrailingObjects (OverloadToken<Stmt *>()));
2684
+ return child_range (getTrailingObjects (),
2685
+ getTrailingObjects () + numTrailingStatements ());
2699
2686
}
2700
2687
2701
2688
const_child_range children () const {
2702
- return const_child_range (getTrailingObjects<Stmt *>(),
2703
- getTrailingObjects<Stmt *>() +
2704
- numTrailingObjects (OverloadToken<Stmt *>()));
2689
+ return const_child_range (getTrailingObjects (),
2690
+ getTrailingObjects () + numTrailingStatements ());
2705
2691
}
2706
2692
2707
2693
static bool classof (const Stmt *T) {
@@ -2738,7 +2724,7 @@ class WhileStmt final : public Stmt,
2738
2724
unsigned condOffset () const { return VarOffset + hasVarStorage (); }
2739
2725
unsigned bodyOffset () const { return condOffset () + BodyOffsetFromCond; }
2740
2726
2741
- unsigned numTrailingObjects (OverloadToken<Stmt *> ) const {
2727
+ unsigned numTrailingStatements ( ) const {
2742
2728
return NumMandatoryStmtPtr + hasVarStorage ();
2743
2729
}
2744
2730
@@ -2764,25 +2750,21 @@ class WhileStmt final : public Stmt,
2764
2750
bool hasVarStorage () const { return WhileStmtBits.HasVar ; }
2765
2751
2766
2752
Expr *getCond () {
2767
- return reinterpret_cast <Expr *>(getTrailingObjects<Stmt *> ()[condOffset ()]);
2753
+ return reinterpret_cast <Expr *>(getTrailingObjects ()[condOffset ()]);
2768
2754
}
2769
2755
2770
2756
const Expr *getCond () const {
2771
- return reinterpret_cast <Expr *>(getTrailingObjects<Stmt *> ()[condOffset ()]);
2757
+ return reinterpret_cast <Expr *>(getTrailingObjects ()[condOffset ()]);
2772
2758
}
2773
2759
2774
2760
void setCond (Expr *Cond) {
2775
- getTrailingObjects<Stmt *> ()[condOffset ()] = reinterpret_cast <Stmt *>(Cond);
2761
+ getTrailingObjects ()[condOffset ()] = reinterpret_cast <Stmt *>(Cond);
2776
2762
}
2777
2763
2778
- Stmt *getBody () { return getTrailingObjects<Stmt *>()[bodyOffset ()]; }
2779
- const Stmt *getBody () const {
2780
- return getTrailingObjects<Stmt *>()[bodyOffset ()];
2781
- }
2764
+ Stmt *getBody () { return getTrailingObjects ()[bodyOffset ()]; }
2765
+ const Stmt *getBody () const { return getTrailingObjects ()[bodyOffset ()]; }
2782
2766
2783
- void setBody (Stmt *Body) {
2784
- getTrailingObjects<Stmt *>()[bodyOffset ()] = Body;
2785
- }
2767
+ void setBody (Stmt *Body) { getTrailingObjects ()[bodyOffset ()] = Body; }
2786
2768
2787
2769
// / Retrieve the variable declared in this "while" statement, if any.
2788
2770
// /
@@ -2804,20 +2786,20 @@ class WhileStmt final : public Stmt,
2804
2786
// / If this WhileStmt has a condition variable, return the faux DeclStmt
2805
2787
// / associated with the creation of that condition variable.
2806
2788
DeclStmt *getConditionVariableDeclStmt () {
2807
- return hasVarStorage () ? static_cast <DeclStmt *>(
2808
- getTrailingObjects<Stmt *>()[varOffset ()])
2809
- : nullptr ;
2789
+ return hasVarStorage ()
2790
+ ? static_cast <DeclStmt *>( getTrailingObjects ()[varOffset ()])
2791
+ : nullptr ;
2810
2792
}
2811
2793
2812
2794
const DeclStmt *getConditionVariableDeclStmt () const {
2813
- return hasVarStorage () ? static_cast <DeclStmt *>(
2814
- getTrailingObjects<Stmt *>()[varOffset ()])
2815
- : nullptr ;
2795
+ return hasVarStorage ()
2796
+ ? static_cast <DeclStmt *>( getTrailingObjects ()[varOffset ()])
2797
+ : nullptr ;
2816
2798
}
2817
2799
2818
2800
void setConditionVariableDeclStmt (DeclStmt *CondVar) {
2819
2801
assert (hasVarStorage ());
2820
- getTrailingObjects<Stmt *> ()[varOffset ()] = CondVar;
2802
+ getTrailingObjects ()[varOffset ()] = CondVar;
2821
2803
}
2822
2804
2823
2805
SourceLocation getWhileLoc () const { return WhileStmtBits.WhileLoc ; }
@@ -2839,15 +2821,13 @@ class WhileStmt final : public Stmt,
2839
2821
2840
2822
// Iterators
2841
2823
child_range children () {
2842
- return child_range (getTrailingObjects<Stmt *>(),
2843
- getTrailingObjects<Stmt *>() +
2844
- numTrailingObjects (OverloadToken<Stmt *>()));
2824
+ return child_range (getTrailingObjects (),
2825
+ getTrailingObjects () + numTrailingStatements ());
2845
2826
}
2846
2827
2847
2828
const_child_range children () const {
2848
- return const_child_range (getTrailingObjects<Stmt *>(),
2849
- getTrailingObjects<Stmt *>() +
2850
- numTrailingObjects (OverloadToken<Stmt *>()));
2829
+ return const_child_range (getTrailingObjects (),
2830
+ getTrailingObjects () + numTrailingStatements ());
2851
2831
}
2852
2832
};
2853
2833
@@ -3158,10 +3138,6 @@ class ReturnStmt final
3158
3138
// / True if this ReturnStmt has storage for an NRVO candidate.
3159
3139
bool hasNRVOCandidate () const { return ReturnStmtBits.HasNRVOCandidate ; }
3160
3140
3161
- unsigned numTrailingObjects (OverloadToken<const VarDecl *>) const {
3162
- return hasNRVOCandidate ();
3163
- }
3164
-
3165
3141
// / Build a return statement.
3166
3142
ReturnStmt (SourceLocation RL, Expr *E, const VarDecl *NRVOCandidate);
3167
3143
@@ -3187,8 +3163,7 @@ class ReturnStmt final
3187
3163
// / The optimization itself can only be performed if the variable is
3188
3164
// / also marked as an NRVO object.
3189
3165
const VarDecl *getNRVOCandidate () const {
3190
- return hasNRVOCandidate () ? *getTrailingObjects<const VarDecl *>()
3191
- : nullptr ;
3166
+ return hasNRVOCandidate () ? *getTrailingObjects () : nullptr ;
3192
3167
}
3193
3168
3194
3169
// / Set the variable that might be used for the named return value
@@ -3197,7 +3172,7 @@ class ReturnStmt final
3197
3172
void setNRVOCandidate (const VarDecl *Var) {
3198
3173
assert (hasNRVOCandidate () &&
3199
3174
" This return statement has no storage for an NRVO candidate!" );
3200
- *getTrailingObjects< const VarDecl *> () = Var;
3175
+ *getTrailingObjects () = Var;
3201
3176
}
3202
3177
3203
3178
SourceLocation getReturnLoc () const { return ReturnStmtBits.RetLoc ; }
0 commit comments