Files
Jonas Jensen 367776511f C++: Don't use dbtypes in ControlFlowNode etc.
Many classes have been declared with `extends @cfgnode` because they
should be implemented internally as a control-flow node but should not
expose the member predicates of `ControlFlowNode` to their users. After
the transition in a1e44041e it became mandatory to convert explicitly
between the `Element`-derived `ControlFlowNode` and the raw dbtype
`@cfgnode`, and that commit inserted numerous such conversions as a
result of having all those classes that did not derive from `Element` in
the standard library.

It was also confusing and error-prone that the libraries implementing
`ControlFlowNode` referred to `ControlFlowNode`. This seemingly cyclic
reference worked out because the libraries did not call the predicates
on `ControlFlowNode` whose implementation they were part of.

Both these problems are now solved by adding a new class
`ControlFlowNodeBase extends Element` that should be used in preference
to `@cfgnode` everywhere. This class is for exactly those use cases
where `@cfgnode` should be seen as an `Element` without having too many
member predicates on it.

The classes that move from extending `@cfgnode` to extending
`ControlFlowNodeBase` are: `BasicBlock`, `AdditionalControlFlowEdge`,
`DefOrUse`, `SsaDefinition`, `SubBasicBlock` and `RangeSsaDefinition`.
These previously had to define their own `toString` rootdef, which
typically had some dummy string as result (like `"BasicBlock"`), but now
their `toString` is part of the `Element` rootdef and should not be
overridden otherwise `Element.toString` will sometimes have multiple
results. Removing these dummy `toString` predicates had some effects on
the tests that are included in this commit.

The `getLocation` family of predicates is affected like `toString`, but
the situation is slightly different. Some of these classes had genuinely
useful alternative definitions of locations. Fortunately, they all used
`hasLocationInfo`, which is preferred over `getLocation` by the QL
engine. Because `Element` does not define `getLocationInfo`, each class
can create its own rootdef of this predicate like before.
2018-08-28 14:27:32 +02:00

178 lines
8.1 KiB
Plaintext

