mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C++: Introduce TypeidInstruction base class
This commit is contained in:
@@ -93,6 +93,7 @@ private newtype TOpcode =
|
||||
TInlineAsm() or
|
||||
TUnreached() or
|
||||
TNewObj() or
|
||||
TTypeid() or
|
||||
TTypeidExpr() or
|
||||
TTypeidType()
|
||||
|
||||
@@ -1284,6 +1285,15 @@ module Opcode {
|
||||
final override string toString() { result = "NewObj" }
|
||||
}
|
||||
|
||||
/**
|
||||
* The `Opcode` for a `TypeidInstruction`.
|
||||
*
|
||||
* See the `TypeidInstruction` documentation for more details.
|
||||
*/
|
||||
class Typeid extends Opcode, TTypeid {
|
||||
final override string toString() { result = "Typeid" }
|
||||
}
|
||||
|
||||
/**
|
||||
* The `Opcode` for a `TypeidExprInstruction`.
|
||||
*
|
||||
|
||||
@@ -2294,11 +2294,18 @@ class NewObjInstruction extends Instruction {
|
||||
NewObjInstruction() { this.getOpcode() instanceof Opcode::NewObj }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instruction that returns the type info for its operand.
|
||||
*/
|
||||
class TypeidInstruction extends Instruction {
|
||||
TypeidInstruction() { this.getOpcode() instanceof Opcode::Typeid }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instruction that returns the type info for its operand, where the
|
||||
* operand occurs as an expression in the AST.
|
||||
*/
|
||||
class TypeidExprInstruction extends UnaryInstruction {
|
||||
class TypeidExprInstruction extends TypeidInstruction, UnaryInstruction {
|
||||
TypeidExprInstruction() { this.getOpcode() instanceof Opcode::TypeidExpr }
|
||||
}
|
||||
|
||||
@@ -2306,6 +2313,6 @@ class TypeidExprInstruction extends UnaryInstruction {
|
||||
* An instruction that returns the type info for its operand, where the
|
||||
* operand occurs as a type in the AST.
|
||||
*/
|
||||
class TypeidTypeInstruction extends Instruction {
|
||||
class TypeidTypeInstruction extends TypeidInstruction {
|
||||
TypeidTypeInstruction() { this.getOpcode() instanceof Opcode::TypeidType }
|
||||
}
|
||||
|
||||
@@ -2294,11 +2294,18 @@ class NewObjInstruction extends Instruction {
|
||||
NewObjInstruction() { this.getOpcode() instanceof Opcode::NewObj }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instruction that returns the type info for its operand.
|
||||
*/
|
||||
class TypeidInstruction extends Instruction {
|
||||
TypeidInstruction() { this.getOpcode() instanceof Opcode::Typeid }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instruction that returns the type info for its operand, where the
|
||||
* operand occurs as an expression in the AST.
|
||||
*/
|
||||
class TypeidExprInstruction extends UnaryInstruction {
|
||||
class TypeidExprInstruction extends TypeidInstruction, UnaryInstruction {
|
||||
TypeidExprInstruction() { this.getOpcode() instanceof Opcode::TypeidExpr }
|
||||
}
|
||||
|
||||
@@ -2306,6 +2313,6 @@ class TypeidExprInstruction extends UnaryInstruction {
|
||||
* An instruction that returns the type info for its operand, where the
|
||||
* operand occurs as a type in the AST.
|
||||
*/
|
||||
class TypeidTypeInstruction extends Instruction {
|
||||
class TypeidTypeInstruction extends TypeidInstruction {
|
||||
TypeidTypeInstruction() { this.getOpcode() instanceof Opcode::TypeidType }
|
||||
}
|
||||
|
||||
@@ -2294,11 +2294,18 @@ class NewObjInstruction extends Instruction {
|
||||
NewObjInstruction() { this.getOpcode() instanceof Opcode::NewObj }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instruction that returns the type info for its operand.
|
||||
*/
|
||||
class TypeidInstruction extends Instruction {
|
||||
TypeidInstruction() { this.getOpcode() instanceof Opcode::Typeid }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instruction that returns the type info for its operand, where the
|
||||
* operand occurs as an expression in the AST.
|
||||
*/
|
||||
class TypeidExprInstruction extends UnaryInstruction {
|
||||
class TypeidExprInstruction extends TypeidInstruction, UnaryInstruction {
|
||||
TypeidExprInstruction() { this.getOpcode() instanceof Opcode::TypeidExpr }
|
||||
}
|
||||
|
||||
@@ -2306,6 +2313,6 @@ class TypeidExprInstruction extends UnaryInstruction {
|
||||
* An instruction that returns the type info for its operand, where the
|
||||
* operand occurs as a type in the AST.
|
||||
*/
|
||||
class TypeidTypeInstruction extends Instruction {
|
||||
class TypeidTypeInstruction extends TypeidInstruction {
|
||||
TypeidTypeInstruction() { this.getOpcode() instanceof Opcode::TypeidType }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user