diff --git a/.github/instructions/expected-files.instructions.md b/.github/instructions/expected-files.instructions.md index b76119d70282..17cf22f93a03 100644 --- a/.github/instructions/expected-files.instructions.md +++ b/.github/instructions/expected-files.instructions.md @@ -1,4 +1,4 @@ --- applyTo: "**/*.expected" --- -Ignore these files. These are generated to be correct by running the tests, and should not be edited manually. +Do not edit these files directly. They are generated by running the tests. If a `.expected` file has a non-empty `testFailures `section it should not be committed - you may want to update the inline expectation comments in the corresponding test source file (e.g. marking expected results as `MISSING` / `SPURIOUS`) then re-run the test. diff --git a/.github/workflows/csv-coverage-pr-artifacts.yml b/.github/workflows/csv-coverage-pr-artifacts.yml index c62de00535e2..e27ccc7312cb 100644 --- a/.github/workflows/csv-coverage-pr-artifacts.yml +++ b/.github/workflows/csv-coverage-pr-artifacts.yml @@ -47,10 +47,10 @@ jobs: git checkout HEAD^1 git log -1 --format='%H' working-directory: base - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.12" - name: Download CodeQL CLI uses: ./merge/.github/actions/fetch-codeql - name: Generate CSV files on merge commit of the PR diff --git a/.github/workflows/csv-coverage-pr-comment.yml b/.github/workflows/csv-coverage-pr-comment.yml index 534725815b4b..ba07ccd5fc4c 100644 --- a/.github/workflows/csv-coverage-pr-comment.yml +++ b/.github/workflows/csv-coverage-pr-comment.yml @@ -25,10 +25,10 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Clone self (github/codeql) uses: actions/checkout@v5 - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.12" - name: Check coverage difference file and comment env: diff --git a/.github/workflows/csv-coverage-timeseries.yml b/.github/workflows/csv-coverage-timeseries.yml index 11bc06bee602..1433aaa41758 100644 --- a/.github/workflows/csv-coverage-timeseries.yml +++ b/.github/workflows/csv-coverage-timeseries.yml @@ -20,10 +20,10 @@ jobs: with: path: codeqlModels fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.12" - name: Download CodeQL CLI uses: ./script/.github/actions/fetch-codeql - name: Build modeled package list diff --git a/.github/workflows/csv-coverage-update.yml b/.github/workflows/csv-coverage-update.yml index 9f7a0b778dab..3bab9977ccd3 100644 --- a/.github/workflows/csv-coverage-update.yml +++ b/.github/workflows/csv-coverage-update.yml @@ -25,10 +25,10 @@ jobs: with: path: ql fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.12" - name: Download CodeQL CLI uses: ./ql/.github/actions/fetch-codeql - name: Generate coverage files diff --git a/.github/workflows/csv-coverage.yml b/.github/workflows/csv-coverage.yml index a1224456410a..9a51710a7115 100644 --- a/.github/workflows/csv-coverage.yml +++ b/.github/workflows/csv-coverage.yml @@ -24,10 +24,10 @@ jobs: with: path: codeqlModels ref: ${{ github.event.inputs.qlModelShaOverride || github.ref }} - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.12" - name: Download CodeQL CLI uses: ./script/.github/actions/fetch-codeql - name: Build modeled package list diff --git a/.github/workflows/label-external-contributions.yml b/.github/workflows/label-external-contributions.yml index 6538066e6768..81ed030b94fc 100644 --- a/.github/workflows/label-external-contributions.yml +++ b/.github/workflows/label-external-contributions.yml @@ -13,7 +13,9 @@ concurrency: jobs: label: - if: github.ref_name == github.event.repository.default_branch + if: >- + github.repository == 'github/codeql' && + github.ref_name == github.event.repository.default_branch runs-on: ubuntu-latest timeout-minutes: 10 permissions: diff --git a/.github/workflows/query-list.yml b/.github/workflows/query-list.yml index 8c736379f8a6..53857b5ae12c 100644 --- a/.github/workflows/query-list.yml +++ b/.github/workflows/query-list.yml @@ -26,10 +26,10 @@ jobs: uses: actions/checkout@v5 with: path: codeql - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.12" - name: Download CodeQL CLI # Look under the `codeql` directory, as this is where we checked out the `github/codeql` repo uses: ./codeql/.github/actions/fetch-codeql diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 3c9b0deb4a1f..968015606401 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -58,6 +58,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 name: Check that python code is properly formatted with: diff --git a/Cargo.lock b/Cargo.lock index ac2b2170c300..754dca177d3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -340,7 +340,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -574,7 +574,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -585,7 +585,7 @@ checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ "darling_core", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -1683,9 +1683,9 @@ dependencies = [ [[package]] name = "ra_ap_base_db" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3282d760382985f6dd4ecba16276aee569a37737204ac7c0ed89c21c8729c8" +checksum = "8a5bf74ba5606b902ada6b8964ac4f22080ac6d73c297f8d4981885843b25fa4" dependencies = [ "dashmap", "indexmap 2.14.2", @@ -1704,9 +1704,9 @@ dependencies = [ [[package]] name = "ra_ap_cfg" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a582e2510c89eb7f25d4076a8c6c6030e14930c2da55a077a52a899da731377" +checksum = "1dc63ce4a2acd1591cac5d5ad1d4f0549bd9069f4aad59acbf600a4d4881a8c9" dependencies = [ "ra_ap_intern", "ra_ap_syntax", @@ -1717,15 +1717,15 @@ dependencies = [ [[package]] name = "ra_ap_edition" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa33cd125dfc80dcb0378a0660051682cf70e538aa1637a2131b2c7c3e5ab7f" +checksum = "1e95437d4702879e3851c80580524f36025589b3eeaec3f7798cdf88671c130b" [[package]] name = "ra_ap_hir" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c497dea446296a1705723137ab83c777f89113ff37ffeb5ee68435cdfa33fc5" +checksum = "9464cf1121d47a72dffa58c31603b5f06139747b3d848c3b87f63a6da283abb5" dependencies = [ "arrayvec", "either", @@ -1752,9 +1752,9 @@ dependencies = [ [[package]] name = "ra_ap_hir_def" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88d7b6cb65042538387667162474e90d7490ddc879e9f1e941be168d058fbf0" +checksum = "7ef811f35ed1c394d27a7e0d79869aa4891108496736597b87bbc632a4eee1ec" dependencies = [ "arrayvec", "bitflags 2.13.2", @@ -1788,9 +1788,9 @@ dependencies = [ [[package]] name = "ra_ap_hir_expand" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bbfffd8c4db9637382dbaeed22645f0db823f424b564f4b1ab92cdf45895bc" +checksum = "f8ffb0602b9cc8b4647b902db5c4fca4a8a37ba7a20f28424aed64c7dd2866d6" dependencies = [ "cov-mark", "either", @@ -1815,9 +1815,9 @@ dependencies = [ [[package]] name = "ra_ap_hir_ty" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c93211cc6305fdbf9efa2d231126613d1258278046448ddd488b4b9de3a657" +checksum = "725f913d562b8d794035bc3bcc3e62adf09b843e11b443750bf8a7027ec1d3bf" dependencies = [ "arrayvec", "bitflags 2.13.2", @@ -1859,9 +1859,9 @@ dependencies = [ [[package]] name = "ra_ap_ide_db" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cba53ccc856c17281d2cef962175d5fd6fa6f3c113353099046a1a5d352bcfc3" +checksum = "f08b0f04a8fecbe4a1b04cd0b03d5b0c8495a2a5de50638c6d66b5c3aba133ac" dependencies = [ "arrayvec", "bitflags 2.13.2", @@ -1894,9 +1894,9 @@ dependencies = [ [[package]] name = "ra_ap_intern" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05397faca776612001946899757a122172cf787e113c1f44927d40347767efc" +checksum = "51fddd20c482af576865ab697077cbf1b61b7d30214ab250ce3aa83f0af41eb2" dependencies = [ "arrayvec", "dashmap", @@ -1908,9 +1908,9 @@ dependencies = [ [[package]] name = "ra_ap_load-cargo" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b60d2111fdec8c1efb92e4e7b537d25d92810e7cd1f521b613de7d9356134b" +checksum = "ee8bbf755a6d81544cd576150986601069918ab46fa5677275ce3b9cc875bc73" dependencies = [ "anyhow", "crossbeam-channel", @@ -1929,9 +1929,9 @@ dependencies = [ [[package]] name = "ra_ap_macros" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c7ca6810542835f6347fdb636736096ec5976635aeb5234db59eabc4ad7d0a" +checksum = "ea5d97f56b9082903327327d70a45f6df69f8fb02880c0040f0e21f1b4983093" dependencies = [ "proc-macro2", "quote", @@ -1941,9 +1941,9 @@ dependencies = [ [[package]] name = "ra_ap_mbe" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0c40fe51f6ecd4dc3abde43e2cda6ef8a90c6813d343f94c4435a826958eda" +checksum = "e2b58d33d66aa5ae520204e9920063dcd78a60a610726be70a2c2a9cb1cbe563" dependencies = [ "arrayvec", "bitflags 2.13.2", @@ -1962,9 +1962,9 @@ dependencies = [ [[package]] name = "ra_ap_parser" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5ff48cb6ff1bfd2d970b013c8526e66e867278e31a80c400135509e599a53a" +checksum = "64b1543d3639a969f5cb4d55a94154ef672f5e1c873b6161407f5705e3164bbc" dependencies = [ "drop_bomb", "ra-ap-rustc_lexer", @@ -1976,18 +1976,18 @@ dependencies = [ [[package]] name = "ra_ap_paths" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fac1f33d3384bee4b71966141575f32f7804ba28981c29ce00439a7b646ff4e" +checksum = "781f81610b0333e60fabdcf4f9ea8a76a7eeff2cda2be6d8f8ad7b9b53985488" dependencies = [ "camino", ] [[package]] name = "ra_ap_proc_macro_api" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af67d958a5c93a9f2353d946a42a63424865cba3c8deb87a7232e3a28492134a" +checksum = "d312f10722d4fa59b93cdbfa534d36a0d2d4a3b18dfad6825d5146afccb41223" dependencies = [ "indexmap 2.14.2", "postcard", @@ -2007,9 +2007,9 @@ dependencies = [ [[package]] name = "ra_ap_profile" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc08a4b422197c7c87ce0637bd2bd21efca772ce59add10e1dcb2f44a0aa5fed" +checksum = "72f43ed3bd40c9f338192cbcaf7169d68d1bb69c66667e127e0ac368bb1bdb68" dependencies = [ "libc", "perf-event", @@ -2018,9 +2018,9 @@ dependencies = [ [[package]] name = "ra_ap_project_model" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f7f30aeba69d975632204769026deeac9df0563ba1c451300d975e84240dfa5" +checksum = "f41727333563bc6cd3299ae5e389d6c1d7f11821b01aa1026aead8c161487de8" dependencies = [ "anyhow", "cargo_metadata", @@ -2045,9 +2045,9 @@ dependencies = [ [[package]] name = "ra_ap_span" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3e2d088e6e32483147e0bd8973d8bb147c5d44318b9ca1080c6482a2051237" +checksum = "98543730b25d99687b95ca1bd4a0f326366eb7a55caf6e847b70ee3c2ac89206" dependencies = [ "hashbrown 0.17.1", "la-arena", @@ -2061,9 +2061,9 @@ dependencies = [ [[package]] name = "ra_ap_stdx" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752cf76786efedcceecd0d7afe5d5bbbf98577d62e9970424d435b9c940638cb" +checksum = "60c564fa8518154e983d5c49be54bfc970cd91ba5b7fd9be07289e1965aa42cc" dependencies = [ "crossbeam-channel", "crossbeam-utils", @@ -2077,9 +2077,9 @@ dependencies = [ [[package]] name = "ra_ap_syntax" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c870c5861a7cb3b2f3cbf255aa964da6d040714127e660b2e953548224e320e" +checksum = "e3b6f7b5310d58d302b6e654b7b7013676a94c462e9e21ae2152d49e5d067ae1" dependencies = [ "either", "itertools", @@ -2097,9 +2097,9 @@ dependencies = [ [[package]] name = "ra_ap_syntax-bridge" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301390c995a3b7b36b3449618615200d460eb9b2bc6eac350b83b501b4203c27" +checksum = "e1ab9a9f42057119efdc9b17530bcd12a5ca7feda2a3cca07cc2ab7e58fd9840" dependencies = [ "ra_ap_intern", "ra_ap_parser", @@ -2112,9 +2112,9 @@ dependencies = [ [[package]] name = "ra_ap_test_fixture" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc62c5ea0c3fa1e0a775f986787bb4d2b5493dd9bbaf7462bd49297289b268c1" +checksum = "bd1102bb800326b4d872487d1cbff8c8dfda9951c2c18185a49b927a2fd21bf7" dependencies = [ "ra_ap_base_db", "ra_ap_cfg", @@ -2130,9 +2130,9 @@ dependencies = [ [[package]] name = "ra_ap_test_utils" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745aa6c6d2b55544058f393286b749803f2563f072d13370e28b01b58dc386f4" +checksum = "2e950ae6ab036ed2d85694222c9ac6c167fd470588af47c354f08c8381787f90" dependencies = [ "dissimilar", "ra_ap_paths", @@ -2144,9 +2144,9 @@ dependencies = [ [[package]] name = "ra_ap_toolchain" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1488e188ddb8a71f73095dce08c4a47ea212cd77622ec8c4e4cf00bdf04ba7c2" +checksum = "aa57909e3770cfb80af82bc502aaf1f8041219244923828fb3dccb93e39fd9e3" dependencies = [ "camino", "semver", @@ -2154,9 +2154,9 @@ dependencies = [ [[package]] name = "ra_ap_tt" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e06cdf663310197d3e1f5b7da0b95397627f2973211a7a5e2d8dae43bb585df2" +checksum = "6767bfe5e71541eef3b764098e0a9ec77864978f610900f8bedfa85151dd58b1" dependencies = [ "arrayvec", "ra-ap-rustc_lexer", @@ -2169,9 +2169,9 @@ dependencies = [ [[package]] name = "ra_ap_vfs" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059025577f043d1e8c999ff8f90ad105eb918ffab94636bf311e508b82f0154a" +checksum = "613e9b9ce9dfb085c980497b712624eca7ec7312c41bc2855ef8cdc245c33dab" dependencies = [ "crossbeam-channel", "fst", @@ -2185,9 +2185,9 @@ dependencies = [ [[package]] name = "ra_ap_vfs-notify" -version = "0.0.357" +version = "0.0.358" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f3d72d96b44cca70daeaef488f29466e60e460b2a520bd6029b32c2df3c4f5a" +checksum = "fd876ebc2872e591cb525395877fc2f3b826fc5a71907dc5e449ab0614b184f3" dependencies = [ "crossbeam-channel", "notify", @@ -2263,7 +2263,7 @@ checksum = "2c9283685feec7d69af75fb0e858d5e7378f33fe4fc699383b2916ab9273e03c" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2313,7 +2313,7 @@ name = "rust-extractor-macros" version = "0.1.0" dependencies = [ "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2403,7 +2403,7 @@ checksum = "69dd77f86ec10e72e314f4ddf7c44c8d349e73cdff1aad524ba9668603fb0549" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2482,15 +2482,16 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] name = "serde_json" -version = "1.0.151" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" dependencies = [ + "foldhash 0.2.0", "indexmap 2.14.2", "itoa", "memchr", @@ -2501,9 +2502,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c" dependencies = [ "serde_core", ] @@ -2538,7 +2539,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2632,9 +2633,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.6" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -2681,7 +2682,7 @@ checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2733,9 +2734,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "toml" -version = "1.1.6+spec-1.1.0" +version = "1.1.8+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a" +checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" dependencies = [ "indexmap 2.14.2", "serde_core", @@ -2748,27 +2749,27 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.1.1+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" dependencies = [ "serde_core", ] [[package]] name = "toml_parser" -version = "1.1.3+spec-1.1.0" +version = "1.1.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" dependencies = [ "winnow 1.0.4", ] [[package]] name = "toml_writer" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" +checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770" [[package]] name = "tracing" @@ -2927,9 +2928,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40688ea6389c8171614b25491f71d4a27946e0c7ce2da1c6de27e25abf1a0ae" +checksum = "0d15f4f5898bcfc5d8a8e45ed30b2f108d710c1a2e5489dbf80e078f707181bc" dependencies = [ "serde", "stable_deref_trait", @@ -3249,7 +3250,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -3269,27 +3270,27 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zstd" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf06bd8162af0734b344780deb55b42a2429ae430870d13fcc12f238e880fe6e" +checksum = "057cfd910cfac363a0ada849592624b4c9ff2e10bef504c3433810d78ed96f93" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "8.0.0" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae42c0555055784c70058d19ba8e275528e8a99a706684868ace5da4e716a4ab" +checksum = "bdd44c6a7284e91f3717755b24315a302edd9153a01f753c3cba3d765e8eafac" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.1.0+zstd.1.5.7" +version = "2.1.1+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef0a8027ec3ee71300ab3bcbcd0393f434aa72b91ca6d635a39941deae8eea0" +checksum = "aeec9eaf2dffbbd09201e23bd0ffcbaa33bb8e9266a10734fd7ed90a85eca078" dependencies = [ "cc", "pkg-config", diff --git a/MODULE.bazel b/MODULE.bazel index ed608bf77a5f..287a999232f5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -124,33 +124,33 @@ use_repo( "vendor_ts__num_cpus-1.17.0", "vendor_ts__proc-macro2-1.0.107", "vendor_ts__quote-1.0.47", - "vendor_ts__ra_ap_base_db-0.0.357", - "vendor_ts__ra_ap_cfg-0.0.357", - "vendor_ts__ra_ap_hir-0.0.357", - "vendor_ts__ra_ap_hir_def-0.0.357", - "vendor_ts__ra_ap_hir_expand-0.0.357", - "vendor_ts__ra_ap_hir_ty-0.0.357", - "vendor_ts__ra_ap_ide_db-0.0.357", - "vendor_ts__ra_ap_intern-0.0.357", - "vendor_ts__ra_ap_load-cargo-0.0.357", - "vendor_ts__ra_ap_parser-0.0.357", - "vendor_ts__ra_ap_paths-0.0.357", - "vendor_ts__ra_ap_project_model-0.0.357", - "vendor_ts__ra_ap_span-0.0.357", - "vendor_ts__ra_ap_stdx-0.0.357", - "vendor_ts__ra_ap_syntax-0.0.357", - "vendor_ts__ra_ap_syntax-bridge-0.0.357", - "vendor_ts__ra_ap_toolchain-0.0.357", - "vendor_ts__ra_ap_vfs-0.0.357", + "vendor_ts__ra_ap_base_db-0.0.358", + "vendor_ts__ra_ap_cfg-0.0.358", + "vendor_ts__ra_ap_hir-0.0.358", + "vendor_ts__ra_ap_hir_def-0.0.358", + "vendor_ts__ra_ap_hir_expand-0.0.358", + "vendor_ts__ra_ap_hir_ty-0.0.358", + "vendor_ts__ra_ap_ide_db-0.0.358", + "vendor_ts__ra_ap_intern-0.0.358", + "vendor_ts__ra_ap_load-cargo-0.0.358", + "vendor_ts__ra_ap_parser-0.0.358", + "vendor_ts__ra_ap_paths-0.0.358", + "vendor_ts__ra_ap_project_model-0.0.358", + "vendor_ts__ra_ap_span-0.0.358", + "vendor_ts__ra_ap_stdx-0.0.358", + "vendor_ts__ra_ap_syntax-0.0.358", + "vendor_ts__ra_ap_syntax-bridge-0.0.358", + "vendor_ts__ra_ap_toolchain-0.0.358", + "vendor_ts__ra_ap_vfs-0.0.358", "vendor_ts__rand-0.10.3", "vendor_ts__rayon-1.12.0", "vendor_ts__regex-1.13.1", "vendor_ts__serde-1.0.229", - "vendor_ts__serde_json-1.0.151", + "vendor_ts__serde_json-1.0.154", "vendor_ts__serde_with-3.24.0", "vendor_ts__serde_yaml-0.9.34-deprecated", - "vendor_ts__syn-3.0.6", - "vendor_ts__toml-1.1.6-spec-1.1.0", + "vendor_ts__syn-3.0.9", + "vendor_ts__toml-1.1.8-spec-1.1.0", "vendor_ts__tracing-0.1.44", "vendor_ts__tracing-flame-0.2.0", "vendor_ts__tracing-subscriber-0.3.23", @@ -160,18 +160,18 @@ use_repo( "vendor_ts__tree-sitter-python-0.25.0", "vendor_ts__tree-sitter-ql-0.23.1", "vendor_ts__tree-sitter-ruby-0.23.1", - "vendor_ts__triomphe-0.1.16", + "vendor_ts__triomphe-0.1.17", "vendor_ts__ungrammar-1.16.1", - "vendor_ts__zstd-0.14.0", + "vendor_ts__zstd-0.14.2", ) http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # rust-analyzer sources needed by the rust ast-generator (see `rust/ast-generator/README.md`). # These should be updated through the `rust/scripts/update_rust_analyzer.py` script. -RUST_ANALYZER_SRC_TAG = "2026-10-05" +RUST_ANALYZER_SRC_TAG = "2026-10-12" -RUST_ANALYZER_SRC_INTEGRITY = "sha256-1p+2oq6NqFQjdRezQijZRzLxsZfwnLA+sPXgIiuP8Us=" +RUST_ANALYZER_SRC_INTEGRITY = "sha256-S9tGdGw7wrZjiMVx+/tZ0RE39Uw/wvO6GKDkGNvAZCA=" http_archive( name = "rust-analyzer-src", @@ -315,7 +315,7 @@ use_repo( ) go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.27.2") +go_sdk.download(version = "1.27.3") go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//go/extractor:go.mod") diff --git a/actions/ql/lib/qlpack.yml b/actions/ql/lib/qlpack.yml index 34de9308ea72..00dfb439af70 100644 --- a/actions/ql/lib/qlpack.yml +++ b/actions/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-all -version: 0.7.0 +version: 0.7.1-dev library: true warnOnImplicitThis: true dependencies: diff --git a/actions/ql/src/qlpack.yml b/actions/ql/src/qlpack.yml index fc604c700879..b1a092734a13 100644 --- a/actions/ql/src/qlpack.yml +++ b/actions/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-queries -version: 0.6.38 +version: 0.6.39-dev library: false warnOnImplicitThis: true groups: [actions, queries] diff --git a/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/exprs.ql b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/exprs.ql new file mode 100644 index 000000000000..3af03b1d60b2 --- /dev/null +++ b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/exprs.ql @@ -0,0 +1,17 @@ +class Expr extends @expr { + string toString() { none() } +} + +class Location extends @location_default { + string toString() { none() } +} + +predicate isExprWithNewBuiltin(Expr expr) { + exists(int kind | exprs(expr, kind, _) | 397 <= kind and kind <= 403) +} + +from Expr expr, int kind, int kind_new, Location location +where + exprs(expr, kind, location) and + if isExprWithNewBuiltin(expr) then kind_new = 1 else kind_new = kind +select expr, kind_new, location diff --git a/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/old.dbscheme b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/old.dbscheme new file mode 100644 index 000000000000..293904928d85 --- /dev/null +++ b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/old.dbscheme @@ -0,0 +1,2602 @@ + +/*- 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 + * + * 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 +); + +/** + * The expanded arguments that were passed to the extractor for a + * compiler invocation. This is similar to `compilation_args`, but + * for a `@someFile` argument, it includes the arguments from that + * file, rather than just taking the argument literally. + */ +#keyset[id, num] +compilation_expanded_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 -*/ + +/** + * 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 +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Files and folders -*/ + +/** + * The location of an element. + * 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( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Lines of code -*/ + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +/*- Diagnostic messages -*/ + +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 +); + +/*- C++ dbscheme -*/ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +/** + * Gives the TRAP filename that `trap` is associated with. + * For debugging only. + */ +trap_filename( + int trap: @trap, + string filename: string ref +); + +/** + * Gives the tag name for `tag`. + * For debugging only. + */ +tag_name( + int tag: @tag, + string name: string ref +); + +@trap_or_tag = @tag | @trap; + +/** + * Gives the name for the source file. + */ +source_file_name( + int sf: @source_file, + string name: string ref +); + +/** + * In `build-mode: none` overlay mode, indicates that `source_file` + * (`/path/to/foo.c`) uses the TRAP file `trap_file`; i.e. it is the + * TRAP file corresponding to `foo.c`, something it transitively + * includes, or a template instantiation it transitively uses. + */ +source_file_uses_trap( + int source_file: @source_file ref, + int trap_file: @trap ref +); + +/** + * In `build-mode: none` overlay mode, indicates that the TRAP file + * `trap_file` uses tag `tag`. + */ +trap_uses_tag( + int trap_file: @trap ref, + int tag: @tag ref +); + +/** + * Holds if there is a definition of `element` in TRAP file or tag `t`. + */ +in_trap_or_tag( + int element: @element ref, + int t: @trap_or_tag ref +); + +pch_uses( + int pch: @pch ref, + int compilation: @compilation ref, + int id: @file ref +) + +#keyset[pch, compilation] +pch_creations( + int pch: @pch, + int compilation: @compilation ref, + int from: @file ref +) + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +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_default 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 + 0 = @unknown_function +| 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +// ... 6 = @builtin_function deprecated // 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 +); + +builtin_functions( + int id: @function 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 +// ... 41 _Decimal64 +// ... 42 _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 +| 62 = @mfp8 // __mfp8 +| 63 = @scalable_vector_count // __SVCount_t +| 64 = @complex_fp16 // _Complex __fp16 +| 65 = @complex_std_bfloat16 // _Complex __bf16 +| 66 = @complex_std_float16 // _Complex std::float16_t +| 67 = @bit_precise_int // _BitInt(N) +| 68 = @unsigned_bit_precise_int // unsigned _BitInt(N) +| 69 = @signed_bit_precise_int // signed _BitInt(N) +; + +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 +); + +bit_precise_int_types( + unique int id: @builtintype ref, + int bit_width: 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 +| 11 = @scalable_vector // Arm SVE +; + +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 +); + +tupleelements( + unique int id: @derivedtype ref, + int num_elements: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the 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. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +case @type_operator.kind of + 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type 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 +); +class_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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_default 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 +); +function_template_generated_from( + unique int template: @function ref, + int from: @function 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 +); +variable_template_generated_from( + unique int template: @variable ref, + int from: @variable ref +); + +is_alias_template(unique int id: @usertype ref); +alias_instantiation( + unique int to: @usertype ref, + int from: @usertype ref +); +alias_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +alias_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); +alias_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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 +); + +namespaceattributes( + int namespace_id: @namespace ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +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 + | @decltype + | @derivedtype; + +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_default 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_default 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 +| 394 = @isinvocable +| 395 = @isnothrowinvocable +| 396 = @isbitwisecloneable +| 397 = @isvirtualbaseof +| 398 = @isimplicitlifetime +| 399 = @ltsynthesizesfromspaceship +| 400 = @gtsynthesizesfromspaceship +| 401 = @lesynthesizesfromspaceship +| 402 = @gesynthesizesfromspaceship +| 403 = @isstructural +; + +@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 + | @isinvocable + | @isnothrowinvocable + | @isbitwisecloneable + | @isvirtualbaseof + | @isimplicitlifetime + | @ltsynthesizesfromspaceship + | @gtsynthesizesfromspaceship + | @lesynthesizesfromspaceship + | @gesynthesizesfromspaceship + | @isstructural + ; + +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 +); + +param_ref_to_this( + int expr: @param_ref 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 is_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 is_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, + boolean has_explicit_parameter_list: 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_default 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 +| 40 = @stmt_leave +; + +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 +); + +type_is_vla(unique int type_id: @derivedtype 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 | @stmt_leave; + +@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 +| 17 = @ppd_embed +| 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 +); + +embeds( + unique int id: @ppd_embed 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 +); + +/*- Database metadata -*/ + +/** + * The CLI will automatically emit applicable tuples for this table, + * such as `databaseMetadata("isOverlay", "true")` when building an + * overlay database. + */ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + +/*- Overlay support -*/ + +/** + * The CLI will automatically emit tuples for each new/modified/deleted file + * when building an overlay database. + */ +overlayChangedFiles( + string path: string 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/293904928d857b61a44dc0ff34c89c9eccb8a90a/semmlecode.cpp.dbscheme b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..6aec212e408f --- /dev/null +++ b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/semmlecode.cpp.dbscheme @@ -0,0 +1,2588 @@ + +/*- 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 + * + * 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 +); + +/** + * The expanded arguments that were passed to the extractor for a + * compiler invocation. This is similar to `compilation_args`, but + * for a `@someFile` argument, it includes the arguments from that + * file, rather than just taking the argument literally. + */ +#keyset[id, num] +compilation_expanded_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 -*/ + +/** + * 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 +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Files and folders -*/ + +/** + * The location of an element. + * 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( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Lines of code -*/ + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +/*- Diagnostic messages -*/ + +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 +); + +/*- C++ dbscheme -*/ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +/** + * Gives the TRAP filename that `trap` is associated with. + * For debugging only. + */ +trap_filename( + int trap: @trap, + string filename: string ref +); + +/** + * Gives the tag name for `tag`. + * For debugging only. + */ +tag_name( + int tag: @tag, + string name: string ref +); + +@trap_or_tag = @tag | @trap; + +/** + * Gives the name for the source file. + */ +source_file_name( + int sf: @source_file, + string name: string ref +); + +/** + * In `build-mode: none` overlay mode, indicates that `source_file` + * (`/path/to/foo.c`) uses the TRAP file `trap_file`; i.e. it is the + * TRAP file corresponding to `foo.c`, something it transitively + * includes, or a template instantiation it transitively uses. + */ +source_file_uses_trap( + int source_file: @source_file ref, + int trap_file: @trap ref +); + +/** + * In `build-mode: none` overlay mode, indicates that the TRAP file + * `trap_file` uses tag `tag`. + */ +trap_uses_tag( + int trap_file: @trap ref, + int tag: @tag ref +); + +/** + * Holds if there is a definition of `element` in TRAP file or tag `t`. + */ +in_trap_or_tag( + int element: @element ref, + int t: @trap_or_tag ref +); + +pch_uses( + int pch: @pch ref, + int compilation: @compilation ref, + int id: @file ref +) + +#keyset[pch, compilation] +pch_creations( + int pch: @pch, + int compilation: @compilation ref, + int from: @file ref +) + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +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_default 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 + 0 = @unknown_function +| 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +// ... 6 = @builtin_function deprecated // 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 +); + +builtin_functions( + int id: @function 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 +// ... 41 _Decimal64 +// ... 42 _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 +| 62 = @mfp8 // __mfp8 +| 63 = @scalable_vector_count // __SVCount_t +| 64 = @complex_fp16 // _Complex __fp16 +| 65 = @complex_std_bfloat16 // _Complex __bf16 +| 66 = @complex_std_float16 // _Complex std::float16_t +| 67 = @bit_precise_int // _BitInt(N) +| 68 = @unsigned_bit_precise_int // unsigned _BitInt(N) +| 69 = @signed_bit_precise_int // signed _BitInt(N) +; + +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 +); + +bit_precise_int_types( + unique int id: @builtintype ref, + int bit_width: 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 +| 11 = @scalable_vector // Arm SVE +; + +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 +); + +tupleelements( + unique int id: @derivedtype ref, + int num_elements: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the 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. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +case @type_operator.kind of + 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type 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 +); +class_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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_default 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 +); +function_template_generated_from( + unique int template: @function ref, + int from: @function 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 +); +variable_template_generated_from( + unique int template: @variable ref, + int from: @variable ref +); + +is_alias_template(unique int id: @usertype ref); +alias_instantiation( + unique int to: @usertype ref, + int from: @usertype ref +); +alias_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +alias_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); +alias_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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 +); + +namespaceattributes( + int namespace_id: @namespace ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +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 + | @decltype + | @derivedtype; + +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_default 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_default 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 +| 394 = @isinvocable +| 395 = @isnothrowinvocable +| 396 = @isbitwisecloneable +; + +@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 + | @isinvocable + | @isnothrowinvocable + | @isbitwisecloneable + ; + +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 +); + +param_ref_to_this( + int expr: @param_ref 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 is_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 is_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, + boolean has_explicit_parameter_list: 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_default 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 +| 40 = @stmt_leave +; + +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 +); + +type_is_vla(unique int type_id: @derivedtype 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 | @stmt_leave; + +@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 +| 17 = @ppd_embed +| 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 +); + +embeds( + unique int id: @ppd_embed 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 +); + +/*- Database metadata -*/ + +/** + * The CLI will automatically emit applicable tuples for this table, + * such as `databaseMetadata("isOverlay", "true")` when building an + * overlay database. + */ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + +/*- Overlay support -*/ + +/** + * The CLI will automatically emit tuples for each new/modified/deleted file + * when building an overlay database. + */ +overlayChangedFiles( + string path: string 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/293904928d857b61a44dc0ff34c89c9eccb8a90a/upgrade.properties b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/upgrade.properties new file mode 100644 index 000000000000..d697a16a42fd --- /dev/null +++ b/cpp/downgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/upgrade.properties @@ -0,0 +1,3 @@ +description: Add new builtin operations +compatibility: partial +exprs.rel: run exprs.qlo diff --git a/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected b/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected index 85790a23a836..207617d4ac06 100644 --- a/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected +++ b/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected @@ -1 +1,45 @@ +ql/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql +ql/cpp/ql/src/Best Practices/ComplexCondition.ql +ql/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql +ql/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql +ql/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql +ql/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql +ql/cpp/ql/src/Best Practices/GuardedFree.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql +ql/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql +ql/cpp/ql/src/Best Practices/RuleOfTwo.ql +ql/cpp/ql/src/Best Practices/UseOfGoto.ql +ql/cpp/ql/src/Critical/LargeParameter.ql +ql/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql +ql/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql +ql/cpp/ql/src/Documentation/FixmeComments.ql +ql/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql +ql/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql +ql/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql ql/cpp/ql/src/Likely Bugs/Likely Typos/AmbiguousAssignmentOfComparison.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql +ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql +ql/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql +ql/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql +ql/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql +ql/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql +ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql +ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql diff --git a/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected b/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected index 85790a23a836..207617d4ac06 100644 --- a/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected +++ b/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected @@ -1 +1,45 @@ +ql/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql +ql/cpp/ql/src/Best Practices/ComplexCondition.ql +ql/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql +ql/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql +ql/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql +ql/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql +ql/cpp/ql/src/Best Practices/GuardedFree.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql +ql/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql +ql/cpp/ql/src/Best Practices/RuleOfTwo.ql +ql/cpp/ql/src/Best Practices/UseOfGoto.ql +ql/cpp/ql/src/Critical/LargeParameter.ql +ql/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql +ql/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql +ql/cpp/ql/src/Documentation/FixmeComments.ql +ql/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql +ql/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql +ql/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql ql/cpp/ql/src/Likely Bugs/Likely Typos/AmbiguousAssignmentOfComparison.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql +ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql +ql/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql +ql/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql +ql/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql +ql/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql +ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql +ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql diff --git a/cpp/ql/lib/change-notes/2026-10-15-bitwidth.md b/cpp/ql/lib/change-notes/2026-10-15-bitwidth.md new file mode 100644 index 000000000000..7d1b3b4248c4 --- /dev/null +++ b/cpp/ql/lib/change-notes/2026-10-15-bitwidth.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added a new predicate `getBitWidth` to the `Type` class, which yields the bit-width of the type. diff --git a/cpp/ql/lib/change-notes/2026-10-16-builtins.md b/cpp/ql/lib/change-notes/2026-10-16-builtins.md new file mode 100644 index 000000000000..2434e465cd5a --- /dev/null +++ b/cpp/ql/lib/change-notes/2026-10-16-builtins.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added support for the `__builtin_lt_synthesizes_from_spaceship`, `__builtin_gt_synthesizes_from_spaceship`, `__builtin_le_synthesizes_from_spaceship`, `__builtin_ge_synthesizes_from_spaceship`, `__builtin_is_implicit_lifetime`, `__builtin_is_structural`, and `__builtin_is_virtual_base_of` builtin operations. diff --git a/cpp/ql/lib/experimental/semmle/code/cpp/rangeanalysis/extensions/ConstantShiftExprRange.qll b/cpp/ql/lib/experimental/semmle/code/cpp/rangeanalysis/extensions/ConstantShiftExprRange.qll index 3f300d7aa8d6..0f7e1ce5ed40 100644 --- a/cpp/ql/lib/experimental/semmle/code/cpp/rangeanalysis/extensions/ConstantShiftExprRange.qll +++ b/cpp/ql/lib/experimental/semmle/code/cpp/rangeanalysis/extensions/ConstantShiftExprRange.qll @@ -21,7 +21,7 @@ bindingset[val] private predicate isValidShiftExprShift(float val, Expr l) { val >= 0 and // We use getFullyConverted because the spec says to use the *promoted* left operand - val < (l.getFullyConverted().getUnderlyingType().getSize() * 8) + val < l.getFullyConverted().getUnderlyingType().getBitWidth() } bindingset[val, shift, max_val] diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index 9178c9b9d67f..a32cba70596b 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 12.3.0 +version: 12.3.1-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/lib/semmle/code/cpp/Enum.qll b/cpp/ql/lib/semmle/code/cpp/Enum.qll index 38263dacf7ac..6b30d7921157 100644 --- a/cpp/ql/lib/semmle/code/cpp/Enum.qll +++ b/cpp/ql/lib/semmle/code/cpp/Enum.qll @@ -55,6 +55,12 @@ class Enum extends UserType, IntegralOrEnumType { not exists(UserType.super.getSize()) and result = 4 } + override int getBitWidth() { + result = UserType.super.getBitWidth() + or + not exists(UserType.super.getBitWidth()) and result = 32 + } + /** See `Type.isDeeplyConst` and `Type.isDeeplyConstBelow`. Internal. */ override predicate isDeeplyConstBelow() { any() } // No subparts diff --git a/cpp/ql/lib/semmle/code/cpp/Type.qll b/cpp/ql/lib/semmle/code/cpp/Type.qll index 023aa1b6c3d4..78367dbf7be4 100644 --- a/cpp/ql/lib/semmle/code/cpp/Type.qll +++ b/cpp/ql/lib/semmle/code/cpp/Type.qll @@ -123,6 +123,16 @@ class Type extends Locatable, @type { usertypesize(underlyingElement(this), result, _) } + /** + * Gets the bit width of this type. + */ + int getBitWidth() { + not bit_precise_int_types(underlyingElement(this), _) and + result = this.getSize() * 8 + or + bit_precise_int_types(underlyingElement(this), result) + } + /** * Gets the alignment of this type in bytes. */ @@ -1076,9 +1086,6 @@ class Char32Type extends IntegralType { class BitPreciseIntType extends IntegralType { BitPreciseIntType() { builtintypes(underlyingElement(this), _, [67, 68, 69], _, _, _) } - /** Get the bit-with of the bit-precise integer. */ - int getBitWidth() { bit_precise_int_types(underlyingElement(this), result) } - override string getAPrimaryQlClass() { result = "BitPreciseIntType" } } @@ -1182,6 +1189,8 @@ class Decltype extends Type, NameQualifyingElement { override int getSize() { result = this.getBaseType().getSize() } + override int getBitWidth() { result = this.getBaseType().getBitWidth() } + override int getAlignment() { result = this.getBaseType().getAlignment() } override int getPointerIndirectionLevel() { @@ -1242,6 +1251,8 @@ class TypeofType extends Type { override int getSize() { result = this.getBaseType().getSize() } + override int getBitWidth() { result = this.getBaseType().getBitWidth() } + override int getAlignment() { result = this.getBaseType().getAlignment() } override int getPointerIndirectionLevel() { @@ -1387,6 +1398,8 @@ class IntrinsicTransformedType extends Type { override int getSize() { result = this.getBaseType().getSize() } + override int getBitWidth() { result = this.getBaseType().getBitWidth() } + override int getAlignment() { result = this.getBaseType().getAlignment() } override int getPointerIndirectionLevel() { @@ -1512,6 +1525,8 @@ class SpecifiedType extends DerivedType { override int getSize() { result = this.getBaseType().getSize() } + override int getBitWidth() { result = this.getBaseType().getBitWidth() } + override int getAlignment() { result = this.getBaseType().getAlignment() } override int getPointerIndirectionLevel() { @@ -1587,6 +1602,8 @@ class ArrayType extends DerivedType { */ override int getSize() { result = this.getByteSize() } + override int getBitWidth() { result = this.getByteSize() * 8 } + override string explain() { if exists(this.getArraySize()) then diff --git a/cpp/ql/lib/semmle/code/cpp/TypedefType.qll b/cpp/ql/lib/semmle/code/cpp/TypedefType.qll index 69eb8f881d29..70aa933d6a2d 100644 --- a/cpp/ql/lib/semmle/code/cpp/TypedefType.qll +++ b/cpp/ql/lib/semmle/code/cpp/TypedefType.qll @@ -26,6 +26,8 @@ class TypedefType extends UserType { override int getSize() { result = this.getBaseType().getSize() } + override int getBitWidth() { result = this.getBaseType().getBitWidth() } + override int getAlignment() { result = this.getBaseType().getAlignment() } override int getPointerIndirectionLevel() { diff --git a/cpp/ql/lib/semmle/code/cpp/commons/Printf.qll b/cpp/ql/lib/semmle/code/cpp/commons/Printf.qll index 624465761c2c..dfda2f4796c5 100644 --- a/cpp/ql/lib/semmle/code/cpp/commons/Printf.qll +++ b/cpp/ql/lib/semmle/code/cpp/commons/Printf.qll @@ -1193,7 +1193,7 @@ class FormatLiteral extends Literal instanceof StringLiteral { // Subtract one in the exponent because one bit is for the sign. // Add 1 to account for the possible sign in the output. typeBasedBound = - 1 + lengthInBase10(2.pow(this.getIntegralDisplayType(n).getSize() * 8 - 1)) and + 1 + lengthInBase10(2.pow(this.getIntegralDisplayType(n).getBitWidth() - 1)) and // The second case uses range analysis to deduce a length that's shorter than the length // of the number -2^31. exists(Expr arg, float lower, float upper | @@ -1227,7 +1227,7 @@ class FormatLiteral extends Literal instanceof StringLiteral { // e.g. 2^32 - 1 = "4294967295" exists(float typeBasedBound, float valueBasedBound | // The first case handles length sub-specifiers - typeBasedBound = lengthInBase10(2.pow(this.getIntegralDisplayType(n).getSize() * 8) - 1) and + typeBasedBound = lengthInBase10(2.pow(this.getIntegralDisplayType(n).getBitWidth()) - 1) and // The second case uses range analysis to deduce a length that's shorter than // the length of the number 2^31 - 1. exists(Expr arg, float lower, float upper | @@ -1239,7 +1239,7 @@ class FormatLiteral extends Literal instanceof StringLiteral { lengthInBase10(max(float cand | // If lower can be negative we use `(unsigned)-1` as the candidate value. lower < 0 and - cand = 2.pow(any(IntType t | t.isUnsigned()).getSize() * 8) + cand = 2.pow(any(IntType t | t.isUnsigned()).getBitWidth()) or cand = upper )) and @@ -1275,7 +1275,7 @@ class FormatLiteral extends Literal instanceof StringLiteral { lengthInBase16(max(float cand | // If lower can be negative we use `(unsigned)-1` as the candidate value. lower < 0 and - cand = 2.pow(any(IntType t | t.isUnsigned()).getSize() * 8) + cand = 2.pow(any(IntType t | t.isUnsigned()).getBitWidth()) or cand = upper )) and @@ -1304,12 +1304,12 @@ class FormatLiteral extends Literal instanceof StringLiteral { exists(int sizeBits, int baseLen | sizeBits = min(int bits | - bits = this.getIntegralDisplayType(n).getSize() * 8 + bits = this.getIntegralDisplayType(n).getBitWidth() or exists(IntegralType t | t = this.getUse().getConversionArgument(n).getType().getUnderlyingType() | - t.isUnsigned() and bits = t.getSize() * 8 + t.isUnsigned() and bits = t.getBitWidth() ) ) and baseLen = (sizeBits / 3.0).ceil() and diff --git a/cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll b/cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll index 84e96fa9c468..5329fb92a5a4 100644 --- a/cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll +++ b/cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll @@ -344,12 +344,12 @@ private int convertIntToType(int val, IntegralType t) { then if val = 0 then result = 0 else result = 1 else if t.isUnsigned() - then val >= 0 and val.bitShiftRight(t.getSize() * 8) = 0 and result = val + then val >= 0 and val.bitShiftRight(t.getBitWidth()) = 0 and result = val else - if val >= 0 and val.bitShiftRight(t.getSize() * 8 - 1) = 0 + if val >= 0 and val.bitShiftRight(t.getBitWidth() - 1) = 0 then result = val else ( - (-(val + 1)).bitShiftRight(t.getSize() * 8 - 1) = 0 and result = val + (-(val + 1)).bitShiftRight(t.getBitWidth() - 1) = 0 and result = val ) } diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll b/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll index 2246a887b9c1..be7636fdadee 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll @@ -353,6 +353,21 @@ class BuiltInOperationIsBaseOf extends BuiltInOperation, @isbaseofexpr { override string getAPrimaryQlClass() { result = "BuiltInOperationIsBaseOf" } } +/** + * A C++ `__builtin_is_virtual_base_of` built-in operation (used by some implementations of the + * `` header). + * + * Returns `true` if the first type is a virtual base class of the second type. + * ``` + * bool v = __builtin_is_virtual_base_of(MyType, OtherType); + * ``` + */ +class BuiltInOperationIsVirtualBaseOf extends BuiltInOperation, @isvirtualbaseof { + override string toString() { result = "__builtin_is_virtual_base_of" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsVirtualBaseOf" } +} + /** * A C++ `__is_class` built-in operation (used by some implementations of the * `` header). @@ -1999,3 +2014,105 @@ class BuiltInOperationIsNothrowInvocable extends BuiltInOperation, @isnothrowinv override string getAPrimaryQlClass() { result = "BuiltInOperationIsNothrowInvocable" } } + +/** + * A C++ `__builtin_is_implicit_lifetime` built-in operation (used by some implementations + * of the `` header). + * + * Returns `true` if a type `_Tp` is an implicit lifetime type. + * + * ``` + * template + * constexpr bool is_implicit_lifetime = __builtin_is_implicit_lifetime(_Tp); + * ``` + */ +class BuiltInOperationIsImplicitLifetime extends BuiltInOperation, @isimplicitlifetime { + override string toString() { result = "__builtin_is_implicit_lifetime" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsImplicitLifetime" } +} + +/** + * A C++ `__builtin_is_structural` built-in operation (used by some implementations + * of the `` header). + * + * Returns `true` if a type `_Tp` is structural type. + * + * ``` + * template + * constexpr bool is_structural = __builtin_is_structural(_Tp); + * ``` + */ +class BuiltInOperationIsStructural extends BuiltInOperation, @isstructural { + override string toString() { result = "__builtin_is_structural" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsStructural" } +} + +/** + * A C++ `__builtin_lt_synthesizes_from_spaceship` built-in operation (used by some container + * implementations). + * + * Returns `true` if the `<` operator is synthesized from the spaceship operator `<=>`. + * + * ``` + * bool v = __builtin_lt_synthesizes_from_spaceship(MyType, OtherType); + */ +class BuiltInOperationLtSynthesizesFromSpaceship extends BuiltInOperation, + @ltsynthesizesfromspaceship +{ + override string toString() { result = "__builtin_lt_synthesizes_from_spaceship" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationLtSynthesizesFromSpaceship" } +} + +/** + * A C++ `__builtin_gt_synthesizes_from_spaceship` built-in operation (used by some container + * implementations). + * + * Returns `true` if the `>` operator is synthesized from the spaceship operator `<=>`. + * + * ``` + * bool v = __builtin_gt_synthesizes_from_spaceship(MyType, OtherType); + */ +class BuiltInOperationGtSynthesizesFromSpaceship extends BuiltInOperation, + @gtsynthesizesfromspaceship +{ + override string toString() { result = "__builtin_gt_synthesizes_from_spaceship" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationGtSynthesizesFromSpaceship" } +} + +/** + * A C++ `__builtin_le_synthesizes_from_spaceship` built-in operation (used by some container + * implementations). + * + * Returns `true` if the `<=` operator is synthesized from the spaceship operator `<=>`. + * + * ``` + * bool v = __builtin_le_synthesizes_from_spaceship(MyType, OtherType); + */ +class BuiltInOperationLeSynthesizesFromSpaceship extends BuiltInOperation, + @lesynthesizesfromspaceship +{ + override string toString() { result = "__builtin_le_synthesizes_from_spaceship" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationLeSynthesizesFromSpaceship" } +} + +/** + * A C++ `__builtin_ge_synthesizes_from_spaceship` built-in operation (used by some container + * implementations). + * + * Returns `true` if the `>=` operator is synthesized from the spaceship operator `<=>`. + * + * ``` + * bool v = __builtin_ge_synthesizes_from_spaceship(MyType, OtherType); + */ +class BuiltInOperationGeSynthesizesFromSpaceship extends BuiltInOperation, + @gesynthesizesfromspaceship +{ + override string toString() { result = "__builtin_ge_synthesizes_from_spaceship" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationGeSynthesizesFromSpaceship" } +} diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll index 41e1a4c3082d..7871ddb16189 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll @@ -396,9 +396,7 @@ private int maxColumnWidth() { } private string getPaddingString(int n) { - n = 0 and result = "" - or - n > 0 and n <= maxColumnWidth() and result = getPaddingString(n - 1) + " " + n = [0 .. maxColumnWidth()] and result = concat(int i | i in [1 .. n] | " ") } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll index 41e1a4c3082d..7871ddb16189 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll @@ -396,9 +396,7 @@ private int maxColumnWidth() { } private string getPaddingString(int n) { - n = 0 and result = "" - or - n > 0 and n <= maxColumnWidth() and result = getPaddingString(n - 1) + " " + n = [0 .. maxColumnWidth()] and result = concat(int i | i in [1 .. n] | " ") } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll index 41e1a4c3082d..7871ddb16189 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll @@ -396,9 +396,7 @@ private int maxColumnWidth() { } private string getPaddingString(int n) { - n = 0 and result = "" - or - n > 0 and n <= maxColumnWidth() and result = getPaddingString(n - 1) + " " + n = [0 .. maxColumnWidth()] and result = concat(int i | i in [1 .. n] | " ") } /** diff --git a/cpp/ql/lib/semmle/code/cpp/rangeanalysis/RangeAnalysisUtils.qll b/cpp/ql/lib/semmle/code/cpp/rangeanalysis/RangeAnalysisUtils.qll index 03dbc56dc99c..3b316f5bce5c 100644 --- a/cpp/ql/lib/semmle/code/cpp/rangeanalysis/RangeAnalysisUtils.qll +++ b/cpp/ql/lib/semmle/code/cpp/rangeanalysis/RangeAnalysisUtils.qll @@ -406,7 +406,7 @@ predicate cmpWithLinearBound( */ private predicate typeBounds0(ArithmeticType t, float lb, float ub) { exists(IntegralType integralType, float limit | - integralType = t and limit = 2.pow(8 * integralType.getSize()) + integralType = t and limit = 2.pow(integralType.getBitWidth()) | if integralType instanceof BoolType then lb = 0 and ub = 1 @@ -438,7 +438,7 @@ private IntegralType getUnderlyingTypeForEnum(Enum e) { not e.hasExplicitUnderlyingType() and result.isSigned() and exists(IntType intType | - if max(e.getAnEnumConstant().getValue().toFloat()) >= 2.pow(8 * intType.getSize() - 1) + if max(e.getAnEnumConstant().getValue().toFloat()) >= 2.pow(intType.getBitWidth() - 1) then result instanceof LongType else result = intType ) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index 6aec212e408f..293904928d85 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -2004,6 +2004,13 @@ case @expr.kind of | 394 = @isinvocable | 395 = @isnothrowinvocable | 396 = @isbitwisecloneable +| 397 = @isvirtualbaseof +| 398 = @isimplicitlifetime +| 399 = @ltsynthesizesfromspaceship +| 400 = @gtsynthesizesfromspaceship +| 401 = @lesynthesizesfromspaceship +| 402 = @gesynthesizesfromspaceship +| 403 = @isstructural ; @var_args_expr = @vastartexpr @@ -2123,6 +2130,13 @@ case @expr.kind of | @isinvocable | @isnothrowinvocable | @isbitwisecloneable + | @isvirtualbaseof + | @isimplicitlifetime + | @ltsynthesizesfromspaceship + | @gtsynthesizesfromspaceship + | @lesynthesizesfromspaceship + | @gesynthesizesfromspaceship + | @isstructural ; compound_requirement_is_noexcept( diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 8f5c157b1ae7..90a3250189fb 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 12799 + 12794 @externalDataElement @@ -10,11 +10,11 @@ @file - 66019 + 65994 @folder - 12543 + 12538 @diagnostic @@ -22,7 +22,7 @@ @location_default - 46369281 + 46368911 @trap @@ -42,15 +42,15 @@ @macro_expansion - 40292589 + 40292268 @other_macro_reference - 300524 + 300521 @normal_function - 2699603 + 2699581 @unknown_function @@ -58,11 +58,11 @@ @constructor - 692625 + 692574 @destructor - 84842 + 84841 @conversion_function @@ -70,7 +70,7 @@ @operator - 647305 + 647300 @user_defined_literal @@ -82,23 +82,23 @@ @fun_decl - 4149410 + 4149377 @var_decl - 9411101 + 9411026 @type_decl - 1639750 + 1639737 @namespace_decl - 406675 + 406672 @using_declaration - 270974 + 271344 @using_directive @@ -110,27 +110,27 @@ @static_assert - 172120 + 172118 @parameter - 6932137 + 6932082 @membervariable - 1502215 + 1502203 @globalvariable - 634536 + 634531 @localvariable - 733038 + 733187 @enumconstant - 347913 + 347910 @errortype @@ -366,11 +366,11 @@ @bit_precise_int - 3 + 4 @unsigned_bit_precise_int - 4 + 6 @signed_bit_precise_int @@ -378,23 +378,23 @@ @pointer - 449258 + 449255 @type_with_specifiers - 686964 + 686958 @array - 89630 + 89629 @routineptr - 678207 + 678157 @reference - 959048 + 959040 @gnu_vector @@ -406,7 +406,7 @@ @rvalue_reference - 286941 + 286938 @block @@ -416,10 +416,6 @@ @scalable_vector 1 - - @decltype - 101803 - @typeof 811 @@ -498,15 +494,19 @@ @remove_reference - 5694 + 5695 + + + @decltype + 101802 @struct - 1056586 + 1056347 @union - 20750 + 20749 @enum @@ -514,11 +514,11 @@ @template_parameter - 879786 + 879462 @alias - 1791267 + 1791463 @unknown_usertype @@ -526,15 +526,15 @@ @class - 320951 + 320949 @template_template_parameter - 6191 + 6189 @proxy_class - 51198 + 51179 @scoped_enum @@ -542,7 +542,7 @@ @template_struct - 214653 + 214585 @template_class @@ -554,11 +554,11 @@ @mangledname - 6345485 + 6345435 @type_mention - 5937930 + 5937883 @concept_template @@ -566,11 +566,11 @@ @routinetype - 599125 + 599081 @ptrtomember - 9837 + 9834 @specifier @@ -582,11 +582,11 @@ @stdattribute - 347840 + 347838 @declspec - 330275 + 330272 @msattribute @@ -598,11 +598,11 @@ @attribute_arg_token - 16545 + 16544 @attribute_arg_constant_expr - 72691 + 72665 @attribute_arg_expr @@ -622,19 +622,19 @@ @derivation - 494887 + 494850 @frienddecl - 765587 + 765911 @comment - 11058465 + 11058376 @namespace - 8757 + 8754 @specialnamequalifyingelement @@ -642,15 +642,15 @@ @namequalifier - 3044887 + 3044942 @value - 13539325 + 13539217 @initialiser - 2292690 + 2292672 @address_of @@ -658,19 +658,19 @@ @indirect - 401768 + 401764 @array_to_pointer - 1953190 + 1953174 @parexpr - 4913791 + 4913752 @arithnegexpr - 586365 + 586361 @unaryplusexpr @@ -678,23 +678,23 @@ @complementexpr - 38173 + 38172 @notexpr - 355664 + 355661 @postincrexpr - 84542 + 84541 @postdecrexpr - 57376 + 57375 @preincrexpr - 96686 + 96685 @predecrexpr @@ -702,55 +702,55 @@ @conditionalexpr - 897622 + 897615 @addexpr - 580708 + 580703 @subexpr - 466665 + 466661 @mulexpr - 445292 + 445289 @divexpr - 52369 + 52368 @remexpr - 15870 + 15869 @paddexpr - 118586 + 118585 @psubexpr - 67993 + 67992 @pdiffexpr - 43833 + 43832 @lshiftexpr - 552173 + 552169 @rshiftexpr - 201367 + 201365 @andexpr - 483452 + 483448 @orexpr - 193999 + 193997 @xorexpr @@ -758,19 +758,19 @@ @eqexpr - 643188 + 643183 @neexpr - 411752 + 411749 @gtexpr - 111117 + 111116 @ltexpr - 139389 + 139388 @geexpr @@ -778,11 +778,11 @@ @leexpr - 291831 + 291828 @assignexpr - 1280779 + 1280769 @assignaddexpr @@ -794,7 +794,7 @@ @assignmulexpr - 11324 + 11319 @assigndivexpr @@ -834,23 +834,23 @@ @andlogicalexpr - 346490 + 346487 @orlogicalexpr - 1103221 + 1103212 @commaexpr - 165264 + 165262 @subscriptexpr - 435018 + 435015 @callexpr - 263482 + 263463 @vastartexpr @@ -870,39 +870,39 @@ @varaccess - 8252279 + 8252213 @runtime_sizeof - 401589 + 401586 @runtime_alignof - 50650 + 50646 @expr_stmt - 147584 + 147583 @routineexpr - 5708751 + 5708855 @type_operand - 1404979 + 1404968 @offsetofexpr - 148494 + 148493 @typescompexpr - 701742 + 701736 @literal - 8035745 + 8036394 @aggregateliteral @@ -910,27 +910,27 @@ @c_style_cast - 6023777 + 6023782 @temp_init - 984852 + 985294 @errorexpr - 45078 + 45075 @reference_to - 1891026 + 1890439 @ref_indirect - 2091992 + 2091838 @vacuous_destructor_call - 7766 + 7765 @assume @@ -986,31 +986,31 @@ @thisaccess - 1554385 + 1554373 @new_expr - 45787 + 45784 @delete_expr - 11379 + 11378 @throw_expr - 23913 + 23918 @condition_decl - 406885 + 406893 @braced_init_list - 2114 + 2115 @type_id - 47476 + 47472 @sizeof_pack @@ -1118,7 +1118,7 @@ @ctordirectinit - 111802 + 111793 @ctorvirtualinit @@ -1126,7 +1126,7 @@ @ctorfieldinit - 204063 + 204061 @ctordelegatinginit @@ -1134,7 +1134,7 @@ @dtordirectdestruct - 39102 + 39099 @dtorvirtualdestruct @@ -1142,11 +1142,11 @@ @dtorfielddestruct - 39473 + 39470 @static_cast - 348331 + 348329 @reinterpret_cast @@ -1154,7 +1154,7 @@ @const_cast - 24244 + 24242 @dynamic_cast @@ -1166,11 +1166,11 @@ @param_ref - 165240 + 165342 @noopexpr - 113 + 89 @istriviallyconstructibleexpr @@ -1266,11 +1266,11 @@ @isfinalexpr - 9319 + 9318 @noexceptexpr - 30482 + 30501 @builtinshufflevector @@ -1326,7 +1326,7 @@ @builtinshuffle - 620 + 619 @blockassignexpr @@ -1442,7 +1442,7 @@ @reuseexpr - 842823 + 842839 @istriviallycopyassignable @@ -1554,7 +1554,7 @@ @concept_id - 90176 + 90178 @isinvocable @@ -1568,17 +1568,45 @@ @isbitwisecloneable 2 + + @isvirtualbaseof + 2 + + + @isimplicitlifetime + 2 + + + @ltsynthesizesfromspaceship + 2 + + + @gtsynthesizesfromspaceship + 2 + + + @lesynthesizesfromspaceship + 2 + + + @gesynthesizesfromspaceship + 2 + + + @isstructural + 2 + @lambdacapture 31901 @stmt_expr - 2031035 + 2031019 @stmt_if - 989932 + 989924 @stmt_while @@ -1586,35 +1614,35 @@ @stmt_goto - 159862 + 159803 @stmt_label - 79011 + 78982 @stmt_return - 1257082 + 1257325 @stmt_block - 1707526 + 1707512 @stmt_end_test_while - 232395 + 232393 @stmt_for - 84365 + 84364 @stmt_switch_case - 831947 + 831962 @stmt_switch - 409797 + 409804 @stmt_asm @@ -1622,11 +1650,11 @@ @stmt_decl - 772377 + 772371 @stmt_empty - 427267 + 427275 @stmt_continue @@ -1634,11 +1662,11 @@ @stmt_break - 137610 + 137609 @stmt_try_block - 26563 + 26569 @stmt_microsoft_try @@ -1658,15 +1686,15 @@ @stmt_range_based_for - 6221 + 6225 @stmt_handler - 43492 + 43502 @stmt_constexpr_if - 103259 + 103258 @stmt_co_return @@ -1686,43 +1714,43 @@ @ppd_if - 581617 + 581612 @ppd_ifdef - 214302 + 214300 @ppd_ifndef - 160319 + 160318 @ppd_elif - 22188 + 22180 @ppd_else - 231198 + 231196 @ppd_endif - 874943 + 874936 @ppd_plain_include - 322504 + 322385 @ppd_define - 2706601 + 2706580 @ppd_undef - 98839 + 98838 @ppd_pragma - 399777 + 399774 @ppd_include_next @@ -1730,7 +1758,7 @@ @ppd_line - 18996 + 19000 @ppd_error @@ -1792,11 +1820,11 @@ compilations - 12799 + 12794 id - 12799 + 12794 cwd @@ -1814,7 +1842,7 @@ 1 2 - 12799 + 12794 @@ -1840,19 +1868,19 @@ compilation_args - 1024731 + 1024354 id - 12799 + 12794 num - 1486 + 1485 arg - 29630 + 29619 @@ -1871,12 +1899,12 @@ 42 43 - 1112 + 1111 43 44 - 727 + 726 44 @@ -1911,7 +1939,7 @@ 98 99 - 1358 + 1357 100 @@ -1926,7 +1954,7 @@ 104 119 - 1080 + 1079 120 @@ -1957,7 +1985,7 @@ 38 39 - 1518 + 1517 39 @@ -1967,7 +1995,7 @@ 40 42 - 1101 + 1100 42 @@ -1992,7 +2020,7 @@ 67 68 - 1422 + 1421 68 @@ -2002,7 +2030,7 @@ 70 71 - 1422 + 1421 73 @@ -2012,7 +2040,7 @@ 79 89 - 1144 + 1143 89 @@ -2180,17 +2208,17 @@ 1 2 - 13569 + 13564 2 3 - 12842 + 12837 3 103 - 2224 + 2223 104 @@ -2211,17 +2239,17 @@ 1 2 - 19621 + 19614 2 3 - 8832 + 8829 3 62 - 1176 + 1175 @@ -2231,19 +2259,19 @@ compilation_expanded_args - 1024731 + 1024354 id - 12799 + 12794 num - 1486 + 1485 arg - 29630 + 29619 @@ -2262,12 +2290,12 @@ 42 43 - 1112 + 1111 43 44 - 727 + 726 44 @@ -2302,7 +2330,7 @@ 98 99 - 1358 + 1357 100 @@ -2317,7 +2345,7 @@ 104 119 - 1080 + 1079 120 @@ -2348,7 +2376,7 @@ 38 39 - 1518 + 1517 39 @@ -2358,7 +2386,7 @@ 40 42 - 1101 + 1100 42 @@ -2383,7 +2411,7 @@ 67 68 - 1422 + 1421 68 @@ -2393,7 +2421,7 @@ 70 71 - 1422 + 1421 73 @@ -2403,7 +2431,7 @@ 79 89 - 1144 + 1143 89 @@ -2571,17 +2599,17 @@ 1 2 - 13569 + 13564 2 3 - 12842 + 12837 3 103 - 2224 + 2223 104 @@ -2602,17 +2630,17 @@ 1 2 - 19621 + 19614 2 3 - 8832 + 8829 3 62 - 1176 + 1175 @@ -2916,7 +2944,7 @@ compilation_time - 62930 + 62929 id @@ -2932,7 +2960,7 @@ seconds - 22646 + 19434 @@ -3013,27 +3041,22 @@ 3 4 - 326 + 381 4 5 - 1034 + 979 6 - 7 - 163 - - - 8 - 10 - 163 + 9 + 217 - 10 + 9 11 - 108 + 217 11 @@ -3041,23 +3064,23 @@ 217 - 12 + 13 18 - 163 + 217 18 - 20 - 217 + 21 + 163 21 - 40 + 45 217 - 60 - 152 + 52 + 137 108 @@ -3126,42 +3149,47 @@ 3 4 - 925 + 1034 4 5 - 1469 + 1415 5 6 - 108 + 272 6 7 - 653 + 272 7 + 8 + 435 + + + 8 9 - 381 + 163 9 - 11 + 12 381 - 12 - 31 + 13 + 43 381 - 42 - 98 - 217 + 44 + 95 + 163 @@ -3206,24 +3234,19 @@ 12 - - 4 - 5 - 54 - 5 6 - 54 + 108 - 226 - 227 + 198 + 199 54 - 230 - 231 + 201 + 202 54 @@ -3240,17 +3263,22 @@ 1 2 - 17583 + 13446 2 3 - 3701 + 3919 3 - 46 - 1360 + 5 + 1578 + + + 5 + 45 + 489 @@ -3266,22 +3294,22 @@ 1 2 - 16494 + 12738 2 3 - 4191 + 3701 3 - 8 - 1742 + 4 + 1687 - 12 - 71 - 217 + 4 + 65 + 1306 @@ -3297,12 +3325,12 @@ 1 2 - 19978 + 16603 2 3 - 2667 + 2830 @@ -3578,19 +3606,19 @@ compilation_finished - 12799 + 12794 id - 12799 + 12794 cpu_seconds - 8843 + 9791 elapsed_seconds - 149 + 256 @@ -3604,7 +3632,7 @@ 1 2 - 12799 + 12794 @@ -3620,7 +3648,7 @@ 1 2 - 12799 + 12794 @@ -3636,17 +3664,17 @@ 1 2 - 7078 + 8316 2 3 - 1186 + 1004 3 - 34 - 577 + 20 + 470 @@ -3662,12 +3690,12 @@ 1 2 - 8009 + 9182 2 3 - 834 + 609 @@ -3683,17 +3711,12 @@ 1 2 - 32 + 74 2 3 - 10 - - - 3 - 4 - 10 + 21 4 @@ -3701,39 +3724,39 @@ 10 - 15 - 16 + 6 + 7 21 - 24 - 25 - 10 + 8 + 12 + 21 - 30 - 31 - 10 + 13 + 14 + 21 - 37 - 38 - 10 + 16 + 30 + 21 - 235 - 236 - 10 + 41 + 98 + 21 - 411 - 412 - 10 + 157 + 229 + 21 - 418 - 419 - 10 + 268 + 290 + 21 @@ -3749,17 +3772,12 @@ 1 2 - 32 + 74 2 3 - 10 - - - 3 - 4 - 10 + 21 4 @@ -3767,39 +3785,39 @@ 10 - 15 - 16 + 6 + 7 21 - 24 - 25 - 10 + 8 + 12 + 21 - 30 - 31 - 10 + 13 + 14 + 21 - 37 - 38 - 10 + 16 + 30 + 21 - 200 - 201 - 10 + 41 + 96 + 21 - 216 - 217 - 10 + 134 + 152 + 21 - 356 - 357 - 10 + 204 + 232 + 21 @@ -4036,11 +4054,11 @@ locations_default - 46369281 + 46368911 id - 46369281 + 46368911 file @@ -4048,7 +4066,7 @@ beginLine - 7382992 + 7382933 beginColumn @@ -4056,7 +4074,7 @@ endLine - 7383974 + 7383915 endColumn @@ -4074,7 +4092,7 @@ 1 2 - 46369281 + 46368911 @@ -4090,7 +4108,7 @@ 1 2 - 46369281 + 46368911 @@ -4106,7 +4124,7 @@ 1 2 - 46369281 + 46368911 @@ -4122,7 +4140,7 @@ 1 2 - 46369281 + 46368911 @@ -4138,7 +4156,7 @@ 1 2 - 46369281 + 46368911 @@ -4539,27 +4557,27 @@ 1 2 - 4879594 + 4879555 2 3 - 768245 + 768239 3 4 - 535451 + 535447 4 12 - 558166 + 558161 12 97 - 555342 + 555337 97 @@ -4580,27 +4598,27 @@ 1 2 - 4940984 + 4940945 2 3 - 1200560 + 1200550 3 6 - 629747 + 629742 6 56 - 554973 + 554969 56 329 - 56725 + 56724 @@ -4616,27 +4634,27 @@ 1 2 - 5554157 + 5554112 2 3 - 476638 + 476635 3 7 - 569093 + 569089 7 25 - 557061 + 557056 25 94 - 226041 + 226039 @@ -4652,12 +4670,12 @@ 1 2 - 6923297 + 6923241 2 85 - 459695 + 459691 @@ -4673,27 +4691,27 @@ 1 2 - 4947124 + 4947084 2 3 - 731165 + 731159 3 4 - 528207 + 528203 4 12 - 576214 + 576210 12 71 - 554605 + 554600 71 @@ -5094,32 +5112,32 @@ 1 2 - 4877384 + 4877345 2 3 - 771560 + 771554 3 4 - 534714 + 534710 4 12 - 557061 + 557056 12 94 - 553868 + 553864 94 622 - 89385 + 89384 @@ -5135,27 +5153,27 @@ 1 2 - 4938038 + 4937998 2 3 - 1204121 + 1204111 3 6 - 622258 + 622253 6 51 - 554850 + 554846 51 329 - 64706 + 64705 @@ -5171,12 +5189,12 @@ 1 2 - 6940118 + 6940062 2 15 - 443856 + 443852 @@ -5192,27 +5210,27 @@ 1 2 - 5552806 + 5552762 2 3 - 475165 + 475161 3 7 - 573268 + 573263 7 25 - 559762 + 559757 25 89 - 222971 + 222969 @@ -5228,27 +5246,27 @@ 1 2 - 4945650 + 4945611 2 3 - 736322 + 736316 3 4 - 526611 + 526606 4 12 - 578056 + 578052 12 72 - 554359 + 554355 72 @@ -5563,15 +5581,15 @@ files - 66019 + 65994 id - 66019 + 65994 name - 66019 + 65994 @@ -5585,7 +5603,7 @@ 1 2 - 66019 + 65994 @@ -5601,7 +5619,7 @@ 1 2 - 66019 + 65994 @@ -5611,15 +5629,15 @@ folders - 12543 + 12538 id - 12543 + 12538 name - 12543 + 12538 @@ -5633,7 +5651,7 @@ 1 2 - 12543 + 12538 @@ -5649,7 +5667,7 @@ 1 2 - 12543 + 12538 @@ -5659,15 +5677,15 @@ containerparent - 78540 + 78512 parent - 12543 + 12538 child - 78540 + 78512 @@ -5681,7 +5699,7 @@ 1 2 - 6105 + 6103 2 @@ -5732,7 +5750,7 @@ 1 2 - 78540 + 78512 @@ -5742,15 +5760,15 @@ numlines - 794398 + 794391 element_id - 793293 + 793286 num_lines - 38799 + 38798 num_code @@ -5772,7 +5790,7 @@ 1 2 - 792188 + 792181 2 @@ -5793,7 +5811,7 @@ 1 2 - 792188 + 792181 2 @@ -5814,7 +5832,7 @@ 1 2 - 793047 + 793041 2 @@ -5907,7 +5925,7 @@ 1 2 - 26398 + 26397 2 @@ -5984,7 +6002,7 @@ 1 2 - 21855 + 21854 2 @@ -7508,11 +7526,11 @@ fileannotations - 4252500 + 4250935 id - 5838 + 5836 kind @@ -7520,11 +7538,11 @@ name - 59443 + 59421 value - 40002 + 39988 @@ -7543,7 +7561,7 @@ 2 3 - 5635 + 5633 @@ -7569,7 +7587,7 @@ 212 291 - 449 + 448 291 @@ -7594,7 +7612,7 @@ 550 551 - 1347 + 1346 553 @@ -7609,7 +7627,7 @@ 753 1231 - 449 + 448 1234 @@ -7645,12 +7663,12 @@ 352 434 - 449 + 448 434 490 - 449 + 448 490 @@ -7665,7 +7683,7 @@ 706 707 - 1347 + 1346 710 @@ -7769,62 +7787,62 @@ 1 2 - 11163 + 11159 2 3 - 4416 + 4414 3 5 - 5122 + 5120 5 7 - 4148 + 4147 7 9 - 4651 + 4649 9 16 - 4384 + 4382 16 19 - 4950 + 4949 19 27 - 4309 + 4307 27 47 - 4897 + 4895 47 128 - 4982 + 4981 128 459 - 4683 + 4681 459 546 - 1732 + 1731 @@ -7840,7 +7858,7 @@ 1 2 - 59443 + 59421 @@ -7856,57 +7874,57 @@ 1 2 - 11730 + 11726 2 3 - 7784 + 7781 3 4 - 4148 + 4147 4 6 - 4116 + 4115 6 8 - 3464 + 3463 8 11 - 4801 + 4799 11 17 - 5464 + 5462 17 23 - 4758 + 4756 23 41 - 4737 + 4735 41 95 - 4523 + 4521 95 1726 - 3913 + 3912 @@ -7922,27 +7940,27 @@ 1 2 - 3400 + 3399 2 4 - 1657 + 1656 4 5 - 3229 + 3228 5 8 - 2491 + 2490 8 14 - 3004 + 3003 14 @@ -7952,42 +7970,42 @@ 17 24 - 3079 + 3078 24 51 - 3582 + 3580 51 58 - 3068 + 3067 58 80 - 3015 + 3014 81 151 - 3122 + 3121 151 334 - 3015 + 3014 334 473 - 3036 + 3035 473 547 - 2341 + 2340 @@ -8003,7 +8021,7 @@ 1 2 - 39992 + 39977 2 @@ -8024,67 +8042,67 @@ 1 2 - 3443 + 3441 2 4 - 1935 + 1934 4 5 - 3090 + 3089 5 8 - 2512 + 2511 8 14 - 3528 + 3527 14 18 - 3496 + 3495 18 28 - 3240 + 3238 28 34 - 3186 + 3185 34 41 - 3240 + 3238 41 66 - 3026 + 3025 66 92 - 3111 + 3110 92 113 - 3026 + 3025 113 145 - 3068 + 3067 145 @@ -8099,15 +8117,15 @@ inmacroexpansion - 149973979 + 149972783 id - 24663860 + 24663663 inv - 3704596 + 3704566 @@ -8121,37 +8139,37 @@ 1 3 - 2207729 + 2207711 3 5 - 1468685 + 1468674 5 6 - 1626701 + 1626688 6 7 - 6580830 + 6580777 7 8 - 8716496 + 8716427 8 9 - 3556027 + 3555999 9 22 - 507389 + 507385 @@ -8167,32 +8185,32 @@ 1 2 - 529077 + 529073 2 3 - 740947 + 740941 3 4 - 480815 + 480811 4 7 - 280651 + 280649 7 8 - 282072 + 282069 8 9 - 330155 + 330153 9 @@ -8202,22 +8220,22 @@ 10 11 - 444522 + 444519 11 337 - 307708 + 307705 339 423 - 281674 + 281672 423 7616 - 23928 + 23927 @@ -8227,15 +8245,15 @@ affectedbymacroexpansion - 48637828 + 48637440 id - 7021712 + 7021656 inv - 3802035 + 3802004 @@ -8249,37 +8267,37 @@ 1 2 - 3845602 + 3845572 2 3 - 766084 + 766078 3 4 - 361737 + 361735 4 5 - 751511 + 751505 5 12 - 535006 + 535002 12 50 - 556107 + 556103 50 9900 - 205660 + 205658 @@ -8295,62 +8313,62 @@ 1 4 - 313742 + 313740 4 7 - 319104 + 319101 7 9 - 300107 + 300104 9 12 - 342542 + 342540 12 13 - 460448 + 460444 13 14 - 224633 + 224631 14 15 - 409403 + 409400 15 16 - 165317 + 165315 16 17 - 377187 + 377184 17 18 - 202389 + 202387 18 20 - 342019 + 342016 20 26 - 297274 + 297272 26 @@ -8365,19 +8383,19 @@ macroinvocations - 40373865 + 40373543 id - 40373865 + 40373543 macro_id - 182367 + 182365 location - 5923123 + 5923076 kind @@ -8395,7 +8413,7 @@ 1 2 - 40373865 + 40373543 @@ -8411,7 +8429,7 @@ 1 2 - 40373865 + 40373543 @@ -8427,7 +8445,7 @@ 1 2 - 40373865 + 40373543 @@ -8443,12 +8461,12 @@ 1 2 - 61079 + 61078 2 3 - 27600 + 27599 3 @@ -8499,7 +8517,7 @@ 1 2 - 77628 + 77627 2 @@ -8550,7 +8568,7 @@ 1 2 - 177848 + 177847 2 @@ -8571,17 +8589,17 @@ 1 2 - 5259361 + 5259319 2 4 - 429406 + 429403 4 72214 - 234355 + 234353 @@ -8597,7 +8615,7 @@ 1 2 - 5900967 + 5900919 2 @@ -8618,7 +8636,7 @@ 1 2 - 5923123 + 5923076 @@ -8691,15 +8709,15 @@ macroparent - 33673531 + 33673263 id - 33673531 + 33673263 parent_id - 15935844 + 15935717 @@ -8713,7 +8731,7 @@ 1 2 - 33673531 + 33673263 @@ -8729,27 +8747,27 @@ 1 2 - 7812284 + 7812221 2 3 - 1595250 + 1595237 3 4 - 4705781 + 4705743 4 5 - 1296657 + 1296647 5 205 - 525870 + 525866 @@ -8759,15 +8777,15 @@ macrolocationbind - 6014601 + 6014113 id - 4204073 + 4203558 location - 2268452 + 2268486 @@ -8781,12 +8799,12 @@ 1 2 - 3282337 + 3281808 2 3 - 488105 + 488113 3 @@ -8796,7 +8814,7 @@ 4 5 - 411988 + 411994 5 @@ -8817,27 +8835,27 @@ 1 2 - 1330299 + 1330319 2 3 - 480271 + 480278 3 4 - 7812 + 7813 4 5 - 426051 + 426058 5 522 - 24016 + 24017 @@ -8847,11 +8865,11 @@ macro_argument_unexpanded - 83523288 + 83492408 invocation - 26610301 + 26600368 argument_index @@ -8859,7 +8877,7 @@ text - 347515 + 347387 @@ -8873,22 +8891,22 @@ 1 2 - 9798055 + 9794310 2 3 - 9894700 + 9891058 3 4 - 5064942 + 5063078 4 67 - 1852603 + 1851921 @@ -8904,22 +8922,22 @@ 1 2 - 9982950 + 9979137 2 3 - 9912504 + 9908855 3 4 - 4906299 + 4904493 4 67 - 1808547 + 1807881 @@ -8935,7 +8953,7 @@ 46457 46458 - 620 + 619 46659 @@ -8944,7 +8962,7 @@ 646916 - 2488547 + 2488534 32 @@ -8961,7 +8979,7 @@ 2 3 - 620 + 619 13 @@ -8987,57 +9005,57 @@ 1 2 - 40195 + 40180 2 3 - 63078 + 63055 3 4 - 21247 + 21239 4 5 - 35126 + 35113 5 6 - 39746 + 39731 6 9 - 31191 + 31180 9 15 - 29331 + 29320 15 26 - 26198 + 26188 26 57 - 27481 + 27471 57 517 - 26337 + 26327 518 486640 - 7581 + 7578 @@ -9053,17 +9071,17 @@ 1 2 - 246187 + 246096 2 3 - 90987 + 90954 3 9 - 10340 + 10336 @@ -9073,11 +9091,11 @@ macro_argument_expanded - 83523288 + 83492408 invocation - 26610301 + 26600368 argument_index @@ -9085,7 +9103,7 @@ text - 210472 + 210395 @@ -9099,22 +9117,22 @@ 1 2 - 9798055 + 9794310 2 3 - 9894700 + 9891058 3 4 - 5064942 + 5063078 4 67 - 1852603 + 1851921 @@ -9130,22 +9148,22 @@ 1 2 - 12794618 + 12789770 2 3 - 8535135 + 8531993 3 4 - 4277907 + 4276333 4 9 - 1002639 + 1002270 @@ -9161,7 +9179,7 @@ 46457 46458 - 620 + 619 46659 @@ -9170,7 +9188,7 @@ 646916 - 2488547 + 2488534 32 @@ -9213,57 +9231,57 @@ 1 2 - 22102 + 22094 2 3 - 27139 + 27129 3 4 - 44012 + 43996 4 5 - 16253 + 16247 5 6 - 3314 + 3313 6 7 - 18520 + 18513 7 10 - 19194 + 19187 10 19 - 18541 + 18535 19 51 - 15964 + 15958 51 251 - 15793 + 15787 251 - 1169187 - 9634 + 1169174 + 9630 @@ -9279,17 +9297,17 @@ 1 2 - 106353 + 106314 2 3 - 90014 + 89981 3 66 - 14104 + 14099 @@ -9299,15 +9317,15 @@ functions - 3995810 + 3995778 id - 3995810 + 3995778 name - 1666640 + 1666626 kind @@ -9325,7 +9343,7 @@ 1 2 - 3995810 + 3995778 @@ -9341,7 +9359,7 @@ 1 2 - 3995810 + 3995778 @@ -9357,17 +9375,17 @@ 1 2 - 1422058 + 1422047 2 4 - 138497 + 138496 4 3162 - 106083 + 106082 @@ -9383,7 +9401,7 @@ 1 2 - 1663816 + 1663802 2 @@ -9490,26 +9508,26 @@ builtin_functions - 31213 + 31201 id - 31213 + 31201 function_entry_point - 1131527 + 1131444 id - 1128150 + 1128067 entry_point - 1131527 + 1131444 @@ -9523,7 +9541,7 @@ 1 2 - 1125314 + 1125231 2 @@ -9544,7 +9562,7 @@ 1 2 - 1131527 + 1131444 @@ -9554,15 +9572,15 @@ function_return_type - 4012877 + 4012845 id - 3995810 + 3995778 return_type - 611084 + 611080 @@ -9576,7 +9594,7 @@ 1 2 - 3978744 + 3978712 2 @@ -9597,12 +9615,12 @@ 1 2 - 304867 + 304864 2 3 - 211921 + 211919 3 @@ -9897,44 +9915,44 @@ purefunctions - 131114 + 131113 id - 131114 + 131113 function_deleted - 87628 + 87630 id - 87628 + 87630 function_defaulted - 51425 + 51426 id - 51425 + 51426 function_prototyped - 3994337 + 3994305 id - 3994337 + 3994305 @@ -10014,15 +10032,15 @@ member_function_this_type - 670714 + 671002 id - 670714 + 671002 this_type - 227880 + 227957 @@ -10036,7 +10054,7 @@ 1 2 - 670714 + 671002 @@ -10052,32 +10070,32 @@ 1 2 - 100108 + 100146 2 3 - 59175 + 59164 3 4 - 22091 + 22137 4 5 - 13879 + 13853 5 8 - 18520 + 18535 8 152 - 14104 + 14120 @@ -10087,27 +10105,27 @@ fun_decls - 4155304 + 4155271 id - 4149410 + 4149377 function - 3975060 + 3975028 type_id - 604209 + 604204 name - 1665166 + 1665153 location - 2768852 + 2768830 @@ -10121,7 +10139,7 @@ 1 2 - 4149410 + 4149377 @@ -10137,7 +10155,7 @@ 1 2 - 4143517 + 4143484 2 @@ -10158,7 +10176,7 @@ 1 2 - 4149410 + 4149377 @@ -10174,7 +10192,7 @@ 1 2 - 4149410 + 4149377 @@ -10190,12 +10208,12 @@ 1 2 - 3815567 + 3815536 2 5 - 159493 + 159492 @@ -10211,7 +10229,7 @@ 1 2 - 3957011 + 3956980 2 @@ -10232,7 +10250,7 @@ 1 2 - 3975060 + 3975028 @@ -10248,12 +10266,12 @@ 1 2 - 3836562 + 3836532 2 4 - 138497 + 138496 @@ -10269,22 +10287,22 @@ 1 2 - 290256 + 290253 2 3 - 219288 + 219286 3 5 - 48376 + 48375 5 506 - 45429 + 45428 555 @@ -10305,17 +10323,17 @@ 1 2 - 300815 + 300812 2 3 - 210447 + 210446 3 5 - 47639 + 47638 5 @@ -10336,17 +10354,17 @@ 1 2 - 486093 + 486089 2 3 - 52305 + 52304 3 7 - 49358 + 49357 7 @@ -10367,7 +10385,7 @@ 1 2 - 449258 + 449255 2 @@ -10382,7 +10400,7 @@ 6 4756 - 30327 + 30326 @@ -10398,17 +10416,17 @@ 1 2 - 1310327 + 1310316 2 3 - 190925 + 190924 3 11 - 127693 + 127692 11 @@ -10429,17 +10447,17 @@ 1 2 - 1421567 + 1421556 2 4 - 138988 + 138987 4 3162 - 104610 + 104609 @@ -10455,7 +10473,7 @@ 1 2 - 1576763 + 1576751 2 @@ -10476,17 +10494,17 @@ 1 2 - 1345688 + 1345677 2 3 - 205045 + 205043 3 1592 - 114432 + 114431 @@ -10502,17 +10520,17 @@ 1 2 - 2376564 + 2376545 2 3 - 251948 + 251946 3 211 - 140339 + 140338 @@ -10528,17 +10546,17 @@ 1 2 - 2396332 + 2396313 2 3 - 232671 + 232669 3 211 - 139848 + 139847 @@ -10554,12 +10572,12 @@ 1 2 - 2655893 + 2655871 2 211 - 112959 + 112958 @@ -10575,7 +10593,7 @@ 1 2 - 2730298 + 2730276 2 @@ -10590,11 +10608,11 @@ fun_def - 1397747 + 1397736 id - 1397747 + 1397736 @@ -10623,11 +10641,11 @@ fun_decl_specifiers - 4215835 + 4215802 id - 1724347 + 1724333 name @@ -10645,17 +10663,17 @@ 1 2 - 360855 + 360852 2 3 - 258087 + 258085 3 4 - 1082812 + 1082804 4 @@ -10857,26 +10875,26 @@ fun_decl_empty_throws - 434681 + 434678 fun_decl - 434681 + 434678 fun_decl_noexcept - 140571 + 140561 fun_decl - 140571 + 140561 constant - 140132 + 140122 @@ -10890,7 +10908,7 @@ 1 2 - 140571 + 140561 @@ -10906,7 +10924,7 @@ 1 2 - 139693 + 139683 2 @@ -10921,11 +10939,11 @@ fun_decl_empty_noexcept - 1156481 + 1156472 fun_decl - 1156481 + 1156472 @@ -11030,7 +11048,7 @@ fun_requires - 28966 + 28967 id @@ -11160,7 +11178,7 @@ 1 2 - 28495 + 28496 2 @@ -11191,19 +11209,19 @@ param_decl_bind - 7220306 + 7220248 id - 7220306 + 7220248 index - 7858 + 7857 fun_decl - 3489335 + 3489307 @@ -11217,7 +11235,7 @@ 1 2 - 7220306 + 7220248 @@ -11233,7 +11251,7 @@ 1 2 - 7220306 + 7220248 @@ -11249,7 +11267,7 @@ 2 3 - 3929 + 3928 6 @@ -11290,7 +11308,7 @@ 2 3 - 3929 + 3928 6 @@ -11331,27 +11349,27 @@ 1 2 - 1486764 + 1486752 2 3 - 972677 + 972669 3 4 - 592544 + 592540 4 5 - 285958 + 285956 5 65 - 151389 + 151388 @@ -11367,27 +11385,27 @@ 1 2 - 1486764 + 1486752 2 3 - 972677 + 972669 3 4 - 592544 + 592540 4 5 - 285958 + 285956 5 65 - 151389 + 151388 @@ -11397,27 +11415,27 @@ var_decls - 9417486 + 9417411 id - 9411101 + 9411026 variable - 9072837 + 9072765 type_id - 1441089 + 1441078 name - 839090 + 839084 location - 6177029 + 6176980 @@ -11431,7 +11449,7 @@ 1 2 - 9411101 + 9411026 @@ -11447,7 +11465,7 @@ 1 2 - 9404717 + 9404642 2 @@ -11468,7 +11486,7 @@ 1 2 - 9411101 + 9411026 @@ -11484,7 +11502,7 @@ 1 2 - 9411101 + 9411026 @@ -11500,12 +11518,12 @@ 1 2 - 8752254 + 8752184 2 5 - 320583 + 320580 @@ -11521,12 +11539,12 @@ 1 2 - 9020532 + 9020460 2 3 - 52305 + 52304 @@ -11542,12 +11560,12 @@ 1 2 - 8969087 + 8969015 2 4 - 103750 + 103749 @@ -11563,12 +11581,12 @@ 1 2 - 8831448 + 8831378 2 4 - 241389 + 241387 @@ -11584,27 +11602,27 @@ 1 2 - 839213 + 839206 2 3 - 280556 + 280554 3 5 - 127570 + 127569 5 11 - 112836 + 112835 11 2786 - 80913 + 80912 @@ -11620,22 +11638,22 @@ 1 2 - 860454 + 860447 2 3 - 265699 + 265697 3 5 - 122413 + 122412 5 11 - 112468 + 112467 11 @@ -11656,22 +11674,22 @@ 1 2 - 1105036 + 1105027 2 3 - 191048 + 191046 3 7 - 116397 + 116396 7 1038 - 28608 + 28607 @@ -11687,22 +11705,22 @@ 1 2 - 974519 + 974511 2 3 - 215236 + 215234 3 5 - 104610 + 104609 5 15 - 109889 + 109888 15 @@ -11723,12 +11741,12 @@ 1 2 - 457239 + 457235 2 3 - 162194 + 162193 3 @@ -11738,12 +11756,12 @@ 4 7 - 64583 + 64582 7 24 - 63969 + 63968 24 @@ -11764,27 +11782,27 @@ 1 2 - 468166 + 468163 2 3 - 162194 + 162193 3 4 - 55129 + 55128 4 8 - 70845 + 70844 8 43 - 63355 + 63354 43 @@ -11805,7 +11823,7 @@ 1 2 - 642885 + 642880 2 @@ -11815,7 +11833,7 @@ 3 11 - 64092 + 64091 11 @@ -11836,12 +11854,12 @@ 1 2 - 484865 + 484861 2 3 - 180980 + 180978 3 @@ -11851,12 +11869,12 @@ 4 8 - 63969 + 63968 8 22619 - 57953 + 57952 @@ -11872,12 +11890,12 @@ 1 2 - 5668589 + 5668544 2 16 - 468780 + 468777 16 @@ -11898,12 +11916,12 @@ 1 2 - 5749257 + 5749211 2 2935 - 427771 + 427768 @@ -11919,12 +11937,12 @@ 1 2 - 5876213 + 5876167 2 2555 - 300815 + 300812 @@ -11940,7 +11958,7 @@ 1 2 - 6164873 + 6164824 2 @@ -11955,11 +11973,11 @@ var_def - 3684804 + 3684775 id - 3684804 + 3684775 @@ -11977,11 +11995,11 @@ var_decl_specifiers - 481672 + 481669 id - 481672 + 481669 name @@ -11999,7 +12017,7 @@ 1 2 - 481672 + 481669 @@ -12109,19 +12127,19 @@ type_decls - 1639750 + 1639737 id - 1639750 + 1639737 type_id - 1621088 + 1621075 location - 1543612 + 1543600 @@ -12135,7 +12153,7 @@ 1 2 - 1639750 + 1639737 @@ -12151,7 +12169,7 @@ 1 2 - 1639750 + 1639737 @@ -12167,7 +12185,7 @@ 1 2 - 1605003 + 1604990 2 @@ -12188,7 +12206,7 @@ 1 2 - 1605126 + 1605113 2 @@ -12209,7 +12227,7 @@ 1 2 - 1513531 + 1513519 2 @@ -12230,7 +12248,7 @@ 1 2 - 1513653 + 1513641 2 @@ -12245,22 +12263,22 @@ type_def - 1092512 + 1092503 id - 1092512 + 1092503 type_decl_top - 676228 + 676223 type_decl - 676228 + 676223 @@ -12340,11 +12358,11 @@ namespace_decls - 406675 + 406672 id - 406675 + 406672 namespace_id @@ -12352,11 +12370,11 @@ location - 406675 + 406672 bodylocation - 406675 + 406672 @@ -12370,7 +12388,7 @@ 1 2 - 406675 + 406672 @@ -12386,7 +12404,7 @@ 1 2 - 406675 + 406672 @@ -12402,7 +12420,7 @@ 1 2 - 406675 + 406672 @@ -12616,7 +12634,7 @@ 1 2 - 406675 + 406672 @@ -12632,7 +12650,7 @@ 1 2 - 406675 + 406672 @@ -12648,7 +12666,7 @@ 1 2 - 406675 + 406672 @@ -12664,7 +12682,7 @@ 1 2 - 406675 + 406672 @@ -12680,7 +12698,7 @@ 1 2 - 406675 + 406672 @@ -12696,7 +12714,7 @@ 1 2 - 406675 + 406672 @@ -12706,19 +12724,19 @@ usings - 275176 + 275545 id - 275176 + 275545 element_id - 59517 + 59966 location - 27181 + 27171 kind @@ -12736,7 +12754,7 @@ 1 2 - 275176 + 275545 @@ -12752,7 +12770,7 @@ 1 2 - 275176 + 275545 @@ -12768,7 +12786,7 @@ 1 2 - 275176 + 275545 @@ -12784,17 +12802,17 @@ 1 2 - 51701 + 52152 2 5 - 5442 + 5440 5 134 - 2373 + 2372 @@ -12810,17 +12828,17 @@ 1 2 - 51701 + 52152 2 5 - 5442 + 5440 5 134 - 2373 + 2372 @@ -12836,7 +12854,7 @@ 1 2 - 59517 + 59966 @@ -12852,21 +12870,21 @@ 1 2 - 21450 + 21442 2 4 - 2320 + 2319 4 132 - 1967 + 1966 145 - 364 + 370 1443 @@ -12883,21 +12901,21 @@ 1 2 - 21450 + 21442 2 4 - 2320 + 2319 4 132 - 1967 + 1966 145 - 364 + 370 1443 @@ -12914,7 +12932,7 @@ 1 2 - 27181 + 27171 @@ -12933,8 +12951,8 @@ 10 - 25341 - 25342 + 25385 + 25386 10 @@ -12954,8 +12972,8 @@ 10 - 5352 - 5353 + 5396 + 5397 10 @@ -12987,15 +13005,15 @@ using_container - 582165 + 582421 parent - 20541 + 20619 child - 275176 + 275545 @@ -13009,27 +13027,27 @@ 1 2 - 9131 + 9139 2 3 - 1625 + 1614 3 6 - 1785 + 1795 6 7 - 2288 + 2362 7 26 - 1550 + 1549 26 @@ -13039,12 +13057,12 @@ 145 146 - 2651 + 2650 146 437 - 695 + 694 @@ -13060,27 +13078,27 @@ 1 2 - 98184 + 98618 2 3 - 121848 + 121803 3 4 - 19964 + 19956 4 5 - 26839 + 26829 5 65 - 8340 + 8337 @@ -13090,15 +13108,15 @@ static_asserts - 172120 + 172118 id - 172120 + 172118 condition - 172120 + 172118 message @@ -13106,11 +13124,11 @@ location - 22499 + 22498 enclosing - 6220 + 6219 @@ -13124,7 +13142,7 @@ 1 2 - 172120 + 172118 @@ -13140,7 +13158,7 @@ 1 2 - 172120 + 172118 @@ -13156,7 +13174,7 @@ 1 2 - 172120 + 172118 @@ -13172,7 +13190,7 @@ 1 2 - 172120 + 172118 @@ -13188,7 +13206,7 @@ 1 2 - 172120 + 172118 @@ -13204,7 +13222,7 @@ 1 2 - 172120 + 172118 @@ -13220,7 +13238,7 @@ 1 2 - 172120 + 172118 @@ -13236,7 +13254,7 @@ 1 2 - 172120 + 172118 @@ -13272,7 +13290,7 @@ 12 17 - 3110 + 3109 17 @@ -13313,7 +13331,7 @@ 12 17 - 3110 + 3109 17 @@ -13698,23 +13716,23 @@ params - 6972041 + 6971985 id - 6932137 + 6932082 function - 3362133 + 3362107 index - 7858 + 7857 type_id - 1206945 + 1206935 @@ -13728,7 +13746,7 @@ 1 2 - 6932137 + 6932082 @@ -13744,7 +13762,7 @@ 1 2 - 6932137 + 6932082 @@ -13760,12 +13778,12 @@ 1 2 - 6892233 + 6892178 2 3 - 39904 + 39903 @@ -13781,27 +13799,27 @@ 1 2 - 1450912 + 1450900 2 3 - 920495 + 920487 3 4 - 570198 + 570194 4 5 - 276504 + 276502 5 65 - 144023 + 144021 @@ -13817,27 +13835,27 @@ 1 2 - 1450912 + 1450900 2 3 - 920495 + 920487 3 4 - 570198 + 570194 4 5 - 276504 + 276502 5 65 - 144023 + 144021 @@ -13853,22 +13871,22 @@ 1 2 - 1757744 + 1757730 2 3 - 1020071 + 1020063 3 4 - 431455 + 431451 4 11 - 152863 + 152862 @@ -13884,7 +13902,7 @@ 2 3 - 3929 + 3928 6 @@ -13925,7 +13943,7 @@ 2 3 - 3929 + 3928 6 @@ -13966,7 +13984,7 @@ 1 2 - 3929 + 3928 2 @@ -14007,12 +14025,12 @@ 1 2 - 728832 + 728826 2 3 - 237091 + 237089 3 @@ -14022,12 +14040,12 @@ 5 13 - 93559 + 93558 13 2574 - 54515 + 54514 @@ -14043,22 +14061,22 @@ 1 2 - 810850 + 810844 2 3 - 175823 + 175822 3 6 - 107065 + 107064 6 27 - 90858 + 90857 27 @@ -14079,17 +14097,17 @@ 1 2 - 981886 + 981878 2 3 - 167719 + 167718 3 65 - 57339 + 57338 @@ -14099,11 +14117,11 @@ overrides - 160157 + 160156 new - 151386 + 151385 old @@ -14121,7 +14139,7 @@ 1 2 - 142623 + 142622 2 @@ -14147,7 +14165,7 @@ 2 3 - 2373 + 2372 3 @@ -14177,19 +14195,19 @@ membervariables - 1504665 + 1504653 id - 1502215 + 1502203 type_id - 457823 + 457819 name - 644001 + 643996 @@ -14203,7 +14221,7 @@ 1 2 - 1499874 + 1499862 2 @@ -14224,7 +14242,7 @@ 1 2 - 1502215 + 1502203 @@ -14240,7 +14258,7 @@ 1 2 - 339692 + 339690 2 @@ -14271,7 +14289,7 @@ 1 2 - 357276 + 357273 2 @@ -14302,22 +14320,22 @@ 1 2 - 423200 + 423197 2 3 - 122539 + 122538 3 5 - 58085 + 58084 5 664 - 40175 + 40174 @@ -14333,17 +14351,17 @@ 1 2 - 526197 + 526193 2 3 - 73273 + 73272 3 668 - 44530 + 44529 @@ -14353,11 +14371,11 @@ globalvariables - 634536 + 634531 id - 634536 + 634531 type_id @@ -14365,7 +14383,7 @@ name - 110749 + 110748 @@ -14379,7 +14397,7 @@ 1 2 - 634536 + 634531 @@ -14395,7 +14413,7 @@ 1 2 - 634536 + 634531 @@ -14493,7 +14511,7 @@ 1 2 - 92700 + 92699 2 @@ -14524,7 +14542,7 @@ 1 2 - 93928 + 93927 2 @@ -14544,19 +14562,19 @@ localvariables - 733038 + 733187 id - 733038 + 733187 type_id - 53913 + 53924 name - 102626 + 102647 @@ -14570,7 +14588,7 @@ 1 2 - 733038 + 733187 @@ -14586,7 +14604,7 @@ 1 2 - 733038 + 733187 @@ -14602,22 +14620,22 @@ 1 2 - 29150 + 29156 2 3 - 7879 + 7881 3 4 - 4081 + 4082 4 6 - 4105 + 4106 6 @@ -14627,7 +14645,7 @@ 12 162 - 4044 + 4045 162 @@ -14648,22 +14666,22 @@ 1 2 - 38683 + 38691 2 3 - 6784 + 6786 3 5 - 4521 + 4522 5 3509 - 3923 + 3924 @@ -14679,27 +14697,27 @@ 1 2 - 63151 + 63163 2 3 - 16195 + 16199 3 4 - 6602 + 6604 4 8 - 8235 + 8237 8 137 - 7705 + 7707 137 @@ -14720,17 +14738,17 @@ 1 2 - 85412 + 85429 2 3 - 8493 + 8495 3 15 - 7758 + 7760 15 @@ -14745,11 +14763,11 @@ autoderivation - 224076 + 224074 var - 224076 + 224074 derivation_type @@ -14767,7 +14785,7 @@ 1 2 - 224076 + 224074 @@ -14813,15 +14831,15 @@ orphaned_variables - 43930 + 43927 var - 43930 + 43927 function - 40689 + 40686 @@ -14835,7 +14853,7 @@ 1 2 - 43930 + 43927 @@ -14851,7 +14869,7 @@ 1 2 - 39844 + 39841 2 @@ -14866,11 +14884,11 @@ enumconstants - 347913 + 347910 id - 347913 + 347910 parent @@ -14886,11 +14904,11 @@ name - 347531 + 347529 location - 320530 + 320528 @@ -14904,7 +14922,7 @@ 1 2 - 347913 + 347910 @@ -14920,7 +14938,7 @@ 1 2 - 347913 + 347910 @@ -14936,7 +14954,7 @@ 1 2 - 347913 + 347910 @@ -14952,7 +14970,7 @@ 1 2 - 347913 + 347910 @@ -14968,7 +14986,7 @@ 1 2 - 347913 + 347910 @@ -15584,7 +15602,7 @@ 1 2 - 347150 + 347148 2 @@ -15605,7 +15623,7 @@ 1 2 - 347150 + 347148 2 @@ -15626,7 +15644,7 @@ 1 2 - 347531 + 347529 @@ -15642,7 +15660,7 @@ 1 2 - 347531 + 347529 @@ -15658,7 +15676,7 @@ 1 2 - 347150 + 347148 2 @@ -15679,7 +15697,7 @@ 1 2 - 319496 + 319493 2 @@ -15700,7 +15718,7 @@ 1 2 - 320530 + 320528 @@ -15716,7 +15734,7 @@ 1 2 - 319496 + 319493 2 @@ -15737,7 +15755,7 @@ 1 2 - 320530 + 320528 @@ -15753,7 +15771,7 @@ 1 2 - 319496 + 319493 2 @@ -16460,15 +16478,15 @@ bit_precise_int_types - 8 + 11 id - 8 + 11 bit_width - 4 + 6 @@ -16482,7 +16500,7 @@ 1 2 - 8 + 11 @@ -16498,12 +16516,12 @@ 1 2 - 1 + 2 2 3 - 2 + 3 3 @@ -16518,15 +16536,15 @@ derivedtypes - 2998331 + 2998307 id - 2998331 + 2998307 name - 1445632 + 1445621 kind @@ -16534,7 +16552,7 @@ type_id - 1926078 + 1926062 @@ -16548,7 +16566,7 @@ 1 2 - 2998331 + 2998307 @@ -16564,7 +16582,7 @@ 1 2 - 2998331 + 2998307 @@ -16580,7 +16598,7 @@ 1 2 - 2998331 + 2998307 @@ -16596,12 +16614,12 @@ 1 2 - 1328130 + 1328120 2 23 - 108784 + 108783 23 @@ -16622,7 +16640,7 @@ 1 2 - 1445632 + 1445621 @@ -16638,7 +16656,7 @@ 1 2 - 1328253 + 1328242 2 @@ -16787,22 +16805,22 @@ 1 2 - 1303205 + 1303195 2 3 - 372519 + 372516 3 4 - 121676 + 121675 4 137 - 128675 + 128674 @@ -16818,22 +16836,22 @@ 1 2 - 1304679 + 1304668 2 3 - 372519 + 372516 3 4 - 120203 + 120202 4 137 - 128675 + 128674 @@ -16849,22 +16867,22 @@ 1 2 - 1305047 + 1305037 2 3 - 373133 + 373130 3 4 - 121922 + 121921 4 6 - 125974 + 125973 @@ -16874,11 +16892,11 @@ pointerishsize - 2221736 + 2221718 id - 2221736 + 2221718 size @@ -16900,7 +16918,7 @@ 1 2 - 2221736 + 2221718 @@ -16916,7 +16934,7 @@ 1 2 - 2221736 + 2221718 @@ -17000,11 +17018,11 @@ arraysizes - 79317 + 79316 id - 79317 + 79316 num_elements @@ -17030,7 +17048,7 @@ 1 2 - 79317 + 79316 @@ -17046,7 +17064,7 @@ 1 2 - 79317 + 79316 @@ -17062,7 +17080,7 @@ 1 2 - 79317 + 79316 @@ -17083,7 +17101,7 @@ 2 3 - 10682 + 10681 3 @@ -17129,7 +17147,7 @@ 2 3 - 3929 + 3928 3 @@ -17160,7 +17178,7 @@ 2 3 - 3929 + 3928 3 @@ -17263,7 +17281,7 @@ 1 2 - 14611 + 14610 2 @@ -17439,15 +17457,15 @@ typedefbase - 1791267 + 1791463 id - 1791267 + 1791463 type_id - 851342 + 851307 @@ -17461,7 +17479,7 @@ 1 2 - 1791267 + 1791463 @@ -17477,22 +17495,22 @@ 1 2 - 673623 + 673460 2 3 - 82048 + 82124 3 6 - 64928 + 64968 6 4525 - 30742 + 30752 @@ -17502,7 +17520,7 @@ decltypes - 814253 + 814246 id @@ -17510,7 +17528,7 @@ expr - 814253 + 814246 kind @@ -17640,7 +17658,7 @@ 1 2 - 814253 + 814246 @@ -17656,7 +17674,7 @@ 1 2 - 814253 + 814246 @@ -17672,7 +17690,7 @@ 1 2 - 814253 + 814246 @@ -17688,7 +17706,7 @@ 1 2 - 814253 + 814246 @@ -18070,7 +18088,7 @@ 1 2 - 7172 + 7171 2 @@ -18189,7 +18207,7 @@ 2 3 - 942 + 941 3 @@ -18266,15 +18284,15 @@ usertypes - 4280805 + 4280384 id - 4280805 + 4280384 name - 966486 + 966130 kind @@ -18292,7 +18310,7 @@ 1 2 - 4280805 + 4280384 @@ -18308,7 +18326,7 @@ 1 2 - 4280805 + 4280384 @@ -18324,22 +18342,22 @@ 1 2 - 692667 + 692231 2 3 - 163369 + 163458 3 8 - 73996 + 74001 8 33429 - 36452 + 36439 @@ -18355,12 +18373,12 @@ 1 2 - 913640 + 913304 2 10 - 52845 + 52825 @@ -18394,8 +18412,8 @@ 10 - 1557 - 1558 + 1559 + 1560 10 @@ -18409,13 +18427,13 @@ 10 - 20074 - 20075 + 20075 + 20076 10 - 21713 - 21714 + 21724 + 21725 10 @@ -18424,13 +18442,13 @@ 10 - 98810 - 98811 + 98824 + 98825 10 - 167516 - 167517 + 167596 + 167597 10 @@ -18512,15 +18530,15 @@ usertypesize - 1445377 + 1444984 id - 1445377 + 1444984 size - 1497 + 1496 alignment @@ -18538,7 +18556,7 @@ 1 2 - 1445377 + 1444984 @@ -18554,7 +18572,7 @@ 1 2 - 1445377 + 1444984 @@ -18609,12 +18627,12 @@ 118 - 1731 + 1735 117 1840 - 105869 + 105871 53 @@ -18631,7 +18649,7 @@ 1 2 - 1219 + 1218 2 @@ -18680,18 +18698,18 @@ 10 - 2042 - 2043 + 2044 + 2045 10 - 11942 - 11943 + 11951 + 11952 10 - 121064 - 121065 + 121066 + 121067 10 @@ -18767,7 +18785,7 @@ uuid - 47209 + 47208 @@ -18812,11 +18830,11 @@ usertype_alias_kind - 1791267 + 1791463 id - 1791267 + 1791463 alias_kind @@ -18834,7 +18852,7 @@ 1 2 - 1791267 + 1791463 @@ -18848,13 +18866,13 @@ 12 - 36937 - 36938 + 36949 + 36950 10 - 130579 - 130580 + 130647 + 130648 10 @@ -18865,18 +18883,18 @@ nontype_template_parameters - 758842 + 758786 id - 758842 + 758786 type_template_type_constraint - 27018 + 27019 id @@ -18884,7 +18902,7 @@ constraint - 25883 + 25884 @@ -18949,15 +18967,15 @@ mangled_name - 8178495 + 8178430 id - 8178495 + 8178430 mangled_name - 6345485 + 6345435 is_complete @@ -18975,7 +18993,7 @@ 1 2 - 8178495 + 8178430 @@ -18991,7 +19009,7 @@ 1 2 - 8178495 + 8178430 @@ -19007,12 +19025,12 @@ 1 2 - 5990769 + 5990721 2 1120 - 354716 + 354713 @@ -19028,7 +19046,7 @@ 1 2 - 6345485 + 6345435 @@ -19080,59 +19098,59 @@ is_pod_class - 611214 + 611169 id - 611214 + 611169 is_standard_layout_class - 1203445 + 1203088 id - 1203445 + 1203088 is_complete - 1428043 + 1427635 id - 1428043 + 1427635 is_class_template - 235013 + 234937 id - 235013 + 234937 class_instantiation - 1203980 + 1203697 to - 1200900 + 1200629 from - 73130 + 73103 @@ -19146,12 +19164,12 @@ 1 2 - 1198740 + 1198481 2 8 - 2160 + 2148 @@ -19167,47 +19185,47 @@ 1 2 - 20787 + 20779 2 3 - 13034 + 13030 3 4 - 7217 + 7215 4 5 - 4758 + 4756 5 7 - 6330 + 6327 7 10 - 5752 + 5750 10 17 - 5956 + 5964 17 53 - 5560 + 5547 53 4358 - 3731 + 3730 @@ -19217,11 +19235,11 @@ class_template_argument - 3054583 + 3053715 type_id - 1448328 + 1447923 index @@ -19229,7 +19247,7 @@ arg_type - 860881 + 860596 @@ -19243,27 +19261,27 @@ 1 2 - 609999 + 609806 2 3 - 442010 + 441933 3 4 - 268054 + 267956 4 8 - 109807 + 109777 8 113 - 18456 + 18449 @@ -19279,22 +19297,22 @@ 1 2 - 639063 + 638860 2 3 - 456788 + 456705 3 4 - 268151 + 268052 4 113 - 84325 + 84305 @@ -19315,7 +19333,7 @@ 4 5 - 759 + 758 5 @@ -19334,12 +19352,12 @@ 643 - 7142 + 7143 96 - 11996 - 135434 + 11997 + 135446 42 @@ -19361,7 +19379,7 @@ 4 5 - 759 + 758 5 @@ -19385,7 +19403,7 @@ 11131 - 46219 + 46221 32 @@ -19402,27 +19420,27 @@ 1 2 - 534431 + 534234 2 3 - 178008 + 177964 3 5 - 79385 + 79356 5 46 - 64693 + 64680 46 - 13875 - 4362 + 13877 + 4361 @@ -19438,17 +19456,17 @@ 1 2 - 752067 + 751823 2 3 - 89169 + 89137 3 22 - 19643 + 19636 @@ -19458,11 +19476,11 @@ class_template_argument_value - 511973 + 511935 type_id - 210401 + 210385 index @@ -19470,7 +19488,7 @@ arg_value - 511838 + 511800 @@ -19484,12 +19502,12 @@ 1 2 - 160831 + 160819 2 3 - 42985 + 42982 3 @@ -19510,17 +19528,17 @@ 1 2 - 153031 + 153020 2 3 - 40115 + 40112 3 52 - 16005 + 16004 54 @@ -19653,7 +19671,7 @@ 1 2 - 511703 + 511665 2 @@ -19674,7 +19692,7 @@ 1 2 - 511838 + 511800 @@ -19684,15 +19702,15 @@ class_template_generated_from - 62608 + 62595 template - 62608 + 62595 from - 3806 + 3805 @@ -19706,7 +19724,7 @@ 1 2 - 62608 + 62595 @@ -19772,15 +19790,15 @@ is_proxy_class_for - 51198 + 51179 id - 51198 + 51179 templ_param_id - 47830 + 47812 @@ -19794,7 +19812,7 @@ 1 2 - 51198 + 51179 @@ -19810,7 +19828,7 @@ 1 2 - 47060 + 47043 2 @@ -19825,19 +19843,19 @@ type_mentions - 5937930 + 5937883 id - 5937930 + 5937883 type_id - 277905 + 277903 location - 5881641 + 5881594 kind @@ -19855,7 +19873,7 @@ 1 2 - 5937930 + 5937883 @@ -19871,7 +19889,7 @@ 1 2 - 5937930 + 5937883 @@ -19887,7 +19905,7 @@ 1 2 - 5937930 + 5937883 @@ -19903,7 +19921,7 @@ 1 2 - 137401 + 137400 2 @@ -19933,7 +19951,7 @@ 12 28 - 21013 + 21012 28 @@ -19954,7 +19972,7 @@ 1 2 - 137401 + 137400 2 @@ -19984,7 +20002,7 @@ 12 28 - 21013 + 21012 28 @@ -20005,7 +20023,7 @@ 1 2 - 277905 + 277903 @@ -20021,7 +20039,7 @@ 1 2 - 5835968 + 5835921 2 @@ -20042,7 +20060,7 @@ 1 2 - 5835968 + 5835921 2 @@ -20063,7 +20081,7 @@ 1 2 - 5881641 + 5881594 @@ -20121,26 +20139,26 @@ is_function_template - 1311677 + 1311667 id - 1311677 + 1311667 function_instantiation - 965225 + 965154 to - 965225 + 965154 from - 181057 + 181044 @@ -20154,7 +20172,7 @@ 1 2 - 965225 + 965154 @@ -20170,27 +20188,27 @@ 1 2 - 109539 + 109531 2 3 - 42444 + 42441 3 9 - 14317 + 14316 9 104 - 13608 + 13607 119 1531 - 1148 + 1147 @@ -20200,11 +20218,11 @@ function_template_argument - 2479028 + 2478845 function_id - 1456567 + 1456460 index @@ -20212,7 +20230,7 @@ arg_type - 295324 + 295303 @@ -20226,22 +20244,22 @@ 1 2 - 792170 + 792112 2 3 - 409524 + 409494 3 4 - 170320 + 170307 4 15 - 84552 + 84546 @@ -20257,22 +20275,22 @@ 1 2 - 811147 + 811087 2 3 - 407633 + 407603 3 4 - 168158 + 168146 4 9 - 69627 + 69622 @@ -20410,37 +20428,37 @@ 1 2 - 173224 + 173211 2 3 - 26034 + 26032 3 4 - 19652 + 19650 4 6 - 22590 + 22588 6 11 - 23096 + 23094 11 76 - 23096 + 23094 79 2452 - 7631 + 7630 @@ -20456,12 +20474,12 @@ 1 2 - 254467 + 254448 2 3 - 31875 + 31873 3 @@ -20476,11 +20494,11 @@ function_template_argument_value - 456494 + 456460 function_id - 194969 + 194955 index @@ -20488,7 +20506,7 @@ arg_value - 453826 + 453793 @@ -20502,12 +20520,12 @@ 1 2 - 149992 + 149981 2 3 - 42512 + 42509 3 @@ -20528,17 +20546,17 @@ 1 2 - 143137 + 143127 2 3 - 36299 + 36296 3 54 - 14756 + 14755 54 @@ -20681,7 +20699,7 @@ 1 2 - 451159 + 451125 2 @@ -20702,7 +20720,7 @@ 1 2 - 453826 + 453793 @@ -20712,15 +20730,15 @@ function_template_generated_from - 869530 + 869466 template - 869530 + 869466 from - 22286 + 22284 @@ -20734,7 +20752,7 @@ 1 2 - 869530 + 869466 @@ -20750,7 +20768,7 @@ 1 2 - 3613 + 3612 2 @@ -20775,7 +20793,7 @@ 16 20 - 1587 + 1586 20 @@ -20815,22 +20833,22 @@ is_variable_template - 57707 + 57706 id - 57707 + 57706 variable_instantiation - 566269 + 566265 to - 566269 + 566265 from @@ -20848,7 +20866,7 @@ 1 2 - 566269 + 566265 @@ -20914,11 +20932,11 @@ variable_template_argument - 1073726 + 1073718 variable_id - 548711 + 548707 index @@ -20926,7 +20944,7 @@ arg_type - 461782 + 461778 @@ -20940,12 +20958,12 @@ 1 2 - 179998 + 179996 2 3 - 272698 + 272696 3 @@ -20971,17 +20989,17 @@ 1 2 - 196205 + 196203 2 3 - 261402 + 261400 3 4 - 75633 + 75632 4 @@ -21104,12 +21122,12 @@ 1 2 - 361101 + 361098 2 3 - 56234 + 56233 3 @@ -21135,7 +21153,7 @@ 1 2 - 429367 + 429364 2 @@ -21202,7 +21220,7 @@ 2 3 - 3929 + 3928 4 @@ -21359,26 +21377,26 @@ is_alias_template - 108155 + 108147 id - 108155 + 108147 alias_instantiation - 462909 + 462875 to - 462909 + 462875 from - 92858 + 92852 @@ -21392,7 +21410,7 @@ 1 2 - 462909 + 462875 @@ -21408,27 +21426,27 @@ 1 2 - 16647 + 16645 2 3 - 16917 + 16915 3 4 - 20158 + 20157 4 5 - 12561 + 12560 5 7 - 6753 + 6752 7 @@ -21458,11 +21476,11 @@ alias_template_argument - 1000106 + 1000033 type_id - 570997 + 570955 index @@ -21470,7 +21488,7 @@ arg_type - 128617 + 128608 @@ -21484,22 +21502,22 @@ 1 2 - 278137 + 278117 2 3 - 183624 + 183610 3 4 - 87523 + 87517 4 10 - 21712 + 21710 @@ -21515,22 +21533,22 @@ 1 2 - 279387 + 279366 2 3 - 182408 + 182395 3 4 - 88975 + 88969 4 10 - 20226 + 20224 @@ -21658,27 +21676,27 @@ 1 2 - 78710 + 78704 2 3 - 20428 + 20427 3 4 - 5470 + 5469 4 6 - 10535 + 10534 6 76 - 10906 + 10905 84 @@ -21699,12 +21717,12 @@ 1 2 - 109573 + 109565 2 3 - 17423 + 17422 3 @@ -21719,11 +21737,11 @@ alias_template_argument_value - 174405 + 174393 type_id - 161743 + 161731 index @@ -21731,7 +21749,7 @@ arg_value - 174405 + 174393 @@ -21745,7 +21763,7 @@ 1 2 - 160493 + 160482 2 @@ -21766,7 +21784,7 @@ 1 2 - 159818 + 159806 2 @@ -21849,7 +21867,7 @@ 1 2 - 174405 + 174393 @@ -21865,7 +21883,7 @@ 1 2 - 174405 + 174393 @@ -21875,11 +21893,11 @@ alias_template_generated_from - 100523 + 100516 template - 100523 + 100516 from @@ -21897,7 +21915,7 @@ 1 2 - 100523 + 100516 @@ -21983,15 +22001,15 @@ template_template_instantiation - 6116 + 6114 to - 5720 + 5718 from - 3977 + 3976 @@ -22005,7 +22023,7 @@ 1 2 - 5603 + 5601 2 @@ -22026,7 +22044,7 @@ 1 2 - 2491 + 2490 2 @@ -22046,11 +22064,11 @@ template_template_argument - 9794 + 9791 type_id - 6191 + 6189 index @@ -22058,7 +22076,7 @@ arg_type - 9196 + 9192 @@ -22072,7 +22090,7 @@ 1 2 - 5079 + 5077 2 @@ -22103,7 +22121,7 @@ 1 2 - 5100 + 5098 2 @@ -22256,7 +22274,7 @@ 1 2 - 9163 + 9160 3 @@ -22277,7 +22295,7 @@ 1 2 - 9174 + 9171 2 @@ -22524,11 +22542,11 @@ concept_instantiation - 90176 + 90178 to - 90176 + 90178 from @@ -22546,7 +22564,7 @@ 1 2 - 90176 + 90178 @@ -22653,11 +22671,11 @@ concept_template_argument - 112784 + 112786 concept_id - 76196 + 76197 index @@ -22679,7 +22697,7 @@ 1 2 - 46351 + 46352 2 @@ -22705,7 +22723,7 @@ 1 2 - 49948 + 49949 2 @@ -22813,7 +22831,7 @@ 1 2 - 10554 + 10555 2 @@ -23015,15 +23033,15 @@ routinetypes - 599125 + 599081 id - 599125 + 599081 return_type - 281345 + 281324 @@ -23037,7 +23055,7 @@ 1 2 - 599125 + 599081 @@ -23053,17 +23071,17 @@ 1 2 - 232012 + 231995 2 3 - 34914 + 34912 3 4676 - 14418 + 14417 @@ -23073,11 +23091,11 @@ routinetypeargs - 1178092 + 1178082 routine - 415851 + 415848 index @@ -23085,7 +23103,7 @@ type_id - 112033 + 112032 @@ -23099,22 +23117,22 @@ 1 2 - 82909 + 82908 2 3 - 126023 + 126022 3 4 - 107841 + 107840 4 5 - 49266 + 49265 5 @@ -23124,7 +23142,7 @@ 7 19 - 16658 + 16657 @@ -23140,12 +23158,12 @@ 1 2 - 88897 + 88896 2 3 - 138653 + 138652 3 @@ -23414,12 +23432,12 @@ 1 2 - 79370 + 79369 2 3 - 17529 + 17528 3 @@ -23439,19 +23457,19 @@ ptrtomembers - 9837 + 9834 id - 9837 + 9834 type_id - 8073 + 8070 class_id - 4929 + 4927 @@ -23465,7 +23483,7 @@ 1 2 - 9837 + 9834 @@ -23481,7 +23499,7 @@ 1 2 - 9837 + 9834 @@ -23497,7 +23515,7 @@ 1 2 - 7859 + 7856 2 @@ -23518,7 +23536,7 @@ 1 2 - 7859 + 7856 2 @@ -23539,7 +23557,7 @@ 1 2 - 3956 + 3954 2 @@ -23570,7 +23588,7 @@ 1 2 - 3956 + 3954 2 @@ -23643,11 +23661,11 @@ typespecifiers - 868922 + 868944 type_id - 863725 + 863749 spec_id @@ -23665,12 +23683,12 @@ 1 2 - 858528 + 858554 2 3 - 5196 + 5194 @@ -23699,8 +23717,8 @@ 10 - 530 - 531 + 533 + 534 10 @@ -23714,18 +23732,18 @@ 10 - 4192 - 4193 + 4195 + 4196 10 - 18328 - 18329 + 18331 + 18332 10 - 55214 - 55215 + 55237 + 55238 10 @@ -23736,11 +23754,11 @@ funspecifiers - 9572191 + 9572483 func_id - 3955783 + 3955752 spec_id @@ -23758,27 +23776,27 @@ 1 2 - 1511321 + 1511309 2 3 - 501195 + 500822 3 4 - 1019334 + 1019694 4 5 - 682052 + 682047 5 8 - 241880 + 241878 @@ -23882,8 +23900,8 @@ 122 - 22794 - 22795 + 22797 + 22798 122 @@ -23894,11 +23912,11 @@ varspecifiers - 3148493 + 3148468 var_id - 2429115 + 2429095 spec_id @@ -23916,17 +23934,17 @@ 1 2 - 1807839 + 1807824 2 3 - 523664 + 523660 3 5 - 97611 + 97610 @@ -24040,11 +24058,11 @@ attributes - 644113 + 644108 id - 644113 + 644108 kind @@ -24060,7 +24078,7 @@ location - 638096 + 638091 @@ -24074,7 +24092,7 @@ 1 2 - 644113 + 644108 @@ -24090,7 +24108,7 @@ 1 2 - 644113 + 644108 @@ -24106,7 +24124,7 @@ 1 2 - 644113 + 644108 @@ -24122,7 +24140,7 @@ 1 2 - 644113 + 644108 @@ -24525,7 +24543,7 @@ 1 2 - 632326 + 632321 2 @@ -24546,7 +24564,7 @@ 1 2 - 638096 + 638091 @@ -24562,7 +24580,7 @@ 1 2 - 633062 + 633057 2 @@ -24583,7 +24601,7 @@ 1 2 - 638096 + 638091 @@ -24593,11 +24611,11 @@ attribute_args - 82122 + 82121 id - 82122 + 82121 kind @@ -24627,7 +24645,7 @@ 1 2 - 82122 + 82121 @@ -24643,7 +24661,7 @@ 1 2 - 82122 + 82121 @@ -24659,7 +24677,7 @@ 1 2 - 82122 + 82121 @@ -24675,7 +24693,7 @@ 1 2 - 82122 + 82121 @@ -24821,7 +24839,7 @@ 1 2 - 69371 + 69370 2 @@ -24863,7 +24881,7 @@ 1 2 - 68381 + 68380 2 @@ -25053,7 +25071,7 @@ 2 3 - 11795 + 11794 3 @@ -25121,7 +25139,7 @@ 1 2 - 56632 + 56631 2 @@ -25136,11 +25154,11 @@ attribute_arg_value - 16545 + 16544 arg - 16545 + 16544 value @@ -25158,7 +25176,7 @@ 1 2 - 16545 + 16544 @@ -25292,15 +25310,15 @@ attribute_arg_constant - 72691 + 72665 arg - 72691 + 72665 constant - 72691 + 72665 @@ -25314,7 +25332,7 @@ 1 2 - 72691 + 72665 @@ -25330,7 +25348,7 @@ 1 2 - 72691 + 72665 @@ -25441,11 +25459,11 @@ typeattributes - 94787 + 94786 type_id - 93068 + 93067 spec_id @@ -25463,7 +25481,7 @@ 1 2 - 91349 + 91348 2 @@ -25484,7 +25502,7 @@ 1 2 - 27503 + 27502 2 @@ -25504,15 +25522,15 @@ funcattributes - 834547 + 834541 func_id - 788873 + 788866 spec_id - 607647 + 607642 @@ -25526,7 +25544,7 @@ 1 2 - 747618 + 747612 2 @@ -25547,7 +25565,7 @@ 1 2 - 561358 + 561353 2 @@ -25756,15 +25774,15 @@ unspecifiedtype - 7365434 + 7365375 type_id - 7365434 + 7365375 unspecified_type_id - 4133203 + 4133170 @@ -25778,7 +25796,7 @@ 1 2 - 7365434 + 7365375 @@ -25794,17 +25812,17 @@ 1 2 - 2667188 + 2667167 2 3 - 1105036 + 1105027 3 8 - 311742 + 311740 8 @@ -25819,19 +25837,19 @@ member - 4121662 + 4121629 parent - 532872 + 532868 index - 29222 + 29221 child - 4117119 + 4117086 @@ -25845,7 +25863,7 @@ 1 2 - 126710 + 126709 2 @@ -25865,7 +25883,7 @@ 5 6 - 41623 + 41622 6 @@ -25875,7 +25893,7 @@ 7 9 - 41623 + 41622 9 @@ -25911,12 +25929,12 @@ 1 2 - 126465 + 126464 2 3 - 80667 + 80666 3 @@ -25926,12 +25944,12 @@ 4 5 - 44447 + 44446 5 6 - 41623 + 41622 6 @@ -26109,7 +26127,7 @@ 1 2 - 4117119 + 4117086 @@ -26125,7 +26143,7 @@ 1 2 - 4112576 + 4112543 2 @@ -26148,7 +26166,7 @@ parent - 70189 + 70206 @@ -26178,22 +26196,22 @@ 1 2 - 38046 + 38074 2 3 - 24882 + 24873 3 5 - 6159 + 6156 5 45 - 1101 + 1100 @@ -26203,15 +26221,15 @@ derivations - 494887 + 494850 derivation - 494887 + 494850 sub - 473343 + 473309 index @@ -26219,11 +26237,11 @@ super - 240926 + 240908 location - 35083 + 35081 @@ -26237,7 +26255,7 @@ 1 2 - 494887 + 494850 @@ -26253,7 +26271,7 @@ 1 2 - 494887 + 494850 @@ -26269,7 +26287,7 @@ 1 2 - 494887 + 494850 @@ -26285,7 +26303,7 @@ 1 2 - 494887 + 494850 @@ -26301,12 +26319,12 @@ 1 2 - 456966 + 456933 2 9 - 16376 + 16375 @@ -26322,12 +26340,12 @@ 1 2 - 456966 + 456933 2 8 - 16376 + 16375 @@ -26343,12 +26361,12 @@ 1 2 - 456966 + 456933 2 9 - 16376 + 16375 @@ -26364,12 +26382,12 @@ 1 2 - 456966 + 456933 2 8 - 16376 + 16375 @@ -26524,12 +26542,12 @@ 1 2 - 231269 + 231252 2 1758 - 9657 + 9656 @@ -26545,12 +26563,12 @@ 1 2 - 231269 + 231252 2 1758 - 9657 + 9656 @@ -26566,7 +26584,7 @@ 1 2 - 240487 + 240469 2 @@ -26587,7 +26605,7 @@ 1 2 - 235658 + 235641 2 @@ -26608,7 +26626,7 @@ 1 2 - 26000 + 25998 2 @@ -26644,7 +26662,7 @@ 1 2 - 26000 + 25998 2 @@ -26680,7 +26698,7 @@ 1 2 - 35083 + 35081 @@ -26696,12 +26714,12 @@ 1 2 - 28330 + 28328 2 4 - 2600 + 2599 4 @@ -26721,11 +26739,11 @@ derspecifiers - 496643 + 496606 der_id - 494448 + 494411 spec_id @@ -26743,7 +26761,7 @@ 1 2 - 492253 + 492217 2 @@ -26789,11 +26807,11 @@ direct_base_offsets - 468211 + 468176 der_id - 468211 + 468176 offset @@ -26811,7 +26829,7 @@ 1 2 - 468211 + 468176 @@ -26872,11 +26890,11 @@ virtual_base_offsets - 5774 + 5773 sub - 5774 + 5773 super @@ -26898,7 +26916,7 @@ 1 2 - 5774 + 5773 @@ -26914,7 +26932,7 @@ 1 2 - 5774 + 5773 @@ -27008,23 +27026,23 @@ frienddecls - 765587 + 765911 id - 765587 + 765911 type_id - 54229 + 54225 decl_id - 100489 + 100482 location - 6044 + 6043 @@ -27038,7 +27056,7 @@ 1 2 - 765587 + 765911 @@ -27054,7 +27072,7 @@ 1 2 - 765587 + 765911 @@ -27070,7 +27088,7 @@ 1 2 - 765587 + 765911 @@ -27091,22 +27109,22 @@ 2 3 - 24953 + 24951 3 8 - 4794 + 4760 8 17 - 4693 + 4727 17 27 - 4457 + 4456 27 @@ -27142,22 +27160,22 @@ 2 3 - 24953 + 24951 3 8 - 4794 + 4760 8 17 - 4693 + 4727 17 27 - 4457 + 4456 27 @@ -27188,7 +27206,7 @@ 1 2 - 52878 + 52875 2 @@ -27209,32 +27227,32 @@ 1 2 - 67431 + 67359 2 3 - 7968 + 8103 3 9 - 9252 + 9183 9 24 - 7597 + 7596 24 - 135 - 7597 + 136 + 7630 - 135 + 137 191 - 641 + 607 @@ -27250,32 +27268,32 @@ 1 2 - 67431 + 67359 2 3 - 7968 + 8103 3 9 - 9252 + 9183 9 24 - 7597 + 7596 24 - 135 - 7597 + 136 + 7630 - 135 + 137 191 - 641 + 607 @@ -27291,7 +27309,7 @@ 1 2 - 99273 + 99267 2 @@ -27316,7 +27334,7 @@ 2 - 22484 + 22495 371 @@ -27333,7 +27351,7 @@ 1 2 - 5909 + 5908 2 @@ -27369,19 +27387,19 @@ comments - 11058465 + 11058376 id - 11058465 + 11058376 contents - 4237445 + 4237411 location - 11058465 + 11058376 @@ -27395,7 +27413,7 @@ 1 2 - 11058465 + 11058376 @@ -27411,7 +27429,7 @@ 1 2 - 11058465 + 11058376 @@ -27427,12 +27445,12 @@ 1 2 - 3867994 + 3867964 2 6 - 318495 + 318493 6 @@ -27453,12 +27471,12 @@ 1 2 - 3867994 + 3867964 2 6 - 318495 + 318493 6 @@ -27479,7 +27497,7 @@ 1 2 - 11058465 + 11058376 @@ -27495,7 +27513,7 @@ 1 2 - 11058465 + 11058376 @@ -27505,15 +27523,15 @@ commentbinding - 3860014 + 3859983 id - 3297919 + 3297892 element - 3697082 + 3697053 @@ -27527,7 +27545,7 @@ 1 2 - 3230266 + 3230240 2 @@ -27548,12 +27566,12 @@ 1 2 - 3534151 + 3534122 2 3 - 162931 + 162930 @@ -27563,15 +27581,15 @@ exprconv - 9630323 + 9630246 converted - 9630218 + 9630141 conversion - 9630323 + 9630246 @@ -27585,7 +27603,7 @@ 1 2 - 9630112 + 9630035 2 @@ -27606,7 +27624,7 @@ 1 2 - 9630323 + 9630246 @@ -27616,22 +27634,22 @@ compgenerated - 9856495 + 9855321 id - 9856495 + 9855321 synthetic_destructor_call - 1663253 + 1663283 element - 1238704 + 1238727 i @@ -27639,7 +27657,7 @@ destructor_call - 1663253 + 1663283 @@ -27653,12 +27671,12 @@ 1 2 - 824561 + 824576 2 3 - 407377 + 407385 3 @@ -27679,12 +27697,12 @@ 1 2 - 824561 + 824576 2 3 - 407377 + 407385 3 @@ -27837,7 +27855,7 @@ 1 2 - 1663253 + 1663283 @@ -27853,7 +27871,7 @@ 1 2 - 1663253 + 1663283 @@ -27863,15 +27881,15 @@ namespaces - 8757 + 8754 id - 8757 + 8754 name - 4630 + 4628 @@ -27885,7 +27903,7 @@ 1 2 - 8757 + 8754 @@ -27901,7 +27919,7 @@ 1 2 - 3785 + 3783 2 @@ -27911,7 +27929,7 @@ 3 149 - 310 + 309 @@ -27932,15 +27950,15 @@ namespacembrs - 2457354 + 2457335 parentid - 3929 + 3928 memberid - 2457354 + 2457335 @@ -28030,7 +28048,7 @@ 1 2 - 2457354 + 2457335 @@ -28040,11 +28058,11 @@ exprparents - 19448700 + 19448545 expr_id - 19448700 + 19448545 child_index @@ -28052,7 +28070,7 @@ parent_id - 12936328 + 12936225 @@ -28066,7 +28084,7 @@ 1 2 - 19448700 + 19448545 @@ -28082,7 +28100,7 @@ 1 2 - 19448700 + 19448545 @@ -28200,17 +28218,17 @@ 1 2 - 7392678 + 7392619 2 3 - 5081231 + 5081191 3 712 - 462418 + 462414 @@ -28226,17 +28244,17 @@ 1 2 - 7392678 + 7392619 2 3 - 5081231 + 5081191 3 712 - 462418 + 462414 @@ -28246,22 +28264,22 @@ expr_isload - 6890637 + 6890582 expr_id - 6890637 + 6890582 conversionkinds - 6047233 + 6047238 expr_id - 6047233 + 6047238 kind @@ -28279,7 +28297,7 @@ 1 2 - 6047233 + 6047238 @@ -28323,8 +28341,8 @@ 1 - 5828722 - 5828723 + 5828727 + 5828728 1 @@ -28335,11 +28353,11 @@ iscall - 5777667 + 5777774 caller - 5777667 + 5777774 kind @@ -28357,7 +28375,7 @@ 1 2 - 5777667 + 5777774 @@ -28393,11 +28411,11 @@ numtemplatearguments - 684876 + 684871 expr_id - 684876 + 684871 num @@ -28415,7 +28433,7 @@ 1 2 - 684876 + 684871 @@ -28524,23 +28542,23 @@ namequalifiers - 3044887 + 3044942 id - 3044887 + 3044942 qualifiableelement - 3044887 + 3044942 qualifyingelement - 54379 + 54380 location - 557008 + 557018 @@ -28554,7 +28572,7 @@ 1 2 - 3044887 + 3044942 @@ -28570,7 +28588,7 @@ 1 2 - 3044887 + 3044942 @@ -28586,7 +28604,7 @@ 1 2 - 3044887 + 3044942 @@ -28602,7 +28620,7 @@ 1 2 - 3044887 + 3044942 @@ -28618,7 +28636,7 @@ 1 2 - 3044887 + 3044942 @@ -28634,7 +28652,7 @@ 1 2 - 3044887 + 3044942 @@ -28712,7 +28730,7 @@ 1 2 - 41234 + 41235 2 @@ -28743,22 +28761,22 @@ 1 2 - 84417 + 84418 2 6 - 39007 + 39008 6 7 - 397208 + 397215 7 192 - 36374 + 36375 @@ -28774,22 +28792,22 @@ 1 2 - 84417 + 84418 2 6 - 39007 + 39008 6 7 - 397208 + 397215 7 192 - 36374 + 36375 @@ -28805,17 +28823,17 @@ 1 2 - 117045 + 117047 2 4 - 14065 + 14066 4 5 - 413479 + 413487 5 @@ -28830,15 +28848,15 @@ varbind - 8252279 + 8252213 expr - 8252279 + 8252213 var - 1050076 + 1050068 @@ -28852,7 +28870,7 @@ 1 2 - 8252279 + 8252213 @@ -28868,27 +28886,27 @@ 1 2 - 171487 + 171485 2 3 - 188646 + 188645 3 4 - 145606 + 145605 4 5 - 116603 + 116602 5 6 - 83127 + 83126 6 @@ -28898,7 +28916,7 @@ 7 9 - 80792 + 80791 9 @@ -28908,12 +28926,12 @@ 13 27 - 79104 + 79103 27 5137 - 37358 + 37357 @@ -28923,15 +28941,15 @@ funbind - 5788265 + 5788371 expr - 5785803 + 5785909 fun - 275046 + 275051 @@ -28945,7 +28963,7 @@ 1 2 - 5783341 + 5783447 2 @@ -28966,7 +28984,7 @@ 1 2 - 180845 + 180848 2 @@ -28996,11 +29014,11 @@ expr_allocator - 44842 + 44839 expr - 44842 + 44839 func @@ -29022,7 +29040,7 @@ 1 2 - 44842 + 44839 @@ -29038,7 +29056,7 @@ 1 2 - 44842 + 44839 @@ -29122,11 +29140,11 @@ expr_deallocator - 53351 + 53347 expr - 53351 + 53347 func @@ -29148,7 +29166,7 @@ 1 2 - 53351 + 53347 @@ -29164,7 +29182,7 @@ 1 2 - 53351 + 53347 @@ -29269,15 +29287,15 @@ expr_cond_guard - 897622 + 897615 cond - 897622 + 897615 guard - 897622 + 897615 @@ -29291,7 +29309,7 @@ 1 2 - 897622 + 897615 @@ -29307,7 +29325,7 @@ 1 2 - 897622 + 897615 @@ -29317,15 +29335,15 @@ expr_cond_true - 897618 + 897611 cond - 897618 + 897611 true - 897618 + 897611 @@ -29339,7 +29357,7 @@ 1 2 - 897618 + 897611 @@ -29355,7 +29373,7 @@ 1 2 - 897618 + 897611 @@ -29365,15 +29383,15 @@ expr_cond_false - 897622 + 897615 cond - 897622 + 897615 false - 897622 + 897615 @@ -29387,7 +29405,7 @@ 1 2 - 897622 + 897615 @@ -29403,7 +29421,7 @@ 1 2 - 897622 + 897615 @@ -29413,15 +29431,15 @@ values - 13539325 + 13539217 id - 13539325 + 13539217 str - 113961 + 113960 @@ -29435,7 +29453,7 @@ 1 2 - 13539325 + 13539217 @@ -29481,11 +29499,11 @@ valuetext - 6632066 + 6631932 id - 6632066 + 6631932 text @@ -29503,7 +29521,7 @@ 1 2 - 6632066 + 6631932 @@ -29533,7 +29551,7 @@ 7 - 594514 + 594510 27811 @@ -29544,15 +29562,15 @@ valuebind - 13647524 + 13647415 val - 13539325 + 13539217 expr - 13647524 + 13647415 @@ -29566,12 +29584,12 @@ 1 2 - 13449127 + 13449020 2 6 - 90198 + 90197 @@ -29587,7 +29605,7 @@ 1 2 - 13647524 + 13647415 @@ -29597,11 +29615,11 @@ fieldoffsets - 1502215 + 1502203 id - 1502215 + 1502203 byteoffset @@ -29623,7 +29641,7 @@ 1 2 - 1502215 + 1502203 @@ -29639,7 +29657,7 @@ 1 2 - 1502215 + 1502203 @@ -29989,23 +30007,23 @@ initialisers - 2292690 + 2292672 init - 2292690 + 2292672 var - 998340 + 998332 expr - 2292690 + 2292672 location - 526645 + 526641 @@ -30019,7 +30037,7 @@ 1 2 - 2292690 + 2292672 @@ -30035,7 +30053,7 @@ 1 2 - 2292690 + 2292672 @@ -30051,7 +30069,7 @@ 1 2 - 2292690 + 2292672 @@ -30067,17 +30085,17 @@ 1 2 - 874360 + 874353 2 15 - 51218 + 51217 16 25 - 72761 + 72760 @@ -30093,17 +30111,17 @@ 1 2 - 874360 + 874353 2 15 - 51218 + 51217 16 25 - 72761 + 72760 @@ -30119,7 +30137,7 @@ 1 2 - 998332 + 998324 2 @@ -30140,7 +30158,7 @@ 1 2 - 2292690 + 2292672 @@ -30156,7 +30174,7 @@ 1 2 - 2292690 + 2292672 @@ -30172,7 +30190,7 @@ 1 2 - 2292690 + 2292672 @@ -30188,7 +30206,7 @@ 1 2 - 415900 + 415896 2 @@ -30219,7 +30237,7 @@ 1 2 - 454329 + 454326 2 @@ -30245,7 +30263,7 @@ 1 2 - 415900 + 415896 2 @@ -30270,26 +30288,26 @@ braced_initialisers - 67888 + 67930 init - 67888 + 67930 expr_ancestor - 1669204 + 1669235 exp - 1669204 + 1669235 ancestor - 835480 + 835495 @@ -30303,7 +30321,7 @@ 1 2 - 1669204 + 1669235 @@ -30324,7 +30342,7 @@ 2 3 - 808504 + 808519 3 @@ -30339,11 +30357,11 @@ exprs - 25203419 + 25203218 id - 25203419 + 25203218 kind @@ -30351,7 +30369,7 @@ location - 10582678 + 10582593 @@ -30365,7 +30383,7 @@ 1 2 - 25203419 + 25203218 @@ -30381,7 +30399,7 @@ 1 2 - 25203419 + 25203218 @@ -30559,22 +30577,22 @@ 1 2 - 8901168 + 8901097 2 3 - 820384 + 820377 3 16 - 796981 + 796974 16 71733 - 64144 + 64143 @@ -30590,17 +30608,17 @@ 1 2 - 9040532 + 9040460 2 3 - 774061 + 774055 3 32 - 768084 + 768078 @@ -30610,15 +30628,15 @@ expr_reuse - 842823 + 842839 reuse - 842823 + 842839 original - 842823 + 842839 value_category @@ -30636,7 +30654,7 @@ 1 2 - 842823 + 842839 @@ -30652,7 +30670,7 @@ 1 2 - 842823 + 842839 @@ -30668,7 +30686,7 @@ 1 2 - 842823 + 842839 @@ -30684,7 +30702,7 @@ 1 2 - 842823 + 842839 @@ -30736,15 +30754,15 @@ expr_types - 25203419 + 25203218 id - 25203419 + 25203218 typeid - 214144 + 214142 value_category @@ -30762,7 +30780,7 @@ 1 2 - 25203419 + 25203218 @@ -30778,7 +30796,7 @@ 1 2 - 25203419 + 25203218 @@ -30819,7 +30837,7 @@ 8 14 - 17382 + 17381 14 @@ -30855,7 +30873,7 @@ 1 2 - 185862 + 185861 2 @@ -30923,15 +30941,15 @@ new_allocated_type - 45787 + 45784 expr - 45787 + 45784 type_id - 27148 + 27146 @@ -30945,7 +30963,7 @@ 1 2 - 45787 + 45784 @@ -30961,12 +30979,12 @@ 1 2 - 11413 + 11412 2 3 - 14350 + 14349 3 @@ -31044,11 +31062,11 @@ param_ref_to_this - 25267 + 25272 expr - 25267 + 25272 @@ -32391,15 +32409,15 @@ condition_decl_bind - 406885 + 406893 expr - 406885 + 406893 decl - 406885 + 406893 @@ -32413,7 +32431,7 @@ 1 2 - 406885 + 406893 @@ -32429,7 +32447,7 @@ 1 2 - 406885 + 406893 @@ -32439,15 +32457,15 @@ typeid_bind - 47476 + 47472 expr - 47476 + 47472 type_id - 15802 + 15801 @@ -32461,7 +32479,7 @@ 1 2 - 47476 + 47472 @@ -32545,11 +32563,11 @@ sizeof_bind - 241939 + 241937 expr - 241939 + 241937 type_id @@ -32567,7 +32585,7 @@ 1 2 - 241939 + 241937 @@ -32930,7 +32948,7 @@ lambda - 15469 + 15468 index @@ -34010,7 +34028,7 @@ 1 2 - 15712 + 15711 2 @@ -34036,7 +34054,7 @@ 1 2 - 16287 + 16286 2 @@ -34083,7 +34101,7 @@ 1 2 - 15712 + 15711 2 @@ -34109,7 +34127,7 @@ 1 2 - 17915 + 17914 2 @@ -34266,11 +34284,11 @@ stmts - 6328636 + 6328585 id - 6328636 + 6328585 kind @@ -34278,7 +34296,7 @@ location - 2676389 + 2676368 @@ -34292,7 +34310,7 @@ 1 2 - 6328636 + 6328585 @@ -34308,7 +34326,7 @@ 1 2 - 6328636 + 6328585 @@ -34546,22 +34564,22 @@ 1 2 - 2225153 + 2225135 2 3 - 177732 + 177731 3 11 - 203471 + 203469 11 1816 - 70032 + 70031 @@ -34577,7 +34595,7 @@ 1 2 - 2599926 + 2599906 2 @@ -34747,15 +34765,15 @@ if_then - 989932 + 989924 if_stmt - 989932 + 989924 then_id - 989932 + 989924 @@ -34769,7 +34787,7 @@ 1 2 - 989932 + 989924 @@ -34785,7 +34803,7 @@ 1 2 - 989932 + 989924 @@ -34795,15 +34813,15 @@ if_else - 434910 + 434918 if_stmt - 434910 + 434918 else_id - 434910 + 434918 @@ -34817,7 +34835,7 @@ 1 2 - 434910 + 434918 @@ -34833,7 +34851,7 @@ 1 2 - 434910 + 434918 @@ -34891,15 +34909,15 @@ constexpr_if_then - 103259 + 103258 constexpr_if_stmt - 103259 + 103258 then_id - 103259 + 103258 @@ -34913,7 +34931,7 @@ 1 2 - 103259 + 103258 @@ -34929,7 +34947,7 @@ 1 2 - 103259 + 103258 @@ -34939,15 +34957,15 @@ constexpr_if_else - 74037 + 74036 constexpr_if_stmt - 74037 + 74036 else_id - 74037 + 74036 @@ -34961,7 +34979,7 @@ 1 2 - 74037 + 74036 @@ -34977,7 +34995,7 @@ 1 2 - 74037 + 74036 @@ -35131,15 +35149,15 @@ do_body - 232395 + 232393 do_stmt - 232395 + 232393 body_id - 232395 + 232393 @@ -35153,7 +35171,7 @@ 1 2 - 232395 + 232393 @@ -35169,7 +35187,7 @@ 1 2 - 232395 + 232393 @@ -35227,11 +35245,11 @@ switch_case - 831947 + 831962 switch_stmt - 409797 + 409804 index @@ -35239,7 +35257,7 @@ case_id - 831947 + 831962 @@ -35258,7 +35276,7 @@ 2 3 - 406928 + 406935 3 @@ -35284,7 +35302,7 @@ 2 3 - 406928 + 406935 3 @@ -35447,7 +35465,7 @@ 1 2 - 831947 + 831962 @@ -35463,7 +35481,7 @@ 1 2 - 831947 + 831962 @@ -35473,15 +35491,15 @@ switch_body - 409797 + 409804 switch_stmt - 409797 + 409804 body_id - 409797 + 409804 @@ -35495,7 +35513,7 @@ 1 2 - 409797 + 409804 @@ -35511,7 +35529,7 @@ 1 2 - 409797 + 409804 @@ -35521,15 +35539,15 @@ for_initialization - 73225 + 73224 for_stmt - 73225 + 73224 init_id - 73225 + 73224 @@ -35543,7 +35561,7 @@ 1 2 - 73225 + 73224 @@ -35559,7 +35577,7 @@ 1 2 - 73225 + 73224 @@ -35665,15 +35683,15 @@ for_body - 84365 + 84364 for_stmt - 84365 + 84364 body_id - 84365 + 84364 @@ -35687,7 +35705,7 @@ 1 2 - 84365 + 84364 @@ -35703,7 +35721,7 @@ 1 2 - 84365 + 84364 @@ -35713,11 +35731,11 @@ stmtparents - 5605702 + 5605658 id - 5605702 + 5605658 index @@ -35725,7 +35743,7 @@ parent - 2362374 + 2362355 @@ -35739,7 +35757,7 @@ 1 2 - 5605702 + 5605658 @@ -35755,7 +35773,7 @@ 1 2 - 5605702 + 5605658 @@ -35893,27 +35911,27 @@ 1 2 - 1342037 + 1342027 2 3 - 516011 + 516007 3 4 - 151119 + 151118 4 6 - 155274 + 155272 6 16 - 179012 + 179010 16 @@ -35934,27 +35952,27 @@ 1 2 - 1342037 + 1342027 2 3 - 516011 + 516007 3 4 - 151119 + 151118 4 6 - 155274 + 155272 6 16 - 179012 + 179010 16 @@ -35969,22 +35987,22 @@ ishandler - 43492 + 43502 block - 43492 + 43502 stmt_decl_bind - 728504 + 728652 stmt - 688131 + 688271 num @@ -35992,7 +36010,7 @@ decl - 728435 + 728583 @@ -36006,12 +36024,12 @@ 1 2 - 665975 + 666111 2 32 - 22156 + 22160 @@ -36027,12 +36045,12 @@ 1 2 - 665975 + 666111 2 32 - 22156 + 22160 @@ -36170,7 +36188,7 @@ 1 2 - 728411 + 728559 2 @@ -36191,7 +36209,7 @@ 1 2 - 728435 + 728583 @@ -36201,11 +36219,11 @@ stmt_decl_entry_bind - 728504 + 728652 stmt - 688131 + 688271 num @@ -36213,7 +36231,7 @@ decl_entry - 728504 + 728652 @@ -36227,12 +36245,12 @@ 1 2 - 665975 + 666111 2 32 - 22156 + 22160 @@ -36248,12 +36266,12 @@ 1 2 - 665975 + 666111 2 32 - 22156 + 22160 @@ -36391,7 +36409,7 @@ 1 2 - 728504 + 728652 @@ -36407,7 +36425,7 @@ 1 2 - 728504 + 728652 @@ -36417,15 +36435,15 @@ blockscope - 1625753 + 1625740 block - 1625753 + 1625740 enclosing - 1404746 + 1404735 @@ -36439,7 +36457,7 @@ 1 2 - 1625753 + 1625740 @@ -36455,12 +36473,12 @@ 1 2 - 1267599 + 1267589 2 4 - 122045 + 122044 4 @@ -36475,11 +36493,11 @@ jumpinfo - 348076 + 348073 id - 348076 + 348073 str @@ -36487,7 +36505,7 @@ target - 72655 + 72654 @@ -36501,7 +36519,7 @@ 1 2 - 348076 + 348073 @@ -36517,7 +36535,7 @@ 1 2 - 348076 + 348073 @@ -36558,7 +36576,7 @@ 10 25 - 2188 + 2187 25 @@ -36646,7 +36664,7 @@ 1 2 - 72655 + 72654 @@ -36656,11 +36674,11 @@ preprocdirects - 5322959 + 5322916 id - 5322959 + 5322916 kind @@ -36668,7 +36686,7 @@ location - 5319889 + 5319847 @@ -36682,7 +36700,7 @@ 1 2 - 5322959 + 5322916 @@ -36698,7 +36716,7 @@ 1 2 - 5322959 + 5322916 @@ -36846,7 +36864,7 @@ 1 2 - 5319766 + 5319724 26 @@ -36867,7 +36885,7 @@ 1 2 - 5319889 + 5319847 @@ -36877,15 +36895,15 @@ preprocpair - 1123207 + 1123198 begin - 874943 + 874936 elseelifend - 1123207 + 1123198 @@ -36899,12 +36917,12 @@ 1 2 - 639324 + 639319 2 3 - 226777 + 226776 3 @@ -36925,7 +36943,7 @@ 1 2 - 1123207 + 1123198 @@ -36935,41 +36953,41 @@ preproctrue - 432314 + 432311 branch - 432314 + 432311 preprocfalse - 280801 + 280799 branch - 280801 + 280799 preproctext - 4283611 + 4283577 id - 4283611 + 4283577 head - 2908455 + 2908431 body - 1656817 + 1656804 @@ -36983,7 +37001,7 @@ 1 2 - 4283611 + 4283577 @@ -36999,7 +37017,7 @@ 1 2 - 4283611 + 4283577 @@ -37015,12 +37033,12 @@ 1 2 - 2712986 + 2712964 2 798 - 195468 + 195467 @@ -37036,7 +37054,7 @@ 1 2 - 2828524 + 2828501 2 @@ -37057,12 +37075,12 @@ 1 2 - 1510952 + 1510940 2 10 - 125237 + 125236 10 @@ -37083,17 +37101,17 @@ 1 2 - 1515127 + 1515115 2 12 - 124869 + 124868 12 3246 - 16821 + 16820 @@ -37103,15 +37121,15 @@ includes - 322579 + 322460 id - 322579 + 322460 included - 59421 + 59399 @@ -37125,7 +37143,7 @@ 1 2 - 322579 + 322460 @@ -37141,32 +37159,32 @@ 1 2 - 29406 + 29395 2 3 - 9559 + 9556 3 4 - 5015 + 5013 4 6 - 5421 + 5419 6 11 - 4576 + 4574 11 47 - 4459 + 4457 47 @@ -37277,11 +37295,11 @@ link_parent - 31164351 + 31162056 element - 3960481 + 3960190 link_target @@ -37299,17 +37317,17 @@ 1 2 - 540607 + 540567 2 9 - 27182 + 27180 9 10 - 3392691 + 3392442 diff --git a/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/old.dbscheme b/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/old.dbscheme new file mode 100644 index 000000000000..6aec212e408f --- /dev/null +++ b/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/old.dbscheme @@ -0,0 +1,2588 @@ + +/*- 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 + * + * 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 +); + +/** + * The expanded arguments that were passed to the extractor for a + * compiler invocation. This is similar to `compilation_args`, but + * for a `@someFile` argument, it includes the arguments from that + * file, rather than just taking the argument literally. + */ +#keyset[id, num] +compilation_expanded_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 -*/ + +/** + * 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 +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Files and folders -*/ + +/** + * The location of an element. + * 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( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Lines of code -*/ + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +/*- Diagnostic messages -*/ + +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 +); + +/*- C++ dbscheme -*/ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +/** + * Gives the TRAP filename that `trap` is associated with. + * For debugging only. + */ +trap_filename( + int trap: @trap, + string filename: string ref +); + +/** + * Gives the tag name for `tag`. + * For debugging only. + */ +tag_name( + int tag: @tag, + string name: string ref +); + +@trap_or_tag = @tag | @trap; + +/** + * Gives the name for the source file. + */ +source_file_name( + int sf: @source_file, + string name: string ref +); + +/** + * In `build-mode: none` overlay mode, indicates that `source_file` + * (`/path/to/foo.c`) uses the TRAP file `trap_file`; i.e. it is the + * TRAP file corresponding to `foo.c`, something it transitively + * includes, or a template instantiation it transitively uses. + */ +source_file_uses_trap( + int source_file: @source_file ref, + int trap_file: @trap ref +); + +/** + * In `build-mode: none` overlay mode, indicates that the TRAP file + * `trap_file` uses tag `tag`. + */ +trap_uses_tag( + int trap_file: @trap ref, + int tag: @tag ref +); + +/** + * Holds if there is a definition of `element` in TRAP file or tag `t`. + */ +in_trap_or_tag( + int element: @element ref, + int t: @trap_or_tag ref +); + +pch_uses( + int pch: @pch ref, + int compilation: @compilation ref, + int id: @file ref +) + +#keyset[pch, compilation] +pch_creations( + int pch: @pch, + int compilation: @compilation ref, + int from: @file ref +) + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +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_default 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 + 0 = @unknown_function +| 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +// ... 6 = @builtin_function deprecated // 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 +); + +builtin_functions( + int id: @function 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 +// ... 41 _Decimal64 +// ... 42 _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 +| 62 = @mfp8 // __mfp8 +| 63 = @scalable_vector_count // __SVCount_t +| 64 = @complex_fp16 // _Complex __fp16 +| 65 = @complex_std_bfloat16 // _Complex __bf16 +| 66 = @complex_std_float16 // _Complex std::float16_t +| 67 = @bit_precise_int // _BitInt(N) +| 68 = @unsigned_bit_precise_int // unsigned _BitInt(N) +| 69 = @signed_bit_precise_int // signed _BitInt(N) +; + +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 +); + +bit_precise_int_types( + unique int id: @builtintype ref, + int bit_width: 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 +| 11 = @scalable_vector // Arm SVE +; + +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 +); + +tupleelements( + unique int id: @derivedtype ref, + int num_elements: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the 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. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +case @type_operator.kind of + 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type 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 +); +class_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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_default 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 +); +function_template_generated_from( + unique int template: @function ref, + int from: @function 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 +); +variable_template_generated_from( + unique int template: @variable ref, + int from: @variable ref +); + +is_alias_template(unique int id: @usertype ref); +alias_instantiation( + unique int to: @usertype ref, + int from: @usertype ref +); +alias_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +alias_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); +alias_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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 +); + +namespaceattributes( + int namespace_id: @namespace ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +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 + | @decltype + | @derivedtype; + +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_default 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_default 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 +| 394 = @isinvocable +| 395 = @isnothrowinvocable +| 396 = @isbitwisecloneable +; + +@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 + | @isinvocable + | @isnothrowinvocable + | @isbitwisecloneable + ; + +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 +); + +param_ref_to_this( + int expr: @param_ref 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 is_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 is_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, + boolean has_explicit_parameter_list: 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_default 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 +| 40 = @stmt_leave +; + +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 +); + +type_is_vla(unique int type_id: @derivedtype 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 | @stmt_leave; + +@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 +| 17 = @ppd_embed +| 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 +); + +embeds( + unique int id: @ppd_embed 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 +); + +/*- Database metadata -*/ + +/** + * The CLI will automatically emit applicable tuples for this table, + * such as `databaseMetadata("isOverlay", "true")` when building an + * overlay database. + */ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + +/*- Overlay support -*/ + +/** + * The CLI will automatically emit tuples for each new/modified/deleted file + * when building an overlay database. + */ +overlayChangedFiles( + string path: string 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/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..293904928d85 --- /dev/null +++ b/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/semmlecode.cpp.dbscheme @@ -0,0 +1,2602 @@ + +/*- 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 + * + * 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 +); + +/** + * The expanded arguments that were passed to the extractor for a + * compiler invocation. This is similar to `compilation_args`, but + * for a `@someFile` argument, it includes the arguments from that + * file, rather than just taking the argument literally. + */ +#keyset[id, num] +compilation_expanded_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 -*/ + +/** + * 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 +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Files and folders -*/ + +/** + * The location of an element. + * 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( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Lines of code -*/ + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +/*- Diagnostic messages -*/ + +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 +); + +/*- C++ dbscheme -*/ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +/** + * Gives the TRAP filename that `trap` is associated with. + * For debugging only. + */ +trap_filename( + int trap: @trap, + string filename: string ref +); + +/** + * Gives the tag name for `tag`. + * For debugging only. + */ +tag_name( + int tag: @tag, + string name: string ref +); + +@trap_or_tag = @tag | @trap; + +/** + * Gives the name for the source file. + */ +source_file_name( + int sf: @source_file, + string name: string ref +); + +/** + * In `build-mode: none` overlay mode, indicates that `source_file` + * (`/path/to/foo.c`) uses the TRAP file `trap_file`; i.e. it is the + * TRAP file corresponding to `foo.c`, something it transitively + * includes, or a template instantiation it transitively uses. + */ +source_file_uses_trap( + int source_file: @source_file ref, + int trap_file: @trap ref +); + +/** + * In `build-mode: none` overlay mode, indicates that the TRAP file + * `trap_file` uses tag `tag`. + */ +trap_uses_tag( + int trap_file: @trap ref, + int tag: @tag ref +); + +/** + * Holds if there is a definition of `element` in TRAP file or tag `t`. + */ +in_trap_or_tag( + int element: @element ref, + int t: @trap_or_tag ref +); + +pch_uses( + int pch: @pch ref, + int compilation: @compilation ref, + int id: @file ref +) + +#keyset[pch, compilation] +pch_creations( + int pch: @pch, + int compilation: @compilation ref, + int from: @file ref +) + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +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_default 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 + 0 = @unknown_function +| 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +// ... 6 = @builtin_function deprecated // 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 +); + +builtin_functions( + int id: @function 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 +// ... 41 _Decimal64 +// ... 42 _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 +| 62 = @mfp8 // __mfp8 +| 63 = @scalable_vector_count // __SVCount_t +| 64 = @complex_fp16 // _Complex __fp16 +| 65 = @complex_std_bfloat16 // _Complex __bf16 +| 66 = @complex_std_float16 // _Complex std::float16_t +| 67 = @bit_precise_int // _BitInt(N) +| 68 = @unsigned_bit_precise_int // unsigned _BitInt(N) +| 69 = @signed_bit_precise_int // signed _BitInt(N) +; + +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 +); + +bit_precise_int_types( + unique int id: @builtintype ref, + int bit_width: 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 +| 11 = @scalable_vector // Arm SVE +; + +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 +); + +tupleelements( + unique int id: @derivedtype ref, + int num_elements: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the 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. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +case @type_operator.kind of + 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type 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 +); +class_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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_default 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 +); +function_template_generated_from( + unique int template: @function ref, + int from: @function 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 +); +variable_template_generated_from( + unique int template: @variable ref, + int from: @variable ref +); + +is_alias_template(unique int id: @usertype ref); +alias_instantiation( + unique int to: @usertype ref, + int from: @usertype ref +); +alias_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +alias_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); +alias_template_generated_from( + unique int template: @usertype ref, + int from: @usertype 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 +); + +namespaceattributes( + int namespace_id: @namespace ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +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 + | @decltype + | @derivedtype; + +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_default 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_default 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 +| 394 = @isinvocable +| 395 = @isnothrowinvocable +| 396 = @isbitwisecloneable +| 397 = @isvirtualbaseof +| 398 = @isimplicitlifetime +| 399 = @ltsynthesizesfromspaceship +| 400 = @gtsynthesizesfromspaceship +| 401 = @lesynthesizesfromspaceship +| 402 = @gesynthesizesfromspaceship +| 403 = @isstructural +; + +@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 + | @isinvocable + | @isnothrowinvocable + | @isbitwisecloneable + | @isvirtualbaseof + | @isimplicitlifetime + | @ltsynthesizesfromspaceship + | @gtsynthesizesfromspaceship + | @lesynthesizesfromspaceship + | @gesynthesizesfromspaceship + | @isstructural + ; + +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 +); + +param_ref_to_this( + int expr: @param_ref 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 is_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 is_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, + boolean has_explicit_parameter_list: 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_default 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 +| 40 = @stmt_leave +; + +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 +); + +type_is_vla(unique int type_id: @derivedtype 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 | @stmt_leave; + +@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 +| 17 = @ppd_embed +| 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 +); + +embeds( + unique int id: @ppd_embed 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 +); + +/*- Database metadata -*/ + +/** + * The CLI will automatically emit applicable tuples for this table, + * such as `databaseMetadata("isOverlay", "true")` when building an + * overlay database. + */ +databaseMetadata( + string metadataKey: string ref, + string value: string ref +); + +/*- Overlay support -*/ + +/** + * The CLI will automatically emit tuples for each new/modified/deleted file + * when building an overlay database. + */ +overlayChangedFiles( + string path: string 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/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/upgrade.properties b/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/upgrade.properties new file mode 100644 index 000000000000..db0e7e92d0e9 --- /dev/null +++ b/cpp/ql/lib/upgrades/6aec212e408fad907b19368a3376a4d9837783d2/upgrade.properties @@ -0,0 +1,2 @@ +description: Add new builtin operations +compatibility: backwards diff --git a/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql b/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql index be175660bd9c..a35ec36837b1 100644 --- a/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql +++ b/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql @@ -5,9 +5,11 @@ * @problem.severity recommendation * @precision high * @id cpp/complex-block - * @tags testability + * @tags quality + * testability * readability * maintainability + * complexity */ import cpp diff --git a/cpp/ql/src/Best Practices/ComplexCondition.ql b/cpp/ql/src/Best Practices/ComplexCondition.ql index 20ecd1b1adeb..b93d0b371e0b 100644 --- a/cpp/ql/src/Best Practices/ComplexCondition.ql +++ b/cpp/ql/src/Best Practices/ComplexCondition.ql @@ -5,9 +5,11 @@ * @problem.severity recommendation * @precision high * @id cpp/complex-condition - * @tags testability + * @tags quality + * testability * readability * maintainability + * complexity * statistical * non-attributable */ diff --git a/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql b/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql index 1e902579a495..be5a04fedb96 100644 --- a/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql +++ b/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql @@ -5,8 +5,10 @@ * @problem.severity warning * @precision high * @id cpp/rethrow-no-exception - * @tags reliability + * @tags quality + * reliability * correctness + * error-handling * exceptions */ diff --git a/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql b/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql index 28e7541fc744..9ac27287ae3b 100644 --- a/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql +++ b/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql @@ -5,8 +5,11 @@ * @problem.severity warning * @precision very-high * @id cpp/catch-by-value - * @tags efficiency + * @tags quality + * reliability + * efficiency * correctness + * error-handling * exceptions */ diff --git a/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql b/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql index d3848962abda..97ccbdc63e07 100644 --- a/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql +++ b/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql @@ -5,8 +5,11 @@ * @problem.severity warning * @precision high * @id cpp/catch-missing-free - * @tags efficiency + * @tags quality + * reliability + * efficiency * correctness + * error-handling * exceptions * external/cwe/cwe-401 */ diff --git a/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql b/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql index 85c21a28f560..ad73b220868c 100644 --- a/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql +++ b/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql @@ -5,8 +5,11 @@ * @problem.severity warning * @precision high * @id cpp/throwing-pointer - * @tags efficiency + * @tags quality + * reliability + * efficiency * correctness + * error-handling * exceptions */ diff --git a/cpp/ql/src/Best Practices/GuardedFree.ql b/cpp/ql/src/Best Practices/GuardedFree.ql index 3afe1a92e954..76b921e56688 100644 --- a/cpp/ql/src/Best Practices/GuardedFree.ql +++ b/cpp/ql/src/Best Practices/GuardedFree.ql @@ -6,8 +6,10 @@ * @problem.severity recommendation * @precision very-high * @id cpp/guarded-free - * @tags maintainability + * @tags quality + * maintainability * readability + * useless-code */ import cpp diff --git a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql index 64e5760ed2b4..b4c0e7854605 100644 --- a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql +++ b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision very-high * @id cpp/declaration-hides-parameter - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql index d10d346c5135..b5d40675c823 100644 --- a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql +++ b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision high * @id cpp/declaration-hides-variable - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql b/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql index 52fec3ccbba8..ab9f5a27f0d5 100644 --- a/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql +++ b/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql @@ -5,7 +5,8 @@ * @problem.severity warning * @precision high * @id cpp/slicing - * @tags reliability + * @tags quality + * reliability * correctness * types */ diff --git a/cpp/ql/src/Best Practices/RuleOfTwo.ql b/cpp/ql/src/Best Practices/RuleOfTwo.ql index efc30c0829ee..c519bc4043ad 100644 --- a/cpp/ql/src/Best Practices/RuleOfTwo.ql +++ b/cpp/ql/src/Best Practices/RuleOfTwo.ql @@ -7,8 +7,9 @@ * @problem.severity warning * @precision high * @id cpp/rule-of-two - * @tags reliability - * readability + * @tags quality + * reliability + * correctness * language-features */ diff --git a/cpp/ql/src/Best Practices/UseOfGoto.ql b/cpp/ql/src/Best Practices/UseOfGoto.ql index 26d72d69a0a2..5f360f72b869 100644 --- a/cpp/ql/src/Best Practices/UseOfGoto.ql +++ b/cpp/ql/src/Best Practices/UseOfGoto.ql @@ -6,8 +6,10 @@ * @problem.severity warning * @precision high * @id cpp/use-of-goto - * @tags maintainability + * @tags quality + * maintainability * readability + * complexity * language-features */ diff --git a/cpp/ql/src/Critical/LargeParameter.ql b/cpp/ql/src/Critical/LargeParameter.ql index 2df622a4c81c..42fd8215369a 100644 --- a/cpp/ql/src/Critical/LargeParameter.ql +++ b/cpp/ql/src/Critical/LargeParameter.ql @@ -5,7 +5,10 @@ * @problem.severity recommendation * @precision very-high * @id cpp/large-parameter - * @tags efficiency + * @tags quality + * reliability + * performance + * efficiency * readability * statistical * non-attributable diff --git a/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql b/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql index c41a8c5ce29c..d91db6a5a5a6 100644 --- a/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql +++ b/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/new-array-delete-mismatch - * @tags reliability + * @tags quality + * reliability + * correctness */ import NewDelete diff --git a/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql b/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql index 497ddfe19c4a..c449828da804 100644 --- a/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql +++ b/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/new-delete-array-mismatch - * @tags reliability + * @tags quality + * reliability + * correctness */ import NewDelete diff --git a/cpp/ql/src/Documentation/FixmeComments.ql b/cpp/ql/src/Documentation/FixmeComments.ql index 5ccbf1292758..0699e1852279 100644 --- a/cpp/ql/src/Documentation/FixmeComments.ql +++ b/cpp/ql/src/Documentation/FixmeComments.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision very-high * @id cpp/fixme-comment - * @tags maintainability + * @tags quality + * maintainability * documentation * external/cwe/cwe-546 */ diff --git a/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql b/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql index c06cfeabe0d0..7b2a8bb1d1de 100644 --- a/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql +++ b/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql @@ -5,7 +5,7 @@ * @problem.severity error * @precision high * @id cpp/duplicate-include-guard - * @tags reliability + * @tags quality * maintainability * modularity */ diff --git a/cpp/ql/src/Likely Bugs/AmbiguouslySignedBitField.ql b/cpp/ql/src/Likely Bugs/AmbiguouslySignedBitField.ql index 1fabf449ab35..3244d6748e9f 100644 --- a/cpp/ql/src/Likely Bugs/AmbiguouslySignedBitField.ql +++ b/cpp/ql/src/Likely Bugs/AmbiguouslySignedBitField.ql @@ -29,7 +29,7 @@ where // GLib's gboolean is a typedef for a type representing BoolType. not bf.getType().hasName("gboolean") and // If this is true, then there cannot be unsigned sign extension or overflow. - not bf.getDeclaredNumBits() = bf.getType().getSize() * 8 and + not bf.getDeclaredNumBits() = bf.getType().getBitWidth() and not bf.isAnonymous() and not bf.isFromUninstantiatedTemplate(_) select bf, diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql b/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql index dd27e4b7aee2..fba2fcf3f022 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql @@ -5,7 +5,8 @@ * @problem.severity warning * @precision high * @id cpp/bitwise-sign-check - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql b/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql index d4b23265eed5..cd893ca705ee 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision very-high * @id cpp/comparison-precedence - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql b/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql index 1f2a7ca506fd..7f1dfad0c6cf 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql @@ -7,7 +7,8 @@ * @problem.severity recommendation * @precision high * @id cpp/equality-on-floats - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql b/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql index d2602c5bd28a..1ab9ee67c404 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision high * @id cpp/comparison-of-identical-expressions - * @tags readability + * @tags quality + * readability * maintainability */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql b/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql index 7f89569c3ba5..ff2ad98085e3 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql @@ -7,7 +7,9 @@ * @problem.severity warning * @precision very-high * @id cpp/unsigned-comparison-zero - * @tags maintainability + * @tags quality + * reliability + * correctness * readability */ diff --git a/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql b/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql index 5b16fc7cf8f0..b83392c4dfb6 100644 --- a/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql +++ b/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql @@ -7,7 +7,9 @@ * @id cpp/continue-in-false-loop * @problem.severity warning * @precision high - * @tags correctness + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql b/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql index 924b5d87f90f..b50460262134 100644 --- a/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql +++ b/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql @@ -6,7 +6,9 @@ * @id cpp/array-arg-size-mismatch * @problem.severity warning * @precision high - * @tags reliability + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Conversion/ConversionChangesSign.ql b/cpp/ql/src/Likely Bugs/Conversion/ConversionChangesSign.ql index c89c71fb50b7..35843512ac05 100644 --- a/cpp/ql/src/Likely Bugs/Conversion/ConversionChangesSign.ql +++ b/cpp/ql/src/Likely Bugs/Conversion/ConversionChangesSign.ql @@ -23,7 +23,7 @@ where not ( e1.isConstant() and 0 <= e1.getValue().toInt() and - e1.getValue().toInt() <= ((it2.getSize() * 8 - 1) * 2.log()).exp() + e1.getValue().toInt() <= ((it2.getBitWidth() - 1) * 2.log()).exp() ) and not e1.isConstant() select e1, diff --git a/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql b/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql index 237d20c8f628..b9fb6b970b88 100644 --- a/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql +++ b/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql @@ -6,7 +6,8 @@ * @problem.severity warning * @precision high * @id cpp/implicit-bitfield-downcast - * @tags reliability + * @tags quality + * reliability * correctness * types */ @@ -20,8 +21,8 @@ where then fct = va.getFullyConverted().getType().(ReferenceType).getBaseType() else fct = va.getFullyConverted().getType() ) and - fi.getNumBits() > fct.getSize() * 8 and - va.getExplicitlyConverted().getType().getSize() > fct.getSize() and + fi.getNumBits() > fct.getBitWidth() and + va.getExplicitlyConverted().getType().getBitWidth() > fct.getBitWidth() and va.getTarget() = fi and not fct.getUnspecifiedType() instanceof BoolType select va, "Implicit downcast of bitfield $@.", fi, fi.toString() diff --git a/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql b/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql index 5b539faa5b4e..5a8fa0b8fa96 100644 --- a/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql +++ b/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql @@ -7,7 +7,8 @@ * @problem.severity recommendation * @precision high * @id cpp/too-many-format-arguments - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql b/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql index 3d2f6830bf54..6e71233672e2 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql @@ -6,7 +6,8 @@ * @problem.severity error * @precision high * @id cpp/assign-where-compare-meant - * @tags reliability + * @tags quality + * reliability * correctness * external/cwe/cwe-481 */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql b/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql index 46c271b11d7e..709545af661e 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql @@ -6,7 +6,8 @@ * @problem.severity error * @precision high * @id cpp/compare-where-assign-meant - * @tags reliability + * @tags quality + * reliability * correctness * external/cwe/cwe-482 */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql b/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql index 819ecbae8ec8..99c7753fa3bc 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql @@ -6,8 +6,9 @@ * @problem.severity warning * @precision very-high * @id cpp/dubious-null-check - * @tags reliability - * readability + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql b/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql index bf724de3d70c..137ae31d4d8d 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql @@ -6,8 +6,9 @@ * @problem.severity recommendation * @precision high * @id cpp/empty-if - * @tags reliability - * readability + * @tags quality + * maintainability + * useless-code */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql b/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql index a1b5d7b8f358..dea16e9606d5 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql @@ -6,7 +6,8 @@ * @problem.severity warning * @precision high * @id cpp/logical-operator-applied-to-flag - * @tags reliability + * @tags quality + * reliability * correctness * external/cwe/cwe-480 */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql b/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql index 5b1d54b51f8f..3f633600667a 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql @@ -7,7 +7,9 @@ * @problem.severity error * @precision high * @id cpp/string-copy-return-value-as-boolean - * @tags correctness + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql b/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql index 958d7aa3c559..7173dfb70c58 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql @@ -5,7 +5,9 @@ * @problem.severity error * @precision high * @id cpp/inconsistent-loop-direction - * @tags correctness + * @tags quality + * reliability + * correctness * external/cwe/cwe-835 * @msrc.severity important */ diff --git a/cpp/ql/src/Likely Bugs/Memory Management/Padding/Suboptimal64BitType.ql b/cpp/ql/src/Likely Bugs/Memory Management/Padding/Suboptimal64BitType.ql index f2cf4367d86d..5393c17b3ea3 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/Padding/Suboptimal64BitType.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/Padding/Suboptimal64BitType.ql @@ -14,7 +14,7 @@ from PaddedType t, Architecture arch, WideCharType wc, int holes, int size, int percentage, int optimum where arch.pointerSize() = 64 and // Select 64-bit architecture - arch.wideCharSize() = (wc.getSize() * 8) and // Select Windows(sizeof(wchar_t == 2)) or non-Windows(sizeof(wchar_t == 4)) + arch.wideCharSize() = wc.getBitWidth() and // Select Windows(sizeof(wchar_t == 2)) or non-Windows(sizeof(wchar_t == 4)) t.isPrecise() and optimum = t.optimalSize(arch) and size = arch.paddedSize(t) and diff --git a/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql b/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql index feca6558ef6e..e028fc8219e1 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql @@ -8,7 +8,8 @@ * @problem.severity warning * @precision high * @id cpp/return-c-str-of-std-string - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql b/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql index 38cd86a594d9..55d2d620e015 100644 --- a/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql +++ b/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql @@ -7,8 +7,9 @@ * @problem.severity warning * @precision high * @id cpp/constructor-delegation - * @tags maintainability - * readability + * @tags quality + * reliability + * correctness * language-features */ diff --git a/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql b/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql index 7a223f56f57b..366118513aa3 100644 --- a/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql +++ b/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql @@ -5,8 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/virtual-destructor - * @tags reliability - * readability + * @tags quality + * reliability + * correctness * language-features */ diff --git a/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql b/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql index 75252eb45097..2b702d814e58 100644 --- a/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql +++ b/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql @@ -6,8 +6,10 @@ * @problem.severity warning * @precision very-high * @id cpp/throw-in-destructor - * @tags reliability - * readability + * @tags quality + * reliability + * correctness + * error-handling * language-features */ diff --git a/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql b/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql index 661abfd07e9c..45a65d3ea44e 100644 --- a/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql +++ b/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql @@ -5,8 +5,10 @@ * @problem.severity warning * @precision very-high * @id cpp/member-const-no-effect - * @tags maintainability + * @tags quality + * maintainability * readability + * useless-code * language-features */ diff --git a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql index 8e921faf2117..18b3799003b7 100644 --- a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +++ b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql @@ -7,8 +7,9 @@ * @problem.severity warning * @precision high * @id cpp/implicit-function-declaration - * @tags correctness - * maintainability + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql b/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql index 4e7f85097b8e..59f745b14956 100644 --- a/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql +++ b/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql @@ -7,8 +7,9 @@ * @problem.severity warning * @precision very-high * @id cpp/futile-params - * @tags correctness - * maintainability + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.qhelp b/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.qhelp index 2e888bf80df5..f9153b95700e 100644 --- a/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.qhelp +++ b/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.qhelp @@ -34,7 +34,7 @@ should be safe against command injection.

