Skip to content

Commit be0d949

Browse files
ddobrevtritao
authored andcommitted
Exposed many more properties of expressions.
They were previously hidden by a bug in the pass for properties fixed since. Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent aad3b7f commit be0d949

File tree

21 files changed

+29688
-11245
lines changed

21 files changed

+29688
-11245
lines changed

src/AST/Expr.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ public Expr()
378378
public bool IsXValue;
379379
public bool IsGLValue;
380380
public bool IsOrdinaryOrBitFieldObject;
381+
public Field SourceBitField;
382+
public Declaration ReferencedDeclOfCallee;
383+
public bool HasPlaceholderType;
381384
}
382385

383386
public partial class FullExpr : Expr
@@ -417,6 +420,7 @@ public DeclRefExpr()
417420
public SourceLocation Location;
418421
public bool HadMultipleCandidates;
419422
public bool HasQualifier;
423+
public Declaration FoundDecl;
420424
public bool HasTemplateKWAndArgsInfo;
421425
public SourceLocation TemplateKeywordLoc;
422426
public SourceLocation LAngleLoc;
@@ -566,6 +570,12 @@ public UnaryOperator()
566570
public Expr SubExpr;
567571
public SourceLocation OperatorLoc;
568572
public bool CanOverflow;
573+
public bool IsPrefix;
574+
public bool IsPostfix;
575+
public bool IsIncrementOp;
576+
public bool IsDecrementOp;
577+
public bool IsIncrementDecrementOp;
578+
public bool IsArithmeticOp;
569579
}
570580

571581
public partial class OffsetOfExpr : Expr
@@ -591,6 +601,7 @@ public UnaryExprOrTypeTraitExpr()
591601
public SourceLocation RParenLoc;
592602
public bool IsArgumentType;
593603
public QualifiedType ArgumentType;
604+
public Expr ArgumentExpr;
594605
public QualifiedType TypeOfArgument;
595606
}
596607

@@ -603,6 +614,8 @@ public ArraySubscriptExpr()
603614
public Expr LHS;
604615
public Expr RHS;
605616
public SourceLocation RBracketLoc;
617+
public Expr Base;
618+
public Expr Idx;
606619
}
607620

608621
public partial class CallExpr : Expr
@@ -614,6 +627,8 @@ public CallExpr()
614627
public List<Expr> Arguments = new List<Expr>();
615628
public Expr Callee;
616629
public SourceLocation RParenLoc;
630+
public Declaration CalleeDecl;
631+
public Function DirectCallee;
617632
public uint NumArgs;
618633
public uint NumCommas;
619634
public uint BuiltinCallee;
@@ -660,6 +675,8 @@ public CastExpr()
660675

661676
public CastKind CastKind;
662677
public Expr SubExpr;
678+
public string CastKindName;
679+
public Expr SubExprAsWritten;
663680
public Declaration ConversionFunction;
664681
public bool PathEmpty;
665682
public uint PathSize;
@@ -708,6 +725,19 @@ public BinaryOperator()
708725
public BinaryOperatorKind Opcode;
709726
public Expr LHS;
710727
public Expr RHS;
728+
public string OpcodeStr;
729+
public bool IsPtrMemOp;
730+
public bool IsMultiplicativeOp;
731+
public bool IsAdditiveOp;
732+
public bool IsShiftOp;
733+
public bool IsBitwiseOp;
734+
public bool IsRelationalOp;
735+
public bool IsEqualityOp;
736+
public bool IsComparisonOp;
737+
public bool IsLogicalOp;
738+
public bool IsAssignmentOp;
739+
public bool IsCompoundAssignmentOp;
740+
public bool IsShiftAssignOp;
711741
public bool IsFPContractableWithinStatement;
712742
public bool IsFEnvAccessOn;
713743
}
@@ -967,8 +997,10 @@ public GenericSelectionExpr()
967997
public SourceLocation GenericLoc;
968998
public SourceLocation DefaultLoc;
969999
public SourceLocation RParenLoc;
1000+
public Expr ControllingExpr;
9701001
public bool IsResultDependent;
9711002
public uint ResultIndex;
1003+
public Expr ResultExpr;
9721004
}
9731005

