diff --git a/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_array_init.ql b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_array_init.ql new file mode 100644 index 000000000000..acf38e449509 --- /dev/null +++ b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_array_init.ql @@ -0,0 +1,11 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, int element_index, int position +where aggregate_array_init(aggregate, initializer, element_index, position, _) +select aggregate, initializer, element_index, position diff --git a/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_field_init.ql b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_field_init.ql new file mode 100644 index 000000000000..47503cbfd17a --- /dev/null +++ b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_field_init.ql @@ -0,0 +1,15 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +class MemberVariable extends @membervariable { + string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, MemberVariable field, int position +where aggregate_field_init(aggregate, initializer, field, position, _) +select aggregate, initializer, field, position diff --git a/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/old.dbscheme b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/old.dbscheme new file mode 100644 index 000000000000..159dbb330468 --- /dev/null +++ b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/old.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@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 + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/semmlecode.cpp.dbscheme b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..e594389175c0 --- /dev/null +++ b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/semmlecode.cpp.dbscheme @@ -0,0 +1,2444 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@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 + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/upgrade.properties b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/upgrade.properties new file mode 100644 index 000000000000..b7e78b39ee7a --- /dev/null +++ b/cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/upgrade.properties @@ -0,0 +1,4 @@ +description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +compatibility: backwards +aggregate_array_init.rel: run aggregate_array_init.qlo +aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file diff --git a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md new file mode 100644 index 000000000000..3598136973c5 --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct\union fields and array elements. \ No newline at end of file diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll index a36758417bb9..fb79988c10f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll @@ -213,7 +213,27 @@ class ClassAggregateLiteral extends AggregateLiteral { Expr getFieldExpr(Field field, int position) { field = classType.getAField() and aggregate_field_init(underlyingElement(this), unresolveElement(result), unresolveElement(field), - position) + position, _) + } + + /** + * Holds if the `position`-th initialization of `field` in this aggregate initializer + * uses a designator (e.g., `.x =`, `[42] =`) rather than a positional initializer. + * + * This can be used to distinguish explicitly designated initializations from + * implicit positional ones. + * + * For example, in the initializer: + * ```c + * struct S { int x, y; }; + * struct S s = { .x = 1, 2 }; + * ``` + * - `.x = 1` is a designator init, therefore `isDesignatorInit(x, 0)` holds. + * - `2` is a positional init for `.y`, therefore `isDesignatorInit(y, 1)` does **not** hold. + */ + predicate isDesignatorInit(Field field, int position) { + field = classType.getAField() and + aggregate_field_init(underlyingElement(this), _, unresolveElement(field), position, true) } /** @@ -304,7 +324,24 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral { * - `a.getElementExpr(0, 2)` gives `789`. */ Expr getElementExpr(int elementIndex, int position) { - aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position) + aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position, + _) + } + + /** + * Holds if the `position`-th initialization of the array element at `elementIndex` + * in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than + * an implicit positional initializer. + * + * For example, in: + * ```c + * int x[] = { [0] = 1, 2 }; + * ``` + * - `[0] = 1` is a designator init, therefore `isDesignatorInit(0, 0)` holds. + * - `2` is a positional init for `x[1]`, therefore `isDesignatorInit(1, 1)` does **not** hold. + */ + predicate isDesignatorInit(int elementIndex, int position) { + aggregate_array_init(underlyingElement(this), _, elementIndex, position, true) } /** diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index 0f0a390468a5..5923d7e8351f 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -2039,7 +2039,8 @@ aggregate_field_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int field: @membervariable ref, - int position: int ref + int position: int ref, + boolean designated: boolean ref ); /** @@ -2051,7 +2052,8 @@ aggregate_array_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int element_index: int ref, - int position: int ref + int position: int ref, + boolean designated: boolean ref ); @ctorinit = @ctordirectinit diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 585e8f31e0a1..0e0894531621 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 16215 + 16222 @externalDataElement @@ -34,15 +34,19 @@ @file - 83639 + 83676 @folder - 15890 + 15897 @macro_expansion +<<<<<<< HEAD 40299208 +======= + 40316851 +>>>>>>> d32eedeb48e (C++: update stats file) @other_macro_reference @@ -58,11 +62,19 @@ @var_decl +<<<<<<< HEAD 6734225 @type_decl 1890777 +======= + 6734091 + + + @type_decl + 1891510 +>>>>>>> d32eedeb48e (C++: update stats file) @namespace_decl @@ -70,7 +82,11 @@ @using_declaration +<<<<<<< HEAD 333244 +======= + 333146 +>>>>>>> d32eedeb48e (C++: update stats file) @using_directive @@ -98,7 +114,7 @@ @localvariable - 735324 + 735323 @enumconstant @@ -366,11 +382,15 @@ @decltype - 22068 + 21996 @usertype +<<<<<<< HEAD 4987434 +======= + 4988303 +>>>>>>> d32eedeb48e (C++: update stats file) @mangledname @@ -390,7 +410,7 @@ @ptrtomember - 12083 + 12089 @specifier @@ -422,11 +442,15 @@ @attribute_arg_constant_expr +<<<<<<< HEAD 89600 +======= + 89571 +>>>>>>> d32eedeb48e (C++: update stats file) @attribute_arg_expr - 1801 + 1802 @attribute_arg_empty @@ -446,7 +470,11 @@ @frienddecl +<<<<<<< HEAD 883308 +======= + 883351 +>>>>>>> d32eedeb48e (C++: update stats file) @comment @@ -454,7 +482,7 @@ @namespace - 11095 + 11099 @specialnamequalifyingelement @@ -538,7 +566,11 @@ @divexpr +<<<<<<< HEAD 60352 +======= + 60365 +>>>>>>> d32eedeb48e (C++: update stats file) @remexpr @@ -614,7 +646,7 @@ @assignmulexpr - 14129 + 14135 @assigndivexpr @@ -722,7 +754,11 @@ @literal +<<<<<<< HEAD 6101411 +======= + 6101410 +>>>>>>> d32eedeb48e (C++: update stats file) @aggregateliteral @@ -734,7 +770,11 @@ @temp_init +<<<<<<< HEAD 1076139 +======= + 1076142 +>>>>>>> d32eedeb48e (C++: update stats file) @errorexpr @@ -926,7 +966,7 @@ @delete_array_expr - 1598 + 1599 @new_array_expr @@ -966,7 +1006,11 @@ @static_cast +<<<<<<< HEAD 335479 +======= + 335572 +>>>>>>> d32eedeb48e (C++: update stats file) @reinterpret_cast @@ -986,7 +1030,11 @@ @param_ref +<<<<<<< HEAD 177993 +======= + 177994 +>>>>>>> d32eedeb48e (C++: update stats file) @noopexpr @@ -1146,7 +1194,7 @@ @builtinshuffle - 785 + 786 @blockassignexpr @@ -1430,7 +1478,11 @@ @stmt_decl +<<<<<<< HEAD 770895 +======= + 770894 +>>>>>>> d32eedeb48e (C++: update stats file) @stmt_empty @@ -1502,7 +1554,7 @@ @ppd_elif - 28110 + 28122 @ppd_else @@ -1514,7 +1566,11 @@ @ppd_plain_include +<<<<<<< HEAD 408579 +======= + 408758 +>>>>>>> d32eedeb48e (C++: update stats file) @ppd_define @@ -1592,11 +1648,11 @@ compilations - 16215 + 16222 id - 16215 + 16222 cwd @@ -1614,7 +1670,7 @@ 1 2 - 16215 + 16222 @@ -1640,11 +1696,15 @@ compilation_args +<<<<<<< HEAD 1298229 +======= + 1298797 +>>>>>>> d32eedeb48e (C++: update stats file) id - 16215 + 16222 num @@ -1652,7 +1712,7 @@ arg - 37538 + 37555 @@ -1666,12 +1726,12 @@ 36 42 - 1286 + 1287 42 43 - 1408 + 1409 43 @@ -1696,12 +1756,12 @@ 71 72 - 907 + 908 72 90 - 1151 + 1152 94 @@ -1711,7 +1771,7 @@ 98 99 - 1720 + 1721 100 @@ -1721,7 +1781,7 @@ 103 104 - 2560 + 2561 104 @@ -1757,12 +1817,12 @@ 38 39 - 1923 + 1924 39 40 - 1259 + 1260 40 @@ -1777,22 +1837,22 @@ 53 54 - 907 + 908 54 63 - 1151 + 1152 64 67 - 514 + 515 67 68 - 1801 + 1802 68 @@ -1802,7 +1862,7 @@ 70 71 - 1801 + 1802 73 @@ -1812,7 +1872,7 @@ 79 89 - 1449 + 1450 89 @@ -1980,22 +2040,26 @@ 1 2 - 17191 + 17198 2 3 +<<<<<<< HEAD 16270 +======= + 16277 +>>>>>>> d32eedeb48e (C++: update stats file) 3 103 - 2817 + 2819 104 1198 - 1259 + 1260 @@ -2011,12 +2075,12 @@ 1 2 - 24858 + 24869 2 3 - 11189 + 11194 3 @@ -2031,11 +2095,11 @@ compilation_build_mode - 16215 + 16222 id - 16215 + 16222 mode @@ -2053,7 +2117,7 @@ 1 2 - 16215 + 16222 @@ -2079,11 +2143,11 @@ compilation_compiling_files - 16215 + 16222 id - 16215 + 16222 num @@ -2091,7 +2155,7 @@ file - 7423 + 7427 @@ -2105,7 +2169,7 @@ 1 2 - 16215 + 16222 @@ -2121,7 +2185,7 @@ 1 2 - 16215 + 16222 @@ -2174,7 +2238,7 @@ 2 3 - 7220 + 7223 28 @@ -2195,7 +2259,7 @@ 1 2 - 7423 + 7427 @@ -2205,11 +2269,11 @@ compilation_time - 64592 + 64620 id - 16148 + 16155 num @@ -2221,7 +2285,11 @@ seconds +<<<<<<< HEAD 17407 +======= + 17727 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2235,7 +2303,7 @@ 1 2 - 16148 + 16155 @@ -2251,7 +2319,7 @@ 4 5 - 16148 + 16155 @@ -2267,17 +2335,25 @@ 2 3 +<<<<<<< HEAD 149 +======= + 257 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 - 8277 + 8036 4 5 +<<<<<<< HEAD 7721 +======= + 7860 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2323,8 +2399,13 @@ 12 +<<<<<<< HEAD 1285 1286 +======= + 1308 + 1309 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -2376,11 +2457,12 @@ 13 - 11 - 12 + 12 + 13 13 +<<<<<<< HEAD 718 719 13 @@ -2388,6 +2470,15 @@ 769 770 +======= + 727 + 728 + 13 + + + 768 + 769 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -2404,16 +2495,25 @@ 1 2 +<<<<<<< HEAD 10837 +======= + 11194 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 3617 +======= + 3699 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 1368 @@ -2425,6 +2525,19 @@ 10 694 257 +======= + 1355 + + + 4 + 22 + 1341 + + + 22 + 699 + 135 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2440,7 +2553,11 @@ 1 2 +<<<<<<< HEAD 17407 +======= + 17727 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2456,17 +2573,21 @@ 1 2 - 14414 + 14908 2 3 +<<<<<<< HEAD 2980 3 4 13 +======= + 2819 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2722,15 +2843,19 @@ compilation_finished - 16215 + 16222 id - 16215 + 16222 cpu_seconds +<<<<<<< HEAD 12083 +======= + 11858 +>>>>>>> d32eedeb48e (C++: update stats file) elapsed_seconds @@ -2748,7 +2873,7 @@ 1 2 - 16215 + 16222 @@ -2764,7 +2889,7 @@ 1 2 - 16215 + 16222 @@ -2780,17 +2905,30 @@ 1 2 +<<<<<<< HEAD 10241 +======= + 9812 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 1246 3 35 596 +======= + 1355 + + + 3 + 23 + 691 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2806,12 +2944,20 @@ 1 2 +<<<<<<< HEAD 11365 +======= + 11059 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 717 +======= + 799 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -2827,11 +2973,19 @@ 1 2 +<<<<<<< HEAD 67 2 3 +======= + 54 + + + 3 + 4 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -2840,6 +2994,7 @@ 13 +<<<<<<< HEAD 6 7 13 @@ -2882,6 +3037,60 @@ 330 331 +======= + 8 + 9 + 13 + + + 9 + 10 + 27 + + + 12 + 13 + 13 + + + 16 + 17 + 13 + + + 19 + 20 + 13 + + + 24 + 25 + 13 + + + 48 + 49 + 13 + + + 147 + 148 + 13 + + + 263 + 264 + 13 + + + 303 + 304 + 13 + + + 325 + 326 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -2898,11 +3107,19 @@ 1 2 +<<<<<<< HEAD 67 2 3 +======= + 54 + + + 3 + 4 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -2911,6 +3128,7 @@ 13 +<<<<<<< HEAD 6 7 13 @@ -2953,6 +3171,60 @@ 267 268 +======= + 8 + 9 + 13 + + + 9 + 10 + 27 + + + 12 + 13 + 13 + + + 16 + 17 + 13 + + + 19 + 20 + 13 + + + 24 + 25 + 13 + + + 48 + 49 + 13 + + + 143 + 144 + 13 + + + 159 + 160 + 13 + + + 232 + 233 + 13 + + + 241 + 242 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -11159,15 +11431,15 @@ files - 83639 + 83676 id - 83639 + 83676 name - 83639 + 83676 @@ -11181,7 +11453,7 @@ 1 2 - 83639 + 83676 @@ -11197,7 +11469,7 @@ 1 2 - 83639 + 83676 @@ -11207,15 +11479,15 @@ folders - 15890 + 15897 id - 15890 + 15897 name - 15890 + 15897 @@ -11229,7 +11501,7 @@ 1 2 - 15890 + 15897 @@ -11245,7 +11517,7 @@ 1 2 - 15890 + 15897 @@ -11255,15 +11527,23 @@ containerparent +<<<<<<< HEAD 99503 +======= + 99546 +>>>>>>> d32eedeb48e (C++: update stats file) parent - 15890 + 15897 child +<<<<<<< HEAD 99503 +======= + 99546 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -11277,12 +11557,12 @@ 1 2 - 7735 + 7738 2 3 - 1950 + 1951 3 @@ -11292,7 +11572,7 @@ 4 6 - 1286 + 1287 6 @@ -11302,7 +11582,7 @@ 10 16 - 1286 + 1287 16 @@ -11328,7 +11608,11 @@ 1 2 +<<<<<<< HEAD 99503 +======= + 99546 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -11338,11 +11622,15 @@ fileannotations +<<<<<<< HEAD 5387479 +======= + 5389838 +>>>>>>> d32eedeb48e (C++: update stats file) id - 7396 + 7399 kind @@ -11350,11 +11638,15 @@ name +<<<<<<< HEAD 75308 +======= + 75341 +>>>>>>> d32eedeb48e (C++: update stats file) value - 50679 + 50701 @@ -11373,7 +11665,7 @@ 2 3 - 7139 + 7142 @@ -11399,7 +11691,7 @@ 212 291 - 568 + 569 291 @@ -11424,7 +11716,7 @@ 550 551 - 1706 + 1707 553 @@ -11439,7 +11731,7 @@ 753 1231 - 568 + 569 1234 @@ -11475,12 +11767,12 @@ 352 434 - 568 + 569 434 490 - 568 + 569 490 @@ -11495,7 +11787,7 @@ 706 707 - 1706 + 1707 710 @@ -11599,62 +11891,62 @@ 1 2 - 14143 + 14149 2 3 - 5594 + 5597 3 5 - 6489 + 6491 5 7 - 5256 + 5258 7 9 - 5892 + 5895 9 16 - 5554 + 5556 16 19 - 6272 + 6275 19 27 - 5459 + 5461 27 47 - 6204 + 6207 47 128 - 6312 + 6315 128 459 - 5933 + 5936 459 546 - 2194 + 2195 @@ -11670,7 +11962,11 @@ 1 2 +<<<<<<< HEAD 75308 +======= + 75341 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -11686,57 +11982,57 @@ 1 2 - 14861 + 14867 2 3 - 9862 + 9866 3 4 - 5256 + 5258 4 6 - 5215 + 5217 6 8 - 4389 + 4391 8 11 - 6082 + 6085 11 17 - 6922 + 6925 17 23 - 6028 + 6031 23 41 - 6001 + 6003 41 95 - 5730 + 5732 95 1726 - 4958 + 4960 @@ -11752,72 +12048,76 @@ 1 2 - 4307 + 4309 2 4 - 2099 + 2100 4 5 - 4091 + 4093 5 8 - 3156 + 3157 8 14 - 3806 + 3808 14 17 - 2479 + 2480 17 24 - 3901 + 3903 24 51 - 4538 + 4540 51 58 +<<<<<<< HEAD 3888 +======= + 3889 +>>>>>>> d32eedeb48e (C++: update stats file) 58 80 - 3820 + 3821 81 151 - 3955 + 3957 151 334 - 3820 + 3821 334 473 - 3847 + 3849 473 547 - 2966 + 2968 @@ -11833,7 +12133,11 @@ 1 2 +<<<<<<< HEAD 50666 +======= + 50688 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -11854,67 +12158,71 @@ 1 2 - 4362 + 4364 2 4 - 2452 + 2453 4 5 - 3915 + 3916 5 8 - 3183 + 3184 8 14 - 4470 + 4472 14 18 - 4429 + 4431 18 28 - 4104 + 4106 28 34 - 4037 + 4038 34 41 - 4104 + 4106 41 66 - 3833 + 3835 66 92 - 3942 + 3943 92 113 - 3833 + 3835 113 145 +<<<<<<< HEAD 3888 +======= + 3889 +>>>>>>> d32eedeb48e (C++: update stats file) 145 @@ -12002,7 +12310,11 @@ 2 3 +<<<<<<< HEAD 743634 +======= + 743632 +>>>>>>> d32eedeb48e (C++: update stats file) 3 @@ -12037,7 +12349,11 @@ 11 337 +<<<<<<< HEAD 306934 +======= + 306936 +>>>>>>> d32eedeb48e (C++: update stats file) 339 @@ -12195,6 +12511,7 @@ macroinvocations +<<<<<<< HEAD 40601294 @@ -12208,6 +12525,21 @@ location 1070096 +======= + 40619070 + + + id + 40619070 + + + macro_id + 109955 + + + location + 1070564 +>>>>>>> d32eedeb48e (C++: update stats file) kind @@ -12225,7 +12557,11 @@ 1 2 +<<<<<<< HEAD 40601294 +======= + 40619070 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12241,7 +12577,11 @@ 1 2 +<<<<<<< HEAD 40601294 +======= + 40619070 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12257,7 +12597,11 @@ 1 2 +<<<<<<< HEAD 40601294 +======= + 40619070 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12273,52 +12617,52 @@ 1 2 - 23517 + 23528 2 3 - 20428 + 20437 3 4 - 7491 + 7494 4 6 - 10106 + 10110 6 11 - 9455 + 9459 11 21 - 9184 + 9188 21 48 - 8250 + 8253 48 145 - 8304 + 8307 145 952 - 8250 + 8253 954 175299 - 4917 + 4919 @@ -12334,37 +12678,37 @@ 1 2 - 60257 + 60283 2 3 - 13641 + 13647 3 4 - 6881 + 6884 4 6 - 8724 + 8728 6 13 - 9442 + 9446 13 67 - 8290 + 8294 67 4815 - 2668 + 2669 @@ -12380,12 +12724,12 @@ 1 2 - 101453 + 101498 2 3 - 8453 + 8457 @@ -12401,37 +12745,61 @@ 1 2 +<<<<<<< HEAD 426610 +======= + 426797 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 252707 +======= + 252817 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 113199 +======= + 113248 +>>>>>>> d32eedeb48e (C++: update stats file) 4 6 +<<<<<<< HEAD 77502 +======= + 77536 +>>>>>>> d32eedeb48e (C++: update stats file) 6 11 +<<<<<<< HEAD 82759 +======= + 82795 +>>>>>>> d32eedeb48e (C++: update stats file) 11 42 +<<<<<<< HEAD 80456 +======= + 80491 +>>>>>>> d32eedeb48e (C++: update stats file) 42 226288 - 36861 + 36877 @@ -12447,12 +12815,20 @@ 1 2 +<<<<<<< HEAD 1009649 +======= + 1010091 +>>>>>>> d32eedeb48e (C++: update stats file) 2 367 +<<<<<<< HEAD 60447 +======= + 60473 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12468,7 +12844,11 @@ 1 2 +<<<<<<< HEAD 1070096 +======= + 1070564 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12541,6 +12921,7 @@ macroparent +<<<<<<< HEAD 35811023 @@ -12550,6 +12931,17 @@ parent_id 28060082 +======= + 35826702 + + + id + 35826702 + + + parent_id + 28072367 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12563,7 +12955,11 @@ 1 2 +<<<<<<< HEAD 35811023 +======= + 35826702 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12579,17 +12975,29 @@ 1 2 +<<<<<<< HEAD 21858004 +======= + 21867574 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 5174275 +======= + 5176540 +>>>>>>> d32eedeb48e (C++: update stats file) 3 91 +<<<<<<< HEAD 1027802 +======= + 1028252 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12677,11 +13085,19 @@ macro_argument_unexpanded +<<<<<<< HEAD 103252337 invocation 31226086 +======= + 103297544 + + + invocation + 31239757 +>>>>>>> d32eedeb48e (C++: update stats file) argument_index @@ -12689,7 +13105,11 @@ text +<<<<<<< HEAD 440266 +======= + 440458 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12703,22 +13123,38 @@ 1 2 +<<<<<<< HEAD 9979461 +======= + 9983830 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 12505068 +======= + 12510543 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 6395516 +======= + 6398316 +>>>>>>> d32eedeb48e (C++: update stats file) 4 67 +<<<<<<< HEAD 2346040 +======= + 2347067 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12734,22 +13170,38 @@ 1 2 +<<<<<<< HEAD 10213703 +======= + 10218175 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 12526567 +======= + 12532051 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 6195602 +======= + 6198315 +>>>>>>> d32eedeb48e (C++: update stats file) 4 67 +<<<<<<< HEAD 2290213 +======= + 2291215 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12765,7 +13217,7 @@ 46457 46458 - 785 + 786 46659 @@ -12791,7 +13243,7 @@ 2 3 - 785 + 786 13 @@ -12817,57 +13269,65 @@ 1 2 - 52020 + 52043 2 3 - 79995 + 80030 3 4 - 29681 + 29694 4 5 - 44447 + 44467 5 6 - 50218 + 50240 6 9 - 36590 + 36606 9 15 +<<<<<<< HEAD 36848 +======= + 36864 +>>>>>>> d32eedeb48e (C++: update stats file) 15 27 - 33515 + 33530 27 57 +<<<<<<< HEAD 34125 +======= + 34140 +>>>>>>> d32eedeb48e (C++: update stats file) 57 517 - 33244 + 33259 518 485091 - 9577 + 9581 @@ -12883,17 +13343,29 @@ 1 2 +<<<<<<< HEAD 311894 +======= + 312030 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 115272 +======= + 115322 +>>>>>>> d32eedeb48e (C++: update stats file) 3 9 +<<<<<<< HEAD 13100 +======= + 13105 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12903,11 +13375,19 @@ macro_argument_expanded +<<<<<<< HEAD 103252337 invocation 31226086 +======= + 103297544 + + + invocation + 31239757 +>>>>>>> d32eedeb48e (C++: update stats file) argument_index @@ -12915,7 +13395,11 @@ text +<<<<<<< HEAD 266687 +======= + 266804 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12929,22 +13413,38 @@ 1 2 +<<<<<<< HEAD 9979461 +======= + 9983830 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 12505068 +======= + 12510543 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 6395516 +======= + 6398316 +>>>>>>> d32eedeb48e (C++: update stats file) 4 67 +<<<<<<< HEAD 2346040 +======= + 2347067 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12960,22 +13460,38 @@ 1 2 +<<<<<<< HEAD 13763116 +======= + 13769142 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 10789751 +======= + 10794475 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 5403993 +======= + 5406359 +>>>>>>> d32eedeb48e (C++: update stats file) 4 9 +<<<<<<< HEAD 1269224 +======= + 1269780 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -12991,7 +13507,7 @@ 46457 46458 - 785 + 786 46659 @@ -13043,57 +13559,57 @@ 1 2 - 28299 + 28312 2 3 - 35154 + 35170 3 4 - 58509 + 58535 4 5 - 20564 + 20573 5 6 - 3996 + 3998 6 7 - 23314 + 23324 7 10 - 21770 + 21779 10 19 - 22948 + 22958 19 51 - 20076 + 20085 51 253 - 20090 + 20099 254 990266 - 11962 + 11967 @@ -13109,17 +13625,21 @@ 1 2 - 134779 + 134838 2 3 +<<<<<<< HEAD 114039 +======= + 114089 +>>>>>>> d32eedeb48e (C++: update stats file) 3 66 - 17868 + 17876 @@ -15296,11 +15816,19 @@ var_decls +<<<<<<< HEAD 6739203 id 6734225 +======= + 6739069 + + + id + 6734091 +>>>>>>> d32eedeb48e (C++: update stats file) variable @@ -15330,7 +15858,11 @@ 1 2 +<<<<<<< HEAD 6734225 +======= + 6734091 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -15346,7 +15878,11 @@ 1 2 +<<<<<<< HEAD 6729247 +======= + 6729112 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -15367,7 +15903,11 @@ 1 2 +<<<<<<< HEAD 6734225 +======= + 6734091 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -15383,7 +15923,11 @@ 1 2 +<<<<<<< HEAD 6734225 +======= + 6734091 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -15399,12 +15943,16 @@ 1 2 +<<<<<<< HEAD 6408486 +======= + 6408621 +>>>>>>> d32eedeb48e (C++: update stats file) 2 4 - 157285 + 157151 @@ -15646,7 +16194,7 @@ 28 - 6411 + 6410 27716 @@ -15780,7 +16328,7 @@ 4 - 2760 + 2759 194017 @@ -16018,6 +16566,7 @@ type_decls +<<<<<<< HEAD 1890777 @@ -16031,6 +16580,21 @@ location 1485517 +======= + 1891510 + + + id + 1891510 + + + type_id + 1850079 + + + location + 1486167 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16044,7 +16608,11 @@ 1 2 +<<<<<<< HEAD 1890777 +======= + 1891510 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16060,7 +16628,11 @@ 1 2 +<<<<<<< HEAD 1890777 +======= + 1891510 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16076,12 +16648,20 @@ 1 2 +<<<<<<< HEAD 1819574 +======= + 1820276 +>>>>>>> d32eedeb48e (C++: update stats file) 2 24 +<<<<<<< HEAD 29790 +======= + 29803 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16097,12 +16677,16 @@ 1 2 +<<<<<<< HEAD 1820902 +======= + 1821604 +>>>>>>> d32eedeb48e (C++: update stats file) 2 24 - 28462 + 28474 @@ -16118,12 +16702,16 @@ 1 2 +<<<<<<< HEAD 1408989 +======= + 1409606 +>>>>>>> d32eedeb48e (C++: update stats file) 2 651 - 76527 + 76560 @@ -16139,12 +16727,20 @@ 1 2 +<<<<<<< HEAD 1410331 +======= + 1410948 +>>>>>>> d32eedeb48e (C++: update stats file) 2 651 +<<<<<<< HEAD 75186 +======= + 75219 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16154,11 +16750,19 @@ type_def +<<<<<<< HEAD 1297362 id 1297362 +======= + 1297902 + + + id + 1297902 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16234,7 +16838,7 @@ 1 2 - 8186 + 8187 2 @@ -16615,19 +17219,27 @@ usings +<<<<<<< HEAD 338568 id 338568 +======= + 338472 + + + id + 338472 +>>>>>>> d32eedeb48e (C++: update stats file) element_id - 65337 + 65122 location - 33921 + 33936 kind @@ -16645,7 +17257,11 @@ 1 2 +<<<<<<< HEAD 338568 +======= + 338472 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16661,7 +17277,11 @@ 1 2 +<<<<<<< HEAD 338568 +======= + 338472 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16677,7 +17297,11 @@ 1 2 +<<<<<<< HEAD 338568 +======= + 338472 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16693,17 +17317,21 @@ 1 2 +<<<<<<< HEAD 55421 +======= + 55201 +>>>>>>> d32eedeb48e (C++: update stats file) 2 4 - 5608 + 5610 4 134 - 4307 + 4309 @@ -16719,17 +17347,21 @@ 1 2 +<<<<<<< HEAD 55421 +======= + 55201 +>>>>>>> d32eedeb48e (C++: update stats file) 2 4 - 5608 + 5610 4 134 - 4307 + 4309 @@ -16745,7 +17377,7 @@ 1 2 - 65337 + 65122 @@ -16761,22 +17393,22 @@ 1 2 - 26809 + 26821 2 4 - 2858 + 2859 4 145 - 2465 + 2480 145 - 289 - 1788 + 287 + 1775 @@ -16792,22 +17424,22 @@ 1 2 - 26809 + 26821 2 4 - 2858 + 2859 4 145 - 2465 + 2480 145 - 289 - 1788 + 287 + 1775 @@ -16823,7 +17455,7 @@ 1 2 - 33921 + 33936 @@ -16842,8 +17474,8 @@ 13 - 24599 - 24600 + 24581 + 24582 13 @@ -16863,8 +17495,8 @@ 13 - 4609 - 4610 + 4591 + 4592 13 @@ -16896,15 +17528,23 @@ using_container +<<<<<<< HEAD 732097 +======= + 732173 +>>>>>>> d32eedeb48e (C++: update stats file) parent - 26484 + 26455 child +<<<<<<< HEAD 338568 +======= + 338472 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -16918,27 +17558,27 @@ 1 2 - 12327 + 12333 2 4 - 2438 + 2439 4 6 - 1598 + 1599 6 7 - 2899 + 2859 7 27 - 1991 + 1992 27 @@ -16948,7 +17588,7 @@ 145 146 - 3359 + 3361 146 @@ -16969,27 +17609,31 @@ 1 2 - 114174 + 113980 2 3 +<<<<<<< HEAD 154260 +======= + 154328 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 - 25238 + 25249 4 5 - 34233 + 34248 5 65 - 10661 + 10666 @@ -18553,11 +19197,11 @@ localvariables - 735324 + 735323 id - 735324 + 735323 type_id @@ -18565,7 +19209,7 @@ name - 102827 + 102826 @@ -18579,7 +19223,7 @@ 1 2 - 735324 + 735323 @@ -18595,7 +19239,7 @@ 1 2 - 735324 + 735323 @@ -21390,7 +22034,11 @@ decltypes +<<<<<<< HEAD 175649 +======= + 175650 +>>>>>>> d32eedeb48e (C++: update stats file) id @@ -21711,6 +22359,7 @@ usertypes +<<<<<<< HEAD 4987434 @@ -21720,6 +22369,17 @@ name 1074810 +======= + 4988303 + + + id + 4988303 + + + name + 1075281 +>>>>>>> d32eedeb48e (C++: update stats file) kind @@ -21737,7 +22397,11 @@ 1 2 +<<<<<<< HEAD 4987434 +======= + 4988303 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -21753,7 +22417,11 @@ 1 2 +<<<<<<< HEAD 4987434 +======= + 4988303 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -21769,22 +22437,38 @@ 1 2 +<<<<<<< HEAD 743259 +======= + 743720 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 196974 +======= + 196925 +>>>>>>> d32eedeb48e (C++: update stats file) 3 7 +<<<<<<< HEAD 85996 +======= + 86034 +>>>>>>> d32eedeb48e (C++: update stats file) 7 30181 +<<<<<<< HEAD 48579 +======= + 48601 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -21800,12 +22484,20 @@ 1 2 +<<<<<<< HEAD 1008457 +======= + 1008898 +>>>>>>> d32eedeb48e (C++: update stats file) 2 10 +<<<<<<< HEAD 66353 +======= + 66382 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -21839,8 +22531,8 @@ 13 - 1476 - 1477 + 1475 + 1476 13 @@ -21854,13 +22546,18 @@ 13 - 19666 - 19667 + 19665 + 19666 13 +<<<<<<< HEAD 20064 20065 +======= + 20058 + 20059 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -21869,6 +22566,7 @@ 13 +<<<<<<< HEAD 85548 85549 13 @@ -21876,6 +22574,15 @@ 151139 151140 +======= + 85539 + 85540 + 13 + + + 151059 + 151060 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -21957,15 +22664,23 @@ usertypesize +<<<<<<< HEAD 1632137 id 1632137 +======= + 1632702 + + + id + 1632702 +>>>>>>> d32eedeb48e (C++: update stats file) size - 1896 + 1897 alignment @@ -21983,7 +22698,11 @@ 1 2 +<<<<<<< HEAD 1632137 +======= + 1632702 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -21999,7 +22718,11 @@ 1 2 +<<<<<<< HEAD 1632137 +======= + 1632702 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22054,12 +22777,16 @@ 96 - 1592 + 1588 149 1733 +<<<<<<< HEAD 92729 +======= + 92728 +>>>>>>> d32eedeb48e (C++: update stats file) 67 @@ -22076,7 +22803,7 @@ 1 2 - 1557 + 1558 2 @@ -22125,18 +22852,23 @@ 13 - 1959 - 1960 + 1958 + 1959 13 - 10484 - 10485 + 10475 + 10476 13 +<<<<<<< HEAD 107915 107916 +======= + 107914 + 107915 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -22334,7 +23066,7 @@ constraint - 27881 + 27882 @@ -22399,6 +23131,7 @@ mangled_name +<<<<<<< HEAD 7776179 @@ -22408,6 +23141,17 @@ mangled_name 5325040 +======= + 7776588 + + + id + 7776588 + + + mangled_name + 5327372 +>>>>>>> d32eedeb48e (C++: update stats file) is_complete @@ -22425,7 +23169,11 @@ 1 2 +<<<<<<< HEAD 7776179 +======= + 7776588 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22441,7 +23189,11 @@ 1 2 +<<<<<<< HEAD 7776179 +======= + 7776588 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22457,17 +23209,29 @@ 1 2 +<<<<<<< HEAD 4731503 +======= + 4736407 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 459353 +======= + 456722 +>>>>>>> d32eedeb48e (C++: update stats file) 3 9032 +<<<<<<< HEAD 134183 +======= + 134242 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22483,7 +23247,11 @@ 1 2 +<<<<<<< HEAD 5325040 +======= + 5327372 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22502,8 +23270,13 @@ 13 +<<<<<<< HEAD 570633 570634 +======= + 570412 + 570413 +>>>>>>> d32eedeb48e (C++: update stats file) 13 @@ -22546,39 +23319,64 @@ is_standard_layout_class +<<<<<<< HEAD 1344858 id 1344858 +======= + 1345352 + + + id + 1345352 +>>>>>>> d32eedeb48e (C++: update stats file) is_complete +<<<<<<< HEAD 1611274 id 1611274 +======= + 1611844 + + + id + 1611844 +>>>>>>> d32eedeb48e (C++: update stats file) is_class_template +<<<<<<< HEAD 292183 id 292183 +======= + 292297 + + + id + 292297 +>>>>>>> d32eedeb48e (C++: update stats file) class_instantiation +<<<<<<< HEAD 1327030 @@ -22588,6 +23386,17 @@ from 91605 +======= + 1327367 + + + to + 1323504 + + + from + 91645 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22601,12 +23410,20 @@ 1 2 +<<<<<<< HEAD 1320392 +======= + 1320807 +>>>>>>> d32eedeb48e (C++: update stats file) 2 8 +<<<<<<< HEAD 2736 +======= + 2697 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22622,47 +23439,79 @@ 1 2 +<<<<<<< HEAD 26728 +======= + 26740 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 16622 +======= + 16629 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 9103 +======= + 9107 +>>>>>>> d32eedeb48e (C++: update stats file) 4 5 +<<<<<<< HEAD 5974 +======= + 5976 +>>>>>>> d32eedeb48e (C++: update stats file) 5 7 +<<<<<<< HEAD 7694 +======= + 7698 +>>>>>>> d32eedeb48e (C++: update stats file) 7 10 +<<<<<<< HEAD 6949 +======= + 6952 +>>>>>>> d32eedeb48e (C++: update stats file) 10 17 +<<<<<<< HEAD 7356 +======= + 7372 +>>>>>>> d32eedeb48e (C++: update stats file) 17 53 +<<<<<<< HEAD 6936 +======= + 6925 +>>>>>>> d32eedeb48e (C++: update stats file) 53 4219 - 4240 + 4242 @@ -22672,11 +23521,19 @@ class_template_argument +<<<<<<< HEAD 3501700 type_id 1631215 +======= + 3502921 + + + type_id + 1631781 +>>>>>>> d32eedeb48e (C++: update stats file) index @@ -22684,7 +23541,11 @@ arg_type +<<<<<<< HEAD 1034467 +======= + 1034879 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22698,22 +23559,38 @@ 1 2 +<<<<<<< HEAD 678884 +======= + 679154 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 490105 +======= + 490211 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 308751 +======= + 308886 +>>>>>>> d32eedeb48e (C++: update stats file) 4 7 +<<<<<<< HEAD 124118 +======= + 124159 +>>>>>>> d32eedeb48e (C++: update stats file) 7 @@ -22734,22 +23611,38 @@ 1 2 +<<<<<<< HEAD 713442 +======= + 713728 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 505454 +======= + 505567 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 306813 +======= + 306948 +>>>>>>> d32eedeb48e (C++: update stats file) 4 113 +<<<<<<< HEAD 105504 +======= + 105537 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22770,7 +23663,7 @@ 4 5 - 961 + 962 5 @@ -22789,12 +23682,21 @@ 643 +<<<<<<< HEAD 6819 121 11329 120409 +======= + 6818 + 121 + + + 11328 + 120398 +>>>>>>> d32eedeb48e (C++: update stats file) 54 @@ -22816,7 +23718,7 @@ 4 5 - 961 + 962 5 @@ -22840,7 +23742,11 @@ 10035 +<<<<<<< HEAD 43710 +======= + 43708 +>>>>>>> d32eedeb48e (C++: update stats file) 40 @@ -22857,27 +23763,48 @@ 1 2 +<<<<<<< HEAD 649080 +======= + 649364 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 212187 +======= + 212253 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 62153 +======= + 62167 +>>>>>>> d32eedeb48e (C++: update stats file) 4 11 +<<<<<<< HEAD 78667 11 11553 32377 +======= + 78702 + + + 11 + 11551 + 32391 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -22893,17 +23820,25 @@ 1 2 +<<<<<<< HEAD 912381 +======= + 912740 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 98852 +======= + 98896 +>>>>>>> d32eedeb48e (C++: update stats file) 3 22 - 23233 + 23243 @@ -23139,6 +24074,7 @@ is_proxy_class_for +<<<<<<< HEAD 62059 @@ -23148,6 +24084,17 @@ templ_param_id 58631 +======= + 62086 + + + id + 62086 + + + templ_param_id + 58657 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -23161,7 +24108,11 @@ 1 2 +<<<<<<< HEAD 62059 +======= + 62086 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -23177,7 +24128,11 @@ 1 2 +<<<<<<< HEAD 57710 +======= + 57735 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -24590,15 +25545,15 @@ template_template_instantiation - 7437 + 7440 to - 6976 + 6979 from - 4931 + 4933 @@ -24612,7 +25567,7 @@ 1 2 - 6827 + 6830 2 @@ -24633,12 +25588,12 @@ 1 2 - 3224 + 3225 2 3 - 1530 + 1531 3 @@ -24653,11 +25608,11 @@ template_template_argument - 12409 + 12414 type_id - 7843 + 7847 index @@ -24665,7 +25620,7 @@ arg_type - 11650 + 11655 @@ -24679,12 +25634,12 @@ 1 2 - 6434 + 6437 2 3 - 541 + 542 3 @@ -24710,12 +25665,12 @@ 1 2 - 6461 + 6464 2 4 - 717 + 718 4 @@ -24863,7 +25818,7 @@ 1 2 - 11609 + 11614 3 @@ -24884,7 +25839,7 @@ 1 2 - 11623 + 11628 2 @@ -26066,19 +27021,19 @@ ptrtomembers - 12083 + 12089 id - 12083 + 12089 type_id - 10160 + 10164 class_id - 5987 + 5990 @@ -26092,7 +27047,7 @@ 1 2 - 12083 + 12089 @@ -26108,7 +27063,7 @@ 1 2 - 12083 + 12089 @@ -26124,7 +27079,7 @@ 1 2 - 9875 + 9880 2 @@ -26145,7 +27100,7 @@ 1 2 - 9875 + 9880 2 @@ -26166,17 +27121,17 @@ 1 2 - 4876 + 4879 2 3 - 541 + 542 8 9 - 514 + 515 10 @@ -26197,17 +27152,17 @@ 1 2 - 4876 + 4879 2 3 - 541 + 542 8 9 - 514 + 515 10 @@ -26270,11 +27225,19 @@ typespecifiers +<<<<<<< HEAD 991496 type_id 984912 +======= + 991510 + + + type_id + 984923 +>>>>>>> d32eedeb48e (C++: update stats file) spec_id @@ -26292,12 +27255,16 @@ 1 2 +<<<<<<< HEAD 978328 +======= + 978336 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 - 6583 + 6586 @@ -26321,8 +27288,8 @@ 13 - 532 - 533 + 529 + 530 13 @@ -26336,18 +27303,23 @@ 13 - 4150 - 4151 + 4147 + 4148 13 +<<<<<<< HEAD 17408 17409 +======= + 17406 + 17407 +>>>>>>> d32eedeb48e (C++: update stats file) 13 - 48323 - 48324 + 48300 + 48301 13 @@ -26358,7 +27330,11 @@ funspecifiers +<<<<<<< HEAD 9728427 +======= + 9728556 +>>>>>>> d32eedeb48e (C++: update stats file) func_id @@ -26385,17 +27361,29 @@ 2 3 +<<<<<<< HEAD 677260 +======= + 677303 +>>>>>>> d32eedeb48e (C++: update stats file) 3 4 +<<<<<<< HEAD 1424206 +======= + 1424163 +>>>>>>> d32eedeb48e (C++: update stats file) 4 5 +<<<<<<< HEAD 459483 +======= + 459397 +>>>>>>> d32eedeb48e (C++: update stats file) 5 @@ -26405,7 +27393,11 @@ 6 8 +<<<<<<< HEAD 116600 +======= + 116686 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -26494,8 +27486,13 @@ 42 +<<<<<<< HEAD 42407 42408 +======= + 42410 + 42411 +>>>>>>> d32eedeb48e (C++: update stats file) 42 @@ -27185,11 +28182,11 @@ attribute_args - 99123 + 99099 id - 99123 + 99099 kind @@ -27197,7 +28194,7 @@ attribute - 85332 + 85370 index @@ -27205,7 +28202,7 @@ location - 91943 + 91984 @@ -27219,7 +28216,7 @@ 1 2 - 99123 + 99099 @@ -27235,7 +28232,7 @@ 1 2 - 99123 + 99099 @@ -27251,7 +28248,7 @@ 1 2 - 99123 + 99099 @@ -27267,7 +28264,7 @@ 1 2 - 99123 + 99099 @@ -27296,8 +28293,8 @@ 13 - 6614 - 6615 + 6609 + 6610 13 @@ -27402,17 +28399,17 @@ 1 2 - 77177 + 77279 2 4 - 6800 + 6735 4 18 - 1354 + 1355 @@ -27428,12 +28425,16 @@ 1 2 - 83029 + 83066 2 3 +<<<<<<< HEAD 2303 +======= + 2304 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -27449,12 +28450,16 @@ 1 2 +<<<<<<< HEAD 79047 +======= + 79081 +>>>>>>> d32eedeb48e (C++: update stats file) 2 6 - 6285 + 6288 @@ -27470,12 +28475,16 @@ 1 2 +<<<<<<< HEAD 80659 +======= + 80694 +>>>>>>> d32eedeb48e (C++: update stats file) 2 6 - 4673 + 4675 @@ -27509,8 +28518,8 @@ 13 - 6497 - 6498 + 6492 + 6493 13 @@ -27625,12 +28634,12 @@ 1 2 - 89329 + 89436 2 23 - 2614 + 2547 @@ -27646,7 +28655,11 @@ 1 2 +<<<<<<< HEAD 91727 +======= + 91767 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -27667,7 +28680,7 @@ 1 2 - 91537 + 91577 2 @@ -27688,7 +28701,7 @@ 1 2 - 91388 + 91428 2 @@ -27859,6 +28872,7 @@ attribute_arg_constant +<<<<<<< HEAD 89600 @@ -27868,6 +28882,17 @@ constant 89600 +======= + 89571 + + + arg + 89571 + + + constant + 89571 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -27881,7 +28906,11 @@ 1 2 +<<<<<<< HEAD 89600 +======= + 89571 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -27897,7 +28926,11 @@ 1 2 +<<<<<<< HEAD 89600 +======= + 89571 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -27907,15 +28940,15 @@ attribute_arg_expr - 1801 + 1802 arg - 1801 + 1802 expr - 1801 + 1802 @@ -27929,7 +28962,7 @@ 1 2 - 1801 + 1802 @@ -27945,7 +28978,7 @@ 1 2 - 1801 + 1802 @@ -28265,6 +29298,7 @@ unspecifiedtype +<<<<<<< HEAD 8345603 @@ -28274,6 +29308,17 @@ unspecified_type_id 4799035 +======= + 8345991 + + + type_id + 8345991 + + + unspecified_type_id + 4799808 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -28287,7 +29332,11 @@ 1 2 +<<<<<<< HEAD 8345603 +======= + 8345991 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -28303,17 +29352,29 @@ 1 2 +<<<<<<< HEAD 3198462 +======= + 3199036 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 1309012 +======= + 1309301 +>>>>>>> d32eedeb48e (C++: update stats file) 3 6271 +<<<<<<< HEAD 291559 +======= + 291470 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -29507,11 +30568,19 @@ frienddecls +<<<<<<< HEAD 883308 id 883308 +======= + 883351 + + + id + 883351 +>>>>>>> d32eedeb48e (C++: update stats file) type_id @@ -29537,7 +30606,11 @@ 1 2 +<<<<<<< HEAD 883308 +======= + 883351 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -29553,7 +30626,11 @@ 1 2 +<<<<<<< HEAD 883308 +======= + 883351 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -29569,7 +30646,11 @@ 1 2 +<<<<<<< HEAD 883308 +======= + 883351 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -29585,12 +30666,12 @@ 1 2 - 7776 + 7819 2 3 - 17614 + 17571 3 @@ -29641,12 +30722,12 @@ 1 2 - 7776 + 7819 2 3 - 17614 + 17571 3 @@ -29718,17 +30799,25 @@ 1 2 +<<<<<<< HEAD 60620 +======= + 60748 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 7518 +======= + 7303 +>>>>>>> d32eedeb48e (C++: update stats file) 3 8 - 7561 + 7647 8 @@ -29759,17 +30848,25 @@ 1 2 +<<<<<<< HEAD 60620 +======= + 60748 +>>>>>>> d32eedeb48e (C++: update stats file) 2 3 +<<<<<<< HEAD 7518 +======= + 7303 +>>>>>>> d32eedeb48e (C++: update stats file) 3 8 - 7561 + 7647 8 @@ -29825,7 +30922,7 @@ 2 - 20371 + 20372 472 @@ -30125,11 +31222,19 @@ compgenerated +<<<<<<< HEAD 10714334 id 10714334 +======= + 10714329 + + + id + 10714329 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -30372,15 +31477,15 @@ namespaces - 11095 + 11099 id - 11095 + 11099 name - 5865 + 5868 @@ -30394,7 +31499,7 @@ 1 2 - 11095 + 11099 @@ -30410,7 +31515,7 @@ 1 2 - 4795 + 4797 2 @@ -30420,7 +31525,7 @@ 3 149 - 392 + 393 @@ -30441,15 +31546,23 @@ namespacembrs +<<<<<<< HEAD 2025652 +======= + 2026308 +>>>>>>> d32eedeb48e (C++: update stats file) parentid - 10363 + 10368 memberid +<<<<<<< HEAD 2025652 +======= + 2026308 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -30468,7 +31581,7 @@ 2 3 - 988 + 989 3 @@ -30493,6 +31606,7 @@ 14 22 +<<<<<<< HEAD 812 @@ -30509,10 +31623,29 @@ 57 118 785 +======= + 813 + + + 22 + 37 + 799 + + + 37 + 57 + 799 + + + 57 + 118 + 786 +>>>>>>> d32eedeb48e (C++: update stats file) 118 255 +<<<<<<< HEAD 812 @@ -30523,6 +31656,18 @@ 829 42759 +======= + 813 + + + 256 + 828 + 786 + + + 829 + 42747 +>>>>>>> d32eedeb48e (C++: update stats file) 338 @@ -30539,7 +31684,11 @@ 1 2 +<<<<<<< HEAD 2025652 +======= + 2026308 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -32000,11 +33149,19 @@ valuetext +<<<<<<< HEAD 6605626 id 6605626 +======= + 6605630 + + + id + 6605630 +>>>>>>> d32eedeb48e (C++: update stats file) text @@ -32022,7 +33179,11 @@ 1 2 +<<<<<<< HEAD 6605626 +======= + 6605630 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -33616,6 +34777,10 @@ position 32 + + designated + 2 + @@ -33771,6 +34936,27 @@ + + aggregate + designated + + + 12 + + + 1 + 2 + 1242986 + + + 2 + 3 + 82 + + + + + initializer aggregate @@ -33824,6 +35010,22 @@ + + initializer + designated + + + 12 + + + 1 + 2 + 5717202 + + + + + field aggregate @@ -33957,6 +35159,27 @@ + + field + designated + + + 12 + + + 1 + 2 + 3201 + + + 2 + 3 + 26 + + + + + position aggregate @@ -34170,6 +35393,111 @@ + + position + designated + + + 12 + + + 1 + 2 + 24 + + + 2 + 3 + 8 + + + + + + + designated + aggregate + + + 12 + + + 480 + 481 + 1 + + + 1242670 + 1242671 + 1 + + + + + + + designated + initializer + + + 12 + + + 710 + 711 + 1 + + + 5716492 + 5716493 + 1 + + + + + + + designated + field + + + 12 + + + 218 + 219 + 1 + + + 3035 + 3036 + 1 + + + + + + + designated + position + + + 12 + + + 8 + 9 + 1 + + + 32 + 33 + 1 + + + + + @@ -34192,6 +35520,10 @@ position 62922 + + designated + 2 + @@ -34347,6 +35679,22 @@ + + aggregate + designated + + + 12 + + + 1 + 2 + 152356 + + + + + initializer aggregate @@ -34395,6 +35743,22 @@ + + initializer + designated + + + 12 + + + 1 + 2 + 1349246 + + + + + element_index aggregate @@ -34498,6 +35862,27 @@ + + element_index + designated + + + 12 + + + 1 + 2 + 62914 + + + 2 + 3 + 8 + + + + + position aggregate @@ -34601,6 +35986,111 @@ + + position + designated + + + 12 + + + 1 + 2 + 62915 + + + 2 + 3 + 7 + + + + + + + designated + aggregate + + + 12 + + + 3 + 4 + 1 + + + 152353 + 152354 + 1 + + + + + + + designated + initializer + + + 12 + + + 16 + 17 + 1 + + + 1349230 + 1349231 + 1 + + + + + + + designated + element_index + + + 12 + + + 8 + 9 + 1 + + + 62922 + 62923 + 1 + + + + + + + designated + position + + + 12 + + + 7 + 8 + 1 + + + 62922 + 62923 + 1 + + + + + @@ -38074,11 +39564,11 @@ stmt_decl_bind - 730761 + 730759 stmt - 690291 + 690290 num @@ -38086,7 +39576,7 @@ decl - 730692 + 730690 @@ -38100,7 +39590,11 @@ 1 2 +<<<<<<< HEAD 668062 +======= + 668061 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -38121,7 +39615,11 @@ 1 2 +<<<<<<< HEAD 668062 +======= + 668061 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -38264,7 +39762,11 @@ 1 2 +<<<<<<< HEAD 730667 +======= + 730666 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -38285,7 +39787,7 @@ 1 2 - 730692 + 730690 @@ -38295,11 +39797,11 @@ stmt_decl_entry_bind - 730761 + 730759 stmt - 690291 + 690290 num @@ -38307,7 +39809,7 @@ decl_entry - 730761 + 730759 @@ -38321,7 +39823,11 @@ 1 2 +<<<<<<< HEAD 668062 +======= + 668061 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -38342,7 +39848,11 @@ 1 2 +<<<<<<< HEAD 668062 +======= + 668061 +>>>>>>> d32eedeb48e (C++: update stats file) 2 @@ -38485,7 +39995,7 @@ 1 2 - 730761 + 730759 @@ -38501,7 +40011,7 @@ 1 2 - 730761 + 730759 @@ -39197,6 +40707,7 @@ includes +<<<<<<< HEAD 408674 @@ -39206,6 +40717,17 @@ included 75281 +======= + 408853 + + + id + 408853 + + + included + 75314 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -39219,7 +40741,11 @@ 1 2 +<<<<<<< HEAD 408674 +======= + 408853 +>>>>>>> d32eedeb48e (C++: update stats file) @@ -39235,32 +40761,32 @@ 1 2 - 37254 + 37270 2 3 - 12111 + 12116 3 4 - 6353 + 6356 4 6 - 6868 + 6871 6 11 - 5798 + 5800 11 47 - 5649 + 5651 47 diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_array_init.ql b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_array_init.ql new file mode 100644 index 000000000000..9d09506d2d46 --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_array_init.ql @@ -0,0 +1,11 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, int element_index, int position +where aggregate_array_init(aggregate, initializer, element_index, position) +select aggregate, initializer, element_index, position, false diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_field_init.ql b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_field_init.ql new file mode 100644 index 000000000000..7422fdcbc853 --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_field_init.ql @@ -0,0 +1,16 @@ +class Expr extends @expr { + string toString() { none() } +} + + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +class MemberVariable extends @membervariable { + string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, MemberVariable field, int position +where aggregate_field_init(aggregate, initializer, field, position) +select aggregate, initializer, field, position, false diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme index 0f0a390468a5..5923d7e8351f 100644 --- a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme @@ -2039,7 +2039,8 @@ aggregate_field_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int field: @membervariable ref, - int position: int ref + int position: int ref, + boolean designated: boolean ref ); /** @@ -2051,7 +2052,8 @@ aggregate_array_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int element_index: int ref, - int position: int ref + int position: int ref, + boolean designated: boolean ref ); @ctorinit = @ctordirectinit diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties index f6105ce157b4..ad88f004e98d 100644 --- a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties @@ -1,2 +1,5 @@ -description: Add a new predicate `isVla()` to the `ArrayType` class -compatibility: backwards \ No newline at end of file +description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +compatibility: backwards +aggregate_array_init.rel: run aggregate_array_init.qlo +aggregate_field_init.rel: run aggregate_field_init.qlo +