| conjugation.c:3:5:3:5 | x | AnalysedExpr |
| conjugation.c:3:5:3:5 | x | CompileTimeVariableExpr |
| conjugation.c:3:5:3:5 | x | DefOrUse |
| conjugation.c:3:5:3:5 | x | VariableAccess |
| conjugation.c:3:5:3:10 | ... = ... | AnalysedExpr |
| conjugation.c:3:5:3:10 | ... = ... | AssignExpr |
| conjugation.c:3:5:3:10 | ... = ... | CompileTimeVariableExpr |
| conjugation.c:3:5:3:10 | ... = ... | Def |
| conjugation.c:3:5:3:10 | ... = ... | ExprInVoidContext |
| conjugation.c:3:5:3:10 | ... = ... | NameQualifiableElement |
| conjugation.c:3:5:3:10 | ... = ... | RangeSsaDefinition |
| conjugation.c:3:5:3:10 | ... = ... | SsaDefinition |
| conjugation.c:3:9:3:10 | ~ ... | AnalysedExpr |
| conjugation.c:3:9:3:10 | ~ ... | CompileTimeVariableExpr |
| conjugation.c:3:9:3:10 | ~ ... | ConjugationExpr |
| conjugation.c:3:9:3:10 | ~ ... | DefOrUse |
| conjugation.c:3:9:3:10 | ~ ... | NameQualifiableElement |
| conjugation.c:3:10:3:10 | x | AnalysedExpr |
| conjugation.c:3:10:3:10 | x | CompileTimeVariableExpr |
| conjugation.c:3:10:3:10 | x | Use |
| conjugation.c:3:10:3:10 | x | VariableAccess |
| test.c:5:5:5:5 | z | AnalysedExpr |
| test.c:5:5:5:5 | z | CompileTimeVariableExpr |
| test.c:5:5:5:5 | z | DefOrUse |
| test.c:5:5:5:5 | z | VariableAccess |
| test.c:5:5:5:13 | ... = ... | AnalysedExpr |
| test.c:5:5:5:13 | ... = ... | AssignExpr |
| test.c:5:5:5:13 | ... = ... | CompileTimeVariableExpr |
| test.c:5:5:5:13 | ... = ... | Def |
| test.c:5:5:5:13 | ... = ... | ExprInVoidContext |
| test.c:5:5:5:13 | ... = ... | NameQualifiableElement |
| test.c:5:5:5:13 | ... = ... | RangeSsaDefinition |
| test.c:5:5:5:13 | ... = ... | SsaDefinition |
| test.c:5:9:5:9 | x | AnalysedExpr |
| test.c:5:9:5:9 | x | CompileTimeVariableExpr |
| test.c:5:9:5:9 | x | Use |
| test.c:5:9:5:9 | x | VariableAccess |
| test.c:5:9:5:13 | ... * ... | AnalysedExpr |
| test.c:5:9:5:13 | ... * ... | CompileTimeVariableExpr |
| test.c:5:9:5:13 | ... * ... | DefOrUse |
| test.c:5:9:5:13 | ... * ... | ImaginaryMulExpr |
| test.c:5:9:5:13 | ... * ... | NameQualifiableElement |
| test.c:5:13:5:13 | y | AnalysedExpr |
| test.c:5:13:5:13 | y | CompileTimeVariableExpr |
| test.c:5:13:5:13 | y | Use |
| test.c:5:13:5:13 | y | VariableAccess |
| test.c:6:5:6:5 | z | AnalysedExpr |
| test.c:6:5:6:5 | z | CompileTimeVariableExpr |
| test.c:6:5:6:5 | z | DefOrUse |
| test.c:6:5:6:5 | z | VariableAccess |
| test.c:6:5:6:13 | ... = ... | AnalysedExpr |
| test.c:6:5:6:13 | ... = ... | AssignExpr |
| test.c:6:5:6:13 | ... = ... | CompileTimeVariableExpr |
| test.c:6:5:6:13 | ... = ... | Def |
| test.c:6:5:6:13 | ... = ... | ExprInVoidContext |
| test.c:6:5:6:13 | ... = ... | NameQualifiableElement |
| test.c:6:5:6:13 | ... = ... | RangeSsaDefinition |
| test.c:6:5:6:13 | ... = ... | SsaDefinition |
| test.c:6:9:6:9 | z | AnalysedExpr |
| test.c:6:9:6:9 | z | CompileTimeVariableExpr |
| test.c:6:9:6:9 | z | Use |
| test.c:6:9:6:9 | z | VariableAccess |
| test.c:6:9:6:13 | (double)... | AnalysedExpr |
| test.c:6:9:6:13 | (double)... | CStyleCast |
| test.c:6:9:6:13 | (double)... | CompileTimeVariableExpr |
| test.c:6:9:6:13 | (double)... | DefOrUse |
| test.c:6:9:6:13 | (double)... | FloatingPointConversion |
| test.c:6:9:6:13 | (double)... | NameQualifiableElement |
| test.c:6:9:6:13 | ... / ... | AnalysedExpr |
| test.c:6:9:6:13 | ... / ... | CompileTimeVariableExpr |
| test.c:6:9:6:13 | ... / ... | DefOrUse |
| test.c:6:9:6:13 | ... / ... | ImaginaryDivExpr |
| test.c:6:9:6:13 | ... / ... | NameQualifiableElement |
| test.c:6:13:6:13 | y | AnalysedExpr |
| test.c:6:13:6:13 | y | CompileTimeVariableExpr |
| test.c:6:13:6:13 | y | Use |
| test.c:6:13:6:13 | y | VariableAccess |
| test.c:7:5:7:5 | w | AnalysedExpr |
| test.c:7:5:7:5 | w | CompileTimeVariableExpr |
| test.c:7:5:7:5 | w | DefOrUse |
| test.c:7:5:7:5 | w | VariableAccess |
| test.c:7:5:7:13 | ... = ... | AnalysedExpr |
| test.c:7:5:7:13 | ... = ... | AssignExpr |
| test.c:7:5:7:13 | ... = ... | CompileTimeVariableExpr |
| test.c:7:5:7:13 | ... = ... | Def |
| test.c:7:5:7:13 | ... = ... | ExprInVoidContext |
| test.c:7:5:7:13 | ... = ... | NameQualifiableElement |
| test.c:7:5:7:13 | ... = ... | RangeSsaDefinition |
| test.c:7:5:7:13 | ... = ... | SsaDefinition |
| test.c:7:9:7:9 | z | AnalysedExpr |
| test.c:7:9:7:9 | z | CompileTimeVariableExpr |
| test.c:7:9:7:9 | z | Use |
| test.c:7:9:7:9 | z | VariableAccess |
| test.c:7:9:7:13 | ... + ... | AnalysedExpr |
| test.c:7:9:7:13 | ... + ... | CompileTimeVariableExpr |
| test.c:7:9:7:13 | ... + ... | DefOrUse |
| test.c:7:9:7:13 | ... + ... | NameQualifiableElement |
| test.c:7:9:7:13 | ... + ... | RealImaginaryAddExpr |
| test.c:7:13:7:13 | x | AnalysedExpr |
| test.c:7:13:7:13 | x | CompileTimeVariableExpr |
| test.c:7:13:7:13 | x | Use |
| test.c:7:13:7:13 | x | VariableAccess |
| test.c:8:5:8:5 | w | AnalysedExpr |
| test.c:8:5:8:5 | w | CompileTimeVariableExpr |
| test.c:8:5:8:5 | w | DefOrUse |
| test.c:8:5:8:5 | w | VariableAccess |
| test.c:8:5:8:13 | ... = ... | AnalysedExpr |
| test.c:8:5:8:13 | ... = ... | AssignExpr |
| test.c:8:5:8:13 | ... = ... | CompileTimeVariableExpr |
| test.c:8:5:8:13 | ... = ... | Def |
| test.c:8:5:8:13 | ... = ... | ExprInVoidContext |
| test.c:8:5:8:13 | ... = ... | NameQualifiableElement |
| test.c:8:5:8:13 | ... = ... | RangeSsaDefinition |
| test.c:8:5:8:13 | ... = ... | SsaDefinition |
| test.c:8:9:8:9 | x | AnalysedExpr |
| test.c:8:9:8:9 | x | CompileTimeVariableExpr |
| test.c:8:9:8:9 | x | Use |
| test.c:8:9:8:9 | x | VariableAccess |
| test.c:8:9:8:13 | ... + ... | AnalysedExpr |
| test.c:8:9:8:13 | ... + ... | CompileTimeVariableExpr |
| test.c:8:9:8:13 | ... + ... | DefOrUse |
| test.c:8:9:8:13 | ... + ... | ImaginaryRealAddExpr |
| test.c:8:9:8:13 | ... + ... | NameQualifiableElement |
| test.c:8:13:8:13 | z | AnalysedExpr |
| test.c:8:13:8:13 | z | CompileTimeVariableExpr |
| test.c:8:13:8:13 | z | Use |
| test.c:8:13:8:13 | z | VariableAccess |
| test.c:9:5:9:5 | w | AnalysedExpr |
| test.c:9:5:9:5 | w | CompileTimeVariableExpr |
| test.c:9:5:9:5 | w | DefOrUse |
| test.c:9:5:9:5 | w | VariableAccess |
| test.c:9:5:9:13 | ... = ... | AnalysedExpr |
| test.c:9:5:9:13 | ... = ... | AssignExpr |
| test.c:9:5:9:13 | ... = ... | CompileTimeVariableExpr |
| test.c:9:5:9:13 | ... = ... | Def |
| test.c:9:5:9:13 | ... = ... | ExprInVoidContext |
| test.c:9:5:9:13 | ... = ... | NameQualifiableElement |
| test.c:9:5:9:13 | ... = ... | RangeSsaDefinition |
| test.c:9:5:9:13 | ... = ... | SsaDefinition |
| test.c:9:9:9:9 | z | AnalysedExpr |
| test.c:9:9:9:9 | z | CompileTimeVariableExpr |
| test.c:9:9:9:9 | z | Use |
| test.c:9:9:9:9 | z | VariableAccess |
| test.c:9:9:9:13 | ... - ... | AnalysedExpr |
| test.c:9:9:9:13 | ... - ... | CompileTimeVariableExpr |
| test.c:9:9:9:13 | ... - ... | DefOrUse |
| test.c:9:9:9:13 | ... - ... | NameQualifiableElement |
| test.c:9:9:9:13 | ... - ... | RealImaginarySubExpr |
| test.c:9:13:9:13 | x | AnalysedExpr |
| test.c:9:13:9:13 | x | CompileTimeVariableExpr |
| test.c:9:13:9:13 | x | Use |
| test.c:9:13:9:13 | x | VariableAccess |
| test.c:10:5:10:5 | w | AnalysedExpr |
| test.c:10:5:10:5 | w | CompileTimeVariableExpr |
| test.c:10:5:10:5 | w | DefOrUse |
| test.c:10:5:10:5 | w | VariableAccess |
| test.c:10:5:10:13 | ... = ... | AnalysedExpr |
| test.c:10:5:10:13 | ... = ... | AssignExpr |
| test.c:10:5:10:13 | ... = ... | CompileTimeVariableExpr |
| test.c:10:5:10:13 | ... = ... | Def |
| test.c:10:5:10:13 | ... = ... | ExprInVoidContext |
| test.c:10:5:10:13 | ... = ... | NameQualifiableElement |
| test.c:10:5:10:13 | ... = ... | RangeSsaDefinition |
| test.c:10:5:10:13 | ... = ... | SsaDefinition |
| test.c:10:9:10:9 | x | AnalysedExpr |
| test.c:10:9:10:9 | x | CompileTimeVariableExpr |
| test.c:10:9:10:9 | x | Use |
| test.c:10:9:10:9 | x | VariableAccess |
| test.c:10:9:10:13 | ... - ... | AnalysedExpr |
| test.c:10:9:10:13 | ... - ... | CompileTimeVariableExpr |
| test.c:10:9:10:13 | ... - ... | DefOrUse |
| test.c:10:9:10:13 | ... - ... | ImaginaryRealSubExpr |
| test.c:10:9:10:13 | ... - ... | NameQualifiableElement |
| test.c:10:13:10:13 | z | AnalysedExpr |
| test.c:10:13:10:13 | z | CompileTimeVariableExpr |
| test.c:10:13:10:13 | z | Use |
| test.c:10:13:10:13 | z | VariableAccess |