9741006
public partial class ExtVectorElementExpr : Expr
@@ -991,6 +1023,7 @@ public BlockExpr()
9911023
}
9921024

9931025
public SourceLocation CaretLocation;
1026+
public Stmt Body;
9941027
}
9951028

9961029
public partial class AsTypeExpr : Expr
@@ -1010,7 +1043,9 @@ public PseudoObjectExpr()
10101043
{
10111044
}
10121045

1046+
public Expr SyntacticForm;
10131047
public uint ResultExprIndex;
1048+
public Expr ResultExpr;
10141049
public uint NumSemanticExprs;
10151050
}
10161051

@@ -1079,6 +1114,7 @@ public AtomicExpr()
10791114
public Expr Weak;
10801115
public QualifiedType ValueType;
10811116
public AtomicExpr.AtomicOp Op;
1117+
public uint NumSubExprs;
10821118
public bool IsVolatile;
10831119
public bool IsCmpXChg;
10841120
public bool IsOpenCL;
@@ -1101,6 +1137,7 @@ public CXXOperatorCallExpr()
11011137
}
11021138

11031139
public OverloadedOperatorKind Operator;
1140+
public bool IsAssignmentOp;
11041141
public bool IsInfixBinaryOp;
11051142
public SourceLocation OperatorLoc;
11061143
public bool IsFPContractableWithinStatement;
@@ -1193,6 +1230,7 @@ public UserDefinedLiteral()
11931230
}
11941231

11951232
public UserDefinedLiteral.LiteralOperatorKind literalOperatorKind;
1233+
public Expr CookedLiteral;
11961234
public SourceLocation UDSuffixLoc;
11971235
}
11981236

@@ -1221,6 +1259,7 @@ public CXXStdInitializerListExpr()
12211259
{
12221260
}
12231261

1262+
public Expr SubExpr;
12241263
}
12251264

12261265
public partial class CXXTypeidExpr : Expr
@@ -1253,6 +1292,8 @@ public MSPropertySubscriptExpr()
12531292
}
12541293

12551294
public SourceLocation RBracketLoc;
1295+
public Expr Base;
1296+
public Expr Idx;
12561297
}
12571298

12581299
public partial class CXXUuidofExpr : Expr
@@ -1282,6 +1323,7 @@ public CXXThrowExpr()
12821323
{
12831324
}
12841325

1326+
public Expr SubExpr;
12851327
public SourceLocation ThrowLoc;
12861328
public bool IsThrownVariableInScope;
12871329
}
@@ -1292,6 +1334,7 @@ public CXXDefaultArgExpr()
12921334
{
12931335
}
12941336

1337+
public Expr Expr;
12951338
public SourceLocation UsedLocation;
12961339
}
12971340

@@ -1301,6 +1344,8 @@ public CXXDefaultInitExpr()
13011344
{
13021345
}
13031346

1347+
public Field Field;
1348+
public Expr Expr;
13041349
}
13051350

13061351
public partial class CXXBindTemporaryExpr : Expr
@@ -1415,12 +1460,14 @@ public CXXNewExpr()
14151460
public Function OperatorDelete;
14161461
public QualifiedType AllocatedType;
14171462
public bool IsArray;
1463+
public Expr ArraySize;
14181464
public uint NumPlacementArgs;
14191465
public bool IsParenTypeId;
14201466
public SourceRange TypeIdParens;
14211467
public bool IsGlobalNew;
14221468
public bool HasInitializer;
14231469
public CXXNewExpr.InitializationStyle initializationStyle;
1470+
public Expr Initializer;
14241471
public CXXConstructExpr ConstructExpr;
14251472
public SourceRange DirectInitRange;
14261473
}
@@ -1435,6 +1482,7 @@ public CXXDeleteExpr()
14351482
public bool IsArrayForm;
14361483
public bool IsArrayFormAsWritten;
14371484
public Function OperatorDelete;
1485+
public Expr Argument;
14381486
public QualifiedType DestroyedType;
14391487
}
14401488

@@ -1586,6 +1634,7 @@ public UnresolvedMemberExpr()
15861634
}
15871635