Sanitize data passed to complex subsystems.
  • OWASP: -Command Injection. +Command Injection.
  • diff --git a/cpp/ql/src/change-notes/2026-10-12-cpp-code-quality-suite.md b/cpp/ql/src/change-notes/2026-10-12-cpp-code-quality-suite.md new file mode 100644 index 000000000000..da96d01b3bad --- /dev/null +++ b/cpp/ql/src/change-notes/2026-10-12-cpp-code-quality-suite.md @@ -0,0 +1,4 @@ +--- +category: queryMetadata +--- +* Added a new `cpp-code-quality` query suite containing queries that identify maintainability and reliability issues in C and C++ code. diff --git a/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls b/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls index b4f85c4e306e..d6df483208da 100644 --- a/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls +++ b/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls @@ -1,5 +1,92 @@ - description: Security-and-quality queries for C and C++ - queries: . -- apply: security-and-quality-selectors.yml +- apply: security-and-frozen-quality-selectors.yml from: codeql/suite-helpers +- include: + id: + - cpp/ambiguous-assignment-of-comparison + - cpp/ambiguously-signed-bit-field + - cpp/array-arg-size-mismatch + - cpp/array-in-interface + - cpp/assign-where-compare-meant + - cpp/assignment-does-not-return-this + - cpp/bitwise-sign-check + - cpp/catch-by-value + - cpp/catch-missing-free + - cpp/commented-out-code + - cpp/compare-where-assign-meant + - cpp/comparison-of-identical-expressions + - cpp/comparison-precedence + - cpp/complex-block + - cpp/complex-condition + - cpp/constant-comparison + - cpp/constructor-delegation + - cpp/continue-in-false-loop + - cpp/dead-code-goto + - cpp/declaration-hides-parameter + - cpp/declaration-hides-variable + - cpp/dubious-null-check + - cpp/duplicate-include-guard + - cpp/empty-block + - cpp/empty-if + - cpp/equality-on-floats + - cpp/fixme-comment + - cpp/function-in-block + - cpp/futile-params + - cpp/guarded-free + - cpp/implicit-bitfield-downcast + - cpp/implicit-function-declaration + - cpp/include-non-header + - cpp/incomplete-parity-check + - cpp/inconsistent-call-on-result + - cpp/inconsistent-loop-direction + - cpp/inconsistent-null-check + - cpp/inconsistent-virtual-inheritance + - cpp/integer-used-for-enum + - cpp/irregular-enum-init + - cpp/large-parameter + - cpp/leap-year/adding-365-days-per-year + - cpp/leap-year/unchecked-after-arithmetic-year-modification + - cpp/leap-year/unchecked-return-value-for-time-conversion-function + - cpp/local-variable-hides-global-variable + - cpp/logical-operator-applied-to-flag + - cpp/long-switch + - cpp/loop-variable-changed + - cpp/loop-variable-float + - cpp/lossy-function-result-cast + - cpp/lossy-pointer-cast + - cpp/member-const-no-effect + - cpp/missing-case-in-switch + - cpp/missing-header-guard + - cpp/missing-return + - cpp/mistyped-function-arguments + - cpp/nested-loops-with-same-variable + - cpp/new-array-delete-mismatch + - cpp/new-delete-array-mismatch + - cpp/non-member-const-no-effect + - cpp/poorly-documented-function + - cpp/redefined-default-parameter + - cpp/resource-not-released-in-destructor + - cpp/rethrow-no-exception + - cpp/return-c-str-of-std-string + - cpp/rule-of-two + - cpp/short-global-name + - cpp/sizeof-side-effect + - cpp/slicing + - cpp/stack-address-escape + - cpp/string-copy-return-value-as-boolean + - cpp/throw-in-destructor + - cpp/throwing-pointer + - cpp/too-many-format-arguments + - cpp/trivial-switch + - cpp/undisciplined-multiple-inheritance + - cpp/unsigned-comparison-zero + - cpp/unused-local-variable + - cpp/unused-static-function + - cpp/unused-static-variable + - cpp/use-in-own-initializer + - cpp/use-of-goto + - cpp/useless-expression + - cpp/virtual-call-in-constructor + - cpp/virtual-destructor - apply: codeql-suites/exclude-slow-queries.yml diff --git a/cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.qhelp b/cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.qhelp index 6dd9662c57d5..eb13e3785542 100644 --- a/cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.qhelp +++ b/cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.qhelp @@ -31,7 +31,7 @@ is performed, making this safe from command injection.

    Sanitize data passed to complex subsystems.
  • OWASP: -Command Injection. +Command Injection.
  • diff --git a/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql b/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql index 59a6838c23e3..4f86f64bc435 100644 --- a/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql +++ b/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql @@ -7,7 +7,8 @@ * @problem.severity recommendation * @precision high * @id cpp/missing-header-guard - * @tags efficiency + * @tags quality + * efficiency * maintainability * modularity * external/jsf diff --git a/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql b/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql index ec7d446ac58a..761879c98702 100644 --- a/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql +++ b/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/virtual-call-in-constructor - * @tags reliability + * @tags quality + * reliability + * correctness * readability * language-features * external/jsf diff --git a/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql b/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql index 83fe8facd4f3..c0014f5f3464 100644 --- a/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql +++ b/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql @@ -5,8 +5,10 @@ * @problem.severity warning * @precision high * @id cpp/resource-not-released-in-destructor - * @tags efficiency - * readability + * @tags quality + * reliability + * correctness + * efficiency * external/cwe/cwe-404 * external/jsf */ diff --git a/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 154.ql b/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 154.ql index cd08362ad35a..87086db9e9a9 100644 --- a/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 154.ql +++ b/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 154.ql @@ -22,7 +22,7 @@ where not bf.getUnderlyingType() instanceof Enum and not bf.getUnspecifiedType() instanceof BoolType and not bf.getType().hasName("BOOL") and // At least for C programs on Windows, BOOL is a common typedef for a type representing BoolType. - not bf.getDeclaredNumBits() = bf.getType().getSize() * 8 and // If this is true, then there cannot be unsigned sign extension or overflow. + not bf.getDeclaredNumBits() = bf.getType().getBitWidth() and // If this is true, then there cannot be unsigned sign extension or overflow. not bf.isAnonymous() select bf, "Bit field " + bf.getName() + " of type " + bf.getUnderlyingType().getName() + diff --git a/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 180.ql b/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 180.ql index 16727add3fff..7e03caef0b91 100644 --- a/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 180.ql +++ b/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 180.ql @@ -61,10 +61,10 @@ class ImplicitConversion extends Expr { int getSourceSize() { if this instanceof IntConstantExpr then result = this.(IntConstantExpr).getRequiredSizeBits() - else result = this.getUnderlyingSourceType().getSize() * 8 + else result = this.getUnderlyingSourceType().getBitWidth() } - int getTargetSize() { result = this.getUnderlyingTargetType().getSize() * 8 } + int getTargetSize() { result = this.getUnderlyingTargetType().getBitWidth() } predicate isSourceSignedInt() { if this instanceof IntConstantExpr diff --git a/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql b/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql index 4f76b4c10eaa..17f6b41b5c7d 100644 --- a/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql +++ b/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision high * @id cpp/loop-variable-float - * @tags correctness + * @tags quality + * correctness * reliability * external/jsf */ diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index 9c6c1d1447ae..e61594b23415 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.9.2 +version: 1.9.3-dev groups: - cpp - queries diff --git a/cpp/ql/test/library-tests/blocks/c/code_blocks.ql b/cpp/ql/test/library-tests/blocks/c/code_blocks.ql index 1662525cae6e..647923eea563 100644 --- a/cpp/ql/test/library-tests/blocks/c/code_blocks.ql +++ b/cpp/ql/test/library-tests/blocks/c/code_blocks.ql @@ -1,20 +1,16 @@ import cpp -predicate paramsString(Function f, int n, string res) { - if n = -1 - then res = "" - else - exists(string sep | - (if n = 0 then sep = "" else sep = ", ") and - exists(string prefixRes | - paramsString(f, n - 1, prefixRes) and - res = prefixRes + sep + f.getParameter(n) + "(" + f.getParameter(n).getType() + ")" - ) +string paramsString(Function f) { + result = + concat(int i | + exists(f.getParameter(i)) + | + f.getParameter(i) + "(" + f.getParameter(i).getType() + ")", ", " order by i ) } from BlockExpr e, Function f, string params where f = e.getFunction() and - paramsString(f, f.getNumberOfParameters() - 1, params) + params = paramsString(f) select e, e.getType() as te, te.explain(), e.getFunction(), f.getType() as tf, tf.explain(), params diff --git a/cpp/ql/test/library-tests/blocks/cpp/code_blocks.ql b/cpp/ql/test/library-tests/blocks/cpp/code_blocks.ql index 1662525cae6e..647923eea563 100644 --- a/cpp/ql/test/library-tests/blocks/cpp/code_blocks.ql +++ b/cpp/ql/test/library-tests/blocks/cpp/code_blocks.ql @@ -1,20 +1,16 @@ import cpp -predicate paramsString(Function f, int n, string res) { - if n = -1 - then res = "" - else - exists(string sep | - (if n = 0 then sep = "" else sep = ", ") and - exists(string prefixRes | - paramsString(f, n - 1, prefixRes) and - res = prefixRes + sep + f.getParameter(n) + "(" + f.getParameter(n).getType() + ")" - ) +string paramsString(Function f) { + result = + concat(int i | + exists(f.getParameter(i)) + | + f.getParameter(i) + "(" + f.getParameter(i).getType() + ")", ", " order by i ) } from BlockExpr e, Function f, string params where f = e.getFunction() and - paramsString(f, f.getNumberOfParameters() - 1, params) + params = paramsString(f) select e, e.getType() as te, te.explain(), e.getFunction(), f.getType() as tf, tf.explain(), params diff --git a/cpp/ql/test/library-tests/builtins/builtins/builtins.expected b/cpp/ql/test/library-tests/builtins/builtins/builtins.expected index 48007d6b0e18..2e8e7fd247d6 100644 --- a/cpp/ql/test/library-tests/builtins/builtins/builtins.expected +++ b/cpp/ql/test/library-tests/builtins/builtins/builtins.expected @@ -1,4 +1,12 @@ | choose_expr.c:3:13:3:42 | __builtin_choose_expr | +| spaceship.cpp:22:41:22:101 | __builtin_lt_synthesizes_from_spaceship | +| spaceship.cpp:23:41:23:89 | __builtin_lt_synthesizes_from_spaceship | +| spaceship.cpp:24:41:24:101 | __builtin_gt_synthesizes_from_spaceship | +| spaceship.cpp:25:41:25:89 | __builtin_gt_synthesizes_from_spaceship | +| spaceship.cpp:26:41:26:101 | __builtin_le_synthesizes_from_spaceship | +| spaceship.cpp:27:41:27:89 | __builtin_le_synthesizes_from_spaceship | +| spaceship.cpp:28:41:28:101 | __builtin_ge_synthesizes_from_spaceship | +| spaceship.cpp:29:41:29:89 | __builtin_ge_synthesizes_from_spaceship | | types.c:4:9:4:57 | __builtin_types_compatible_p | | types.c:6:16:6:65 | __builtin_types_compatible_p | | varargs.c:7:5:7:32 | __builtin_va_start | diff --git a/cpp/ql/test/library-tests/builtins/builtins/expr.expected b/cpp/ql/test/library-tests/builtins/builtins/expr.expected new file mode 100644 index 000000000000..a642c211d5c5 --- /dev/null +++ b/cpp/ql/test/library-tests/builtins/builtins/expr.expected @@ -0,0 +1,106 @@ +| atomic.cpp:3:10:3:27 | call to __atomic_fetch_add_4 | ptr,1,0 | | +| atomic.cpp:3:10:3:38 | (int)... | | | +| atomic.cpp:3:29:3:31 | (volatile void *)... | | | +| atomic.cpp:3:29:3:31 | ptr | | | +| atomic.cpp:3:34:3:34 | 1 | | 1 | +| atomic.cpp:3:34:3:34 | (unsigned int)... | | 1 | +| atomic.cpp:3:37:3:37 | 0 | | 0 | +| atomic.cpp:8:10:8:27 | call to __atomic_fetch_add_1 | ptr,1,0 | | +| atomic.cpp:8:10:8:38 | (char)... | | | +| atomic.cpp:8:10:8:38 | (double)... | | | +| atomic.cpp:8:29:8:31 | (volatile void *)... | | | +| atomic.cpp:8:29:8:31 | ptr | | | +| atomic.cpp:8:34:8:34 | 1 | | 1 | +| atomic.cpp:8:34:8:34 | (unsigned char)... | | 1 | +| atomic.cpp:8:37:8:37 | 0 | | 0 | +| atomic.cpp:13:10:13:29 | call to __atomic_fetch_add_4 | ptr,1,0 | | +| atomic.cpp:13:10:13:40 | (int)... | | | +| atomic.cpp:13:31:13:33 | (volatile void *)... | | | +| atomic.cpp:13:31:13:33 | ptr | | | +| atomic.cpp:13:36:13:36 | 1 | | 1 | +| atomic.cpp:13:36:13:36 | (unsigned int)... | | 1 | +| atomic.cpp:13:39:13:39 | 0 | | 0 | +| atomic.cpp:18:10:18:29 | call to __atomic_fetch_add_1 | ptr,1,0 | | +| atomic.cpp:18:10:18:40 | (char)... | | | +| atomic.cpp:18:31:18:33 | (volatile void *)... | | | +| atomic.cpp:18:31:18:33 | ptr | | | +| atomic.cpp:18:36:18:36 | 1 | | 1 | +| atomic.cpp:18:36:18:36 | (unsigned char)... | | 1 | +| atomic.cpp:18:39:18:39 | 0 | | 0 | +| choose_expr.c:3:13:3:42 | __builtin_choose_expr | 1,5,6 | | +| choose_expr.c:3:35:3:35 | 1 | | 1 | +| choose_expr.c:3:38:3:38 | 5 | | 5 | +| choose_expr.c:3:41:3:41 | 6 | | 6 | +| spaceship.cpp:6:45:6:45 | n | this | | +| spaceship.cpp:6:45:6:45 | this | | | +| spaceship.cpp:9:53:9:56 | {...} | - ... | | +| spaceship.cpp:9:54:9:55 | - ... | 1 | -1 | +| spaceship.cpp:9:55:9:55 | 1 | | 1 | +| spaceship.cpp:10:54:10:56 | {...} | 0 | | +| spaceship.cpp:10:55:10:55 | 0 | | 0 | +| spaceship.cpp:11:56:11:58 | {...} | 1 | | +| spaceship.cpp:11:57:11:57 | 1 | | 1 | +| spaceship.cpp:18:12:18:14 | rhs | | | +| spaceship.cpp:18:12:18:24 | ... <=> ... | rhs,i | | +| spaceship.cpp:18:20:18:22 | lhs | | | +| spaceship.cpp:18:24:18:24 | i | lhs | | +| spaceship.cpp:22:41:22:101 | __builtin_lt_synthesizes_from_spaceship | const S &,const int & | 1 | +| spaceship.cpp:22:41:22:101 | const S & | | | +| spaceship.cpp:22:41:22:101 | const int & | | | +| spaceship.cpp:23:41:23:89 | __builtin_lt_synthesizes_from_spaceship | int,int | 0 | +| spaceship.cpp:23:41:23:89 | int | | | +| spaceship.cpp:23:41:23:89 | int | | | +| spaceship.cpp:24:41:24:101 | __builtin_gt_synthesizes_from_spaceship | const S &,const int & | 1 | +| spaceship.cpp:24:41:24:101 | const S & | | | +| spaceship.cpp:24:41:24:101 | const int & | | | +| spaceship.cpp:25:41:25:89 | __builtin_gt_synthesizes_from_spaceship | int,int | 0 | +| spaceship.cpp:25:41:25:89 | int | | | +| spaceship.cpp:25:41:25:89 | int | | | +| spaceship.cpp:26:41:26:101 | __builtin_le_synthesizes_from_spaceship | const S &,const int & | 1 | +| spaceship.cpp:26:41:26:101 | const S & | | | +| spaceship.cpp:26:41:26:101 | const int & | | | +| spaceship.cpp:27:41:27:89 | __builtin_le_synthesizes_from_spaceship | int,int | 0 | +| spaceship.cpp:27:41:27:89 | int | | | +| spaceship.cpp:27:41:27:89 | int | | | +| spaceship.cpp:28:41:28:101 | __builtin_ge_synthesizes_from_spaceship | const S &,const int & | 1 | +| spaceship.cpp:28:41:28:101 | const S & | | | +| spaceship.cpp:28:41:28:101 | const int & | | | +| spaceship.cpp:29:41:29:89 | __builtin_ge_synthesizes_from_spaceship | int,int | 0 | +| spaceship.cpp:29:41:29:89 | int | | | +| spaceship.cpp:29:41:29:89 | int | | | +| types.c:4:9:4:57 | __builtin_types_compatible_p | typeof(...),long | 0 | +| types.c:4:9:4:57 | long | | | +| types.c:4:9:4:57 | typeof(...) | | | +| types.c:4:49:4:49 | s | | | +| types.c:5:9:5:12 | call to puts | long | | +| types.c:5:14:5:19 | array to pointer conversion | | | +| types.c:5:14:5:19 | long | | long | +| types.c:6:16:6:65 | __builtin_types_compatible_p | typeof(...),char * | 1 | +| types.c:6:16:6:65 | char * | | | +| types.c:6:16:6:65 | typeof(...) | | | +| types.c:6:56:6:56 | s | | | +| types.c:7:9:7:12 | call to puts | str | | +| types.c:7:14:7:18 | array to pointer conversion | | | +| types.c:7:14:7:18 | str | | str | +| types.c:9:12:9:14 | (...) | | 0 | +| types.c:9:13:9:13 | 0 | | 0 | +| varargs.c:7:5:7:32 | __builtin_va_start | ap,args | | +| varargs.c:7:24:7:25 | ap | | | +| varargs.c:7:24:7:25 | array to pointer conversion | | | +| varargs.c:7:28:7:31 | args | | | +| varargs.c:8:10:8:10 | i | | | +| varargs.c:8:10:8:14 | ... = ... | i,0 | | +| varargs.c:8:14:8:14 | 0 | | 0 | +| varargs.c:8:17:8:17 | i | | | +| varargs.c:8:17:8:24 | ... < ... | i,args | | +| varargs.c:8:21:8:24 | args | | | +| varargs.c:8:27:8:27 | i | | | +| varargs.c:8:27:8:29 | ... ++ | i | | +| varargs.c:9:9:9:9 | j | | | +| varargs.c:9:9:9:37 | ... = ... | j,__builtin_va_arg | | +| varargs.c:9:13:9:37 | __builtin_va_arg | ap | | +| varargs.c:9:30:9:31 | ap | | | +| varargs.c:9:30:9:31 | array to pointer conversion | | | +| varargs.c:11:5:11:24 | __builtin_va_end | ap | | +| varargs.c:11:22:11:23 | ap | | | +| varargs.c:11:22:11:23 | array to pointer conversion | | | diff --git a/cpp/ql/test/library-tests/builtins/builtins/expr.ql b/cpp/ql/test/library-tests/builtins/builtins/expr.ql new file mode 100644 index 000000000000..c638cf501562 --- /dev/null +++ b/cpp/ql/test/library-tests/builtins/builtins/expr.ql @@ -0,0 +1,5 @@ +import cpp + +from Expr e, string value +where if exists(e.getValue()) then value = e.getValue().toString() else value = "" +select e, concat(int i | | e.getChild(i).toString(), "," order by i), value diff --git a/cpp/ql/test/library-tests/builtins/builtins/spaceship.cpp b/cpp/ql/test/library-tests/builtins/builtins/spaceship.cpp new file mode 100644 index 000000000000..94f978587b1f --- /dev/null +++ b/cpp/ql/test/library-tests/builtins/builtins/spaceship.cpp @@ -0,0 +1,29 @@ +// semmle-extractor-options: --clang --clang_version 240000 -std=c++23 + +namespace std { + struct strong_ordering { + int n; + constexpr operator int() const { return n; } + static const strong_ordering less, equal, greater; + }; + constexpr strong_ordering strong_ordering::less = {-1}; + constexpr strong_ordering strong_ordering::equal = {0}; + constexpr strong_ordering strong_ordering::greater = {1}; +} + +struct S { + int i; + + friend auto operator<=>(S lhs, int rhs) { + return rhs <=> lhs.i; + } +}; + +bool b_lt_synthesizes_from_spaceship1 = __builtin_lt_synthesizes_from_spaceship(const S&, const int&); +bool b_lt_synthesizes_from_spaceship2 = __builtin_lt_synthesizes_from_spaceship(int, int); +bool b_gt_synthesizes_from_spaceship1 = __builtin_gt_synthesizes_from_spaceship(const S&, const int&); +bool b_gt_synthesizes_from_spaceship2 = __builtin_gt_synthesizes_from_spaceship(int, int); +bool b_le_synthesizes_from_spaceship1 = __builtin_le_synthesizes_from_spaceship(const S&, const int&); +bool b_le_synthesizes_from_spaceship2 = __builtin_le_synthesizes_from_spaceship(int, int); +bool b_ge_synthesizes_from_spaceship1 = __builtin_ge_synthesizes_from_spaceship(const S&, const int&); +bool b_ge_synthesizes_from_spaceship2 = __builtin_ge_synthesizes_from_spaceship(int, int); diff --git a/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp b/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp index 3db47a824ede..67664754f4e5 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp +++ b/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp @@ -122,10 +122,20 @@ bool b_is_scoped_enum2 = __is_scoped_enum(int); bool b_is_trivially_relocatable1 = __is_trivially_relocatable(int); bool b_is_trivially_relocatable2 = __is_trivially_relocatable(void); -struct S3{ +struct S3 { S3(S3 &); S3& operator=(S3&); }; -bool bok_is_bitwise_cloneable1 = __is_bitwise_cloneable(int); -bool bok_is_bitwise_cloneable2 = __is_bitwise_cloneable(S3); +bool b_is_bitwise_cloneable1 = __is_bitwise_cloneable(int); +bool b_is_bitwise_cloneable2 = __is_bitwise_cloneable(S3); + +struct S4 : virtual S3 { + ~S4() = delete; +}; + +bool b_is_virtual_base_of1 = __builtin_is_virtual_base_of(int, S4); +bool b_is_virtual_base_of2 = __builtin_is_virtual_base_of(S3, S4); + +bool b_is_implicit_lifetime1 = __builtin_is_implicit_lifetime(int); +bool b_is_implicit_lifetime2 = __builtin_is_implicit_lifetime(S4); diff --git a/cpp/ql/test/library-tests/builtins/type_traits/expr.expected b/cpp/ql/test/library-tests/builtins/type_traits/expr.expected index 1728a48f4237..1580d5dba959 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/expr.expected +++ b/cpp/ql/test/library-tests/builtins/type_traits/expr.expected @@ -165,10 +165,20 @@ | clang.cpp:122:36:122:66 | int | | | | clang.cpp:123:36:123:67 | __is_trivially_relocatable | void | 0 | | clang.cpp:123:36:123:67 | void | | | -| clang.cpp:130:34:130:60 | __is_bitwise_cloneable | int | 1 | -| clang.cpp:130:34:130:60 | int | | | -| clang.cpp:131:34:131:59 | S3 | | | -| clang.cpp:131:34:131:59 | __is_bitwise_cloneable | S3 | 0 | +| clang.cpp:130:32:130:58 | __is_bitwise_cloneable | int | 1 | +| clang.cpp:130:32:130:58 | int | | | +| clang.cpp:131:32:131:57 | S3 | | | +| clang.cpp:131:32:131:57 | __is_bitwise_cloneable | S3 | 0 | +| clang.cpp:137:30:137:66 | S4 | | | +| clang.cpp:137:30:137:66 | __builtin_is_virtual_base_of | int,S4 | 0 | +| clang.cpp:137:30:137:66 | int | | | +| clang.cpp:138:30:138:65 | S3 | | | +| clang.cpp:138:30:138:65 | S4 | | | +| clang.cpp:138:30:138:65 | __builtin_is_virtual_base_of | S3,S4 | 1 | +| clang.cpp:140:32:140:66 | __builtin_is_implicit_lifetime | int | 1 | +| clang.cpp:140:32:140:66 | int | | | +| clang.cpp:141:32:141:65 | S4 | | | +| clang.cpp:141:32:141:65 | __builtin_is_implicit_lifetime | S4 | 0 | | file://:0:0:0:0 | 0 | | 0 | | file://:0:0:0:0 | 0 | | 0 | | file://:0:0:0:0 | 1 | | 1 | @@ -225,6 +235,10 @@ | gcc.cpp:37:32:37:67 | __is_nothrow_invocable | f_type,bool | 0 | | gcc.cpp:37:32:37:67 | bool | | | | gcc.cpp:37:32:37:67 | f_type | | | +| gcc.cpp:39:25:39:52 | __builtin_is_structural | int | 1 | +| gcc.cpp:39:25:39:52 | int | | | +| gcc.cpp:40:25:40:54 | __builtin_is_structural | int && | 0 | +| gcc.cpp:40:25:40:54 | int && | | | | ms.cpp:38:41:38:45 | 0 | | 0 | | ms.cpp:88:27:88:45 | __has_assign | empty | 0 | | ms.cpp:88:27:88:45 | empty | | | diff --git a/cpp/ql/test/library-tests/builtins/type_traits/expr.ql b/cpp/ql/test/library-tests/builtins/type_traits/expr.ql index a7d2b436ebde..c638cf501562 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/expr.ql +++ b/cpp/ql/test/library-tests/builtins/type_traits/expr.ql @@ -1,15 +1,5 @@ import cpp -string childrenFrom(Expr e, int i) { - ( - if i = 0 - then result = e.getChild(i).toString() + childrenFrom(e, i + 1) - else result = "," + e.getChild(i).toString() + childrenFrom(e, i + 1) - ) - or - i = e.getNumChild() and result = "" -} - from Expr e, string value where if exists(e.getValue()) then value = e.getValue().toString() else value = "" -select e, childrenFrom(e, 0), value +select e, concat(int i | | e.getChild(i).toString(), "," order by i), value diff --git a/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp b/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp index 15f59812d2e9..7c6189b81aff 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp +++ b/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp @@ -1,4 +1,4 @@ -// semmle-extractor-options: --gnu_version 150000 +// semmle-extractor-options: --gnu_version 170000 __attribute__ ((aligned(8))) int v; bool b_has_attribute1 = __builtin_has_attribute(v, aligned); @@ -35,3 +35,6 @@ bool b_is_invocable2 = __is_invocable(f_type, bool); bool b_is_nothrow_invocable1 = __is_nothrow_invocable(f_type); bool b_is_nothrow_invocable2 = __is_nothrow_invocable(f_type, bool); + +bool b_is_structural1 = __builtin_is_structural(int); +bool b_is_structural2 = __builtin_is_structural(int&&); diff --git a/cpp/ql/test/library-tests/cpp11_g/cfg.ql b/cpp/ql/test/library-tests/cpp11_g/cfg.ql index 105b4e709ee7..f4df06adde03 100644 --- a/cpp/ql/test/library-tests/cpp11_g/cfg.ql +++ b/cpp/ql/test/library-tests/cpp11_g/cfg.ql @@ -1,16 +1,12 @@ import cpp -string arguments(Function f, int i) { - result = "," and i = -1 - or - result = "" and i = min(int j | function_template_argument(unresolveElement(f), j, _)) - 1 - or - result = arguments(f, i - 1) + "," + f.getTemplateArgument(i).toString() +string arguments(Function f) { + result = concat(int i | | f.getTemplateArgument(i).toString(), "," order by i) } string name(Function f) { if f.isConstructedFrom(_) - then result = f.toString() + "<" + max(arguments(f, _)).suffix(1) + ">" + then result = f.toString() + "<" + arguments(f) + ">" else if f instanceof TemplateFunction then result = f.toString() + " prototype instantiation" diff --git a/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql b/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql index 8f534be558d7..a7118463d96a 100644 --- a/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql +++ b/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql @@ -27,7 +27,7 @@ module IRTest { private string stars(int k) { k = [0 .. max(DataFlow::Node n, int i | n.isFinalValueOfParameter(_, i) | i)] and - (if k = 0 then result = "" else result = "*" + stars(k - 1)) + result = concat(int i | i in [1 .. k] | "*") } module IRParameterDefTest implements TestSig { diff --git a/cpp/ql/test/library-tests/preprocessor/macroinvocations/getanaffectedelement.ql b/cpp/ql/test/library-tests/preprocessor/macroinvocations/getanaffectedelement.ql index 83ab99ccdfd7..a3ff56942431 100644 --- a/cpp/ql/test/library-tests/preprocessor/macroinvocations/getanaffectedelement.ql +++ b/cpp/ql/test/library-tests/preprocessor/macroinvocations/getanaffectedelement.ql @@ -14,20 +14,8 @@ predicate reason(MacroInvocation mi, Element e, string reason) { mi.getEnclosingFunction() = e and reason = "getEnclosingFunction()" } -string reasonspart(MacroInvocation mi, Element e) { - reason(mi, e, result) - or - exists(string a, string b | - a = reasonspart(mi, e) and - reason(mi, e, b) and - not a.splitAt(" ") >= b and - result = a + " " + b - ) -} - string reasons(MacroInvocation mi, Element e) { - result = reasonspart(mi, e) and - not reasonspart(mi, e).length() > result.length() + result = concat(string reason | reason(mi, e, reason) | reason, " " order by reason) } from MacroInvocation mi, Element e diff --git a/cpp/ql/test/library-tests/sideEffects/functions/sideEffects.ql b/cpp/ql/test/library-tests/sideEffects/functions/sideEffects.ql index d2705040373a..d749031f7fb3 100644 --- a/cpp/ql/test/library-tests/sideEffects/functions/sideEffects.ql +++ b/cpp/ql/test/library-tests/sideEffects/functions/sideEffects.ql @@ -1,13 +1,14 @@ import cpp -string functionType(Function f, int i) { - if exists(f.getParameter(i)) - then result = f.getParameter(i).getType().toString() + " -> " + functionType(f, i + 1) - else ( - i = f.getNumberOfParameters() and result = f.getType().toString() - ) +string functionType(Function f) { + if exists(f.getParameter(_)) + then + result = + concat(int i | | f.getParameter(i).getType().toString(), " -> " order by i) + " -> " + + f.getType().toString() + else result = f.getType().toString() } from Function f, boolean b where if f.isSideEffectFree() then b = true else b = false -select f, functionType(f, 0), b +select f, functionType(f), b diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs index 9257edfe2c19..fee72034781f 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs @@ -18,7 +18,6 @@ internal sealed partial class NugetPackageRestorer : IDisposable private readonly IFileProvider fileProvider; private readonly FileContent fileContent; private readonly IDotNet dotnet; - private readonly IRegistryProxy? registryProxy; private readonly IDiagnosticsWriter diagnosticsWriter; private readonly DependencyDirectory legacyPackageDirectory; private readonly DependencyDirectory missingPackageDirectory; @@ -41,7 +40,6 @@ public NugetPackageRestorer( this.fileProvider = fileProvider; this.fileContent = fileContent; this.dotnet = dotnet; - this.registryProxy = registryProxy; this.diagnosticsWriter = diagnosticsWriter; this.logger = logger; this.compilationInfoContainer = compilationInfoContainer; @@ -135,7 +133,7 @@ public HashSet Restore() try { - var packagesConfigRestore = PackagesConfigRestoreFactory.Create(fileProvider, legacyPackageDirectory, logger, feedManager, registryProxy); + var packagesConfigRestore = PackagesConfigRestoreFactory.Create(fileProvider, legacyPackageDirectory, logger, feedManager); var count = packagesConfigRestore.InstallPackages(); if (packagesConfigRestore.PackageCount > 0) { diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/PackagesConfigRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/PackagesConfigRestorer.cs index 29276d72a82c..2348eb809f8c 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/PackagesConfigRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/PackagesConfigRestorer.cs @@ -33,11 +33,11 @@ internal interface IPackagesConfigRestore /// internal class PackagesConfigRestoreFactory { - public static IPackagesConfigRestore Create(IFileProvider fileProvider, DependencyDirectory packageDirectory, Semmle.Util.Logging.ILogger logger, FeedManager feedManager, IRegistryProxy? registryProxy) + public static IPackagesConfigRestore Create(IFileProvider fileProvider, DependencyDirectory packageDirectory, Semmle.Util.Logging.ILogger logger, FeedManager feedManager) { if (SystemBuildActions.Instance.IsWindows() || SystemBuildActions.Instance.IsMonoInstalled()) { - return new NugetExeWrapper(fileProvider, packageDirectory, logger, feedManager, registryProxy); + return new NugetExeWrapper(fileProvider, packageDirectory, logger, feedManager); } return new NoOpPackagesConfig(fileProvider.PackagesConfigs, logger); @@ -52,7 +52,6 @@ private class NugetExeWrapper : IPackagesConfigRestore { private readonly string? nugetExe; private readonly Semmle.Util.Logging.ILogger logger; - private readonly IRegistryProxy? registryProxy; public int PackageCount => fileProvider.PackagesConfigs.Count; @@ -71,13 +70,12 @@ private class NugetExeWrapper : IPackagesConfigRestore /// /// Create the package manager for a specified source tree. /// - public NugetExeWrapper(IFileProvider fileProvider, DependencyDirectory packageDirectory, Semmle.Util.Logging.ILogger logger, FeedManager feedManager, IRegistryProxy? registryProxy) + public NugetExeWrapper(IFileProvider fileProvider, DependencyDirectory packageDirectory, Semmle.Util.Logging.ILogger logger, FeedManager feedManager) { this.fileProvider = fileProvider; this.packageDirectory = packageDirectory; this.logger = logger; this.feedManager = feedManager; - this.registryProxy = registryProxy; if (fileProvider.PackagesConfigs.Count > 0) { @@ -211,9 +209,6 @@ private bool TryRestoreNugetPackage(string packagesConfig) UseShellExecute = false }; - // Configure the proxy settings, if applicable. - registryProxy?.SetProcessEnvironment(pi); - var threadId = Environment.CurrentManagedThreadId; void onOut(string s) => logger.LogDebug(s, threadId); void onError(string s) => logger.LogError(s, threadId); diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index 9c3552c89f94..f815df321b13 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.77 +version: 1.7.78-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 72b51821fe88..b708787ad92d 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.77 +version: 1.7.78-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/change-notes/2026-10-26-nugetcli-proxy-config-rollback.md b/csharp/ql/lib/change-notes/2026-10-26-nugetcli-proxy-config-rollback.md new file mode 100644 index 000000000000..bda5d495d70a --- /dev/null +++ b/csharp/ql/lib/change-notes/2026-10-26-nugetcli-proxy-config-rollback.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Rolled back the change that set proxy and certificate environment variables for the subprocess that invokes the NuGet CLI because the environment variables were only partially respected by the target process in some cases. diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index 701cf4f1a796..af1abccc9f10 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 7.4.1 +version: 7.4.2-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/Security Features/CWE-078/CommandInjection.qhelp b/csharp/ql/src/Security Features/CWE-078/CommandInjection.qhelp index ce5fec7c571a..af8855095325 100644 --- a/csharp/ql/src/Security Features/CWE-078/CommandInjection.qhelp +++ b/csharp/ql/src/Security Features/CWE-078/CommandInjection.qhelp @@ -33,7 +33,7 @@ without examining it first.

  • OWASP: -Command Injection. +Command Injection.