Merge pull request #3427 from MathiasVP/remove-abstract-from-builtin-op

C++: Remove abstract keyword from `BuiltInOperation`
This commit is contained in:
Jonas Jensen
2020-05-11 14:16:46 +02:00
committed by GitHub
6 changed files with 5811 additions and 1624 deletions

View File

@@ -4,7 +4,7 @@ import semmle.code.cpp.exprs.Expr
* A C/C++ builtin operation. This is the root QL class encompassing
* built-in functionality.
*/
abstract class BuiltInOperation extends Expr {
class BuiltInOperation extends Expr, @builtin_op {
override string getCanonicalQLClass() { result = "BuiltInOperation" }
}
@@ -12,17 +12,7 @@ abstract class BuiltInOperation extends Expr {
* A C/C++ built-in operation that is used to support functions with variable numbers of arguments.
* This includes `va_start`, `va_end`, `va_copy`, and `va_arg`.
*/
class VarArgsExpr extends BuiltInOperation {
VarArgsExpr() {
this instanceof BuiltInVarArgsStart
or
this instanceof BuiltInVarArgsEnd
or
this instanceof BuiltInVarArg
or
this instanceof BuiltInVarArgCopy
}
}
class VarArgsExpr extends BuiltInOperation, @var_args_expr { }
/**
* A C/C++ `__builtin_va_start` built-in operation (used by some

View File

@@ -1641,6 +1641,67 @@ case @expr.kind of
| 326 = @spaceshipexpr
;
@var_args_expr = @vastartexpr
| @vaendexpr
| @vaargexpr
| @vacopyexpr
;
@builtin_op = @var_args_expr
| @noopexpr
| @offsetofexpr
| @intaddrexpr
| @hasassignexpr
| @hascopyexpr
| @hasnothrowassign
| @hasnothrowconstr
| @hasnothrowcopy
| @hastrivialassign
| @hastrivialconstr
| @hastrivialcopy
| @hastrivialdestructor
| @hasuserdestr
| @hasvirtualdestr
| @isabstractexpr
| @isbaseofexpr
| @isclassexpr
| @isconvtoexpr
| @isemptyexpr
| @isenumexpr
| @ispodexpr
| @ispolyexpr
| @isunionexpr
| @typescompexpr
| @builtinshufflevector
| @builtinconvertvector
| @builtinaddressof
| @istriviallyconstructibleexpr
| @isdestructibleexpr
| @isnothrowdestructibleexpr
| @istriviallydestructibleexpr
| @istriviallyassignableexpr
| @isnothrowassignableexpr
| @isstandardlayoutexpr
| @istriviallycopyableexpr
| @isliteraltypeexpr
| @hastrivialmoveconstructorexpr
| @hastrivialmoveassignexpr
| @hasnothrowmoveassignexpr
| @isconstructibleexpr
| @isnothrowconstructibleexpr
| @hasfinalizerexpr
| @isdelegateexpr
| @isinterfaceclassexpr
| @isrefarrayexpr
| @isrefclassexpr
| @issealedexpr
| @issimplevalueclassexpr
| @isvalueclassexpr
| @isfinalexpr
| @builtinchooseexpr
| @builtincomplex
;
new_allocated_type(
unique int expr: @new_expr ref,
int type_id: @type ref

File diff suppressed because it is too large Load Diff