File tree Expand file tree Collapse file tree 4 files changed +37
-6
lines changed
cpp/ql/lib/semmle/code/cpp/ir/implementation Expand file tree Collapse file tree 4 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ private newtype TOpcode =
93
93
TInlineAsm ( ) or
94
94
TUnreached ( ) or
95
95
TNewObj ( ) or
96
+ TTypeid ( ) or
96
97
TTypeidExpr ( ) or
97
98
TTypeidType ( )
98
99
@@ -1284,6 +1285,15 @@ module Opcode {
1284
1285
final override string toString ( ) { result = "NewObj" }
1285
1286
}
1286
1287
1288
+ /**
1289
+ * The `Opcode` for a `TypeidInstruction`.
1290
+ *
1291
+ * See the `TypeidInstruction` documentation for more details.
1292
+ */
1293
+ class Typeid extends Opcode , TTypeid {
1294
+ final override string toString ( ) { result = "Typeid" }
1295
+ }
1296
+
1287
1297
/**
1288
1298
* The `Opcode` for a `TypeidExprInstruction`.
1289
1299
*
Original file line number Diff line number Diff line change @@ -2294,18 +2294,25 @@ class NewObjInstruction extends Instruction {
2294
2294
NewObjInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: NewObj }
2295
2295
}
2296
2296
2297
+ /**
2298
+ * An instruction that returns the type info for its operand.
2299
+ */
2300
+ class TypeidInstruction extends Instruction {
2301
+ TypeidInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: Typeid }
2302
+ }
2303
+
2297
2304
/**
2298
2305
* An instruction that returns the type info for its operand, where the
2299
2306
* operand occurs as an expression in the AST.
2300
2307
*/
2301
- class TypeidExprInstruction extends UnaryInstruction {
2308
+ class TypeidExprInstruction extends TypeidInstruction , UnaryInstruction {
2302
2309
TypeidExprInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: TypeidExpr }
2303
2310
}
2304
2311
2305
2312
/**
2306
2313
* An instruction that returns the type info for its operand, where the
2307
2314
* operand occurs as a type in the AST.
2308
2315
*/
2309
- class TypeidTypeInstruction extends Instruction {
2316
+ class TypeidTypeInstruction extends TypeidInstruction {
2310
2317
TypeidTypeInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: TypeidType }
2311
2318
}
Original file line number Diff line number Diff line change @@ -2294,18 +2294,25 @@ class NewObjInstruction extends Instruction {
2294
2294
NewObjInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: NewObj }
2295
2295
}
2296
2296
2297
+ /**
2298
+ * An instruction that returns the type info for its operand.
2299
+ */
2300
+ class TypeidInstruction extends Instruction {
2301
+ TypeidInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: Typeid }
2302
+ }
2303
+
2297
2304
/**
2298
2305
* An instruction that returns the type info for its operand, where the
2299
2306
* operand occurs as an expression in the AST.
2300
2307
*/
2301
- class TypeidExprInstruction extends UnaryInstruction {
2308
+ class TypeidExprInstruction extends TypeidInstruction , UnaryInstruction {
2302
2309
TypeidExprInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: TypeidExpr }
2303
2310
}
2304
2311
2305
2312
/**
2306
2313
* An instruction that returns the type info for its operand, where the
2307
2314
* operand occurs as a type in the AST.
2308
2315
*/
2309
- class TypeidTypeInstruction extends Instruction {
2316
+ class TypeidTypeInstruction extends TypeidInstruction {
2310
2317
TypeidTypeInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: TypeidType }
2311
2318
}
Original file line number Diff line number Diff line change @@ -2294,18 +2294,25 @@ class NewObjInstruction extends Instruction {
2294
2294
NewObjInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: NewObj }
2295
2295
}
2296
2296
2297
+ /**
2298
+ * An instruction that returns the type info for its operand.
2299
+ */
2300
+ class TypeidInstruction extends Instruction {
2301
+ TypeidInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: Typeid }
2302
+ }
2303
+
2297
2304
/**
2298
2305
* An instruction that returns the type info for its operand, where the
2299
2306
* operand occurs as an expression in the AST.
2300
2307
*/
2301
- class TypeidExprInstruction extends UnaryInstruction {
2308
+ class TypeidExprInstruction extends TypeidInstruction , UnaryInstruction {
2302
2309
TypeidExprInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: TypeidExpr }
2303
2310
}
2304
2311
2305
2312
/**
2306
2313
* An instruction that returns the type info for its operand, where the
2307
2314
* operand occurs as a type in the AST.
2308
2315
*/
2309
- class TypeidTypeInstruction extends Instruction {
2316
+ class TypeidTypeInstruction extends TypeidInstruction {
2310
2317
TypeidTypeInstruction ( ) { this .getOpcode ( ) instanceof Opcode:: TypeidType }
2311
2318
}
You can’t perform that action at this time.
0 commit comments