15881636
public bool IsImplicitAccess;
1637+
public Expr Base;
15891638
public QualifiedType BaseType;
15901639
public bool HasUnresolvedUsing;
15911640
public bool IsArrow;
@@ -1609,6 +1658,7 @@ public PackExpansionExpr()
16091658
{
16101659
}
16111660

1661+
public Expr Pattern;
16121662
public SourceLocation EllipsisLoc;
16131663
}
16141664

src/AST/Stmt.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public Stmt()
148148

149149
public SourceRange SourceRange;
150150
public SourceLocation EndLoc;
151+
public Stmt StripLabelLikeStatements;
151152
}
152153

153154
public partial class DeclStmt : Stmt
@@ -158,6 +159,7 @@ public DeclStmt()
158159

159160
public List<Declaration> Decls = new List<Declaration>();
160161
public bool IsSingleDecl;
162+
public Declaration SingleDecl;
161163
}
162164

163165
public partial class NullStmt : Stmt
@@ -179,6 +181,8 @@ public CompoundStmt()
179181
public List<Stmt> Body = new List<Stmt>();
180182
public bool BodyEmpty;
181183
public uint Size;
184+
public Stmt BodyFront;
185+
public Stmt BodyBack;
182186
public SourceLocation LBracLoc;
183187
public SourceLocation RBracLoc;
184188
}
@@ -191,6 +195,7 @@ public SwitchCase()
191195

192196
public SourceLocation KeywordLoc;
193197
public SourceLocation ColonLoc;
198+
public Stmt SubStmt;
194199
}
195200

196201
public partial class CaseStmt : SwitchCase
@@ -203,7 +208,6 @@ public CaseStmt()
203208
public SourceLocation EllipsisLoc;
204209
public Expr LHS;
205210
public Expr RHS;
206-
public Stmt SubStmt;
207211
public bool CaseStmtIsGNURange;
208212
}
209213

@@ -213,7 +217,6 @@ public DefaultStmt()
213217
{
214218
}
215219

216-
public Stmt SubStmt;
217220
public SourceLocation DefaultLoc;
218221
}
219222

@@ -235,6 +238,7 @@ public AttributedStmt()
235238
}
236239

237240
public SourceLocation AttrLoc;
241+
public Stmt SubStmt;
238242
}
239243

240244
public partial class IfStmt : Stmt
@@ -253,6 +257,7 @@ public IfStmt()
253257
public bool HasInitStorage;
254258
public bool HasVarStorage;
255259
public bool HasElseStorage;
260+
public DeclStmt ConditionVariableDeclStmt;
256261
public bool IsObjCAvailabilityCheck;
257262
}
258263

@@ -268,6 +273,7 @@ public SwitchStmt()
268273
public SourceLocation SwitchLoc;
269274
public bool HasInitStorage;
270275
public bool HasVarStorage;
276+
public DeclStmt ConditionVariableDeclStmt;
271277
public bool IsAllEnumCasesCovered;
272278
}
273279

@@ -281,6 +287,7 @@ public WhileStmt()
281287
public Stmt Body;
282288
public SourceLocation WhileLoc;
283289
public bool HasVarStorage;
290+
public DeclStmt ConditionVariableDeclStmt;
284291
}
285292

286293
public partial class DoStmt : Stmt
@@ -491,6 +498,7 @@ public CapturedStmt()
491498
}
492499

493500
public List<Expr> CaptureInits = new List<Expr>();
501+
public Stmt capturedStmt;
494502
public uint CaptureSize;
495503
}
496504

@@ -512,6 +520,7 @@ public CXXTryStmt()
512520
}
513521

514522
public SourceLocation TryLoc;
523+
public CompoundStmt TryBlock;
515524
public uint NumHandlers;
516525
}
517526

@@ -526,6 +535,10 @@ public CXXForRangeStmt()
526535
public Expr Cond;
527536
public Expr Inc;
528537
public Stmt Body;
538+
public DeclStmt RangeStmt;
539+
public DeclStmt BeginStmt;
540+
public DeclStmt EndStmt;
541+
public DeclStmt LoopVarStmt;
529542
public SourceLocation ForLoc;
530543
public SourceLocation CoawaitLoc;
531544
public SourceLocation ColonLoc;

0 commit comments

Comments
 (0)