Skip to content

Commit 3369453

Browse files
authored
Merge pull request github#3427 from MathiasVP/remove-abstract-from-builtin-op
C++: Remove abstract keyword from `BuiltInOperation`
2 parents 4f5b8f7 + 411e52a commit 3369453

File tree

6 files changed

+5803
-1616
lines changed

6 files changed

+5803
-1616
lines changed

cpp/ql/src/semmle/code/cpp/exprs/BuiltInOperations.qll

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,15 @@ import semmle.code.cpp.exprs.Expr
44
* A C/C++ builtin operation. This is the root QL class encompassing
55
* built-in functionality.
66
*/
7-
abstract class BuiltInOperation extends Expr {
7+
class BuiltInOperation extends Expr, @builtin_op {
88
override string getCanonicalQLClass() { result = "BuiltInOperation" }
99
}
1010

1111
/**
1212
* A C/C++ built-in operation that is used to support functions with variable numbers of arguments.
1313
* This includes `va_start`, `va_end`, `va_copy`, and `va_arg`.
1414
*/
15-
class VarArgsExpr extends BuiltInOperation {
16-
VarArgsExpr() {
17-
this instanceof BuiltInVarArgsStart
18-
or
19-
this instanceof BuiltInVarArgsEnd
20-
or
21-
this instanceof BuiltInVarArg
22-
or
23-
this instanceof BuiltInVarArgCopy
24-
}
25-
}
15+
class VarArgsExpr extends BuiltInOperation, @var_args_expr { }
2616

2717
/**
2818
* A C/C++ `__builtin_va_start` built-in operation (used by some

cpp/ql/src/semmlecode.cpp.dbscheme

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,67 @@ case @expr.kind of
16411641
| 326 = @spaceshipexpr
16421642
;
16431643

1644+
@var_args_expr = @vastartexpr
1645+
| @vaendexpr
1646+
| @vaargexpr
1647+
| @vacopyexpr
1648+
;
1649+
1650+
@builtin_op = @var_args_expr
1651+
| @noopexpr
1652+
| @offsetofexpr
1653+
| @intaddrexpr
1654+
| @hasassignexpr
1655+
| @hascopyexpr
1656+
| @hasnothrowassign
1657+
| @hasnothrowconstr
1658+
| @hasnothrowcopy
1659+
| @hastrivialassign
1660+
| @hastrivialconstr
1661+
| @hastrivialcopy
1662+
| @hastrivialdestructor
1663+
| @hasuserdestr
1664+
| @hasvirtualdestr
1665+
| @isabstractexpr
1666+
| @isbaseofexpr
1667+
| @isclassexpr
1668+
| @isconvtoexpr
1669+
| @isemptyexpr
1670+
| @isenumexpr
1671+
| @ispodexpr
1672+
| @ispolyexpr
1673+
| @isunionexpr
1674+
| @typescompexpr
1675+
| @builtinshufflevector
1676+
| @builtinconvertvector
1677+
| @builtinaddressof
1678+
| @istriviallyconstructibleexpr
1679+
| @isdestructibleexpr
1680+
| @isnothrowdestructibleexpr
1681+
| @istriviallydestructibleexpr
1682+
| @istriviallyassignableexpr
1683+
| @isnothrowassignableexpr
1684+
| @isstandardlayoutexpr
1685+
| @istriviallycopyableexpr
1686+
| @isliteraltypeexpr
1687+
| @hastrivialmoveconstructorexpr
1688+
| @hastrivialmoveassignexpr
1689+
| @hasnothrowmoveassignexpr
1690+
| @isconstructibleexpr
1691+
| @isnothrowconstructibleexpr
1692+
| @hasfinalizerexpr
1693+
| @isdelegateexpr
1694+
| @isinterfaceclassexpr
1695+
| @isrefarrayexpr
1696+
| @isrefclassexpr
1697+
| @issealedexpr
1698+
| @issimplevalueclassexpr
1699+
| @isvalueclassexpr
1700+
| @isfinalexpr
1701+
| @builtinchooseexpr
1702+
| @builtincomplex
1703+
;
1704+
16441705
new_allocated_type(
16451706
unique int expr: @new_expr ref,
16461707
int type_id: @type ref

0 commit comments

Comments
 (0)