Skip to content

Commit 07603a8

Browse files
committed
C++: Rename CallOrAllocationExpr to something more generic
1 parent 5aabd90 commit 07603a8

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ private predicate hasDefaultSideEffect(Call call, ParameterIndex i, boolean buff
130130
}
131131

132132
/**
133-
* A `Call` or `NewOrNewArrayExpr` or `DeleteOrDeleteArrayExpr`.
133+
* An expression that can have call side effects.
134134
*
135-
* All kinds of expression invoke a function as part of their evaluation. This class provides a
136-
* way to treat both kinds of function similarly, and to get the invoked `Function`.
135+
* All kinds of expressions invoke a function as part of their evaluation. This class provides a
136+
* way to treat those functions similarly, and to get the invoked `Function`.
137137
*/
138-
class CallOrAllocationExpr extends Expr {
139-
CallOrAllocationExpr() {
138+
class ExprWithCallSizeEffects extends Expr {
139+
ExprWithCallSizeEffects() {
140140
this instanceof Call
141141
or
142142
this instanceof NewOrNewArrayExpr
@@ -158,7 +158,7 @@ class CallOrAllocationExpr extends Expr {
158158
* Returns the side effect opcode, if any, that represents any side effects not specifically modeled
159159
* by an argument side effect.
160160
*/
161-
Opcode getCallSideEffectOpcode(CallOrAllocationExpr expr) {
161+
Opcode getCallSideEffectOpcode(ExprWithCallSizeEffects expr) {
162162
not exists(expr.getTarget().(SideEffectFunction)) and result instanceof Opcode::CallSideEffect
163163
or
164164
exists(SideEffectFunction sideEffectFunction |

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ newtype TTranslatedElement =
871871
// The declaration/initialization part of a `ConditionDeclExpr`
872872
TTranslatedConditionDecl(ConditionDeclExpr expr) { not ignoreExpr(expr) } or
873873
// The side effects of a `Call`
874-
TTranslatedCallSideEffects(CallOrAllocationExpr expr) {
874+
TTranslatedCallSideEffects(ExprWithCallSizeEffects expr) {
875875
not ignoreExpr(expr) and
876876
not ignoreSideEffects(expr)
877877
} or

0 commit comments

Comments
 (0)