From 3ab73c8552a3175420e85e9f8759aa0c625f8fed Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Thu, 4 Apr 2024 22:47:28 +0200 Subject: [PATCH 001/118] C++: Improve the cpp/path-injection qhelp --- .../Security/CWE/CWE-022/TaintedPath.qhelp | 56 +++++++++++++------ .../CWE/CWE-022/{ => examples}/TaintedPath.c | 10 ---- .../CWE/CWE-022/examples/TaintedPathFolder.c | 26 +++++++++ .../CWE-022/examples/TaintedPathNormalize.c | 18 ++++++ .../Security/CWE/CWE-022/semmle/tests/test.c | 40 ++++++++++++- 5 files changed, 122 insertions(+), 28 deletions(-) rename cpp/ql/src/Security/CWE/CWE-022/{ => examples}/TaintedPath.c (55%) create mode 100644 cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c create mode 100644 cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c diff --git a/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp b/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp index eba2ede58f5..3b89b4a763e 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp +++ b/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp @@ -3,36 +3,57 @@ "qhelp.dtd"> -

Accessing paths controlled by users can allow an attacker to access unexpected resources. This +

Accessing paths controlled by users can allow an attacker to access unexpected resources. This can result in sensitive information being revealed or deleted, or an attacker being able to influence behavior by modifying unexpected files.

-

Paths that are naively constructed from data controlled by a user may contain unexpected special characters, -such as "..". Such a path may potentially point to any directory on the filesystem.

+

Paths that are naively constructed from data controlled by a user may be absolute paths, or may contain +unexpected special characters such as "..". Such a path could point anywhere on the file system.

-

Validate user input before using it to construct a filepath. Ideally, follow these rules:

+

Validate user input before using it to construct a file path.

-
    -
  • Do not allow more than a single "." character.
  • -
  • Do not allow directory separators such as "/" or "\" (depending on the filesystem).
  • -
  • Do not rely on simply replacing problematic sequences such as "../". For example, after applying this filter to -".../...//" the resulting string would still be "../".
  • -
  • Ideally use a whitelist of known good patterns.
  • -
+

Common validation methods include checking that the normalized path is relative and does not contain +any ".." components, or checking that the path is contained within a safe folder. The method you should use depends +on how the path is used in the application, and whether the path should be a single path component. +

+ +

If the path should be a single path component (such as a file name), you can check for the existence +of any path separators ("/" or "\"), or ".." sequences in the input, and reject the input if any are found. +

+ +

+Note that removing "../" sequences is not sufficient, since the input could still contain a path separator +followed by "..". For example, the input ".../...//" would still result in the string "../" if only "../" sequences +are removed. +

+ +

Finally, the simplest (but most restrictive) option is to use an allow list of safe patterns and make sure that +the user input matches one of these patterns.

-

In this example, a username and file are read from the arguments to main and then used to access a file in the -user's home directory. However, a malicious user could enter a filename which contains special -characters. For example, the string "../../etc/passwd" will result in the code reading the file located at -"/home/[user]/../../etc/passwd", which is the system's password file. This could potentially allow them to -access all the system's passwords.

+

In this example, a file name is read from a user and then used to access a file. +However, a malicious user could enter a file name anywhere on the file system, +such as "/etc/passwd" or "../../../etc/passwd".

- + + +

+If the input should only be a file name, you can check that it doesn't contain any path separators or ".." sequences. +

+ + + +

+If the input should be within a specific directory, you can check that the resolved path +is still contained within that directory. +

+ +
@@ -41,6 +62,7 @@ access all the system's passwords.

OWASP: Path Traversal. +
  • Rails: ActiveStorage::Filename#sanitized.
  • diff --git a/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c similarity index 55% rename from cpp/ql/src/Security/CWE/CWE-022/TaintedPath.c rename to cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c index 63856888ebb..fe0f466713a 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.c +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c @@ -9,14 +9,4 @@ int main(int argc, char** argv) { // BAD: a string from the user is used in a filename fopen(fileName, "wb+"); } - - { - char fileBuffer[FILENAME_MAX] = "/home/"; - char *fileName = fileBuffer; - size_t len = strlen(fileName); - // GOOD: use a fixed file - char* fixed = "jim/file.txt"; - strncat(fileName+len, fixed, FILENAME_MAX-len-1); - fopen(fileName, "wb+"); - } } diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c new file mode 100644 index 00000000000..1461616f5dc --- /dev/null +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c @@ -0,0 +1,26 @@ +#include +#include + +int main(int argc, char** argv) { + char *userAndFile = argv[2]; + char baseDir[PATH_MAX] = "/home/user/public/"; + char fullPath[PATH_MAX]; + char resolvedPath[PATH_MAX]; + + // Attempt to concatenate the base directory and the user-supplied path + snprintf(fullPath, sizeof(fullPath), "%s%s", baseDir, userAndFile); + + // Resolve the absolute path, normalizing any ".." or "." + if (realpath(fullPath, resolvedPath) == NULL) { + perror("Error resolving path"); + return 1; + } + + // Check if the resolved path starts with the base directory + if (strncmp(baseDir, resolvedPath, strlen(baseDir)) != 0) { + return 1; + } + + // GOOD: Path is within the intended directory + FILE *file = fopen(resolvedPath, "wb+"); +} \ No newline at end of file diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c new file mode 100644 index 00000000000..f46e6d30a41 --- /dev/null +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c @@ -0,0 +1,18 @@ +#include +#include + +int main(int argc, char** argv) { + + char *userAndFile = argv[2]; + // Check for invalid sequences in the user input + if (strstr(userAndFile, "..") || strchr(userAndFile, '/') || strchr(userAndFile, '\\')) { + printf("Invalid filename.\n"); + return 1; + } + + char fileBuffer[FILENAME_MAX] = "/home/user/files/"; + // Ensure buffer overflow is prevented + strncat(fileBuffer, userAndFile, FILENAME_MAX - strlen(fileBuffer) - 1); + // GOOD: We know that the filename is safe and stays within the public folder + FILE *file = fopen(fileBuffer, "wb+"); +} \ No newline at end of file diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c index 824db8f16ad..b01107ef090 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c @@ -2,7 +2,7 @@ // Associated with CWE-022: Improper Limitation of a Pathname to a Restricted Directory. http://cwe.mitre.org/data/definitions/22.html #include "stdlib.h" - +#define PATH_MAX 4096 ///// Test code ///// int main(int argc, char** argv) { @@ -56,6 +56,44 @@ int main(int argc, char** argv) { void read(const char *fileName); read(argv[1]); // BAD } + + { + char *userAndFile = argv[2]; + // Check for invalid sequences in the user input + if (strstr(userAndFile, "..") || strchr(userAndFile, '/') || strchr(userAndFile, '\\')) { + // printf("Invalid filename.\n"); + return 1; + } + + char fileBuffer[FILENAME_MAX] = "/home/user/files/"; + // Ensure buffer overflow is prevented + strncat(fileBuffer, userAndFile, FILENAME_MAX - strlen(fileBuffer) - 1); + // GOOD: We know that the filename is safe and stays within the public folder. But we currently get an FP here. + FILE *file = fopen(fileBuffer, "wb+"); + } + + { + char *userAndFile = argv[2]; + char baseDir[PATH_MAX] = "/home/user/public/"; + char fullPath[PATH_MAX]; + char resolvedPath[PATH_MAX]; + + // Attempt to concatenate the base directory and the user-supplied path + snprintf(fullPath, sizeof(fullPath), "%s%s", baseDir, userAndFile); + + // Resolve the absolute path, normalizing any ".." or "." + if (realpath(fullPath, resolvedPath) == 0) { + return 1; + } + + // Check if the resolved path starts with the base directory + if (strncmp(baseDir, resolvedPath, strlen(baseDir)) != 0) { + return 1; + } + + // GOOD: Path is within the intended directory + FILE *file = fopen(resolvedPath, "wb+"); + } } void read(char *fileName) { From 6d3244d01c0598d1c5af2993d9951bfaf08f3727 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 5 Apr 2024 09:36:09 +0200 Subject: [PATCH 002/118] update expected outputs with an FP --- .../Security/CWE/CWE-022/semmle/tests/TaintedPath.expected | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected index 3b34718d954..2d8f0863f40 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected @@ -2,6 +2,7 @@ edges | test.c:8:27:8:30 | **argv | test.c:17:11:17:18 | *fileName | provenance | | | test.c:8:27:8:30 | **argv | test.c:32:11:32:18 | *fileName | provenance | | | test.c:8:27:8:30 | **argv | test.c:57:10:57:16 | *access to array | provenance | | +| test.c:8:27:8:30 | **argv | test.c:72:24:72:33 | *fileBuffer | provenance | | | test.c:37:17:37:24 | scanf output argument | test.c:38:11:38:18 | *fileName | provenance | | | test.c:43:17:43:24 | scanf output argument | test.c:44:11:44:18 | *fileName | provenance | | nodes @@ -13,6 +14,7 @@ nodes | test.c:43:17:43:24 | scanf output argument | semmle.label | scanf output argument | | test.c:44:11:44:18 | *fileName | semmle.label | *fileName | | test.c:57:10:57:16 | *access to array | semmle.label | *access to array | +| test.c:72:24:72:33 | *fileBuffer | semmle.label | *fileBuffer | subpaths #select | test.c:17:11:17:18 | fileName | test.c:8:27:8:30 | **argv | test.c:17:11:17:18 | *fileName | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | @@ -20,3 +22,4 @@ subpaths | test.c:38:11:38:18 | fileName | test.c:37:17:37:24 | scanf output argument | test.c:38:11:38:18 | *fileName | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:37:17:37:24 | scanf output argument | user input (value read by scanf) | | test.c:44:11:44:18 | fileName | test.c:43:17:43:24 | scanf output argument | test.c:44:11:44:18 | *fileName | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:43:17:43:24 | scanf output argument | user input (value read by scanf) | | test.c:57:10:57:16 | access to array | test.c:8:27:8:30 | **argv | test.c:57:10:57:16 | *access to array | This argument to a file access function is derived from $@ and then passed to read(fileName), which calls fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | +| test.c:72:24:72:33 | fileBuffer | test.c:8:27:8:30 | **argv | test.c:72:24:72:33 | *fileBuffer | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | From 393f6b76664ee13517cd9c9cee918867f3432d1b Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 24 Apr 2024 17:04:57 +0200 Subject: [PATCH 003/118] Go: add gazelle-generated `BUILD` files --- .pre-commit-config.yaml | 7 +++++ MODULE.bazel | 7 +++++ go/extractor/.gitattributes | 1 + go/extractor/BUILD.bazel | 23 ++++++++++++++++ go/extractor/autobuilder/BUILD.bazel | 24 +++++++++++++++++ go/extractor/cli/go-autobuilder/BUILD.bazel | 22 +++++++++++++++ go/extractor/cli/go-bootstrap/BUILD.bazel | 14 ++++++++++ go/extractor/cli/go-build-runner/BUILD.bazel | 18 +++++++++++++ go/extractor/cli/go-extractor/BUILD.bazel | 18 +++++++++++++ go/extractor/cli/go-gen-dbscheme/BUILD.bazel | 15 +++++++++++ go/extractor/cli/go-tokenizer/BUILD.bazel | 14 ++++++++++ go/extractor/dbscheme/BUILD.bazel | 15 +++++++++++ go/extractor/diagnostics/BUILD.bazel | 8 ++++++ go/extractor/project/BUILD.bazel | 21 +++++++++++++++ go/extractor/srcarchive/BUILD.bazel | 17 ++++++++++++ go/extractor/toolchain/BUILD.bazel | 18 +++++++++++++ go/extractor/trap/BUILD.bazel | 23 ++++++++++++++++ go/extractor/util/BUILD.bazel | 14 ++++++++++ .../x/mod/internal/lazyregexp/BUILD.bazel | 9 +++++++ .../golang.org/x/mod/modfile/BUILD.bazel | 19 +++++++++++++ .../golang.org/x/mod/module/BUILD.bazel | 16 +++++++++++ .../golang.org/x/mod/semver/BUILD.bazel | 9 +++++++ .../x/tools/go/gcexportdata/BUILD.bazel | 13 +++++++++ .../go/internal/packagesdriver/BUILD.bazel | 10 +++++++ .../x/tools/go/packages/BUILD.bazel | 25 +++++++++++++++++ .../x/tools/go/types/objectpath/BUILD.bazel | 10 +++++++ .../x/tools/internal/event/BUILD.bazel | 17 ++++++++++++ .../x/tools/internal/event/core/BUILD.bazel | 17 ++++++++++++ .../x/tools/internal/event/keys/BUILD.bazel | 14 ++++++++++ .../x/tools/internal/event/label/BUILD.bazel | 9 +++++++ .../x/tools/internal/event/tag/BUILD.bazel | 10 +++++++ .../x/tools/internal/gcimporter/BUILD.bazel | 27 +++++++++++++++++++ .../x/tools/internal/gocommand/BUILD.bazel | 20 ++++++++++++++ .../internal/packagesinternal/BUILD.bazel | 9 +++++++ .../x/tools/internal/pkgbits/BUILD.bazel | 21 +++++++++++++++ .../tools/internal/tokeninternal/BUILD.bazel | 9 +++++++ .../x/tools/internal/typeparams/BUILD.bazel | 15 +++++++++++ .../tools/internal/typesinternal/BUILD.bazel | 14 ++++++++++ .../x/tools/internal/versions/BUILD.bazel | 15 +++++++++++ go/gazelle/BUILD.bazel | 8 ++++++ go/rules.bzl | 0 41 files changed, 595 insertions(+) create mode 100644 go/extractor/.gitattributes create mode 100644 go/extractor/BUILD.bazel create mode 100644 go/extractor/autobuilder/BUILD.bazel create mode 100644 go/extractor/cli/go-autobuilder/BUILD.bazel create mode 100644 go/extractor/cli/go-bootstrap/BUILD.bazel create mode 100644 go/extractor/cli/go-build-runner/BUILD.bazel create mode 100644 go/extractor/cli/go-extractor/BUILD.bazel create mode 100644 go/extractor/cli/go-gen-dbscheme/BUILD.bazel create mode 100644 go/extractor/cli/go-tokenizer/BUILD.bazel create mode 100644 go/extractor/dbscheme/BUILD.bazel create mode 100644 go/extractor/diagnostics/BUILD.bazel create mode 100644 go/extractor/project/BUILD.bazel create mode 100644 go/extractor/srcarchive/BUILD.bazel create mode 100644 go/extractor/toolchain/BUILD.bazel create mode 100644 go/extractor/trap/BUILD.bazel create mode 100644 go/extractor/util/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel create mode 100644 go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel create mode 100644 go/gazelle/BUILD.bazel create mode 100644 go/rules.bzl diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 383bc110383..4e81bcc7711 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,6 +27,13 @@ repos: - repo: local hooks: + - id: gazelle + name: Check gazelle-generated BUILD files + files: go/extractor/.* + language: system + entry: bazel run //go/gazelle + pass_filenames: false + - id: codeql-format name: Fix QL file formatting files: \.qll?$ diff --git a/MODULE.bazel b/MODULE.bazel index 4e1fe0d9f7c..2dc9dd0a7bb 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,6 +14,7 @@ local_path_override( # see https://registry.bazel.build/ for a list of available packages bazel_dep(name = "platforms", version = "0.0.8") +bazel_dep(name = "rules_go", version = "0.47.0") bazel_dep(name = "rules_pkg", version = "0.10.1") bazel_dep(name = "rules_nodejs", version = "6.0.3") bazel_dep(name = "rules_python", version = "0.31.0") @@ -22,6 +23,8 @@ bazel_dep(name = "abseil-cpp", version = "20240116.0", repo_name = "absl") bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json") bazel_dep(name = "fmt", version = "10.0.0") +bazel_dep(name = "gazelle", version = "0.36.0", dev_dependency = True) + pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") pip.parse( hub_name = "codegen_deps", @@ -50,6 +53,10 @@ node.toolchain( ) use_repo(node, "nodejs", "nodejs_toolchains") +go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk.download(version = "1.22.2") +go_sdk.host() + register_toolchains( "@nodejs_toolchains//:all", ) diff --git a/go/extractor/.gitattributes b/go/extractor/.gitattributes new file mode 100644 index 00000000000..e406d413677 --- /dev/null +++ b/go/extractor/.gitattributes @@ -0,0 +1 @@ +/*/**/BUILD.bazel linguist-generated=true diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel new file mode 100644 index 00000000000..ea99340e7d7 --- /dev/null +++ b/go/extractor/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library") + +# gazelle:prefix github.com/github/codeql-go/extractor + +go_library( + name = "extractor", + srcs = [ + "extractor.go", + "gomodextractor.go", + "semaphore.go", + ], + importpath = "github.com/github/codeql-go/extractor", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/dbscheme", + "//go/extractor/diagnostics", + "//go/extractor/srcarchive", + "//go/extractor/trap", + "//go/extractor/util", + "//go/extractor/vendor/golang.org/x/mod/modfile", + "//go/extractor/vendor/golang.org/x/tools/go/packages", + ], +) diff --git a/go/extractor/autobuilder/BUILD.bazel b/go/extractor/autobuilder/BUILD.bazel new file mode 100644 index 00000000000..b81b15816aa --- /dev/null +++ b/go/extractor/autobuilder/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "autobuilder", + srcs = [ + "autobuilder.go", + "build-environment.go", + ], + importpath = "github.com/github/codeql-go/extractor/autobuilder", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/diagnostics", + "//go/extractor/project", + "//go/extractor/toolchain", + "//go/extractor/util", + "//go/extractor/vendor/golang.org/x/mod/semver", + ], +) + +go_test( + name = "autobuilder_test", + srcs = ["build-environment_test.go"], + embed = [":autobuilder"], +) diff --git a/go/extractor/cli/go-autobuilder/BUILD.bazel b/go/extractor/cli/go-autobuilder/BUILD.bazel new file mode 100644 index 00000000000..b53227b9f1b --- /dev/null +++ b/go/extractor/cli/go-autobuilder/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "go-autobuilder_lib", + srcs = ["go-autobuilder.go"], + importpath = "github.com/github/codeql-go/extractor/cli/go-autobuilder", + visibility = ["//visibility:private"], + deps = [ + "//go/extractor/autobuilder", + "//go/extractor/diagnostics", + "//go/extractor/project", + "//go/extractor/toolchain", + "//go/extractor/util", + "//go/extractor/vendor/golang.org/x/mod/semver", + ], +) + +go_binary( + name = "go-autobuilder", + embed = [":go-autobuilder_lib"], + visibility = ["//visibility:public"], +) diff --git a/go/extractor/cli/go-bootstrap/BUILD.bazel b/go/extractor/cli/go-bootstrap/BUILD.bazel new file mode 100644 index 00000000000..15255227f9a --- /dev/null +++ b/go/extractor/cli/go-bootstrap/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "go-bootstrap_lib", + srcs = ["go-bootstrap.go"], + importpath = "github.com/github/codeql-go/extractor/cli/go-bootstrap", + visibility = ["//visibility:private"], +) + +go_binary( + name = "go-bootstrap", + embed = [":go-bootstrap_lib"], + visibility = ["//visibility:public"], +) diff --git a/go/extractor/cli/go-build-runner/BUILD.bazel b/go/extractor/cli/go-build-runner/BUILD.bazel new file mode 100644 index 00000000000..fc407c3e172 --- /dev/null +++ b/go/extractor/cli/go-build-runner/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "go-build-runner_lib", + srcs = ["go-build-runner.go"], + importpath = "github.com/github/codeql-go/extractor/cli/go-build-runner", + visibility = ["//visibility:private"], + deps = [ + "//go/extractor/autobuilder", + "//go/extractor/util", + ], +) + +go_binary( + name = "go-build-runner", + embed = [":go-build-runner_lib"], + visibility = ["//visibility:public"], +) diff --git a/go/extractor/cli/go-extractor/BUILD.bazel b/go/extractor/cli/go-extractor/BUILD.bazel new file mode 100644 index 00000000000..9419c6f8ba9 --- /dev/null +++ b/go/extractor/cli/go-extractor/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "go-extractor_lib", + srcs = ["go-extractor.go"], + importpath = "github.com/github/codeql-go/extractor/cli/go-extractor", + visibility = ["//visibility:private"], + deps = [ + "//go/extractor", + "//go/extractor/diagnostics", + ], +) + +go_binary( + name = "go-extractor", + embed = [":go-extractor_lib"], + visibility = ["//visibility:public"], +) diff --git a/go/extractor/cli/go-gen-dbscheme/BUILD.bazel b/go/extractor/cli/go-gen-dbscheme/BUILD.bazel new file mode 100644 index 00000000000..1fbd75998c2 --- /dev/null +++ b/go/extractor/cli/go-gen-dbscheme/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "go-gen-dbscheme_lib", + srcs = ["go-gen-dbscheme.go"], + importpath = "github.com/github/codeql-go/extractor/cli/go-gen-dbscheme", + visibility = ["//visibility:private"], + deps = ["//go/extractor/dbscheme"], +) + +go_binary( + name = "go-gen-dbscheme", + embed = [":go-gen-dbscheme_lib"], + visibility = ["//visibility:public"], +) diff --git a/go/extractor/cli/go-tokenizer/BUILD.bazel b/go/extractor/cli/go-tokenizer/BUILD.bazel new file mode 100644 index 00000000000..f55baecc69f --- /dev/null +++ b/go/extractor/cli/go-tokenizer/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "go-tokenizer_lib", + srcs = ["go-tokenizer.go"], + importpath = "github.com/github/codeql-go/extractor/cli/go-tokenizer", + visibility = ["//visibility:private"], +) + +go_binary( + name = "go-tokenizer", + embed = [":go-tokenizer_lib"], + visibility = ["//visibility:public"], +) diff --git a/go/extractor/dbscheme/BUILD.bazel b/go/extractor/dbscheme/BUILD.bazel new file mode 100644 index 00000000000..efaf51684d7 --- /dev/null +++ b/go/extractor/dbscheme/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "dbscheme", + srcs = [ + "dbscheme.go", + "tables.go", + ], + importpath = "github.com/github/codeql-go/extractor/dbscheme", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/trap", + "//go/extractor/vendor/golang.org/x/tools/go/packages", + ], +) diff --git a/go/extractor/diagnostics/BUILD.bazel b/go/extractor/diagnostics/BUILD.bazel new file mode 100644 index 00000000000..8b218dc1317 --- /dev/null +++ b/go/extractor/diagnostics/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "diagnostics", + srcs = ["diagnostics.go"], + importpath = "github.com/github/codeql-go/extractor/diagnostics", + visibility = ["//visibility:public"], +) diff --git a/go/extractor/project/BUILD.bazel b/go/extractor/project/BUILD.bazel new file mode 100644 index 00000000000..dd49b3b320f --- /dev/null +++ b/go/extractor/project/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "project", + srcs = ["project.go"], + importpath = "github.com/github/codeql-go/extractor/project", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/diagnostics", + "//go/extractor/toolchain", + "//go/extractor/util", + "//go/extractor/vendor/golang.org/x/mod/modfile", + "//go/extractor/vendor/golang.org/x/mod/semver", + ], +) + +go_test( + name = "project_test", + srcs = ["project_test.go"], + embed = [":project"], +) diff --git a/go/extractor/srcarchive/BUILD.bazel b/go/extractor/srcarchive/BUILD.bazel new file mode 100644 index 00000000000..90664c90190 --- /dev/null +++ b/go/extractor/srcarchive/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "srcarchive", + srcs = [ + "projectlayout.go", + "srcarchive.go", + ], + importpath = "github.com/github/codeql-go/extractor/srcarchive", + visibility = ["//visibility:public"], +) + +go_test( + name = "srcarchive_test", + srcs = ["projectlayout_test.go"], + embed = [":srcarchive"], +) diff --git a/go/extractor/toolchain/BUILD.bazel b/go/extractor/toolchain/BUILD.bazel new file mode 100644 index 00000000000..d1ce09c2632 --- /dev/null +++ b/go/extractor/toolchain/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "toolchain", + srcs = ["toolchain.go"], + importpath = "github.com/github/codeql-go/extractor/toolchain", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/util", + "//go/extractor/vendor/golang.org/x/mod/semver", + ], +) + +go_test( + name = "toolchain_test", + srcs = ["toolchain_test.go"], + embed = [":toolchain"], +) diff --git a/go/extractor/trap/BUILD.bazel b/go/extractor/trap/BUILD.bazel new file mode 100644 index 00000000000..6c3f67b3247 --- /dev/null +++ b/go/extractor/trap/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "trap", + srcs = [ + "labels.go", + "trapwriter.go", + "util.go", + ], + importpath = "github.com/github/codeql-go/extractor/trap", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/srcarchive", + "//go/extractor/util", + "//go/extractor/vendor/golang.org/x/tools/go/packages", + ], +) + +go_test( + name = "trap_test", + srcs = ["trapwriter_test.go"], + embed = [":trap"], +) diff --git a/go/extractor/util/BUILD.bazel b/go/extractor/util/BUILD.bazel new file mode 100644 index 00000000000..787a627b5bc --- /dev/null +++ b/go/extractor/util/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "util", + srcs = ["util.go"], + importpath = "github.com/github/codeql-go/extractor/util", + visibility = ["//visibility:public"], +) + +go_test( + name = "util_test", + srcs = ["util_test.go"], + embed = [":util"], +) diff --git a/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel new file mode 100644 index 00000000000..33c06c34bec --- /dev/null +++ b/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "lazyregexp", + srcs = ["lazyre.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/mod/internal/lazyregexp", + importpath = "golang.org/x/mod/internal/lazyregexp", + visibility = ["//go/extractor/vendor/golang.org/x/mod:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel new file mode 100644 index 00000000000..7b5a78d785c --- /dev/null +++ b/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "modfile", + srcs = [ + "print.go", + "read.go", + "rule.go", + "work.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/mod/modfile", + importpath = "golang.org/x/mod/modfile", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/vendor/golang.org/x/mod/internal/lazyregexp", + "//go/extractor/vendor/golang.org/x/mod/module", + "//go/extractor/vendor/golang.org/x/mod/semver", + ], +) diff --git a/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel new file mode 100644 index 00000000000..46ff4dbb7d1 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "module", + srcs = [ + "module.go", + "pseudo.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/mod/module", + importpath = "golang.org/x/mod/module", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/vendor/golang.org/x/mod/internal/lazyregexp", + "//go/extractor/vendor/golang.org/x/mod/semver", + ], +) diff --git a/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel new file mode 100644 index 00000000000..5b54efe1981 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "semver", + srcs = ["semver.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/mod/semver", + importpath = "golang.org/x/mod/semver", + visibility = ["//visibility:public"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel new file mode 100644 index 00000000000..57f503f1cb2 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "gcexportdata", + srcs = [ + "gcexportdata.go", + "importer.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/go/gcexportdata", + importpath = "golang.org/x/tools/go/gcexportdata", + visibility = ["//visibility:public"], + deps = ["//go/extractor/vendor/golang.org/x/tools/internal/gcimporter"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel new file mode 100644 index 00000000000..962442de1e0 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel @@ -0,0 +1,10 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "packagesdriver", + srcs = ["sizes.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver", + importpath = "golang.org/x/tools/go/internal/packagesdriver", + visibility = ["//go/extractor/vendor/golang.org/x/tools/go:__subpackages__"], + deps = ["//go/extractor/vendor/golang.org/x/tools/internal/gocommand"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel new file mode 100644 index 00000000000..1cad8baca98 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel @@ -0,0 +1,25 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "packages", + srcs = [ + "doc.go", + "external.go", + "golist.go", + "golist_overlay.go", + "loadmode_string.go", + "packages.go", + "visit.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/go/packages", + importpath = "golang.org/x/tools/go/packages", + visibility = ["//visibility:public"], + deps = [ + "//go/extractor/vendor/golang.org/x/tools/go/gcexportdata", + "//go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver", + "//go/extractor/vendor/golang.org/x/tools/internal/gocommand", + "//go/extractor/vendor/golang.org/x/tools/internal/packagesinternal", + "//go/extractor/vendor/golang.org/x/tools/internal/typesinternal", + "//go/extractor/vendor/golang.org/x/tools/internal/versions", + ], +) diff --git a/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel new file mode 100644 index 00000000000..1029221f434 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel @@ -0,0 +1,10 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "objectpath", + srcs = ["objectpath.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/go/types/objectpath", + importpath = "golang.org/x/tools/go/types/objectpath", + visibility = ["//visibility:public"], + deps = ["//go/extractor/vendor/golang.org/x/tools/internal/typeparams"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel new file mode 100644 index 00000000000..b882fef0d8c --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "event", + srcs = [ + "doc.go", + "event.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/event", + importpath = "golang.org/x/tools/internal/event", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], + deps = [ + "//go/extractor/vendor/golang.org/x/tools/internal/event/core", + "//go/extractor/vendor/golang.org/x/tools/internal/event/keys", + "//go/extractor/vendor/golang.org/x/tools/internal/event/label", + ], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel new file mode 100644 index 00000000000..36bd68eed9f --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "core", + srcs = [ + "event.go", + "export.go", + "fast.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/event/core", + importpath = "golang.org/x/tools/internal/event/core", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], + deps = [ + "//go/extractor/vendor/golang.org/x/tools/internal/event/keys", + "//go/extractor/vendor/golang.org/x/tools/internal/event/label", + ], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel new file mode 100644 index 00000000000..f1674735052 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "keys", + srcs = [ + "keys.go", + "standard.go", + "util.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/event/keys", + importpath = "golang.org/x/tools/internal/event/keys", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], + deps = ["//go/extractor/vendor/golang.org/x/tools/internal/event/label"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel new file mode 100644 index 00000000000..2329754d6cf --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "label", + srcs = ["label.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/event/label", + importpath = "golang.org/x/tools/internal/event/label", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel new file mode 100644 index 00000000000..276dc5f4489 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel @@ -0,0 +1,10 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "tag", + srcs = ["tag.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/event/tag", + importpath = "golang.org/x/tools/internal/event/tag", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], + deps = ["//go/extractor/vendor/golang.org/x/tools/internal/event/keys"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel new file mode 100644 index 00000000000..1879fe0dadf --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "gcimporter", + srcs = [ + "bimport.go", + "exportdata.go", + "gcimporter.go", + "iexport.go", + "iimport.go", + "newInterface10.go", + "newInterface11.go", + "support_go117.go", + "support_go118.go", + "unified_no.go", + "ureader_no.go", + "ureader_yes.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/gcimporter", + importpath = "golang.org/x/tools/internal/gcimporter", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], + deps = [ + "//go/extractor/vendor/golang.org/x/tools/go/types/objectpath", + "//go/extractor/vendor/golang.org/x/tools/internal/pkgbits", + "//go/extractor/vendor/golang.org/x/tools/internal/tokeninternal", + ], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel new file mode 100644 index 00000000000..58f7091b49c --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "gocommand", + srcs = [ + "invoke.go", + "vendor.go", + "version.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/gocommand", + importpath = "golang.org/x/tools/internal/gocommand", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], + deps = [ + "//go/extractor/vendor/golang.org/x/mod/semver", + "//go/extractor/vendor/golang.org/x/tools/internal/event", + "//go/extractor/vendor/golang.org/x/tools/internal/event/keys", + "//go/extractor/vendor/golang.org/x/tools/internal/event/label", + "//go/extractor/vendor/golang.org/x/tools/internal/event/tag", + ], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel new file mode 100644 index 00000000000..3ed918c9489 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "packagesinternal", + srcs = ["packages.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/packagesinternal", + importpath = "golang.org/x/tools/internal/packagesinternal", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel new file mode 100644 index 00000000000..820e8f04c9b --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "pkgbits", + srcs = [ + "codes.go", + "decoder.go", + "doc.go", + "encoder.go", + "flags.go", + "frames_go1.go", + "frames_go17.go", + "reloc.go", + "support.go", + "sync.go", + "syncmarker_string.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/pkgbits", + importpath = "golang.org/x/tools/internal/pkgbits", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel new file mode 100644 index 00000000000..ff66085dbdb --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "tokeninternal", + srcs = ["tokeninternal.go"], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/tokeninternal", + importpath = "golang.org/x/tools/internal/tokeninternal", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel new file mode 100644 index 00000000000..266816d9ea2 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "typeparams", + srcs = [ + "common.go", + "coretype.go", + "normalize.go", + "termlist.go", + "typeterm.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/typeparams", + importpath = "golang.org/x/tools/internal/typeparams", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel new file mode 100644 index 00000000000..c03b8a36ef7 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "typesinternal", + srcs = [ + "errorcode.go", + "errorcode_string.go", + "types.go", + "types_118.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/typesinternal", + importpath = "golang.org/x/tools/internal/typesinternal", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel new file mode 100644 index 00000000000..6d7ffd0ac68 --- /dev/null +++ b/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "versions", + srcs = [ + "gover.go", + "types.go", + "types_go121.go", + "types_go122.go", + "versions.go", + ], + importmap = "github.com/github/codeql-go/extractor/vendor/golang.org/x/tools/internal/versions", + importpath = "golang.org/x/tools/internal/versions", + visibility = ["//go/extractor/vendor/golang.org/x/tools:__subpackages__"], +) diff --git a/go/gazelle/BUILD.bazel b/go/gazelle/BUILD.bazel new file mode 100644 index 00000000000..7c9b34edb3a --- /dev/null +++ b/go/gazelle/BUILD.bazel @@ -0,0 +1,8 @@ +load("@gazelle//:def.bzl", "gazelle") + +gazelle( + name = "gazelle", + extra_args = [ + "go/extractor", + ], +) diff --git a/go/rules.bzl b/go/rules.bzl new file mode 100644 index 00000000000..e69de29bb2d From 4ca8faa9c944faa1005046c2c5cef3f6d68131b3 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 25 Apr 2024 09:14:59 +0200 Subject: [PATCH 004/118] Go: introduce universal binaries on macOS --- MODULE.bazel | 3 ++- go/BUILD.bazel | 0 go/extractor/BUILD.bazel | 1 + go/extractor/cli/go-autobuilder/BUILD.bazel | 5 ++-- go/extractor/cli/go-bootstrap/BUILD.bazel | 5 ++-- go/extractor/cli/go-build-runner/BUILD.bazel | 5 ++-- go/extractor/cli/go-extractor/BUILD.bazel | 5 ++-- go/extractor/cli/go-gen-dbscheme/BUILD.bazel | 5 ++-- go/extractor/cli/go-tokenizer/BUILD.bazel | 5 ++-- go/rules.bzl | 5 ++++ misc/bazel/universal_binary.bzl | 24 ++++++++++++++++++++ 11 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 go/BUILD.bazel create mode 100644 misc/bazel/universal_binary.bzl diff --git a/MODULE.bazel b/MODULE.bazel index 2dc9dd0a7bb..7a85ab51a96 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,7 +13,8 @@ local_path_override( # see https://registry.bazel.build/ for a list of available packages -bazel_dep(name = "platforms", version = "0.0.8") +bazel_dep(name = "apple_support", version = "1.15.1") +bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "rules_go", version = "0.47.0") bazel_dep(name = "rules_pkg", version = "0.10.1") bazel_dep(name = "rules_nodejs", version = "6.0.3") diff --git a/go/BUILD.bazel b/go/BUILD.bazel new file mode 100644 index 00000000000..e69de29bb2d diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index ea99340e7d7..040b4227314 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -1,6 +1,7 @@ load("@rules_go//go:def.bzl", "go_library") # gazelle:prefix github.com/github/codeql-go/extractor +# gazelle:map_kind go_binary codeql_go_binary //go:rules.bzl go_library( name = "extractor", diff --git a/go/extractor/cli/go-autobuilder/BUILD.bazel b/go/extractor/cli/go-autobuilder/BUILD.bazel index b53227b9f1b..bf1235b33aa 100644 --- a/go/extractor/cli/go-autobuilder/BUILD.bazel +++ b/go/extractor/cli/go-autobuilder/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_library") +load("//go:rules.bzl", "codeql_go_binary") go_library( name = "go-autobuilder_lib", @@ -15,7 +16,7 @@ go_library( ], ) -go_binary( +codeql_go_binary( name = "go-autobuilder", embed = [":go-autobuilder_lib"], visibility = ["//visibility:public"], diff --git a/go/extractor/cli/go-bootstrap/BUILD.bazel b/go/extractor/cli/go-bootstrap/BUILD.bazel index 15255227f9a..7bdd6d6e70f 100644 --- a/go/extractor/cli/go-bootstrap/BUILD.bazel +++ b/go/extractor/cli/go-bootstrap/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_library") +load("//go:rules.bzl", "codeql_go_binary") go_library( name = "go-bootstrap_lib", @@ -7,7 +8,7 @@ go_library( visibility = ["//visibility:private"], ) -go_binary( +codeql_go_binary( name = "go-bootstrap", embed = [":go-bootstrap_lib"], visibility = ["//visibility:public"], diff --git a/go/extractor/cli/go-build-runner/BUILD.bazel b/go/extractor/cli/go-build-runner/BUILD.bazel index fc407c3e172..15557d751cf 100644 --- a/go/extractor/cli/go-build-runner/BUILD.bazel +++ b/go/extractor/cli/go-build-runner/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_library") +load("//go:rules.bzl", "codeql_go_binary") go_library( name = "go-build-runner_lib", @@ -11,7 +12,7 @@ go_library( ], ) -go_binary( +codeql_go_binary( name = "go-build-runner", embed = [":go-build-runner_lib"], visibility = ["//visibility:public"], diff --git a/go/extractor/cli/go-extractor/BUILD.bazel b/go/extractor/cli/go-extractor/BUILD.bazel index 9419c6f8ba9..be426331868 100644 --- a/go/extractor/cli/go-extractor/BUILD.bazel +++ b/go/extractor/cli/go-extractor/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_library") +load("//go:rules.bzl", "codeql_go_binary") go_library( name = "go-extractor_lib", @@ -11,7 +12,7 @@ go_library( ], ) -go_binary( +codeql_go_binary( name = "go-extractor", embed = [":go-extractor_lib"], visibility = ["//visibility:public"], diff --git a/go/extractor/cli/go-gen-dbscheme/BUILD.bazel b/go/extractor/cli/go-gen-dbscheme/BUILD.bazel index 1fbd75998c2..06c0d0f61f1 100644 --- a/go/extractor/cli/go-gen-dbscheme/BUILD.bazel +++ b/go/extractor/cli/go-gen-dbscheme/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_library") +load("//go:rules.bzl", "codeql_go_binary") go_library( name = "go-gen-dbscheme_lib", @@ -8,7 +9,7 @@ go_library( deps = ["//go/extractor/dbscheme"], ) -go_binary( +codeql_go_binary( name = "go-gen-dbscheme", embed = [":go-gen-dbscheme_lib"], visibility = ["//visibility:public"], diff --git a/go/extractor/cli/go-tokenizer/BUILD.bazel b/go/extractor/cli/go-tokenizer/BUILD.bazel index f55baecc69f..3fc5b464c7c 100644 --- a/go/extractor/cli/go-tokenizer/BUILD.bazel +++ b/go/extractor/cli/go-tokenizer/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_library") +load("//go:rules.bzl", "codeql_go_binary") go_library( name = "go-tokenizer_lib", @@ -7,7 +8,7 @@ go_library( visibility = ["//visibility:private"], ) -go_binary( +codeql_go_binary( name = "go-tokenizer", embed = [":go-tokenizer_lib"], visibility = ["//visibility:public"], diff --git a/go/rules.bzl b/go/rules.bzl index e69de29bb2d..4ef798001d2 100644 --- a/go/rules.bzl +++ b/go/rules.bzl @@ -0,0 +1,5 @@ +load("@rules_go//go:def.bzl", "go_binary") +load("//misc/bazel:universal_binary.bzl", "wrap_as_universal_binary") + +def codeql_go_binary(**kwargs): + wrap_as_universal_binary(go_binary, **kwargs) diff --git a/misc/bazel/universal_binary.bzl b/misc/bazel/universal_binary.bzl new file mode 100644 index 00000000000..85881356d0e --- /dev/null +++ b/misc/bazel/universal_binary.bzl @@ -0,0 +1,24 @@ +load("@apple_support//rules:universal_binary.bzl", _universal_binary = "universal_binary") + +def wrap_as_universal_binary(rule, *, name, visibility = None, **kwargs): + internal_name = "internal/%s" % name + universal_name = "universal/%s" % name + rule( + name = internal_name, + visibility = ["//visibility:private"], + **kwargs + ) + _universal_binary( + name = universal_name, + target_compatible_with = ["@platforms//os:macos"], + binary = internal_name, + visibility = ["//visibility:private"], + ) + native.alias( + name = name, + actual = select({ + "@platforms//os:macos": universal_name, + "//conditions:default": internal_name, + }), + visibility = visibility, + ) From 8cba276b87e17fa3bfbbef3522dd9e863eaa7487 Mon Sep 17 00:00:00 2001 From: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Date: Thu, 25 Apr 2024 07:59:33 +0000 Subject: [PATCH 005/118] Deprecate the CodeQL for VS Code docs in favour of docs.github.com version --- CONTRIBUTING.md | 4 +++- README.md | 2 +- .../about-codeql-for-visual-studio-code.rst | 2 ++ .../about-telemetry-in-codeql-for-visual-studio-code.rst | 2 ++ .../analyzing-your-projects.rst | 2 ++ .../codeql-for-visual-studio-code/customizing-settings.rst | 2 ++ .../exploring-data-flow-with-path-queries.rst | 2 ++ .../exploring-the-structure-of-your-source-code.rst | 2 ++ docs/codeql/codeql-for-visual-studio-code/index.rst | 2 ++ .../running-codeql-queries-at-scale-with-mrva.rst | 2 ++ .../setting-up-codeql-in-visual-studio-code.rst | 2 ++ .../testing-codeql-queries-in-visual-studio-code.rst | 2 ++ .../troubleshooting-codeql-for-visual-studio-code.rst | 2 ++ .../troubleshooting-variant-analysis.rst | 2 ++ .../using-the-codeql-model-editor.rst | 2 ++ .../working-with-codeql-packs-in-visual-studio-code.rst | 2 ++ .../codeql-language-guides/codeql-library-for-ruby.rst | 2 +- docs/codeql/codeql-overview/about-codeql.rst | 4 ++-- .../codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst | 2 +- docs/codeql/codeql-overview/codeql-tools.rst | 4 ++-- docs/codeql/ql-training/cpp/bad-overflow-guard.rst | 2 +- docs/codeql/ql-training/cpp/control-flow-cpp.rst | 2 +- docs/codeql/ql-training/cpp/data-flow-cpp.rst | 2 +- docs/codeql/ql-training/cpp/global-data-flow-cpp.rst | 2 +- docs/codeql/ql-training/cpp/intro-ql-cpp.rst | 2 +- docs/codeql/ql-training/cpp/snprintf.rst | 2 +- docs/codeql/ql-training/java/apache-struts-java.rst | 2 +- docs/codeql/ql-training/java/data-flow-java.rst | 2 +- docs/codeql/ql-training/java/global-data-flow-java.rst | 2 +- docs/codeql/ql-training/java/intro-ql-java.rst | 2 +- docs/codeql/ql-training/java/query-injection-java.rst | 2 +- docs/codeql/ql-training/template.rst | 2 +- docs/codeql/reusables/deprecation-note.rst | 6 ++++++ .../codeql/writing-codeql-queries/creating-path-queries.rst | 4 ++-- .../defining-the-results-of-a-query.rst | 2 +- docs/codeql/writing-codeql-queries/introduction-to-ql.rst | 4 ++-- .../writing-codeql-queries/metadata-for-codeql-queries.rst | 2 +- docs/ql-style-guide.md | 2 +- docs/supported-queries.md | 2 +- go/CONTRIBUTING.md | 2 +- go/ql/docs/experimental.md | 2 +- python/ql/src/CHANGELOG.md | 2 +- python/ql/src/change-notes/released/0.0.9.md | 2 +- 43 files changed, 68 insertions(+), 32 deletions(-) create mode 100644 docs/codeql/reusables/deprecation-note.rst diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5324ac8f301..a0efca6dec9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ We welcome contributions to our CodeQL libraries and queries. Got an idea for a There is lots of useful documentation to help you write queries, ranging from information about query file structure to tutorials for specific target languages. For more information on the documentation available, see [CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/codeql-queries) on [codeql.github.com](https://codeql.github.com). +Note that the CodeQL for Visual Studio Code documentation has been migrated to https://docs.github.com/en/code-security/codeql-for-vs-code/, but you can still contribute to it via a different repository. For more information, see [Contributing to GitHub Docs documentation](https://docs.github.com/en/contributing)." + ## Change notes Any nontrivial user-visible change to a query pack or library pack should have a change note. For details on how to add a change note for your change, see [this guide](docs/change-notes.md). @@ -43,7 +45,7 @@ If you have an idea for a query that you would like to share with other CodeQL u 3. **Formatting** - - The queries and libraries must be autoformatted, for example using the "Format Document" command in [CodeQL for Visual Studio Code](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code). + - The queries and libraries must be autoformatted, for example using the "Format Document" command in [CodeQL for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/). If you prefer, you can either: 1. install the [pre-commit framework](https://pre-commit.com/) and install the configured hooks on this repo via `pre-commit install`, or diff --git a/README.md b/README.md index 57ecf54486c..42382b1d834 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This open source repository contains the standard CodeQL libraries and queries t ## How do I learn CodeQL and run queries? -There is [extensive documentation](https://codeql.github.com/docs/) on getting started with writing CodeQL using the [CodeQL extension for Visual Studio Code](https://codeql.github.com/docs/codeql-for-visual-studio-code/) and the [CodeQL CLI](https://codeql.github.com/docs/codeql-cli/). +There is [extensive documentation](https://codeql.github.com/docs/) on getting started with writing CodeQL using the [CodeQL extension for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/) and the [CodeQL CLI](https://codeql.github.com/docs/codeql-cli/). ## Contributing diff --git a/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst index 72e2756ea5c..f0dfbe29017 100644 --- a/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst @@ -5,6 +5,8 @@ About CodeQL for Visual Studio Code ================================================= +.. include:: ../reusables/deprecation-note.rst + CodeQL for Visual Studio Code is an extension that lets you write, run, and test CodeQL queries in Visual Studio Code. Features diff --git a/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst index f3258e013f7..832e6d4e856 100644 --- a/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst @@ -5,6 +5,8 @@ About telemetry in CodeQL for Visual Studio Code ================================================= +.. include:: ../reusables/deprecation-note.rst + If you specifically opt in to permit GitHub to do so, GitHub will collect usage data and metrics for the purposes of helping the core developers to improve the CodeQL extension for VS Code. This data will not be shared with any parties outside of GitHub. IP addresses and installation IDs will be retained for a maximum of 30 days. Anonymous data will be retained for a maximum of 180 days. diff --git a/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst b/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst index 62d48c6fbd8..dea8007c460 100644 --- a/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst +++ b/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst @@ -5,6 +5,8 @@ Analyzing your projects ================================================= +.. include:: ../reusables/deprecation-note.rst + You can run queries on CodeQL databases and view the results in Visual Studio Code. This article explains how to get a CodeQL database and analyze it on your local machine. For information on running analysis at scale across many CodeQL databases, see ":ref:`Running CodeQL queries at scale with multi-repository variant analysis `." Choosing a database diff --git a/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst b/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst index 88ad273a3d6..737024861a6 100644 --- a/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst +++ b/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst @@ -5,6 +5,8 @@ Customizing settings ==================== +.. include:: ../reusables/deprecation-note.rst + You can edit the settings for the CodeQL extension to suit your needs. About CodeQL extension settings diff --git a/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst b/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst index dec599829ed..9975d06b0eb 100644 --- a/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst +++ b/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst @@ -5,6 +5,8 @@ Exploring data flow with path queries ===================================== +.. include:: ../reusables/deprecation-note.rst + You can run CodeQL queries in VS Code to help you track the flow of data through a program, highlighting areas that are potential security vulnerabilities. About path queries diff --git a/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst b/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst index 708b2f0cc0c..9494902d24e 100644 --- a/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst @@ -5,6 +5,8 @@ Exploring the structure of your source code ================================================= +.. include:: ../reusables/deprecation-note.rst + You can use the AST viewer to display the abstract syntax tree of a CodeQL database. About the abstract syntax tree diff --git a/docs/codeql/codeql-for-visual-studio-code/index.rst b/docs/codeql/codeql-for-visual-studio-code/index.rst index fc615f932f8..6207d37b286 100644 --- a/docs/codeql/codeql-for-visual-studio-code/index.rst +++ b/docs/codeql/codeql-for-visual-studio-code/index.rst @@ -3,6 +3,8 @@ CodeQL for Visual Studio Code ============================= +.. include:: ../reusables/deprecation-note.rst + The CodeQL extension for Visual Studio Code adds rich language support for CodeQL and allows you to easily find problems in codebases. - :doc:`About CodeQL for Visual Studio Code diff --git a/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst b/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst index dad191274de..2c591c68948 100644 --- a/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst +++ b/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst @@ -5,6 +5,8 @@ Running CodeQL queries at scale with multi-repository variant analysis ====================================================================== +.. include:: ../reusables/deprecation-note.rst + .. include:: ../reusables/beta-note-mrva.rst About multi-repository variant analysis diff --git a/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst index ac67d31afde..fd553d49ab9 100644 --- a/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst @@ -5,6 +5,8 @@ Setting up CodeQL in Visual Studio Code ================================================= +.. include:: ../reusables/deprecation-note.rst + You can install and configure the CodeQL extension in Visual Studio Code. .. include:: ../reusables/license-note.rst diff --git a/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst index 7e19e78bd42..8f77e0110bc 100644 --- a/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst @@ -5,6 +5,8 @@ Testing CodeQL queries in Visual Studio Code ============================================ +.. include:: ../reusables/deprecation-note.rst + You can run unit tests for CodeQL queries using the Visual Studio Code extension. When you are sure that your query finds the results you want to identify, you can use variant analysis to run it at scale. For information on running analysis at scale across many CodeQL databases, see ":ref:`Running CodeQL queries at scale with multi-repository variant analysis `." About testing queries in VS Code diff --git a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst index 2eecc28f0fb..cdd6579b6aa 100644 --- a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst @@ -5,6 +5,8 @@ Troubleshooting CodeQL for Visual Studio Code ============================================= +.. include:: ../reusables/deprecation-note.rst + This article explains how to debug problems with the analysis of CodeQL databases that are stored on your local machine. For information on troubleshooting variant analysis, which runs on GitHub.com, see ":ref:`Troubleshooting variant analysis `." diff --git a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst index 5d9137dee5c..f052bb1722c 100644 --- a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst +++ b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst @@ -5,6 +5,8 @@ Troubleshooting variant analysis ================================ +.. include:: ../reusables/deprecation-note.rst + .. include:: ../reusables/beta-note-mrva.rst This article explains how to debug problems with variant analysis, that is, analysis run using GitHub Actions diff --git a/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst b/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst index d1dce1a6771..5c61e780da5 100644 --- a/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst +++ b/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst @@ -5,6 +5,8 @@ Using the CodeQL model editor ============================= +.. include:: ../reusables/deprecation-note.rst + .. include:: ../reusables/beta-note-model-pack-editor-vsc.rst You can view, write, and edit CodeQL packs in Visual Studio Code using the CodeQL extension. The model editor is designed to help you model external dependencies of your codebase that are not supported by the standard CodeQL Libraries. diff --git a/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst index fe1e9a0bbdd..a652021b1c3 100644 --- a/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst @@ -5,6 +5,8 @@ Working with CodeQL packs in Visual Studio Code =============================================== +.. include:: ../reusables/deprecation-note.rst + .. include:: ../reusables/beta-note-package-management.rst You can view, write, and edit all types of CodeQL packs in Visual Studio Code using the CodeQL extension. diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst b/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst index 7db0028eb03..9d8f218edca 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst @@ -73,7 +73,7 @@ The CodeQL examples in this article are only excerpts and are not meant to repre Abstract syntax --------------- -The abstract syntax tree (AST) represents the elements of the source code organized into a tree. The `AST viewer `__ +The abstract syntax tree (AST) represents the elements of the source code organized into a tree. The `AST viewer `__ in Visual Studio Code shows the AST nodes, including the relevant CodeQL classes and predicates. All CodeQL AST classes inherit from the `AstNode` class, which provides the following member predicates diff --git a/docs/codeql/codeql-overview/about-codeql.rst b/docs/codeql/codeql-overview/about-codeql.rst index 1392e1c7330..db48990e96c 100644 --- a/docs/codeql/codeql-overview/about-codeql.rst +++ b/docs/codeql/codeql-overview/about-codeql.rst @@ -70,8 +70,8 @@ Query execution After you've created a CodeQL database, one or more queries are executed against it. CodeQL queries are written in a specially-designed object-oriented query language called QL. You can run the queries checked out from the CodeQL -repo (or custom queries that you've written yourself) using the :ref:`CodeQL -for VS Code extension ` or the `CodeQL CLI +repo (or custom queries that you've written yourself) using the `CodeQL +for VS Code extension ` or the `CodeQL CLI `__. For more information about queries, see ":ref:`About CodeQL queries `." .. _interpret-query-results: diff --git a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst index 7c76c396073..5197b2f6165 100644 --- a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst +++ b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst @@ -82,7 +82,7 @@ Bug Fixes Python """""" -* The `View AST functionality `__ no longer prints detailed information about regular expressions, greatly improving performance. +* The `View AST functionality `__ no longer prints detailed information about regular expressions, greatly improving performance. Minor Analysis Improvements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/codeql/codeql-overview/codeql-tools.rst b/docs/codeql/codeql-overview/codeql-tools.rst index c6df9d8882d..0adb630bf25 100644 --- a/docs/codeql/codeql-overview/codeql-tools.rst +++ b/docs/codeql/codeql-overview/codeql-tools.rst @@ -53,5 +53,5 @@ CodeQL for Visual Studio Code You can analyze CodeQL databases in Visual Studio Code using the CodeQL extension, which provides an enhanced environment for writing and running custom -queries and viewing the results. For more information, see ":ref:`CodeQL -for Visual Studio Code `." \ No newline at end of file +queries and viewing the results. For more information, see "`CodeQL +for Visual Studio Code `." \ No newline at end of file diff --git a/docs/codeql/ql-training/cpp/bad-overflow-guard.rst b/docs/codeql/ql-training/cpp/bad-overflow-guard.rst index 55657871b4f..07a5b78af76 100644 --- a/docs/codeql/ql-training/cpp/bad-overflow-guard.rst +++ b/docs/codeql/ql-training/cpp/bad-overflow-guard.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. Checking for overflow in C ========================== diff --git a/docs/codeql/ql-training/cpp/control-flow-cpp.rst b/docs/codeql/ql-training/cpp/control-flow-cpp.rst index b18348509c2..d2bbc6a6af2 100644 --- a/docs/codeql/ql-training/cpp/control-flow-cpp.rst +++ b/docs/codeql/ql-training/cpp/control-flow-cpp.rst @@ -11,7 +11,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/cpp/data-flow-cpp.rst b/docs/codeql/ql-training/cpp/data-flow-cpp.rst index da4f287b392..e46f72596be 100644 --- a/docs/codeql/ql-training/cpp/data-flow-cpp.rst +++ b/docs/codeql/ql-training/cpp/data-flow-cpp.rst @@ -9,7 +9,7 @@ Finding string formatting vulnerabilities in C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst b/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst index a2391e40332..c0dc6923f67 100644 --- a/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst +++ b/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/cpp/intro-ql-cpp.rst b/docs/codeql/ql-training/cpp/intro-ql-cpp.rst index dff2c50ec0c..005f847b846 100644 --- a/docs/codeql/ql-training/cpp/intro-ql-cpp.rst +++ b/docs/codeql/ql-training/cpp/intro-ql-cpp.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `exiv2 `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `exiv2 `__ from GitHub. .. Include language-agnostic section here diff --git a/docs/codeql/ql-training/cpp/snprintf.rst b/docs/codeql/ql-training/cpp/snprintf.rst index 58b2c31d2e4..d784d79f5f8 100644 --- a/docs/codeql/ql-training/cpp/snprintf.rst +++ b/docs/codeql/ql-training/cpp/snprintf.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `rsyslog `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `rsyslog `__ from GitHub. ``snprintf`` ============ diff --git a/docs/codeql/ql-training/java/apache-struts-java.rst b/docs/codeql/ql-training/java/apache-struts-java.rst index 24186bda48f..4e5c4493db1 100644 --- a/docs/codeql/ql-training/java/apache-struts-java.rst +++ b/docs/codeql/ql-training/java/apache-struts-java.rst @@ -13,7 +13,7 @@ Exercise: Apache Struts Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. Unsafe deserialization in Struts ================================ diff --git a/docs/codeql/ql-training/java/data-flow-java.rst b/docs/codeql/ql-training/java/data-flow-java.rst index f55b25ff5ab..4353b618acf 100644 --- a/docs/codeql/ql-training/java/data-flow-java.rst +++ b/docs/codeql/ql-training/java/data-flow-java.rst @@ -9,7 +9,7 @@ Finding SPARQL injection vulnerabilities in Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/java/global-data-flow-java.rst b/docs/codeql/ql-training/java/global-data-flow-java.rst index ddee9645d17..67e71c03391 100644 --- a/docs/codeql/ql-training/java/global-data-flow-java.rst +++ b/docs/codeql/ql-training/java/global-data-flow-java.rst @@ -9,7 +9,7 @@ CodeQL for Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/java/intro-ql-java.rst b/docs/codeql/ql-training/java/intro-ql-java.rst index fec966e2fe4..38e311060ec 100644 --- a/docs/codeql/ql-training/java/intro-ql-java.rst +++ b/docs/codeql/ql-training/java/intro-ql-java.rst @@ -9,7 +9,7 @@ CodeQL for Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. .. Include language-agnostic section here diff --git a/docs/codeql/ql-training/java/query-injection-java.rst b/docs/codeql/ql-training/java/query-injection-java.rst index a16ac49b6a3..d1f8c17288a 100644 --- a/docs/codeql/ql-training/java/query-injection-java.rst +++ b/docs/codeql/ql-training/java/query-injection-java.rst @@ -9,7 +9,7 @@ CodeQL for Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. SQL injection ============= diff --git a/docs/codeql/ql-training/template.rst b/docs/codeql/ql-training/template.rst index 503ac757fdb..7d525d9e3b2 100644 --- a/docs/codeql/ql-training/template.rst +++ b/docs/codeql/ql-training/template.rst @@ -36,7 +36,7 @@ Setup For this example you should download: -- `CodeQL for Visual Studio Code `__ +- `CodeQL for Visual Studio Code `__ - A CodeQL database .. note:: diff --git a/docs/codeql/reusables/deprecation-note.rst b/docs/codeql/reusables/deprecation-note.rst new file mode 100644 index 00000000000..1cff31f2385 --- /dev/null +++ b/docs/codeql/reusables/deprecation-note.rst @@ -0,0 +1,6 @@ +.. pull-quote:: + + Note + + This documentation has been migrated to docs.github.com/en/code-security/codeql-for-vs-code. This version is no longer maintained, and it will be removed on TODOCS. + \ No newline at end of file diff --git a/docs/codeql/writing-codeql-queries/creating-path-queries.rst b/docs/codeql/writing-codeql-queries/creating-path-queries.rst index 1e1b8d1f7a6..0ab162a59c2 100644 --- a/docs/codeql/writing-codeql-queries/creating-path-queries.rst +++ b/docs/codeql/writing-codeql-queries/creating-path-queries.rst @@ -20,7 +20,7 @@ This topic provides information on how to structure a path query file so you can Note - The alerts generated by path queries are included in the results generated using the `CodeQL CLI `__ and in `code scanning `__. You can also view the path explanations generated by your path query in the :ref:`CodeQL extension for VS Code `. + The alerts generated by path queries are included in the results generated using the `CodeQL CLI `__ and in `code scanning `__. You can also view the path explanations generated by your path query in the `CodeQL extension for VS Code `. To learn more about modeling data flow with CodeQL, see ":doc:`About data flow analysis `." @@ -171,7 +171,7 @@ Select clauses for path queries consist of four 'columns', with the following st select element, source, sink, string The ``element`` and ``string`` columns represent the location of the alert and the alert message respectively, as explained in ":doc:`About CodeQL queries `." The second and third columns, ``source`` and ``sink``, are nodes on the path graph selected by the query. -Each result generated by your query is displayed at a single location in the same way as an alert query. Additionally, each result also has an associated path, which can be viewed in the :ref:`CodeQL extension for VS Code `. +Each result generated by your query is displayed at a single location in the same way as an alert query. Additionally, each result also has an associated path, which can be viewed in the `CodeQL extension for VS Code `. The ``element`` that you select in the first column depends on the purpose of the query and the type of issue that it is designed to find. This is particularly important for security issues. For example, if you believe the ``source`` value to be globally invalid or malicious it may be best to display the alert at the ``source``. In contrast, you should consider displaying the alert at the ``sink`` if you believe it is the element that requires sanitization. diff --git a/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst b/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst index 4e074bc411d..94a949ce076 100644 --- a/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst +++ b/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst @@ -9,7 +9,7 @@ About query results ------------------- The information contained in the results of a query is controlled by the ``select`` statement. Part of the process of developing a useful query is to make the results clear and easy for other users to understand. -When you write your own queries in the CodeQL :ref:`extension for VS Code ` there are no constraints on what can be selected. +When you write your own queries in the CodeQL `extension for VS Code ` there are no constraints on what can be selected. However, if you want to use a query to create alerts for code scanning or generate valid analysis results using the `CodeQL CLI `__, you'll need to make the ``select`` statement report results in the required format. You must also ensure that the query has the appropriate metadata properties defined. This topic explains how to write your select statement to generate helpful analysis results. diff --git a/docs/codeql/writing-codeql-queries/introduction-to-ql.rst b/docs/codeql/writing-codeql-queries/introduction-to-ql.rst index 04dccfc98b6..fa4736ec706 100644 --- a/docs/codeql/writing-codeql-queries/introduction-to-ql.rst +++ b/docs/codeql/writing-codeql-queries/introduction-to-ql.rst @@ -19,7 +19,7 @@ QL also supports recursion and aggregates. This allows you to write complex recu Running a query --------------- -You can try out the following examples and exercises using :ref:`CodeQL for VS Code ` or the `CodeQL template `__ on GitHub Codespaces. +You can try out the following examples and exercises using `CodeQL for VS Code ` or the `CodeQL template `__ on GitHub Codespaces. Here is an example of a basic query: @@ -114,7 +114,7 @@ The following example queries *do* use these databases and give you an idea of h Queries using the CodeQL libraries can find errors and uncover variants of important security vulnerabilities in codebases. Visit `GitHub Security Lab `__ to read about examples of vulnerabilities that we have recently found in open source projects. -Before you can run the following examples, you will need to install the CodeQL extension for Visual Studio Code. For more information, see :ref:`Setting up CodeQL in Visual Studio Code `. You will also need to import and select a database in the corresponding programming language. For more information about obtaining CodeQL databases, see `Analyzing your projects `__ in the CodeQL for VS Code documentation. +Before you can run the following examples, you will need to install the CodeQL extension for Visual Studio Code. For more information, see :ref:`Setting up CodeQL in Visual Studio Code `. You will also need to import and select a database in the corresponding programming language. For more information about obtaining CodeQL databases, see `Managing CodeQL databases `__ in the CodeQL for VS Code documentation. To import the CodeQL library for a specific programming language, type ``import `` at the start of the query. diff --git a/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst b/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst index 16a0eba56c2..731a5195ae7 100644 --- a/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst +++ b/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst @@ -9,7 +9,7 @@ About query metadata -------------------- Any query that is run as part of an analysis includes a number of properties, known as query metadata. Metadata is included at the top of each query file as the content of a QLDoc comment. -This metadata tells the CodeQL :ref:`extension for VS Code ` and the `Code scanning feature in GitHub `__ how to handle the query and display its results correctly. +This metadata tells the CodeQL `extension for VS Code ` and the `Code scanning feature in GitHub `__ how to handle the query and display its results correctly. It also gives other users information about what the query results mean. For more information on query metadata, see the `query metadata style guide `__ in our `open source repository `__ on GitHub. .. pull-quote:: diff --git a/docs/ql-style-guide.md b/docs/ql-style-guide.md index 29a427fdfae..7018719bb13 100644 --- a/docs/ql-style-guide.md +++ b/docs/ql-style-guide.md @@ -3,7 +3,7 @@ ## Introduction This document describes how to format the code you contribute to this repository. It covers aspects such as layout, white-space, naming, and documentation. Adhering to consistent standards makes code easier to read and maintain. Of course, these are only guidelines, and can be overridden as the need arises on a case-by-case basis. Where existing code deviates from these guidelines, prefer consistency with the surrounding code. -Note, if you use [CodeQL for Visual Studio Code](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code/), you can autoformat your query in the editor. +Note, if you use [CodeQL for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/), you can autoformat your query in the editor. Words in *italic* are defined in the [Glossary](#glossary). diff --git a/docs/supported-queries.md b/docs/supported-queries.md index 3529866d461..4335d819413 100644 --- a/docs/supported-queries.md +++ b/docs/supported-queries.md @@ -45,7 +45,7 @@ The process must begin with the first step and must conclude with the final step - Understand [the evaluation model of QL](https://codeql.github.com/docs/ql-language-reference/evaluation-of-ql-programs/). It's more similar to SQL than to any mainstream programming language. - Most performance tuning in QL boils down to computing as few tuples (rows of data) as possible. As a mental model, think of predicate evaluation as enumerating all combinations of parameters that satisfy the predicate body. This includes the implicit parameters `this` and `result`. - The major libraries in CodeQL are _cached_ and will only be computed once for the entire suite of queries. The first query that needs a cached _stage_ will trigger its evaluation. This means that query authors should usually only look at the run time of the last stage of evaluation. - - In [the settings for the VSCode extension](https://codeql.github.com/docs/codeql-for-visual-studio-code/customizing-settings/), check the box "Running Queries: Debug" (`codeQL.runningQueries.debug`). Then find "CodeQL Query Server" in the VSCode Output panel (View -> Output) and capture the output when running the query. That output contains timing and tuple counts for all computed predicates. + - In [the settings for the VSCode extension](https://docs.github.com/en/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/customizing-settings), check the box "Running Queries: Debug" (`codeQL.runningQueries.debug`). Then find "CodeQL Query Server" in the VSCode Output panel (View -> Output) and capture the output when running the query. That output contains timing and tuple counts for all computed predicates. - To clear the entire cache, invoke "CodeQL: Clear Cache" from the VSCode command palette. 6. **Make sure your query has the correct metadata** diff --git a/go/CONTRIBUTING.md b/go/CONTRIBUTING.md index 801d856e53e..38dffd1d754 100644 --- a/go/CONTRIBUTING.md +++ b/go/CONTRIBUTING.md @@ -33,7 +33,7 @@ Follow the steps below to help other users understand what your query does, and 2. **Format your code correctly** - All of the standard CodeQL queries and libraries are uniformly formatted for clarity and consistency, so we strongly recommend that all contributions follow the same formatting guidelines. If you use the CodeQL extension for Visual Studio Code, you can auto-format your query using the [Format Document command](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code/). For more information, see the [QL style guide](https://github.com/github/codeql/blob/main/docs/ql-style-guide.md). + All of the standard CodeQL queries and libraries are uniformly formatted for clarity and consistency, so we strongly recommend that all contributions follow the same formatting guidelines. If you use the CodeQL extension for Visual Studio Code, you can auto-format your query using the [Format Document command](https://docs.github.com/en/code-security/codeql-for-vs-code/). For more information, see the [QL style guide](https://github.com/github/codeql/blob/main/docs/ql-style-guide.md). 3. **Make sure your query has the correct metadata** diff --git a/go/ql/docs/experimental.md b/go/ql/docs/experimental.md index bef435d6674..ea5ed312fb5 100644 --- a/go/ql/docs/experimental.md +++ b/go/ql/docs/experimental.md @@ -21,7 +21,7 @@ Experimental queries and libraries may not be actively maintained as the standar 3. **Formatting** - - The queries and libraries must be [autoformatted](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code/). + - The queries and libraries must be [autoformatted](https://docs.github.com/en/code-security/codeql-for-vs-code/). 4. **Compilation** diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index ef271f0654d..a980559ca8e 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -277,7 +277,7 @@ No user-facing changes. ### Bug Fixes -* The [View AST functionality](https://codeql.github.com/docs/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code/) no longer prints detailed information about regular expressions, greatly improving performance. +* The [View AST functionality](https://docs.github.com/en/code-security/codeql-for-vs-code/) no longer prints detailed information about regular expressions, greatly improving performance. ## 0.0.8 diff --git a/python/ql/src/change-notes/released/0.0.9.md b/python/ql/src/change-notes/released/0.0.9.md index 1136727b684..d50d846f53e 100644 --- a/python/ql/src/change-notes/released/0.0.9.md +++ b/python/ql/src/change-notes/released/0.0.9.md @@ -2,4 +2,4 @@ ### Bug Fixes -* The [View AST functionality](https://codeql.github.com/docs/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code/) no longer prints detailed information about regular expressions, greatly improving performance. +* The [View AST functionality](https://docs.github.com/en/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/exploring-the-structure-of-your-source-code) no longer prints detailed information about regular expressions, greatly improving performance. From 037211c4a4edf39aa923bc2caec33503c9296af7 Mon Sep 17 00:00:00 2001 From: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:10:27 +0000 Subject: [PATCH 006/118] Add formatting fixes --- .../codeql/codeql-language-guides/codeql-library-for-ruby.rst | 2 +- docs/codeql/codeql-overview/about-codeql.rst | 2 +- .../codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst | 2 +- docs/codeql/codeql-overview/codeql-tools.rst | 2 +- docs/codeql/reusables/deprecation-note.rst | 2 +- docs/codeql/writing-codeql-queries/creating-path-queries.rst | 4 ++-- .../defining-the-results-of-a-query.rst | 2 +- docs/codeql/writing-codeql-queries/introduction-to-ql.rst | 4 ++-- .../writing-codeql-queries/metadata-for-codeql-queries.rst | 2 +- docs/supported-queries.md | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst b/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst index 9d8f218edca..2ff7a62b2ac 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-ruby.rst @@ -73,7 +73,7 @@ The CodeQL examples in this article are only excerpts and are not meant to repre Abstract syntax --------------- -The abstract syntax tree (AST) represents the elements of the source code organized into a tree. The `AST viewer `__ +The abstract syntax tree (AST) represents the elements of the source code organized into a tree. The `AST viewer `__ in Visual Studio Code shows the AST nodes, including the relevant CodeQL classes and predicates. All CodeQL AST classes inherit from the `AstNode` class, which provides the following member predicates diff --git a/docs/codeql/codeql-overview/about-codeql.rst b/docs/codeql/codeql-overview/about-codeql.rst index db48990e96c..eccc81c8754 100644 --- a/docs/codeql/codeql-overview/about-codeql.rst +++ b/docs/codeql/codeql-overview/about-codeql.rst @@ -71,7 +71,7 @@ After you've created a CodeQL database, one or more queries are executed against it. CodeQL queries are written in a specially-designed object-oriented query language called QL. You can run the queries checked out from the CodeQL repo (or custom queries that you've written yourself) using the `CodeQL -for VS Code extension ` or the `CodeQL CLI +for VS Code extension `__ or the `CodeQL CLI `__. For more information about queries, see ":ref:`About CodeQL queries `." .. _interpret-query-results: diff --git a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst index 5197b2f6165..c59a3e6498e 100644 --- a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst +++ b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.8.1.rst @@ -82,7 +82,7 @@ Bug Fixes Python """""" -* The `View AST functionality `__ no longer prints detailed information about regular expressions, greatly improving performance. +* The `View AST functionality `__ no longer prints detailed information about regular expressions, greatly improving performance. Minor Analysis Improvements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/codeql/codeql-overview/codeql-tools.rst b/docs/codeql/codeql-overview/codeql-tools.rst index 0adb630bf25..d58730e4702 100644 --- a/docs/codeql/codeql-overview/codeql-tools.rst +++ b/docs/codeql/codeql-overview/codeql-tools.rst @@ -54,4 +54,4 @@ CodeQL for Visual Studio Code You can analyze CodeQL databases in Visual Studio Code using the CodeQL extension, which provides an enhanced environment for writing and running custom queries and viewing the results. For more information, see "`CodeQL -for Visual Studio Code `." \ No newline at end of file +for Visual Studio Code `__." \ No newline at end of file diff --git a/docs/codeql/reusables/deprecation-note.rst b/docs/codeql/reusables/deprecation-note.rst index 1cff31f2385..3019939baa1 100644 --- a/docs/codeql/reusables/deprecation-note.rst +++ b/docs/codeql/reusables/deprecation-note.rst @@ -2,5 +2,5 @@ Note - This documentation has been migrated to docs.github.com/en/code-security/codeql-for-vs-code. This version is no longer maintained, and it will be removed on TODOCS. + This documentation was migrated to docs.github.com/en/code-security/codeql-for-vs-code on 2024/05/08, and this version is no longer maintained. \ No newline at end of file diff --git a/docs/codeql/writing-codeql-queries/creating-path-queries.rst b/docs/codeql/writing-codeql-queries/creating-path-queries.rst index 0ab162a59c2..41f0683594c 100644 --- a/docs/codeql/writing-codeql-queries/creating-path-queries.rst +++ b/docs/codeql/writing-codeql-queries/creating-path-queries.rst @@ -20,7 +20,7 @@ This topic provides information on how to structure a path query file so you can Note - The alerts generated by path queries are included in the results generated using the `CodeQL CLI `__ and in `code scanning `__. You can also view the path explanations generated by your path query in the `CodeQL extension for VS Code `. + The alerts generated by path queries are included in the results generated using the `CodeQL CLI `__ and in `code scanning `__. You can also view the path explanations generated by your path query in the `CodeQL extension for VS Code `__. To learn more about modeling data flow with CodeQL, see ":doc:`About data flow analysis `." @@ -171,7 +171,7 @@ Select clauses for path queries consist of four 'columns', with the following st select element, source, sink, string The ``element`` and ``string`` columns represent the location of the alert and the alert message respectively, as explained in ":doc:`About CodeQL queries `." The second and third columns, ``source`` and ``sink``, are nodes on the path graph selected by the query. -Each result generated by your query is displayed at a single location in the same way as an alert query. Additionally, each result also has an associated path, which can be viewed in the `CodeQL extension for VS Code `. +Each result generated by your query is displayed at a single location in the same way as an alert query. Additionally, each result also has an associated path, which can be viewed in the `CodeQL extension for VS Code `__. The ``element`` that you select in the first column depends on the purpose of the query and the type of issue that it is designed to find. This is particularly important for security issues. For example, if you believe the ``source`` value to be globally invalid or malicious it may be best to display the alert at the ``source``. In contrast, you should consider displaying the alert at the ``sink`` if you believe it is the element that requires sanitization. diff --git a/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst b/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst index 94a949ce076..560505506f2 100644 --- a/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst +++ b/docs/codeql/writing-codeql-queries/defining-the-results-of-a-query.rst @@ -9,7 +9,7 @@ About query results ------------------- The information contained in the results of a query is controlled by the ``select`` statement. Part of the process of developing a useful query is to make the results clear and easy for other users to understand. -When you write your own queries in the CodeQL `extension for VS Code ` there are no constraints on what can be selected. +When you write your own queries in the CodeQL `extension for VS Code `__ there are no constraints on what can be selected. However, if you want to use a query to create alerts for code scanning or generate valid analysis results using the `CodeQL CLI `__, you'll need to make the ``select`` statement report results in the required format. You must also ensure that the query has the appropriate metadata properties defined. This topic explains how to write your select statement to generate helpful analysis results. diff --git a/docs/codeql/writing-codeql-queries/introduction-to-ql.rst b/docs/codeql/writing-codeql-queries/introduction-to-ql.rst index fa4736ec706..203f590f761 100644 --- a/docs/codeql/writing-codeql-queries/introduction-to-ql.rst +++ b/docs/codeql/writing-codeql-queries/introduction-to-ql.rst @@ -19,7 +19,7 @@ QL also supports recursion and aggregates. This allows you to write complex recu Running a query --------------- -You can try out the following examples and exercises using `CodeQL for VS Code ` or the `CodeQL template `__ on GitHub Codespaces. +You can try out the following examples and exercises using `CodeQL for VS Code `__ or the `CodeQL template `__ on GitHub Codespaces. Here is an example of a basic query: @@ -114,7 +114,7 @@ The following example queries *do* use these databases and give you an idea of h Queries using the CodeQL libraries can find errors and uncover variants of important security vulnerabilities in codebases. Visit `GitHub Security Lab `__ to read about examples of vulnerabilities that we have recently found in open source projects. -Before you can run the following examples, you will need to install the CodeQL extension for Visual Studio Code. For more information, see :ref:`Setting up CodeQL in Visual Studio Code `. You will also need to import and select a database in the corresponding programming language. For more information about obtaining CodeQL databases, see `Managing CodeQL databases `__ in the CodeQL for VS Code documentation. +Before you can run the following examples, you will need to install the CodeQL extension for Visual Studio Code. For more information, see :ref:`Setting up CodeQL in Visual Studio Code `. You will also need to import and select a database in the corresponding programming language. For more information about obtaining CodeQL databases, see `Managing CodeQL databases `__ in the CodeQL for VS Code documentation. To import the CodeQL library for a specific programming language, type ``import `` at the start of the query. diff --git a/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst b/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst index 731a5195ae7..34907e3910c 100644 --- a/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst +++ b/docs/codeql/writing-codeql-queries/metadata-for-codeql-queries.rst @@ -9,7 +9,7 @@ About query metadata -------------------- Any query that is run as part of an analysis includes a number of properties, known as query metadata. Metadata is included at the top of each query file as the content of a QLDoc comment. -This metadata tells the CodeQL `extension for VS Code ` and the `Code scanning feature in GitHub `__ how to handle the query and display its results correctly. +This metadata tells the CodeQL `extension for VS Code `__ and the `Code scanning feature in GitHub `__ how to handle the query and display its results correctly. It also gives other users information about what the query results mean. For more information on query metadata, see the `query metadata style guide `__ in our `open source repository `__ on GitHub. .. pull-quote:: diff --git a/docs/supported-queries.md b/docs/supported-queries.md index 4335d819413..fa4cf1ea5d8 100644 --- a/docs/supported-queries.md +++ b/docs/supported-queries.md @@ -45,7 +45,7 @@ The process must begin with the first step and must conclude with the final step - Understand [the evaluation model of QL](https://codeql.github.com/docs/ql-language-reference/evaluation-of-ql-programs/). It's more similar to SQL than to any mainstream programming language. - Most performance tuning in QL boils down to computing as few tuples (rows of data) as possible. As a mental model, think of predicate evaluation as enumerating all combinations of parameters that satisfy the predicate body. This includes the implicit parameters `this` and `result`. - The major libraries in CodeQL are _cached_ and will only be computed once for the entire suite of queries. The first query that needs a cached _stage_ will trigger its evaluation. This means that query authors should usually only look at the run time of the last stage of evaluation. - - In [the settings for the VSCode extension](https://docs.github.com/en/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/customizing-settings), check the box "Running Queries: Debug" (`codeQL.runningQueries.debug`). Then find "CodeQL Query Server" in the VSCode Output panel (View -> Output) and capture the output when running the query. That output contains timing and tuple counts for all computed predicates. + - In [the settings for the VSCode extension](https://docs.github.com/en/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/customizing-settings/), check the box "Running Queries: Debug" (`codeQL.runningQueries.debug`). Then find "CodeQL Query Server" in the VSCode Output panel (View -> Output) and capture the output when running the query. That output contains timing and tuple counts for all computed predicates. - To clear the entire cache, invoke "CodeQL: Clear Cache" from the VSCode command palette. 6. **Make sure your query has the correct metadata** From be9009d653c32fd8c8b85060418286fc3bd3170e Mon Sep 17 00:00:00 2001 From: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:16:48 +0000 Subject: [PATCH 007/118] Use clearer filename --- .../about-codeql-for-visual-studio-code.rst | 2 +- .../about-telemetry-in-codeql-for-visual-studio-code.rst | 2 +- .../codeql-for-visual-studio-code/analyzing-your-projects.rst | 2 +- .../codeql-for-visual-studio-code/customizing-settings.rst | 2 +- .../exploring-data-flow-with-path-queries.rst | 2 +- .../exploring-the-structure-of-your-source-code.rst | 2 +- docs/codeql/codeql-for-visual-studio-code/index.rst | 2 +- .../running-codeql-queries-at-scale-with-mrva.rst | 2 +- .../setting-up-codeql-in-visual-studio-code.rst | 2 +- .../testing-codeql-queries-in-visual-studio-code.rst | 2 +- .../troubleshooting-codeql-for-visual-studio-code.rst | 2 +- .../troubleshooting-variant-analysis.rst | 2 +- .../using-the-codeql-model-editor.rst | 2 +- .../working-with-codeql-packs-in-visual-studio-code.rst | 2 +- .../{deprecation-note.rst => vs-code-deprecation-note.rst} | 0 15 files changed, 14 insertions(+), 14 deletions(-) rename docs/codeql/reusables/{deprecation-note.rst => vs-code-deprecation-note.rst} (100%) diff --git a/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst index f0dfbe29017..c763092ddac 100644 --- a/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst @@ -5,7 +5,7 @@ About CodeQL for Visual Studio Code ================================================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst CodeQL for Visual Studio Code is an extension that lets you write, run, and test CodeQL queries in Visual Studio Code. diff --git a/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst index 832e6d4e856..03af3e675c3 100644 --- a/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code.rst @@ -5,7 +5,7 @@ About telemetry in CodeQL for Visual Studio Code ================================================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst If you specifically opt in to permit GitHub to do so, GitHub will collect usage data and metrics for the purposes of helping the core developers to improve the CodeQL extension for VS Code. diff --git a/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst b/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst index dea8007c460..4dca293308b 100644 --- a/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst +++ b/docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst @@ -5,7 +5,7 @@ Analyzing your projects ================================================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst You can run queries on CodeQL databases and view the results in Visual Studio Code. This article explains how to get a CodeQL database and analyze it on your local machine. For information on running analysis at scale across many CodeQL databases, see ":ref:`Running CodeQL queries at scale with multi-repository variant analysis `." diff --git a/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst b/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst index 737024861a6..4a5f6e324de 100644 --- a/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst +++ b/docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst @@ -5,7 +5,7 @@ Customizing settings ==================== -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst You can edit the settings for the CodeQL extension to suit your needs. diff --git a/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst b/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst index 9975d06b0eb..26f48dd561c 100644 --- a/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst +++ b/docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst @@ -5,7 +5,7 @@ Exploring data flow with path queries ===================================== -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst You can run CodeQL queries in VS Code to help you track the flow of data through a program, highlighting areas that are potential security vulnerabilities. diff --git a/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst b/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst index 9494902d24e..51056f8d2e7 100644 --- a/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst @@ -5,7 +5,7 @@ Exploring the structure of your source code ================================================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst You can use the AST viewer to display the abstract syntax tree of a CodeQL database. diff --git a/docs/codeql/codeql-for-visual-studio-code/index.rst b/docs/codeql/codeql-for-visual-studio-code/index.rst index 6207d37b286..36089de079c 100644 --- a/docs/codeql/codeql-for-visual-studio-code/index.rst +++ b/docs/codeql/codeql-for-visual-studio-code/index.rst @@ -3,7 +3,7 @@ CodeQL for Visual Studio Code ============================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst The CodeQL extension for Visual Studio Code adds rich language support for CodeQL and allows you to easily find problems in codebases. diff --git a/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst b/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst index 2c591c68948..19d44312a5e 100644 --- a/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst +++ b/docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst @@ -5,7 +5,7 @@ Running CodeQL queries at scale with multi-repository variant analysis ====================================================================== -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst .. include:: ../reusables/beta-note-mrva.rst diff --git a/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst index fd553d49ab9..94b291a69b8 100644 --- a/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst @@ -5,7 +5,7 @@ Setting up CodeQL in Visual Studio Code ================================================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst You can install and configure the CodeQL extension in Visual Studio Code. diff --git a/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst index 8f77e0110bc..67f45203b47 100644 --- a/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/testing-codeql-queries-in-visual-studio-code.rst @@ -5,7 +5,7 @@ Testing CodeQL queries in Visual Studio Code ============================================ -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst You can run unit tests for CodeQL queries using the Visual Studio Code extension. When you are sure that your query finds the results you want to identify, you can use variant analysis to run it at scale. For information on running analysis at scale across many CodeQL databases, see ":ref:`Running CodeQL queries at scale with multi-repository variant analysis `." diff --git a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst index cdd6579b6aa..6b81bd5bd83 100644 --- a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-codeql-for-visual-studio-code.rst @@ -5,7 +5,7 @@ Troubleshooting CodeQL for Visual Studio Code ============================================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst This article explains how to debug problems with the analysis of CodeQL databases that are stored on your local machine. For information on troubleshooting variant analysis, which runs on GitHub.com, see diff --git a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst index f052bb1722c..1b0613accf1 100644 --- a/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst +++ b/docs/codeql/codeql-for-visual-studio-code/troubleshooting-variant-analysis.rst @@ -5,7 +5,7 @@ Troubleshooting variant analysis ================================ -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst .. include:: ../reusables/beta-note-mrva.rst diff --git a/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst b/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst index 5c61e780da5..c74fc247e00 100644 --- a/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst +++ b/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor.rst @@ -5,7 +5,7 @@ Using the CodeQL model editor ============================= -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst .. include:: ../reusables/beta-note-model-pack-editor-vsc.rst diff --git a/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst b/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst index a652021b1c3..11b866cf78c 100644 --- a/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst +++ b/docs/codeql/codeql-for-visual-studio-code/working-with-codeql-packs-in-visual-studio-code.rst @@ -5,7 +5,7 @@ Working with CodeQL packs in Visual Studio Code =============================================== -.. include:: ../reusables/deprecation-note.rst +.. include:: ../reusables/vs-code-deprecation-note.rst .. include:: ../reusables/beta-note-package-management.rst diff --git a/docs/codeql/reusables/deprecation-note.rst b/docs/codeql/reusables/vs-code-deprecation-note.rst similarity index 100% rename from docs/codeql/reusables/deprecation-note.rst rename to docs/codeql/reusables/vs-code-deprecation-note.rst From 7d9a68bf173511af23c94bbd04560c42a123dc09 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 11:19:22 +0200 Subject: [PATCH 008/118] Go: wrap gazelle to regenerate from scratch and add header --- go/extractor/autobuilder/BUILD.bazel | 2 ++ go/extractor/cli/go-autobuilder/BUILD.bazel | 2 ++ go/extractor/cli/go-bootstrap/BUILD.bazel | 2 ++ go/extractor/cli/go-build-runner/BUILD.bazel | 2 ++ go/extractor/cli/go-extractor/BUILD.bazel | 2 ++ go/extractor/cli/go-gen-dbscheme/BUILD.bazel | 2 ++ go/extractor/cli/go-tokenizer/BUILD.bazel | 2 ++ go/extractor/dbscheme/BUILD.bazel | 2 ++ go/extractor/diagnostics/BUILD.bazel | 2 ++ go/extractor/project/BUILD.bazel | 2 ++ go/extractor/srcarchive/BUILD.bazel | 2 ++ go/extractor/toolchain/BUILD.bazel | 2 ++ go/extractor/trap/BUILD.bazel | 2 ++ go/extractor/util/BUILD.bazel | 2 ++ .../x/mod/internal/lazyregexp/BUILD.bazel | 2 ++ .../vendor/golang.org/x/mod/modfile/BUILD.bazel | 2 ++ .../vendor/golang.org/x/mod/module/BUILD.bazel | 2 ++ .../vendor/golang.org/x/mod/semver/BUILD.bazel | 2 ++ .../x/tools/go/gcexportdata/BUILD.bazel | 2 ++ .../tools/go/internal/packagesdriver/BUILD.bazel | 2 ++ .../golang.org/x/tools/go/packages/BUILD.bazel | 2 ++ .../x/tools/go/types/objectpath/BUILD.bazel | 2 ++ .../x/tools/internal/event/BUILD.bazel | 2 ++ .../x/tools/internal/event/core/BUILD.bazel | 2 ++ .../x/tools/internal/event/keys/BUILD.bazel | 2 ++ .../x/tools/internal/event/label/BUILD.bazel | 2 ++ .../x/tools/internal/event/tag/BUILD.bazel | 2 ++ .../x/tools/internal/gcimporter/BUILD.bazel | 2 ++ .../x/tools/internal/gocommand/BUILD.bazel | 2 ++ .../tools/internal/packagesinternal/BUILD.bazel | 2 ++ .../x/tools/internal/pkgbits/BUILD.bazel | 2 ++ .../x/tools/internal/tokeninternal/BUILD.bazel | 2 ++ .../x/tools/internal/typeparams/BUILD.bazel | 2 ++ .../x/tools/internal/typesinternal/BUILD.bazel | 2 ++ .../x/tools/internal/versions/BUILD.bazel | 2 ++ go/gazelle/BUILD.bazel | 13 +++++++++---- go/gazelle/gazelle.py | 16 ++++++++++++++++ 37 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 go/gazelle/gazelle.py diff --git a/go/extractor/autobuilder/BUILD.bazel b/go/extractor/autobuilder/BUILD.bazel index b81b15816aa..e40dc3a0321 100644 --- a/go/extractor/autobuilder/BUILD.bazel +++ b/go/extractor/autobuilder/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( diff --git a/go/extractor/cli/go-autobuilder/BUILD.bazel b/go/extractor/cli/go-autobuilder/BUILD.bazel index bf1235b33aa..7abf4600d94 100644 --- a/go/extractor/cli/go-autobuilder/BUILD.bazel +++ b/go/extractor/cli/go-autobuilder/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") load("//go:rules.bzl", "codeql_go_binary") diff --git a/go/extractor/cli/go-bootstrap/BUILD.bazel b/go/extractor/cli/go-bootstrap/BUILD.bazel index 7bdd6d6e70f..86b08dfa121 100644 --- a/go/extractor/cli/go-bootstrap/BUILD.bazel +++ b/go/extractor/cli/go-bootstrap/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") load("//go:rules.bzl", "codeql_go_binary") diff --git a/go/extractor/cli/go-build-runner/BUILD.bazel b/go/extractor/cli/go-build-runner/BUILD.bazel index 15557d751cf..e91c4530610 100644 --- a/go/extractor/cli/go-build-runner/BUILD.bazel +++ b/go/extractor/cli/go-build-runner/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") load("//go:rules.bzl", "codeql_go_binary") diff --git a/go/extractor/cli/go-extractor/BUILD.bazel b/go/extractor/cli/go-extractor/BUILD.bazel index be426331868..769e4a7b09b 100644 --- a/go/extractor/cli/go-extractor/BUILD.bazel +++ b/go/extractor/cli/go-extractor/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") load("//go:rules.bzl", "codeql_go_binary") diff --git a/go/extractor/cli/go-gen-dbscheme/BUILD.bazel b/go/extractor/cli/go-gen-dbscheme/BUILD.bazel index 06c0d0f61f1..9de6d2198f8 100644 --- a/go/extractor/cli/go-gen-dbscheme/BUILD.bazel +++ b/go/extractor/cli/go-gen-dbscheme/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") load("//go:rules.bzl", "codeql_go_binary") diff --git a/go/extractor/cli/go-tokenizer/BUILD.bazel b/go/extractor/cli/go-tokenizer/BUILD.bazel index 3fc5b464c7c..8ce0c76be26 100644 --- a/go/extractor/cli/go-tokenizer/BUILD.bazel +++ b/go/extractor/cli/go-tokenizer/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") load("//go:rules.bzl", "codeql_go_binary") diff --git a/go/extractor/dbscheme/BUILD.bazel b/go/extractor/dbscheme/BUILD.bazel index efaf51684d7..496a5ccdf49 100644 --- a/go/extractor/dbscheme/BUILD.bazel +++ b/go/extractor/dbscheme/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/diagnostics/BUILD.bazel b/go/extractor/diagnostics/BUILD.bazel index 8b218dc1317..9b0c148db32 100644 --- a/go/extractor/diagnostics/BUILD.bazel +++ b/go/extractor/diagnostics/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/project/BUILD.bazel b/go/extractor/project/BUILD.bazel index dd49b3b320f..0048adf9164 100644 --- a/go/extractor/project/BUILD.bazel +++ b/go/extractor/project/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( diff --git a/go/extractor/srcarchive/BUILD.bazel b/go/extractor/srcarchive/BUILD.bazel index 90664c90190..e72e2e7ca08 100644 --- a/go/extractor/srcarchive/BUILD.bazel +++ b/go/extractor/srcarchive/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( diff --git a/go/extractor/toolchain/BUILD.bazel b/go/extractor/toolchain/BUILD.bazel index d1ce09c2632..fde8d327e9e 100644 --- a/go/extractor/toolchain/BUILD.bazel +++ b/go/extractor/toolchain/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( diff --git a/go/extractor/trap/BUILD.bazel b/go/extractor/trap/BUILD.bazel index 6c3f67b3247..6cc7c4983b2 100644 --- a/go/extractor/trap/BUILD.bazel +++ b/go/extractor/trap/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( diff --git a/go/extractor/util/BUILD.bazel b/go/extractor/util/BUILD.bazel index 787a627b5bc..8b8869cac52 100644 --- a/go/extractor/util/BUILD.bazel +++ b/go/extractor/util/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( diff --git a/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel index 33c06c34bec..deb5dc2b019 100644 --- a/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel index 7b5a78d785c..097bacb107c 100644 --- a/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel index 46ff4dbb7d1..3bf5ae9997d 100644 --- a/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/mod/module/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel b/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel index 5b54efe1981..760be56c9e0 100644 --- a/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/mod/semver/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel index 57f503f1cb2..5d68c2fe989 100644 --- a/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/go/gcexportdata/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel index 962442de1e0..2ef27e2c88a 100644 --- a/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/go/internal/packagesdriver/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel index 1cad8baca98..03d3e3b0158 100644 --- a/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/go/packages/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel index 1029221f434..374c5c601bc 100644 --- a/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/go/types/objectpath/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel index b882fef0d8c..200e436fcd4 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel index 36bd68eed9f..a16713f536c 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/core/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel index f1674735052..1feefdf1a83 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/keys/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel index 2329754d6cf..a4430ba0a17 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/label/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel index 276dc5f4489..d2c87f41a8a 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/event/tag/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel index 1879fe0dadf..56da3b0130e 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/gcimporter/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel index 58f7091b49c..7e64f94b95c 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/gocommand/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel index 3ed918c9489..2d2b7dc5b33 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/packagesinternal/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel index 820e8f04c9b..cce32747051 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/pkgbits/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel index ff66085dbdb..c0f6cc8fb13 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/tokeninternal/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel index 266816d9ea2..9c2dc20b6c6 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/typeparams/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel index c03b8a36ef7..653752ab715 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/typesinternal/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel b/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel index 6d7ffd0ac68..85d428debf5 100644 --- a/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel +++ b/go/extractor/vendor/golang.org/x/tools/internal/versions/BUILD.bazel @@ -1,3 +1,5 @@ +# generated running `bazel run //go/gazelle`, do not edit + load("@rules_go//go:def.bzl", "go_library") go_library( diff --git a/go/gazelle/BUILD.bazel b/go/gazelle/BUILD.bazel index 7c9b34edb3a..3d81b50590a 100644 --- a/go/gazelle/BUILD.bazel +++ b/go/gazelle/BUILD.bazel @@ -1,8 +1,13 @@ load("@gazelle//:def.bzl", "gazelle") gazelle( - name = "gazelle", - extra_args = [ - "go/extractor", - ], + name = "_gazelle", +) + +py_binary( + name = "gazelle", + srcs = ["gazelle.py"], + args = ["$(rlocationpath :_gazelle)"], + data = [":_gazelle"], + deps = ["@rules_python//python/runfiles"], ) diff --git a/go/gazelle/gazelle.py b/go/gazelle/gazelle.py new file mode 100644 index 00000000000..200f3c3ed6b --- /dev/null +++ b/go/gazelle/gazelle.py @@ -0,0 +1,16 @@ +import sys +import pathlib +import subprocess +from python.runfiles import runfiles + +this = pathlib.Path(__file__).resolve() +go_extractor_dir = this.parents[1] / "extractor" +gazelle = runfiles.Create().Rlocation(sys.argv[1]) +for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): + build_file.unlink() + +subprocess.check_call([gazelle, "go/extractor"]) + +for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): + contents = build_file.read_text() + build_file.write_text(f"# generated running `bazel run //go/gazelle`, do not edit\n\n{contents}") From 3ad9c026a5c59b8a23d5541a1251fc611dd89988 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 11:20:47 +0200 Subject: [PATCH 009/118] Go: remove `go_sdk.host` It's not required, and it can't work from the internal repository. --- MODULE.bazel | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 7a85ab51a96..16697403dcc 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -23,8 +23,7 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "abseil-cpp", version = "20240116.0", repo_name = "absl") bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json") bazel_dep(name = "fmt", version = "10.0.0") - -bazel_dep(name = "gazelle", version = "0.36.0", dev_dependency = True) +bazel_dep(name = "gazelle", version = "0.36.0") pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") pip.parse( @@ -56,7 +55,6 @@ use_repo(node, "nodejs", "nodejs_toolchains") go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") go_sdk.download(version = "1.22.2") -go_sdk.host() register_toolchains( "@nodejs_toolchains//:all", From 925a2cca7e6a5c8231b37f67df3de469ddf50925 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 12:01:23 +0200 Subject: [PATCH 010/118] Go: create whole extractor pack with bazel --- go/BUILD.bazel | 59 +++++++++++++++++++++++++++++++++++++ go/codeql-tools/BUILD.bazel | 28 ++++++++++++++++++ go/create_extractor_pack.py | 16 ++++++++++ go/downgrades/BUILD.bazel | 12 ++++++++ go/extractor/BUILD.bazel | 31 +++++++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 go/codeql-tools/BUILD.bazel create mode 100644 go/create_extractor_pack.py create mode 100644 go/downgrades/BUILD.bazel diff --git a/go/BUILD.bazel b/go/BUILD.bazel index e69de29bb2d..5736912310a 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -0,0 +1,59 @@ +load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files") +load("@rules_pkg//pkg:install.bzl", "pkg_install") +load("//:defs.bzl", "codeql_platform") + +pkg_files( + name = "resources", + srcs = [ + "LICENSE", + "codeql-extractor.yml", + "ql/lib/go.dbscheme", + "ql/lib/go.dbscheme.stats", + ], +) + +pkg_filegroup( + name = "extractor-pack-generic", + srcs = [ + ":resources", + "//go/codeql-tools", + "//go/downgrades", + "//go/extractor:tokenizer", + ], + visibility = ["//visibility:public"], +) + +pkg_files( + name = "extractor-pack-arch", + srcs = [ + "//go/extractor/cli/go-autobuilder", + "//go/extractor/cli/go-bootstrap", + "//go/extractor/cli/go-build-runner", + "//go/extractor/cli/go-extractor", + "//go/extractor/cli/go-gen-dbscheme", + "//go/extractor/cli/go-tokenizer", + ], + prefix = "tools/" + codeql_platform, + visibility = ["//visibility:public"], +) + +pkg_filegroup( + name = "extractor-pack", + srcs = [ + ":extractor-pack-arch", + ":extractor-pack-generic", + ], + visibility = ["//visibility:public"], +) + +pkg_install( + name = "_create_extractor_pack", + srcs = [":extractor-pack"], +) + +py_binary( + name = "create-extractor-pack", + srcs = ["create_extractor_pack.py"], + main = "create_extractor_pack.py", + deps = [":_create_extractor_pack"], +) diff --git a/go/codeql-tools/BUILD.bazel b/go/codeql-tools/BUILD.bazel new file mode 100644 index 00000000000..4e839b4774b --- /dev/null +++ b/go/codeql-tools/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") + +pkg_files( + name = "executables", + srcs = glob(["*.sh"]), + attributes = pkg_attributes(mode = "0755"), +) + +pkg_files( + name = "non-executables", + srcs = glob( + ["*"], + exclude = [ + "*.sh", + "BUILD.bazel", + ], + ), +) + +pkg_filegroup( + name = "codeql-tools", + srcs = [ + ":executables", + ":non-executables", + ], + prefix = "tools", + visibility = ["//go:__pkg__"], +) diff --git a/go/create_extractor_pack.py b/go/create_extractor_pack.py new file mode 100644 index 00000000000..08665a2d8dc --- /dev/null +++ b/go/create_extractor_pack.py @@ -0,0 +1,16 @@ +import os +import pathlib +import shutil +import sys +from go._create_extractor_pack_install_script import main + +try: + workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']) +except KeyError: + print("this should be run with bazel run", file=sys.stderr) + sys.exit(1) + +dest_dir = workspace_dir / 'go' / 'build' / 'codeql-extractor-go' +shutil.rmtree(dest_dir, ignore_errors=True) +os.environ['DESTDIR'] = str(dest_dir) +main(sys.argv) diff --git a/go/downgrades/BUILD.bazel b/go/downgrades/BUILD.bazel new file mode 100644 index 00000000000..68c15741a9f --- /dev/null +++ b/go/downgrades/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") + +pkg_files( + name = "downgrades", + srcs = glob( + ["**"], + exclude = ["BUILD.bazel"], + ), + prefix = "downgrades", + strip_prefix = strip_prefix.from_pkg(), + visibility = ["//go:__pkg__"], +) diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index 040b4227314..cb7bc3ac8ef 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -1,4 +1,5 @@ load("@rules_go//go:def.bzl", "go_library") +load("@rules_pkg//pkg:mappings.bzl", "pkg_files") # gazelle:prefix github.com/github/codeql-go/extractor # gazelle:map_kind go_binary codeql_go_binary //go:rules.bzl @@ -22,3 +23,33 @@ go_library( "//go/extractor/vendor/golang.org/x/tools/go/packages", ], ) + +java_library( + name = "tokenizer-deps", + srcs = [ + "net/sourceforge/pmd/cpd/AbstractLanguage.java", + "net/sourceforge/pmd/cpd/SourceCode.java", + "net/sourceforge/pmd/cpd/TokenEntry.java", + "net/sourceforge/pmd/cpd/Tokenizer.java", + ], +) + +java_library( + name = "tokenizer-jar", + srcs = [ + "net/sourceforge/pmd/cpd/GoLanguage.java", + "opencsv/CSVParser.java", + "opencsv/CSVReader.java", + ], + deps = [":tokenizer-deps"], +) + +pkg_files( + name = "tokenizer", + srcs = [":tokenizer-jar"], + prefix = "tools", + renames = { + ":tokenizer-jar": "tokenizer.jar", + }, + visibility = ["//go:__pkg__"], +) From 19b2e56d0276518c1c6559536338b61e2451acf6 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 13:38:10 +0200 Subject: [PATCH 011/118] Go: group BUILD and dbscheme generation target --- .pre-commit-config.yaml | 8 ++++---- go/BUILD.bazel | 28 ++++++++++++++++++++++++++++ go/gazelle/BUILD.bazel | 13 ------------- go/{gazelle/gazelle.py => gen.py} | 12 ++++++++++-- 4 files changed, 42 insertions(+), 19 deletions(-) delete mode 100644 go/gazelle/BUILD.bazel rename go/{gazelle/gazelle.py => gen.py} (56%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e81bcc7711..899ddd71b89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,11 +27,11 @@ repos: - repo: local hooks: - - id: gazelle - name: Check gazelle-generated BUILD files - files: go/extractor/.* + - id: go-gen + name: Check checked in generated files in go + files: go/.* language: system - entry: bazel run //go/gazelle + entry: bazel run //go:gen pass_filenames: false - id: codeql-format diff --git a/go/BUILD.bazel b/go/BUILD.bazel index 5736912310a..c5f32c5309f 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -1,7 +1,26 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files") load("@rules_pkg//pkg:install.bzl", "pkg_install") +load("@bazel_skylib//rules:native_binary.bzl", "native_binary") +load("@gazelle//:def.bzl", "gazelle") load("//:defs.bzl", "codeql_platform") +gazelle( + name = "_gazelle", +) + +_gen_binaries = [ + ":_gazelle", + "//go/extractor/cli/go-gen-dbscheme", +] + +py_binary( + name = "gen", + srcs = ["gen.py"], + args = ["$(rlocationpath %s)" % bin for bin in _gen_binaries], + data = _gen_binaries, + deps = ["@rules_python//python/runfiles"], +) + pkg_files( name = "resources", srcs = [ @@ -57,3 +76,12 @@ py_binary( main = "create_extractor_pack.py", deps = [":_create_extractor_pack"], ) + +native_binary( + name = "gen-dbscheme", + src = "//go/extractor/cli/go-gen-dbscheme", + out = "go-gen-dbscheme", + args = [ + "$$BUILD_WORKSPACE_DIRECTORY/go/ql/lib/go.dbscheme", + ], +) diff --git a/go/gazelle/BUILD.bazel b/go/gazelle/BUILD.bazel deleted file mode 100644 index 3d81b50590a..00000000000 --- a/go/gazelle/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@gazelle//:def.bzl", "gazelle") - -gazelle( - name = "_gazelle", -) - -py_binary( - name = "gazelle", - srcs = ["gazelle.py"], - args = ["$(rlocationpath :_gazelle)"], - data = [":_gazelle"], - deps = ["@rules_python//python/runfiles"], -) diff --git a/go/gazelle/gazelle.py b/go/gen.py similarity index 56% rename from go/gazelle/gazelle.py rename to go/gen.py index 200f3c3ed6b..7b7e9d73237 100644 --- a/go/gazelle/gazelle.py +++ b/go/gen.py @@ -4,13 +4,21 @@ import subprocess from python.runfiles import runfiles this = pathlib.Path(__file__).resolve() -go_extractor_dir = this.parents[1] / "extractor" -gazelle = runfiles.Create().Rlocation(sys.argv[1]) +go_extractor_dir = this.parent / "extractor" +go_dbscheme = this.parent / "ql" / "lib" / "go.dbscheme" +r = runfiles.Create() +gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:]) + +print("clearing generated BUILD files") for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): build_file.unlink() +print("running gazelle") subprocess.check_call([gazelle, "go/extractor"]) +print("adding header to generated BUILD files") for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): contents = build_file.read_text() build_file.write_text(f"# generated running `bazel run //go/gazelle`, do not edit\n\n{contents}") + +subprocess.check_call([go_gen_dbscheme, go_dbscheme]) From bfa189e2ac2c251518cb61f9665f0970b36e099d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 13:48:44 +0200 Subject: [PATCH 012/118] Go: use a dbscheme generated during the build in `extractor-pack` --- go/BUILD.bazel | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/go/BUILD.bazel b/go/BUILD.bazel index c5f32c5309f..d327a406f5f 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -21,13 +21,23 @@ py_binary( deps = ["@rules_python//python/runfiles"], ) +# this is an internal copy of the dbscheme to be used by extractor-pack +# this allows the extractor-pack target to be independent and up-to-date with respect to +# having run //go:gen to update the checked in files +genrule( + name = "dbscheme", + outs = ["go.dbscheme"], + cmd = "$(execpath //go/extractor/cli/go-gen-dbscheme) $@", + tools = ["//go/extractor/cli/go-gen-dbscheme"], +) + pkg_files( name = "resources", srcs = [ "LICENSE", "codeql-extractor.yml", - "ql/lib/go.dbscheme", "ql/lib/go.dbscheme.stats", + ":dbscheme", ], ) From 146d84bbf8c0012cb3e496a4deb7470afb61a0dd Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 15:20:33 +0200 Subject: [PATCH 013/118] Go: rework makefile --- go/Makefile | 75 +++++------------------------------------------------ 1 file changed, 7 insertions(+), 68 deletions(-) diff --git a/go/Makefile b/go/Makefile index d0289a093a5..d9ba2c7e2d4 100644 --- a/go/Makefile +++ b/go/Makefile @@ -1,4 +1,4 @@ -all: extractor ql/lib/go.dbscheme +all: gen extractor ifeq ($(OS),Windows_NT) EXE = .exe @@ -14,17 +14,11 @@ CODEQL_PLATFORM = osx64 endif endif -CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh baseline-config-empty.json baseline-config-vendor.json configure-baseline.cmd configure-baseline.sh identify-environment.cmd identify-environment.sh index.cmd index.sh pre-finalize.cmd pre-finalize.sh tracing-config.lua) - EXTRACTOR_PACK_OUT = build/codeql-extractor-go -BINARIES = go-extractor go-tokenizer go-autobuilder go-build-runner go-bootstrap go-gen-dbscheme - -.PHONY: tools tools-codeql tools-codeql-full clean autoformat \ - tools-linux64 tools-osx64 tools-win64 check-formatting +.PHONY: extractor gen clean autoformat check-formatting clean: - rm -rf tools/bin tools/linux64 tools/osx64 tools/win64 tools/net tools/opencsv rm -rf $(EXTRACTOR_PACK_OUT) build/stats build/testdb autoformat: @@ -47,66 +41,11 @@ endif qhelp-to-markdown: scripts/qhelp-to-markdown.sh ql/src "$(QHELP_OUT_DIR)" -tools: tools-codeql tools/tokenizer.jar +extractor: + bazel run :create-extractor-pack -.PHONY: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) -$(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))): - go build -C extractor -mod=vendor -o ../$@ ./cli/$(basename $(@F)) - -tools-codeql: tools-$(CODEQL_PLATFORM) - -tools-codeql-full: tools-linux64 tools-osx64 tools-win64 - -tools-linux64: $(addprefix tools/linux64/,$(BINARIES)) - -.PHONY: $(addprefix tools/linux64/,$(BINARIES)) -$(addprefix tools/linux64/,$(BINARIES)): - GOOS=linux GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@ ./cli/$(@F) - -tools-osx64: $(addprefix tools/osx64/,$(BINARIES)) - -.PHONY: $(addprefix tools/osx64/,$(BINARIES)) -$(addprefix tools/osx64/,$(BINARIES)): - GOOS=darwin GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@.amd64 ./cli/$(@F) - GOOS=darwin GOARCH=arm64 go build -C extractor -mod=vendor -o ../$@.arm64 ./cli/$(@F) - lipo -create $@.amd64 $@.arm64 -output $@ - rm $@.amd64 $@.arm64 - -tools-win64: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))) - -.PHONY: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))) -$(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))): - env GOOS=windows GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@ ./cli/$(basename $(@F)) - -.PHONY: extractor-common extractor extractor-full -extractor-common: codeql-extractor.yml LICENSE ql/lib/go.dbscheme \ - tools/tokenizer.jar $(CODEQL_TOOLS) - rm -rf $(EXTRACTOR_PACK_OUT) - mkdir -p $(EXTRACTOR_PACK_OUT) - cp codeql-extractor.yml LICENSE ql/lib/go.dbscheme ql/lib/go.dbscheme.stats $(EXTRACTOR_PACK_OUT) - mkdir $(EXTRACTOR_PACK_OUT)/tools - cp -r tools/tokenizer.jar $(CODEQL_TOOLS) $(EXTRACTOR_PACK_OUT)/tools - cp -r downgrades $(EXTRACTOR_PACK_OUT) - -extractor: extractor-common tools-codeql - cp -r tools/$(CODEQL_PLATFORM) $(EXTRACTOR_PACK_OUT)/tools - -extractor-full: extractor-common tools-codeql-full - cp -r $(addprefix tools/,linux64 osx64 win64) $(EXTRACTOR_PACK_OUT)/tools - -tools/tokenizer.jar: tools/net/sourceforge/pmd/cpd/GoLanguage.class - jar cf $@ -C tools net - jar uf $@ -C tools opencsv - -tools/net/sourceforge/pmd/cpd/GoLanguage.class: extractor/net/sourceforge/pmd/cpd/GoLanguage.java - javac -cp extractor -d tools $< - rm tools/net/sourceforge/pmd/cpd/AbstractLanguage.class - rm tools/net/sourceforge/pmd/cpd/SourceCode.class - rm tools/net/sourceforge/pmd/cpd/TokenEntry.class - rm tools/net/sourceforge/pmd/cpd/Tokenizer.class - -ql/lib/go.dbscheme: tools/$(CODEQL_PLATFORM)/go-gen-dbscheme$(EXE) - $< $@ +gen: + bazel run :gen build/stats/src.stamp: mkdir -p $(@D)/src @@ -123,7 +62,7 @@ test: all build/testdb/check-upgrade-path codeql test run -j0 ql/test --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache) # use GOOS=linux because GOOS=darwin GOARCH=386 is no longer supported env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache) - cd extractor; go test -mod=vendor ./... + cd extractor; bazel test ... bash extractor-smoke-test/test.sh || (echo "Extractor smoke test FAILED"; exit 1) .PHONY: build/testdb/check-upgrade-path From d98ccdfa066544c75c3278c7499e12986cfd11e5 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 16:02:22 +0200 Subject: [PATCH 014/118] Go: update workflow --- .github/workflows/go-tests.yml | 58 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 6d9cac5dae9..75c34f4f5de 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -28,13 +28,6 @@ jobs: name: Test Linux (Ubuntu) runs-on: ubuntu-latest-xl steps: - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - cache: false - id: go - - name: Check out code uses: actions/checkout@v4 @@ -47,24 +40,7 @@ jobs: - name: Build run: | - cd go - make - - - name: Check that all Go code is autoformatted - run: | - cd go - make check-formatting - - - name: Compile qhelp files to markdown - run: | - cd go - env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown - - - name: Upload qhelp markdown - uses: actions/upload-artifact@v3 - with: - name: qhelp-markdown - path: go/qhelp-out/**/*.md + bazel run //go:create-extractor-pack - name: Cache compilation cache id: query-cache @@ -76,3 +52,35 @@ jobs: run: | cd go make test cache="${{ steps.query-cache.outputs.cache-dir }}" + + check-code: + name: Check code + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Check that all Go code is autoformatted + run: | + cd go + make check-formatting + + - name: Check checked-in generated code + run: | + bazel run //go:gen + git add . + git diff --exit-code HEAD || ( + echo "please run bazel run //go:gen" + exit 1 + ) + + - name: Compile qhelp files to markdown + run: | + cd go + env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown + + - name: Upload qhelp markdown + uses: actions/upload-artifact@v3 + with: + name: qhelp-markdown + path: go/qhelp-out/**/*.md From 0f387eeac298cb8c30c11a13ba9f9dcd027220e9 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 16:31:04 +0200 Subject: [PATCH 015/118] Go: add vendor update to `//go:gen` --- go/BUILD.bazel | 9 ++++++--- go/extractor/vendor/modules.txt | 1 + go/gen.py | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/go/BUILD.bazel b/go/BUILD.bazel index e769afeea1d..50e2bc0d447 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -1,15 +1,17 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary") load("@gazelle//:def.bzl", "gazelle") load("@rules_pkg//pkg:install.bzl", "pkg_install") -load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files") +load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") load("//:defs.bzl", "codeql_platform") gazelle( - name = "_gazelle", + name = "gazelle", + extra_args = ["go/extractor"], ) _gen_binaries = [ - ":_gazelle", + "@rules_go//go", + ":gazelle", "//go/extractor/cli/go-gen-dbscheme", ] @@ -62,6 +64,7 @@ pkg_files( "//go/extractor/cli/go-gen-dbscheme", "//go/extractor/cli/go-tokenizer", ], + attributes = pkg_attributes(mode = "0755"), prefix = "tools/" + codeql_platform, visibility = ["//visibility:public"], ) diff --git a/go/extractor/vendor/modules.txt b/go/extractor/vendor/modules.txt index 5687615f62c..37c4a68d828 100644 --- a/go/extractor/vendor/modules.txt +++ b/go/extractor/vendor/modules.txt @@ -1,3 +1,4 @@ +## workspace # golang.org/x/mod v0.15.0 ## explicit; go 1.18 golang.org/x/mod/internal/lazyregexp diff --git a/go/gen.py b/go/gen.py index 7b7e9d73237..4b4cac0e46f 100644 --- a/go/gen.py +++ b/go/gen.py @@ -7,14 +7,17 @@ this = pathlib.Path(__file__).resolve() go_extractor_dir = this.parent / "extractor" go_dbscheme = this.parent / "ql" / "lib" / "go.dbscheme" r = runfiles.Create() -gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:]) +go, gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:]) + +print("updating vendor") +subprocess.check_call([go, "-C", go_extractor_dir, "work", "vendor"]) print("clearing generated BUILD files") for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): build_file.unlink() print("running gazelle") -subprocess.check_call([gazelle, "go/extractor"]) +subprocess.check_call([gazelle]) print("adding header to generated BUILD files") for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): From 86d6b8ef21c8a1d82fb23c4530aa31b07de0a305 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 16:39:51 +0200 Subject: [PATCH 016/118] Go: put back go setup --- .github/workflows/go-tests.yml | 47 +++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 75c34f4f5de..5c9204f8405 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -16,9 +16,6 @@ on: - .github/actions/** - codeql-workspace.yml -env: - GO_VERSION: '~1.22.0' - permissions: contents: read @@ -31,6 +28,21 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - name: Get go version + shell: bash + run: | + ( + echo -n "GO_VERSION=" + bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' + ) | tee -a "$GITHUB_ENV" + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + id: go + - name: Set up CodeQL CLI uses: ./.github/actions/fetch-codeql @@ -42,24 +54,6 @@ jobs: run: | bazel run //go:create-extractor-pack - - name: Cache compilation cache - id: query-cache - uses: ./.github/actions/cache-query-compilation - with: - key: go-qltest - - - name: Test - run: | - cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" - - check-code: - name: Check code - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Check that all Go code is autoformatted run: | cd go @@ -84,3 +78,14 @@ jobs: with: name: qhelp-markdown path: go/qhelp-out/**/*.md + + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: go-qltest + + - name: Test + run: | + cd go + make test cache="${{ steps.query-cache.outputs.cache-dir }}" From d66494dcb0b2b23010794a052a2315f19de10f30 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 17:03:56 +0200 Subject: [PATCH 017/118] Go: update `go-tests-other-os.yml` --- .github/workflows/go-tests-other-os.yml | 70 ++++++++----------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/.github/workflows/go-tests-other-os.yml b/.github/workflows/go-tests-other-os.yml index ded53f868b7..ba3dd0335ad 100644 --- a/.github/workflows/go-tests-other-os.yml +++ b/.github/workflows/go-tests-other-os.yml @@ -7,27 +7,38 @@ on: - .github/workflows/go-tests-other-os.yml - .github/actions/** - codeql-workspace.yml -env: - GO_VERSION: '~1.22.0' permissions: contents: read jobs: - test-mac: - name: Test MacOS - runs-on: macos-latest + test: + name: Test + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest-xl] + if: matrix.os == 'macos-latest' || github.repository_owner == 'github' + runs-on: ${{ matrix.os }} steps: - - name: Set up Go ${{ env.GO_VERSION }} + - name: Check out code + uses: actions/checkout@v4 + + - name: Get go version + shell: bash + run: | + ( + echo -n "GO_VERSION=" + bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' + ) | tee -a "$GITHUB_ENV" + + - name: Set up Go uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} cache: false id: go - - name: Check out code - uses: actions/checkout@v4 - - name: Set up CodeQL CLI uses: ./.github/actions/fetch-codeql @@ -37,8 +48,7 @@ jobs: - name: Build run: | - cd go - make + bazel run //go:create-extractor-pack - name: Cache compilation cache id: query-cache @@ -49,41 +59,3 @@ jobs: run: | cd go make test cache="${{ steps.query-cache.outputs.cache-dir }}" - - test-win: - if: github.repository_owner == 'github' - name: Test Windows - runs-on: windows-latest-xl - steps: - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - cache: false - id: go - - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up CodeQL CLI - uses: ./.github/actions/fetch-codeql - - - name: Enable problem matchers in repository - shell: bash - run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' - - - name: Build - run: | - cd go - make - - - name: Cache compilation cache - id: query-cache - uses: ./.github/actions/cache-query-compilation - with: - key: go-qltest - - - name: Test - run: | - cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" From b0758fd1097191313fc62a95cb61edff994707ee Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 10:29:53 +0200 Subject: [PATCH 018/118] Go: workaround for gazelle on macOS See https://github.com/bazelbuild/bazel-gazelle/issues/1793 for details. --- MODULE.bazel | 6 +++++- go/BUILD.bazel | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 6daa5a98215..5fd99f76740 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -56,7 +56,11 @@ node.toolchain( use_repo(node, "nodejs", "nodejs_toolchains") go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.22.2") +go_sdk.download(version = "1.22.2") # default + +# following is needed for gazelle on macOS +# see https://github.com/bazelbuild/bazel-gazelle/issues/1793 +go_sdk.download(version = "1.21.9") register_toolchains( "@nodejs_toolchains//:all", diff --git a/go/BUILD.bazel b/go/BUILD.bazel index 50e2bc0d447..41113d45f51 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -1,12 +1,25 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary") load("@gazelle//:def.bzl", "gazelle") +load("@rules_go//go:def.bzl", "go_cross_binary") load("@rules_pkg//pkg:install.bzl", "pkg_install") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") load("//:defs.bzl", "codeql_platform") +# following is needed for running gazelle on macOS +# see https://github.com/bazelbuild/bazel-gazelle/issues/1793 +go_cross_binary( + name = "gazelle-1.21.9", + sdk_version = "1.21.9", + target = "@gazelle//cmd/gazelle", +) + gazelle( name = "gazelle", extra_args = ["go/extractor"], + gazelle = select({ + "@platforms//os:macos": ":gazelle-1.21.9", + "//conditions:default": "@gazelle//cmd/gazelle", + }), ) _gen_binaries = [ From 0dfd3367291da2e84b2dbe95f57d3ae054992bf3 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 10:34:22 +0200 Subject: [PATCH 019/118] Go: fix `//go:gen` on windows --- go/gen.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/go/gen.py b/go/gen.py index 4b4cac0e46f..b9394cd15b2 100644 --- a/go/gen.py +++ b/go/gen.py @@ -1,11 +1,17 @@ import sys import pathlib import subprocess +import os from python.runfiles import runfiles -this = pathlib.Path(__file__).resolve() -go_extractor_dir = this.parent / "extractor" -go_dbscheme = this.parent / "ql" / "lib" / "go.dbscheme" +try: + workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']) +except KeyError: + print("this should be run with bazel run", file=sys.stderr) + sys.exit(1) + +go_extractor_dir = workspace_dir / "go" / "extractor" +go_dbscheme = workspace_dir / "go" / "ql" / "lib" / "go.dbscheme" r = runfiles.Create() go, gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:]) From 6ec223c5150efbacdb14157f7e5f0815bac7d62a Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 11:00:21 +0200 Subject: [PATCH 020/118] Go: small cleanup in `Makefile` --- go/Makefile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/go/Makefile b/go/Makefile index d9ba2c7e2d4..3ebeb69fcaf 100644 --- a/go/Makefile +++ b/go/Makefile @@ -1,19 +1,5 @@ all: gen extractor -ifeq ($(OS),Windows_NT) -EXE = .exe -CODEQL_PLATFORM = win64 -else -EXE = -UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Linux) -CODEQL_PLATFORM = linux64 -endif -ifeq ($(UNAME_S),Darwin) -CODEQL_PLATFORM = osx64 -endif -endif - EXTRACTOR_PACK_OUT = build/codeql-extractor-go .PHONY: extractor gen clean autoformat check-formatting From 2f6dd2ab819c59425a4c636cdb65930d6c6405fb Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 11:11:23 +0200 Subject: [PATCH 021/118] Go: refactor workflows with shared action --- .github/workflows/go-tests-other-os.yml | 57 +++++------------- .github/workflows/go-tests.yml | 64 +------------------- go/actions/test/action.yml | 80 +++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 104 deletions(-) create mode 100644 go/actions/test/action.yml diff --git a/.github/workflows/go-tests-other-os.yml b/.github/workflows/go-tests-other-os.yml index ba3dd0335ad..9915b0869db 100644 --- a/.github/workflows/go-tests-other-os.yml +++ b/.github/workflows/go-tests-other-os.yml @@ -12,50 +12,21 @@ permissions: contents: read jobs: - test: - name: Test - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest-xl] - if: matrix.os == 'macos-latest' || github.repository_owner == 'github' - runs-on: ${{ matrix.os }} + test-mac: + name: Test MacOS + runs-on: macos-latest steps: - name: Check out code uses: actions/checkout@v4 + - name: Run tests + uses: ./go/actions/test - - name: Get go version - shell: bash - run: | - ( - echo -n "GO_VERSION=" - bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' - ) | tee -a "$GITHUB_ENV" - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - cache: false - id: go - - - name: Set up CodeQL CLI - uses: ./.github/actions/fetch-codeql - - - name: Enable problem matchers in repository - shell: bash - run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' - - - name: Build - run: | - bazel run //go:create-extractor-pack - - - name: Cache compilation cache - id: query-cache - uses: ./.github/actions/cache-query-compilation - with: - key: go-qltest - - name: Test - run: | - cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" + test-win: + if: github.repository_owner == 'github' + name: Test Windows + runs-on: windows-latest-xl + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Run tests + uses: ./go/actions/test diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 5c9204f8405..63e2b7c4974 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -27,65 +27,7 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 - - - name: Get go version - shell: bash - run: | - ( - echo -n "GO_VERSION=" - bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' - ) | tee -a "$GITHUB_ENV" - - - name: Set up Go - uses: actions/setup-go@v5 + - name: Run tests + uses: ./go/actions/test with: - go-version: ${{ env.GO_VERSION }} - cache: false - id: go - - - name: Set up CodeQL CLI - uses: ./.github/actions/fetch-codeql - - - name: Enable problem matchers in repository - shell: bash - run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' - - - name: Build - run: | - bazel run //go:create-extractor-pack - - - name: Check that all Go code is autoformatted - run: | - cd go - make check-formatting - - - name: Check checked-in generated code - run: | - bazel run //go:gen - git add . - git diff --exit-code HEAD || ( - echo "please run bazel run //go:gen" - exit 1 - ) - - - name: Compile qhelp files to markdown - run: | - cd go - env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown - - - name: Upload qhelp markdown - uses: actions/upload-artifact@v3 - with: - name: qhelp-markdown - path: go/qhelp-out/**/*.md - - - name: Cache compilation cache - id: query-cache - uses: ./.github/actions/cache-query-compilation - with: - key: go-qltest - - - name: Test - run: | - cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" + run-code-checks: true diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml new file mode 100644 index 00000000000..f9bdee5fe0c --- /dev/null +++ b/go/actions/test/action.yml @@ -0,0 +1,80 @@ +name: Test go extractor +description: Run build, QL tests and optionally basic code sanity checks (formatting and generation) +inputs: + run-code-checks: + description: Whether to run formatting, code and qhelp generation checks + required: false + default: false +runs: + using: composite + steps: + - name: Get go version + shell: bash + run: | + ( + echo -n "GO_VERSION=" + bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' + ) | tee -a "$GITHUB_ENV" + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + id: go + + - name: Set up CodeQL CLI + uses: ./.github/actions/fetch-codeql + + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + + - name: Build + shell: bash + run: | + bazel run //go:create-extractor-pack + + - name: Check that all Go code is autoformatted + if: inputs.run-code-checks == 'true' + shell: bash + run: | + cd go + make check-formatting + + - name: Check checked-in generated code + if: inputs.run-code-checks == 'true' + shell: bash + run: | + bazel run //go:gen + git add . + git diff --exit-code HEAD || ( + echo "please run bazel run //go:gen" + exit 1 + ) + + - name: Compile qhelp files to markdown + if: inputs.run-code-checks == 'true' + shell: bash + run: | + cd go + env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown + + - name: Upload qhelp markdown + if: inputs.run-code-checks == 'true' + uses: actions/upload-artifact@v3 + with: + name: qhelp-markdown + path: go/qhelp-out/**/*.md + + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: go-qltest + + - name: Test + shell: bash + run: | + cd go + make test cache="${{ steps.query-cache.outputs.cache-dir }}" From f0f6c229f6d10c6f3f770777a5bc23b1bd808439 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 11:16:30 +0200 Subject: [PATCH 022/118] Go: fix regex in action for macOS --- go/actions/test/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml index f9bdee5fe0c..ade22410d95 100644 --- a/go/actions/test/action.yml +++ b/go/actions/test/action.yml @@ -13,7 +13,7 @@ runs: run: | ( echo -n "GO_VERSION=" - bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' + bazel run @rules_go//go -- version | sed 's/go version go\(.*\) .*/\1/' ) | tee -a "$GITHUB_ENV" - name: Set up Go From 1f78882cdc80011a86dfeb866b08dd46f3004121 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 11:27:16 +0200 Subject: [PATCH 023/118] Go: make windows checks happy --- go/actions/test/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml index ade22410d95..a351c4382ac 100644 --- a/go/actions/test/action.yml +++ b/go/actions/test/action.yml @@ -33,7 +33,7 @@ runs: - name: Build shell: bash run: | - bazel run //go:create-extractor-pack + bazel run go:create-extractor-pack - name: Check that all Go code is autoformatted if: inputs.run-code-checks == 'true' @@ -46,7 +46,7 @@ runs: if: inputs.run-code-checks == 'true' shell: bash run: | - bazel run //go:gen + bazel run go:gen git add . git diff --exit-code HEAD || ( echo "please run bazel run //go:gen" From 15bb846a5fb9a00748219475e4a2d436181e5e1a Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 12:17:47 +0200 Subject: [PATCH 024/118] Go: add workaround for extractor pack windows installer --- go/BUILD.bazel | 23 +++++++++++++++++++++-- go/create_extractor_pack.py | 16 +++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/go/BUILD.bazel b/go/BUILD.bazel index 41113d45f51..4251ebd228f 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -3,6 +3,7 @@ load("@gazelle//:def.bzl", "gazelle") load("@rules_go//go:def.bzl", "go_cross_binary") load("@rules_pkg//pkg:install.bzl", "pkg_install") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") +load("@rules_pkg//pkg:zip.bzl", "pkg_zip") load("//:defs.bzl", "codeql_platform") # following is needed for running gazelle on macOS @@ -92,15 +93,33 @@ pkg_filegroup( ) pkg_install( - name = "_create_extractor_pack", + name = "_extractor-pack-installer", srcs = [":extractor-pack"], ) +# rules_pkg installer is currently broken on Windows +# see https://github.com/bazelbuild/rules_pkg/issues/387 +# for now, work around it using an archive +pkg_zip( + name = "_extractor-pack-zip", + srcs = [":extractor-pack"], +) + +alias( + name = "_create-extractor-pack-arg", + actual = select({ + "@platforms//os:windows": ":_extractor-pack-zip", + "//conditions:default": ":_extractor-pack-installer", + }), +) + py_binary( name = "create-extractor-pack", srcs = ["create_extractor_pack.py"], + args = ["$(rlocationpath :_create-extractor-pack-arg)"], + data = [":_create-extractor-pack-arg"], main = "create_extractor_pack.py", - deps = [":_create_extractor_pack"], + deps = ["@rules_python//python/runfiles"], ) native_binary( diff --git a/go/create_extractor_pack.py b/go/create_extractor_pack.py index 08665a2d8dc..a1154a777d8 100644 --- a/go/create_extractor_pack.py +++ b/go/create_extractor_pack.py @@ -2,7 +2,9 @@ import os import pathlib import shutil import sys -from go._create_extractor_pack_install_script import main +import subprocess +import zipfile +from python.runfiles import runfiles try: workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']) @@ -11,6 +13,14 @@ except KeyError: sys.exit(1) dest_dir = workspace_dir / 'go' / 'build' / 'codeql-extractor-go' +installer_or_zip = pathlib.Path(runfiles.Create().Rlocation(sys.argv[1])) + shutil.rmtree(dest_dir, ignore_errors=True) -os.environ['DESTDIR'] = str(dest_dir) -main(sys.argv) + +if installer_or_zip.suffix == '.zip': + dest_dir.mkdir() + with zipfile.ZipFile(installer_or_zip) as pack: + pack.extractall(dest_dir) +else: + os.environ['DESTDIR'] = str(dest_dir) + subprocess.check_call([installer_or_zip]) From e7886d0e572a3b13e073dce8a121ef44dd9e6e26 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 13:31:48 +0200 Subject: [PATCH 025/118] Bazel: add empty registry override --- .bazelrc | 3 + .bazelrc.internal | 4 + misc/bazel/registry/AUTHORS | 7 + misc/bazel/registry/LICENSE | 202 ++++++++++++++++++++++++ misc/bazel/registry/NOTICE | 3 + misc/bazel/registry/README.md | 3 + misc/bazel/registry/bazel_registry.json | 3 + misc/bazel/registry/fix.py | 55 +++++++ 8 files changed, 280 insertions(+) create mode 100644 .bazelrc.internal create mode 100644 misc/bazel/registry/AUTHORS create mode 100644 misc/bazel/registry/LICENSE create mode 100644 misc/bazel/registry/NOTICE create mode 100644 misc/bazel/registry/README.md create mode 100644 misc/bazel/registry/bazel_registry.json create mode 100755 misc/bazel/registry/fix.py diff --git a/.bazelrc b/.bazelrc index 12232b4bbd6..0a49f682da3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -14,4 +14,7 @@ build:linux --cxxopt=-std=c++20 build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64 build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor +common --registry=file:///%workspace%/misc/bazel/registry +common --registry=https://bcr.bazel.build + try-import %workspace%/local.bazelrc diff --git a/.bazelrc.internal b/.bazelrc.internal new file mode 100644 index 00000000000..cdffa9ccdea --- /dev/null +++ b/.bazelrc.internal @@ -0,0 +1,4 @@ +# this file should contain bazel settings required to build things from `semmle-code` + +common --registry=file:///%workspace%/ql/misc/bazel/registry +common --registry=https://bcr.bazel.build diff --git a/misc/bazel/registry/AUTHORS b/misc/bazel/registry/AUTHORS new file mode 100644 index 00000000000..42818b292e7 --- /dev/null +++ b/misc/bazel/registry/AUTHORS @@ -0,0 +1,7 @@ +# This is the list of Bazel's significant contributors. +# +# This does not necessarily list everyone who has contributed code, +# especially since many employees of one corporation may be contributing. +# To see the full list of contributors, see the revision history in +# source control. +Google LLC diff --git a/misc/bazel/registry/LICENSE b/misc/bazel/registry/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/misc/bazel/registry/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/misc/bazel/registry/NOTICE b/misc/bazel/registry/NOTICE new file mode 100644 index 00000000000..95329ae18f6 --- /dev/null +++ b/misc/bazel/registry/NOTICE @@ -0,0 +1,3 @@ +The files in this directory where originally taken from http://github.com/bazelbuild/bazel-central-registry and are +a derivative work thereof, distributed under the Apache 2.0 license, with the following exceptions: +* the `fix.py` file was added under the MIT license as the rest of the `codeql` repository. diff --git a/misc/bazel/registry/README.md b/misc/bazel/registry/README.md new file mode 100644 index 00000000000..5d1723d0eac --- /dev/null +++ b/misc/bazel/registry/README.md @@ -0,0 +1,3 @@ +Versions to be patched can be taken from https://github.com/bazelbuild/bazel-central-repository. After adding patches +inside `//patches`, and eventually renaming ``, run [`fix.py`](./fix.py) to align all metadata +to the renamed version and added patches. diff --git a/misc/bazel/registry/bazel_registry.json b/misc/bazel/registry/bazel_registry.json new file mode 100644 index 00000000000..ea3f94f7a1e --- /dev/null +++ b/misc/bazel/registry/bazel_registry.json @@ -0,0 +1,3 @@ +{ + "mirrors": [] +} diff --git a/misc/bazel/registry/fix.py b/misc/bazel/registry/fix.py new file mode 100755 index 00000000000..a2b947e19e2 --- /dev/null +++ b/misc/bazel/registry/fix.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 GitHub, Inc. + +""" +Fix metadata in overridden registry, updating `metadata.json` to list correct versions and `source.json` +to list correct patches with sha256 hashes. +""" + +import pathlib +import json +import base64 +import hashlib +import re + +this_dir = pathlib.Path(__file__).resolve().parent + + +def sha256(file): + with open(file, 'rb') as input: + hash = hashlib.sha256(input.read()).digest() + hash = base64.b64encode(hash).decode() + return f"sha256-{hash}" + + +def patch_file(file, f): + try: + data = file.read_text() + except FileNotFoundError: + data = None + file.write_text(f(data)) + + +def patch_json(file, **kwargs): + def update(data): + data = json.loads(data) if data else {} + data.update(kwargs) + return json.dumps(data, indent=4) + "\n" + + patch_file(file, update) + + +for entry in this_dir.joinpath("modules").iterdir(): + if not entry.is_dir(): + continue + versions = [e for e in entry.iterdir() if e.is_dir()] + + patch_json(entry / "metadata.json", versions=[v.name for v in versions]) + + for version in versions: + patch_json(version / "source.json", patches={ + p.name: sha256(p) for p in version.joinpath("patches").iterdir() + }) + patch_file(version / "MODULE.bazel", + lambda s: re.sub(r'''version\s*=\s*['"].*['"]''', f'version = "{version.name}"', s, 1)) From cb85a756a053b4f7526e3ef7ab88e4c044baa39d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 29 Apr 2024 13:42:05 +0200 Subject: [PATCH 026/118] Bazel: patch `apple_support` to avoid registering its toolchain This is done in order to avoid requiring a full Xcode installation, but still being able to use other `apple_support` facilities, like `universal_binary`. --- MODULE.bazel | 2 +- .../1.15.1-codeql.1/MODULE.bazel | 17 ++++++++++++++++ .../1.15.1-codeql.1/patches/module.patch | 20 +++++++++++++++++++ .../apple_support/1.15.1-codeql.1/source.json | 9 +++++++++ .../modules/apple_support/metadata.json | 5 +++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel create mode 100644 misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch create mode 100644 misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json create mode 100644 misc/bazel/registry/modules/apple_support/metadata.json diff --git a/MODULE.bazel b/MODULE.bazel index 5fd99f76740..875e61da383 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,7 +13,7 @@ local_path_override( # see https://registry.bazel.build/ for a list of available packages -bazel_dep(name = "apple_support", version = "1.15.1") +bazel_dep(name = "apple_support", version = "1.15.1-codeql.1") bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "rules_go", version = "0.47.0") bazel_dep(name = "rules_pkg", version = "0.10.1") diff --git a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel new file mode 100644 index 00000000000..a58d520fee2 --- /dev/null +++ b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel @@ -0,0 +1,17 @@ +module( + name = "apple_support", + version = "1.15.1-codeql.1", + bazel_compatibility = [">=6.0.0"], + compatibility_level = 1, + repo_name = "build_bazel_apple_support", +) + +bazel_dep(name = "bazel_skylib", version = "1.3.0") +bazel_dep(name = "platforms", version = "0.0.9") + +bazel_dep( + name = "stardoc", + version = "0.6.2", + dev_dependency = True, + repo_name = "io_bazel_stardoc", +) diff --git a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch new file mode 100644 index 00000000000..59fc49ec7b3 --- /dev/null +++ b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch @@ -0,0 +1,20 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +index 6b06c3b..99bc7c6 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -1,6 +1,6 @@ + module( + name = "apple_support", +- version = "0", ++ version = "1.15.1-codeql.1", + bazel_compatibility = [">=6.0.0"], + compatibility_level = 1, + repo_name = "build_bazel_apple_support", +@@ -16,7 +16,3 @@ bazel_dep( + repo_name = "io_bazel_stardoc", + ) + +-apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension") +-use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains") +- +-register_toolchains("@local_config_apple_cc_toolchains//:all") diff --git a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json new file mode 100644 index 00000000000..57a1f2137fe --- /dev/null +++ b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-xLsrc2fEhDgjAK7nW+WYuS+EeJb7MbvSLzojRq32aoA=", + "strip_prefix": "", + "url": "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz", + "patches": { + "module.patch": "sha256-K06B2W9t6nKcU8S5u6cWeNIdw/vGWWKAoJdGiI8CSS0=" + }, + "patch_strip": 1 +} diff --git a/misc/bazel/registry/modules/apple_support/metadata.json b/misc/bazel/registry/modules/apple_support/metadata.json new file mode 100644 index 00000000000..8a0e54c9abd --- /dev/null +++ b/misc/bazel/registry/modules/apple_support/metadata.json @@ -0,0 +1,5 @@ +{ + "versions": [ + "1.15.1-codeql.1" + ] +} From 608791fd7f99166b6f6daba5b27f9abb7c37bac9 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 09:13:40 +0200 Subject: [PATCH 027/118] Bazel/Go: use native cross compilation for fat binaries --- go/rules.bzl | 40 +++++++++++++++++++++++++++++---- misc/bazel/universal_binary.bzl | 24 -------------------- 2 files changed, 36 insertions(+), 28 deletions(-) delete mode 100644 misc/bazel/universal_binary.bzl diff --git a/go/rules.bzl b/go/rules.bzl index 4ef798001d2..e26dd57bf44 100644 --- a/go/rules.bzl +++ b/go/rules.bzl @@ -1,5 +1,37 @@ -load("@rules_go//go:def.bzl", "go_binary") -load("//misc/bazel:universal_binary.bzl", "wrap_as_universal_binary") +load("@rules_go//go:def.bzl", "go_binary", "go_cross_binary") -def codeql_go_binary(**kwargs): - wrap_as_universal_binary(go_binary, **kwargs) +def codeql_go_binary(*, name, visibility = None, **kwargs): + def internal(prefix = "internal"): + return "%s/%s" % (prefix, name) + + go_binary( + name = internal(), + visibility = ["//visibility:private"], + **kwargs + ) + macos_targets = ("darwin_arm64", "darwin_amd64") + for target in macos_targets: + go_cross_binary( + name = internal(target), + platform = "@rules_go//go/toolchain:%s" % target, + target = internal(), + target_compatible_with = ["@platforms//os:macos"], + visibility = ["//visibility:private"], + ) + native.genrule( + name = internal("universal"), + outs = [internal("universal_")], + srcs = [internal(t) for t in macos_targets], + target_compatible_with = ["@platforms//os:macos"], + executable = True, + visibility = ["//visibility:private"], + cmd = "lipo -create $(SRCS) -output $@", + ) + native.alias( + name = name, + actual = select({ + "@platforms//os:macos": internal("universal"), + "//conditions:default": internal(), + }), + visibility = visibility, + ) diff --git a/misc/bazel/universal_binary.bzl b/misc/bazel/universal_binary.bzl deleted file mode 100644 index 85881356d0e..00000000000 --- a/misc/bazel/universal_binary.bzl +++ /dev/null @@ -1,24 +0,0 @@ -load("@apple_support//rules:universal_binary.bzl", _universal_binary = "universal_binary") - -def wrap_as_universal_binary(rule, *, name, visibility = None, **kwargs): - internal_name = "internal/%s" % name - universal_name = "universal/%s" % name - rule( - name = internal_name, - visibility = ["//visibility:private"], - **kwargs - ) - _universal_binary( - name = universal_name, - target_compatible_with = ["@platforms//os:macos"], - binary = internal_name, - visibility = ["//visibility:private"], - ) - native.alias( - name = name, - actual = select({ - "@platforms//os:macos": universal_name, - "//conditions:default": internal_name, - }), - visibility = visibility, - ) From 94212d103ec3cffd91f5efcffa668db36f99b7a7 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 09:14:15 +0200 Subject: [PATCH 028/118] Bazel/Go: remove `apple_support` This was actually unnecessary, and requried a full Xcode installation that we'd rather avoid. --- MODULE.bazel | 5 ----- go/BUILD.bazel | 13 ------------ .../1.15.1-codeql.1/MODULE.bazel | 17 ---------------- .../1.15.1-codeql.1/patches/module.patch | 20 ------------------- .../apple_support/1.15.1-codeql.1/source.json | 9 --------- .../modules/apple_support/metadata.json | 5 ----- 6 files changed, 69 deletions(-) delete mode 100644 misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel delete mode 100644 misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch delete mode 100644 misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json delete mode 100644 misc/bazel/registry/modules/apple_support/metadata.json diff --git a/MODULE.bazel b/MODULE.bazel index 875e61da383..d069d320f07 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,7 +13,6 @@ local_path_override( # see https://registry.bazel.build/ for a list of available packages -bazel_dep(name = "apple_support", version = "1.15.1-codeql.1") bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "rules_go", version = "0.47.0") bazel_dep(name = "rules_pkg", version = "0.10.1") @@ -58,10 +57,6 @@ use_repo(node, "nodejs", "nodejs_toolchains") go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") go_sdk.download(version = "1.22.2") # default -# following is needed for gazelle on macOS -# see https://github.com/bazelbuild/bazel-gazelle/issues/1793 -go_sdk.download(version = "1.21.9") - register_toolchains( "@nodejs_toolchains//:all", ) diff --git a/go/BUILD.bazel b/go/BUILD.bazel index 4251ebd228f..6c80e7cb258 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -1,26 +1,13 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary") load("@gazelle//:def.bzl", "gazelle") -load("@rules_go//go:def.bzl", "go_cross_binary") load("@rules_pkg//pkg:install.bzl", "pkg_install") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") load("@rules_pkg//pkg:zip.bzl", "pkg_zip") load("//:defs.bzl", "codeql_platform") -# following is needed for running gazelle on macOS -# see https://github.com/bazelbuild/bazel-gazelle/issues/1793 -go_cross_binary( - name = "gazelle-1.21.9", - sdk_version = "1.21.9", - target = "@gazelle//cmd/gazelle", -) - gazelle( name = "gazelle", extra_args = ["go/extractor"], - gazelle = select({ - "@platforms//os:macos": ":gazelle-1.21.9", - "//conditions:default": "@gazelle//cmd/gazelle", - }), ) _gen_binaries = [ diff --git a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel deleted file mode 100644 index a58d520fee2..00000000000 --- a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/MODULE.bazel +++ /dev/null @@ -1,17 +0,0 @@ -module( - name = "apple_support", - version = "1.15.1-codeql.1", - bazel_compatibility = [">=6.0.0"], - compatibility_level = 1, - repo_name = "build_bazel_apple_support", -) - -bazel_dep(name = "bazel_skylib", version = "1.3.0") -bazel_dep(name = "platforms", version = "0.0.9") - -bazel_dep( - name = "stardoc", - version = "0.6.2", - dev_dependency = True, - repo_name = "io_bazel_stardoc", -) diff --git a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch deleted file mode 100644 index 59fc49ec7b3..00000000000 --- a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/patches/module.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/MODULE.bazel b/MODULE.bazel -index 6b06c3b..99bc7c6 100644 ---- a/MODULE.bazel -+++ b/MODULE.bazel -@@ -1,6 +1,6 @@ - module( - name = "apple_support", -- version = "0", -+ version = "1.15.1-codeql.1", - bazel_compatibility = [">=6.0.0"], - compatibility_level = 1, - repo_name = "build_bazel_apple_support", -@@ -16,7 +16,3 @@ bazel_dep( - repo_name = "io_bazel_stardoc", - ) - --apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension") --use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains") -- --register_toolchains("@local_config_apple_cc_toolchains//:all") diff --git a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json b/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json deleted file mode 100644 index 57a1f2137fe..00000000000 --- a/misc/bazel/registry/modules/apple_support/1.15.1-codeql.1/source.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "integrity": "sha256-xLsrc2fEhDgjAK7nW+WYuS+EeJb7MbvSLzojRq32aoA=", - "strip_prefix": "", - "url": "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz", - "patches": { - "module.patch": "sha256-K06B2W9t6nKcU8S5u6cWeNIdw/vGWWKAoJdGiI8CSS0=" - }, - "patch_strip": 1 -} diff --git a/misc/bazel/registry/modules/apple_support/metadata.json b/misc/bazel/registry/modules/apple_support/metadata.json deleted file mode 100644 index 8a0e54c9abd..00000000000 --- a/misc/bazel/registry/modules/apple_support/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "versions": [ - "1.15.1-codeql.1" - ] -} From 6eb07a7a7e99ee2aec2373cf71172cfb0c4a5ba0 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Thu, 2 May 2024 11:05:39 +0100 Subject: [PATCH 029/118] Apply suggestions from code review Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> --- README.md | 2 +- docs/codeql/ql-training/cpp/bad-overflow-guard.rst | 2 +- docs/codeql/ql-training/cpp/control-flow-cpp.rst | 2 +- docs/codeql/ql-training/cpp/data-flow-cpp.rst | 2 +- docs/codeql/ql-training/cpp/global-data-flow-cpp.rst | 2 +- docs/codeql/ql-training/cpp/intro-ql-cpp.rst | 2 +- docs/codeql/ql-training/cpp/snprintf.rst | 2 +- docs/codeql/ql-training/java/apache-struts-java.rst | 2 +- docs/codeql/ql-training/java/data-flow-java.rst | 2 +- docs/codeql/ql-training/java/global-data-flow-java.rst | 2 +- docs/codeql/ql-training/java/intro-ql-java.rst | 2 +- docs/codeql/ql-training/java/query-injection-java.rst | 2 +- docs/codeql/ql-training/template.rst | 2 +- docs/codeql/reusables/vs-code-deprecation-note.rst | 2 +- python/ql/src/CHANGELOG.md | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 42382b1d834..2a0fad907f9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This open source repository contains the standard CodeQL libraries and queries t ## How do I learn CodeQL and run queries? -There is [extensive documentation](https://codeql.github.com/docs/) on getting started with writing CodeQL using the [CodeQL extension for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/) and the [CodeQL CLI](https://codeql.github.com/docs/codeql-cli/). +There is [extensive documentation](https://codeql.github.com/docs/) on getting started with writing CodeQL using the [CodeQL extension for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/) and the [CodeQL CLI](https://docs.github.com/en/code-security/codeql-cli). ## Contributing diff --git a/docs/codeql/ql-training/cpp/bad-overflow-guard.rst b/docs/codeql/ql-training/cpp/bad-overflow-guard.rst index 07a5b78af76..b2e6883dcae 100644 --- a/docs/codeql/ql-training/cpp/bad-overflow-guard.rst +++ b/docs/codeql/ql-training/cpp/bad-overflow-guard.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. Checking for overflow in C ========================== diff --git a/docs/codeql/ql-training/cpp/control-flow-cpp.rst b/docs/codeql/ql-training/cpp/control-flow-cpp.rst index d2bbc6a6af2..6c6905576e5 100644 --- a/docs/codeql/ql-training/cpp/control-flow-cpp.rst +++ b/docs/codeql/ql-training/cpp/control-flow-cpp.rst @@ -11,7 +11,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `ChakraCore `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/cpp/data-flow-cpp.rst b/docs/codeql/ql-training/cpp/data-flow-cpp.rst index e46f72596be..8a22db69463 100644 --- a/docs/codeql/ql-training/cpp/data-flow-cpp.rst +++ b/docs/codeql/ql-training/cpp/data-flow-cpp.rst @@ -9,7 +9,7 @@ Finding string formatting vulnerabilities in C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst b/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst index c0dc6923f67..62c235b7696 100644 --- a/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst +++ b/docs/codeql/ql-training/cpp/global-data-flow-cpp.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `dotnet/coreclr `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/cpp/intro-ql-cpp.rst b/docs/codeql/ql-training/cpp/intro-ql-cpp.rst index 005f847b846..2511669a731 100644 --- a/docs/codeql/ql-training/cpp/intro-ql-cpp.rst +++ b/docs/codeql/ql-training/cpp/intro-ql-cpp.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `exiv2 `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `exiv2 `__ from GitHub. .. Include language-agnostic section here diff --git a/docs/codeql/ql-training/cpp/snprintf.rst b/docs/codeql/ql-training/cpp/snprintf.rst index d784d79f5f8..86c963fa1f2 100644 --- a/docs/codeql/ql-training/cpp/snprintf.rst +++ b/docs/codeql/ql-training/cpp/snprintf.rst @@ -9,7 +9,7 @@ CodeQL for C/C++ Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `rsyslog `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `rsyslog `__ from GitHub. ``snprintf`` ============ diff --git a/docs/codeql/ql-training/java/apache-struts-java.rst b/docs/codeql/ql-training/java/apache-struts-java.rst index 4e5c4493db1..503dfad5450 100644 --- a/docs/codeql/ql-training/java/apache-struts-java.rst +++ b/docs/codeql/ql-training/java/apache-struts-java.rst @@ -13,7 +13,7 @@ Exercise: Apache Struts Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. Unsafe deserialization in Struts ================================ diff --git a/docs/codeql/ql-training/java/data-flow-java.rst b/docs/codeql/ql-training/java/data-flow-java.rst index 4353b618acf..1648589f5a5 100644 --- a/docs/codeql/ql-training/java/data-flow-java.rst +++ b/docs/codeql/ql-training/java/data-flow-java.rst @@ -9,7 +9,7 @@ Finding SPARQL injection vulnerabilities in Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/java/global-data-flow-java.rst b/docs/codeql/ql-training/java/global-data-flow-java.rst index 67e71c03391..0b6d4c08b90 100644 --- a/docs/codeql/ql-training/java/global-data-flow-java.rst +++ b/docs/codeql/ql-training/java/global-data-flow-java.rst @@ -9,7 +9,7 @@ CodeQL for Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. .. rst-class:: agenda diff --git a/docs/codeql/ql-training/java/intro-ql-java.rst b/docs/codeql/ql-training/java/intro-ql-java.rst index 38e311060ec..9d546b62b37 100644 --- a/docs/codeql/ql-training/java/intro-ql-java.rst +++ b/docs/codeql/ql-training/java/intro-ql-java.rst @@ -9,7 +9,7 @@ CodeQL for Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `Apache Struts `__ from GitHub. .. Include language-agnostic section here diff --git a/docs/codeql/ql-training/java/query-injection-java.rst b/docs/codeql/ql-training/java/query-injection-java.rst index d1f8c17288a..028b26bfab6 100644 --- a/docs/codeql/ql-training/java/query-injection-java.rst +++ b/docs/codeql/ql-training/java/query-injection-java.rst @@ -9,7 +9,7 @@ CodeQL for Java Setup ===== -For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. +For this example you need to set up `CodeQL for Visual Studio Code `__ and download the CodeQL database for `VIVO Vitro `__ from GitHub. SQL injection ============= diff --git a/docs/codeql/ql-training/template.rst b/docs/codeql/ql-training/template.rst index 7d525d9e3b2..761d5b36235 100644 --- a/docs/codeql/ql-training/template.rst +++ b/docs/codeql/ql-training/template.rst @@ -36,7 +36,7 @@ Setup For this example you should download: -- `CodeQL for Visual Studio Code `__ +- `CodeQL for Visual Studio Code `__ - A CodeQL database .. note:: diff --git a/docs/codeql/reusables/vs-code-deprecation-note.rst b/docs/codeql/reusables/vs-code-deprecation-note.rst index 3019939baa1..5f56c9cc0cb 100644 --- a/docs/codeql/reusables/vs-code-deprecation-note.rst +++ b/docs/codeql/reusables/vs-code-deprecation-note.rst @@ -2,5 +2,5 @@ Note - This documentation was migrated to docs.github.com/en/code-security/codeql-for-vs-code on 2024/05/08, and this version is no longer maintained. + This documentation `was migrated `_ to docs.github.com/en/code-security/codeql-for-vs-code on 2024/05/08, and this version is no longer maintained. \ No newline at end of file diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index a980559ca8e..aa139345d22 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -277,7 +277,7 @@ No user-facing changes. ### Bug Fixes -* The [View AST functionality](https://docs.github.com/en/code-security/codeql-for-vs-code/) no longer prints detailed information about regular expressions, greatly improving performance. +* The [View AST functionality](https://docs.github.com/en/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/exploring-the-structure-of-your-source-code) no longer prints detailed information about regular expressions, greatly improving performance. ## 0.0.8 From 12b9b805e2f40fd72bf30c0c8178c6b04e647891 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 12:37:47 +0200 Subject: [PATCH 030/118] Go: revert changes to `make` and CI to postpone them in a separate PR --- .github/workflows/go-tests-other-os.yml | 65 ++++++++++++++++-- .github/workflows/go-tests.yml | 51 +++++++++++++- go/Makefile | 89 +++++++++++++++++++++++-- 3 files changed, 191 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go-tests-other-os.yml b/.github/workflows/go-tests-other-os.yml index 9915b0869db..ded53f868b7 100644 --- a/.github/workflows/go-tests-other-os.yml +++ b/.github/workflows/go-tests-other-os.yml @@ -7,6 +7,8 @@ on: - .github/workflows/go-tests-other-os.yml - .github/actions/** - codeql-workspace.yml +env: + GO_VERSION: '~1.22.0' permissions: contents: read @@ -16,17 +18,72 @@ jobs: name: Test MacOS runs-on: macos-latest steps: + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + id: go + - name: Check out code uses: actions/checkout@v4 - - name: Run tests - uses: ./go/actions/test + + - name: Set up CodeQL CLI + uses: ./.github/actions/fetch-codeql + + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + + - name: Build + run: | + cd go + make + + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: go-qltest + - name: Test + run: | + cd go + make test cache="${{ steps.query-cache.outputs.cache-dir }}" test-win: if: github.repository_owner == 'github' name: Test Windows runs-on: windows-latest-xl steps: + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + id: go + - name: Check out code uses: actions/checkout@v4 - - name: Run tests - uses: ./go/actions/test + + - name: Set up CodeQL CLI + uses: ./.github/actions/fetch-codeql + + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + + - name: Build + run: | + cd go + make + + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: go-qltest + + - name: Test + run: | + cd go + make test cache="${{ steps.query-cache.outputs.cache-dir }}" diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 63e2b7c4974..6d9cac5dae9 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -16,6 +16,9 @@ on: - .github/actions/** - codeql-workspace.yml +env: + GO_VERSION: '~1.22.0' + permissions: contents: read @@ -25,9 +28,51 @@ jobs: name: Test Linux (Ubuntu) runs-on: ubuntu-latest-xl steps: + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + id: go + - name: Check out code uses: actions/checkout@v4 - - name: Run tests - uses: ./go/actions/test + + - name: Set up CodeQL CLI + uses: ./.github/actions/fetch-codeql + + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + + - name: Build + run: | + cd go + make + + - name: Check that all Go code is autoformatted + run: | + cd go + make check-formatting + + - name: Compile qhelp files to markdown + run: | + cd go + env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown + + - name: Upload qhelp markdown + uses: actions/upload-artifact@v3 with: - run-code-checks: true + name: qhelp-markdown + path: go/qhelp-out/**/*.md + + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: go-qltest + + - name: Test + run: | + cd go + make test cache="${{ steps.query-cache.outputs.cache-dir }}" diff --git a/go/Makefile b/go/Makefile index 3ebeb69fcaf..d0289a093a5 100644 --- a/go/Makefile +++ b/go/Makefile @@ -1,10 +1,30 @@ -all: gen extractor +all: extractor ql/lib/go.dbscheme + +ifeq ($(OS),Windows_NT) +EXE = .exe +CODEQL_PLATFORM = win64 +else +EXE = +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) +CODEQL_PLATFORM = linux64 +endif +ifeq ($(UNAME_S),Darwin) +CODEQL_PLATFORM = osx64 +endif +endif + +CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh baseline-config-empty.json baseline-config-vendor.json configure-baseline.cmd configure-baseline.sh identify-environment.cmd identify-environment.sh index.cmd index.sh pre-finalize.cmd pre-finalize.sh tracing-config.lua) EXTRACTOR_PACK_OUT = build/codeql-extractor-go -.PHONY: extractor gen clean autoformat check-formatting +BINARIES = go-extractor go-tokenizer go-autobuilder go-build-runner go-bootstrap go-gen-dbscheme + +.PHONY: tools tools-codeql tools-codeql-full clean autoformat \ + tools-linux64 tools-osx64 tools-win64 check-formatting clean: + rm -rf tools/bin tools/linux64 tools/osx64 tools/win64 tools/net tools/opencsv rm -rf $(EXTRACTOR_PACK_OUT) build/stats build/testdb autoformat: @@ -27,11 +47,66 @@ endif qhelp-to-markdown: scripts/qhelp-to-markdown.sh ql/src "$(QHELP_OUT_DIR)" -extractor: - bazel run :create-extractor-pack +tools: tools-codeql tools/tokenizer.jar -gen: - bazel run :gen +.PHONY: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) +$(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))): + go build -C extractor -mod=vendor -o ../$@ ./cli/$(basename $(@F)) + +tools-codeql: tools-$(CODEQL_PLATFORM) + +tools-codeql-full: tools-linux64 tools-osx64 tools-win64 + +tools-linux64: $(addprefix tools/linux64/,$(BINARIES)) + +.PHONY: $(addprefix tools/linux64/,$(BINARIES)) +$(addprefix tools/linux64/,$(BINARIES)): + GOOS=linux GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@ ./cli/$(@F) + +tools-osx64: $(addprefix tools/osx64/,$(BINARIES)) + +.PHONY: $(addprefix tools/osx64/,$(BINARIES)) +$(addprefix tools/osx64/,$(BINARIES)): + GOOS=darwin GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@.amd64 ./cli/$(@F) + GOOS=darwin GOARCH=arm64 go build -C extractor -mod=vendor -o ../$@.arm64 ./cli/$(@F) + lipo -create $@.amd64 $@.arm64 -output $@ + rm $@.amd64 $@.arm64 + +tools-win64: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))) + +.PHONY: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))) +$(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))): + env GOOS=windows GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@ ./cli/$(basename $(@F)) + +.PHONY: extractor-common extractor extractor-full +extractor-common: codeql-extractor.yml LICENSE ql/lib/go.dbscheme \ + tools/tokenizer.jar $(CODEQL_TOOLS) + rm -rf $(EXTRACTOR_PACK_OUT) + mkdir -p $(EXTRACTOR_PACK_OUT) + cp codeql-extractor.yml LICENSE ql/lib/go.dbscheme ql/lib/go.dbscheme.stats $(EXTRACTOR_PACK_OUT) + mkdir $(EXTRACTOR_PACK_OUT)/tools + cp -r tools/tokenizer.jar $(CODEQL_TOOLS) $(EXTRACTOR_PACK_OUT)/tools + cp -r downgrades $(EXTRACTOR_PACK_OUT) + +extractor: extractor-common tools-codeql + cp -r tools/$(CODEQL_PLATFORM) $(EXTRACTOR_PACK_OUT)/tools + +extractor-full: extractor-common tools-codeql-full + cp -r $(addprefix tools/,linux64 osx64 win64) $(EXTRACTOR_PACK_OUT)/tools + +tools/tokenizer.jar: tools/net/sourceforge/pmd/cpd/GoLanguage.class + jar cf $@ -C tools net + jar uf $@ -C tools opencsv + +tools/net/sourceforge/pmd/cpd/GoLanguage.class: extractor/net/sourceforge/pmd/cpd/GoLanguage.java + javac -cp extractor -d tools $< + rm tools/net/sourceforge/pmd/cpd/AbstractLanguage.class + rm tools/net/sourceforge/pmd/cpd/SourceCode.class + rm tools/net/sourceforge/pmd/cpd/TokenEntry.class + rm tools/net/sourceforge/pmd/cpd/Tokenizer.class + +ql/lib/go.dbscheme: tools/$(CODEQL_PLATFORM)/go-gen-dbscheme$(EXE) + $< $@ build/stats/src.stamp: mkdir -p $(@D)/src @@ -48,7 +123,7 @@ test: all build/testdb/check-upgrade-path codeql test run -j0 ql/test --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache) # use GOOS=linux because GOOS=darwin GOARCH=386 is no longer supported env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache) - cd extractor; bazel test ... + cd extractor; go test -mod=vendor ./... bash extractor-smoke-test/test.sh || (echo "Extractor smoke test FAILED"; exit 1) .PHONY: build/testdb/check-upgrade-path From 7f271273010e58955e9be4ab017a6ee3b0247042 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Thu, 2 May 2024 12:02:09 +0100 Subject: [PATCH 031/118] Update docs/codeql/reusables/vs-code-deprecation-note.rst --- docs/codeql/reusables/vs-code-deprecation-note.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/reusables/vs-code-deprecation-note.rst b/docs/codeql/reusables/vs-code-deprecation-note.rst index 5f56c9cc0cb..73fae9b98a0 100644 --- a/docs/codeql/reusables/vs-code-deprecation-note.rst +++ b/docs/codeql/reusables/vs-code-deprecation-note.rst @@ -2,5 +2,5 @@ Note - This documentation `was migrated `_ to docs.github.com/en/code-security/codeql-for-vs-code on 2024/05/08, and this version is no longer maintained. + This documentation `was migrated `__ to docs.github.com/en/code-security/codeql-for-vs-code on 2024/05/08, and this version is no longer maintained. \ No newline at end of file From 54793cfa01acc05b37f7bfe98db3a0de32c3e0da Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Thu, 2 May 2024 12:52:43 +0100 Subject: [PATCH 032/118] Update a couple of reusables --- .../vs-code-basic-instructions/note-store-quick-query.rst | 2 +- .../vs-code-basic-instructions/setup-to-run-queries.rst | 2 +- docs/codeql/reusables/vs-code-deprecation-note.rst | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/codeql/reusables/vs-code-basic-instructions/note-store-quick-query.rst b/docs/codeql/reusables/vs-code-basic-instructions/note-store-quick-query.rst index 3638b37d35e..070ff04a789 100644 --- a/docs/codeql/reusables/vs-code-basic-instructions/note-store-quick-query.rst +++ b/docs/codeql/reusables/vs-code-basic-instructions/note-store-quick-query.rst @@ -2,4 +2,4 @@ Note - If you want to move your experimental query somewhere more permanent, you need to move the whole ``Quick Queries`` directory. The directory is a CodeQL pack with a ``qlpack.yml`` file that defines the content as queries for |language-text| CodeQL databases. For more information about CodeQL packs, see ":ref:`Working with CodeQL packs in Visual Studio Code `." \ No newline at end of file + If you want to move your experimental query somewhere more permanent, you need to move the whole ``Quick Queries`` directory. The directory is a CodeQL pack with a ``qlpack.yml`` file that defines the content as queries for |language-text| CodeQL databases. For more information about CodeQL packs, see "`Managing CodeQL query packs and library packs `__." diff --git a/docs/codeql/reusables/vs-code-basic-instructions/setup-to-run-queries.rst b/docs/codeql/reusables/vs-code-basic-instructions/setup-to-run-queries.rst index 4e6ecf8daf2..3fe9e27013d 100644 --- a/docs/codeql/reusables/vs-code-basic-instructions/setup-to-run-queries.rst +++ b/docs/codeql/reusables/vs-code-basic-instructions/setup-to-run-queries.rst @@ -1 +1 @@ -For information about installing the CodeQL extension for Visual Studio code, see ":ref:`Setting up CodeQL in Visual Studio Code `." \ No newline at end of file +For information about installing the CodeQL extension for Visual Studio code, see "`Installing CodeQL for Visual Studio Code `__." diff --git a/docs/codeql/reusables/vs-code-deprecation-note.rst b/docs/codeql/reusables/vs-code-deprecation-note.rst index 73fae9b98a0..51e70e00d5e 100644 --- a/docs/codeql/reusables/vs-code-deprecation-note.rst +++ b/docs/codeql/reusables/vs-code-deprecation-note.rst @@ -2,5 +2,4 @@ Note - This documentation `was migrated `__ to docs.github.com/en/code-security/codeql-for-vs-code on 2024/05/08, and this version is no longer maintained. - \ No newline at end of file + This documentation `was migrated `__ to ``docs.github.com/en/code-security/codeql-for-vs-code`` on 2024/05/08, and this version is no longer maintained. From 9055d9567aa9e850e6c7836aa7086c847192d588 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 15:08:51 +0200 Subject: [PATCH 033/118] Go: remove unused action (will be re-added later) --- go/actions/test/action.yml | 80 -------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 go/actions/test/action.yml diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml deleted file mode 100644 index a351c4382ac..00000000000 --- a/go/actions/test/action.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Test go extractor -description: Run build, QL tests and optionally basic code sanity checks (formatting and generation) -inputs: - run-code-checks: - description: Whether to run formatting, code and qhelp generation checks - required: false - default: false -runs: - using: composite - steps: - - name: Get go version - shell: bash - run: | - ( - echo -n "GO_VERSION=" - bazel run @rules_go//go -- version | sed 's/go version go\(.*\) .*/\1/' - ) | tee -a "$GITHUB_ENV" - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - cache: false - id: go - - - name: Set up CodeQL CLI - uses: ./.github/actions/fetch-codeql - - - name: Enable problem matchers in repository - shell: bash - run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' - - - name: Build - shell: bash - run: | - bazel run go:create-extractor-pack - - - name: Check that all Go code is autoformatted - if: inputs.run-code-checks == 'true' - shell: bash - run: | - cd go - make check-formatting - - - name: Check checked-in generated code - if: inputs.run-code-checks == 'true' - shell: bash - run: | - bazel run go:gen - git add . - git diff --exit-code HEAD || ( - echo "please run bazel run //go:gen" - exit 1 - ) - - - name: Compile qhelp files to markdown - if: inputs.run-code-checks == 'true' - shell: bash - run: | - cd go - env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown - - - name: Upload qhelp markdown - if: inputs.run-code-checks == 'true' - uses: actions/upload-artifact@v3 - with: - name: qhelp-markdown - path: go/qhelp-out/**/*.md - - - name: Cache compilation cache - id: query-cache - uses: ./.github/actions/cache-query-compilation - with: - key: go-qltest - - - name: Test - shell: bash - run: | - cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" From ca2d94b297820ff93ef072419c19de31d6c6dd57 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 15:15:45 +0200 Subject: [PATCH 034/118] Fix go pattern in `.pre-commit-config.yaml` --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 055cab4ac05..5a0ccc4938f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: - id: go-gen name: Check checked in generated files in go - files: go/.* + files: ^go/.* language: system entry: bazel run //go:gen pass_filenames: false From 318d954536bfca389d3c00812a84ff81f99ff64c Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 15:38:47 +0200 Subject: [PATCH 035/118] Go: make `//go:gen` not clear by default, and clean on `--force` --- go/gen.py | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/go/gen.py b/go/gen.py index b9394cd15b2..ebb57b2a685 100644 --- a/go/gen.py +++ b/go/gen.py @@ -2,8 +2,18 @@ import sys import pathlib import subprocess import os +import argparse +import shutil from python.runfiles import runfiles +def options(): + p = argparse.ArgumentParser(description="Update generated checked in files in the Go pack") + p.add_argument("--force", "-f", action="store_true", help="Regenerate all files from scratch rather than updating them") + p.add_argument("generators", nargs=3) + return p.parse_args() + +opts = options() + try: workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']) except KeyError: @@ -13,20 +23,34 @@ except KeyError: go_extractor_dir = workspace_dir / "go" / "extractor" go_dbscheme = workspace_dir / "go" / "ql" / "lib" / "go.dbscheme" r = runfiles.Create() -go, gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:]) +go, gazelle, go_gen_dbscheme = map(r.Rlocation, opts.generators) -print("updating vendor") + +if opts.force: + print("clearing vendor directory") + shutil.rmtree(go_extractor_dir / "vendor") + +existing_build_files = set(go_extractor_dir.glob("*/**/BUILD.bazel")) + +print("updating vendor directory") subprocess.check_call([go, "-C", go_extractor_dir, "work", "vendor"]) -print("clearing generated BUILD files") -for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): - build_file.unlink() +if opts.force: + print("clearing generated BUILD files") + for build_file in existing_build_files: + build_file.unlink() print("running gazelle") subprocess.check_call([gazelle]) +build_files_to_update = set(go_extractor_dir.glob("*/**/BUILD.bazel")) +if not opts.force: + build_files_to_update -= existing_build_files + # these are always refreshed + build_files_to_update.update(go_extractor_dir.glob("vendor/**/BUILD.bazel")) + print("adding header to generated BUILD files") -for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"): +for build_file in build_files_to_update: contents = build_file.read_text() build_file.write_text(f"# generated running `bazel run //go/gazelle`, do not edit\n\n{contents}") From 4ae82ac2150cd2c90cb708f1e810381367fb0fa7 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 15:40:13 +0200 Subject: [PATCH 036/118] Go: add explanatory comment to `extractor` `BUILD` file --- go/extractor/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index cb7bc3ac8ef..32eaa8fda74 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -4,6 +4,7 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_files") # gazelle:prefix github.com/github/codeql-go/extractor # gazelle:map_kind go_binary codeql_go_binary //go:rules.bzl +# following target is kept up to date by `bazel run //go:gen`, do not edit directly go_library( name = "extractor", srcs = [ From 0bc6934bfc210d7efc2f87966ab13cae710a82a0 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 15:44:06 +0200 Subject: [PATCH 037/118] Go: rename `pkg_files` to something less confusing --- go/codeql-tools/BUILD.bazel | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go/codeql-tools/BUILD.bazel b/go/codeql-tools/BUILD.bazel index 4e839b4774b..8c3946b24ad 100644 --- a/go/codeql-tools/BUILD.bazel +++ b/go/codeql-tools/BUILD.bazel @@ -1,13 +1,13 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") pkg_files( - name = "executables", + name = "sh-files", srcs = glob(["*.sh"]), attributes = pkg_attributes(mode = "0755"), ) pkg_files( - name = "non-executables", + name = "non-sh-files", srcs = glob( ["*"], exclude = [ @@ -20,8 +20,8 @@ pkg_files( pkg_filegroup( name = "codeql-tools", srcs = [ - ":executables", - ":non-executables", + ":non-sh-files", + ":sh-files", ], prefix = "tools", visibility = ["//go:__pkg__"], From abcd9165b4b9ded2c2b9c297502df24529f95561 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 16:08:17 +0200 Subject: [PATCH 038/118] Go: write test go runtime version in a specific file --- .github/workflows/go-tests-other-os.yml | 10 ++++------ .github/workflows/go-tests.yml | 7 ++----- go/ql/test/go.mod | 4 ---- go/test-runtime-version/go.work | 1 + 4 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 go/ql/test/go.mod create mode 100644 go/test-runtime-version/go.work diff --git a/.github/workflows/go-tests-other-os.yml b/.github/workflows/go-tests-other-os.yml index ded53f868b7..d38fd18f272 100644 --- a/.github/workflows/go-tests-other-os.yml +++ b/.github/workflows/go-tests-other-os.yml @@ -7,8 +7,6 @@ on: - .github/workflows/go-tests-other-os.yml - .github/actions/** - codeql-workspace.yml -env: - GO_VERSION: '~1.22.0' permissions: contents: read @@ -18,10 +16,10 @@ jobs: name: Test MacOS runs-on: macos-latest steps: - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go/test-runtime-version/go.work cache: false id: go @@ -55,10 +53,10 @@ jobs: name: Test Windows runs-on: windows-latest-xl steps: - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go/test-runtime-version/go.work cache: false id: go diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 6d9cac5dae9..60182bb2c81 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -16,9 +16,6 @@ on: - .github/actions/** - codeql-workspace.yml -env: - GO_VERSION: '~1.22.0' - permissions: contents: read @@ -28,10 +25,10 @@ jobs: name: Test Linux (Ubuntu) runs-on: ubuntu-latest-xl steps: - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go/test-runtime-version/go.work cache: false id: go diff --git a/go/ql/test/go.mod b/go/ql/test/go.mod deleted file mode 100644 index 2420613ecee..00000000000 --- a/go/ql/test/go.mod +++ /dev/null @@ -1,4 +0,0 @@ -module github.com/github/codeql-go/ql/test - -go 1.21 - diff --git a/go/test-runtime-version/go.work b/go/test-runtime-version/go.work new file mode 100644 index 00000000000..233b1008240 --- /dev/null +++ b/go/test-runtime-version/go.work @@ -0,0 +1 @@ +go 1.22 From 1aafc377adf9a809e59e3a66f24235e2671b1822 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 16:22:24 +0200 Subject: [PATCH 039/118] Revert "Go: write test go runtime version in a specific file" This reverts commit abcd9165b4b9ded2c2b9c297502df24529f95561. --- .github/workflows/go-tests-other-os.yml | 10 ++++++---- .github/workflows/go-tests.yml | 7 +++++-- go/ql/test/go.mod | 4 ++++ go/test-runtime-version/go.work | 1 - 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 go/ql/test/go.mod delete mode 100644 go/test-runtime-version/go.work diff --git a/.github/workflows/go-tests-other-os.yml b/.github/workflows/go-tests-other-os.yml index d38fd18f272..ded53f868b7 100644 --- a/.github/workflows/go-tests-other-os.yml +++ b/.github/workflows/go-tests-other-os.yml @@ -7,6 +7,8 @@ on: - .github/workflows/go-tests-other-os.yml - .github/actions/** - codeql-workspace.yml +env: + GO_VERSION: '~1.22.0' permissions: contents: read @@ -16,10 +18,10 @@ jobs: name: Test MacOS runs-on: macos-latest steps: - - name: Set up Go + - name: Set up Go ${{ env.GO_VERSION }} uses: actions/setup-go@v5 with: - go-version-file: go/test-runtime-version/go.work + go-version: ${{ env.GO_VERSION }} cache: false id: go @@ -53,10 +55,10 @@ jobs: name: Test Windows runs-on: windows-latest-xl steps: - - name: Set up Go + - name: Set up Go ${{ env.GO_VERSION }} uses: actions/setup-go@v5 with: - go-version-file: go/test-runtime-version/go.work + go-version: ${{ env.GO_VERSION }} cache: false id: go diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 60182bb2c81..6d9cac5dae9 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -16,6 +16,9 @@ on: - .github/actions/** - codeql-workspace.yml +env: + GO_VERSION: '~1.22.0' + permissions: contents: read @@ -25,10 +28,10 @@ jobs: name: Test Linux (Ubuntu) runs-on: ubuntu-latest-xl steps: - - name: Set up Go + - name: Set up Go ${{ env.GO_VERSION }} uses: actions/setup-go@v5 with: - go-version-file: go/test-runtime-version/go.work + go-version: ${{ env.GO_VERSION }} cache: false id: go diff --git a/go/ql/test/go.mod b/go/ql/test/go.mod new file mode 100644 index 00000000000..2420613ecee --- /dev/null +++ b/go/ql/test/go.mod @@ -0,0 +1,4 @@ +module github.com/github/codeql-go/ql/test + +go 1.21 + diff --git a/go/test-runtime-version/go.work b/go/test-runtime-version/go.work deleted file mode 100644 index 233b1008240..00000000000 --- a/go/test-runtime-version/go.work +++ /dev/null @@ -1 +0,0 @@ -go 1.22 From 76067cb12d88fdd761ac4dbfbd85eada52415977 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 17:02:48 +0200 Subject: [PATCH 040/118] Go: skip `X:nocoverageredesign` printing by autobuilder built with bazel --- go/extractor/cli/go-autobuilder/go-autobuilder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index 08f8477cac7..8df8b506918 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -487,7 +487,9 @@ func extract(workspace project.GoWorkspace) bool { // Build the project and run the extractor. func installDependenciesAndBuild() { - log.Printf("Autobuilder was built with %s, environment has %s\n", runtime.Version(), toolchain.GetEnvGoVersion()) + // do not print experiments the autobuilder was built with if any, only the version + version := strings.SplitN(runtime.Version(), " ", 2)[0] + log.Printf("Autobuilder was built with %s, environment has %s\n", version, toolchain.GetEnvGoVersion()) srcdir := getSourceDir() From 00baccbc152af091936983ba111d0f5cc3b46c46 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 2 May 2024 17:08:23 +0200 Subject: [PATCH 041/118] Go: autoformat --- go/extractor/cli/go-autobuilder/go-autobuilder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index 8df8b506918..2e9731c989b 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -487,8 +487,8 @@ func extract(workspace project.GoWorkspace) bool { // Build the project and run the extractor. func installDependenciesAndBuild() { - // do not print experiments the autobuilder was built with if any, only the version - version := strings.SplitN(runtime.Version(), " ", 2)[0] + // do not print experiments the autobuilder was built with if any, only the version + version := strings.SplitN(runtime.Version(), " ", 2)[0] log.Printf("Autobuilder was built with %s, environment has %s\n", version, toolchain.GetEnvGoVersion()) srcdir := getSourceDir() From 355c7d9b41f017ff54d0f8c552cbae12262ca35d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 1 May 2024 09:29:56 +0100 Subject: [PATCH 042/118] C++: Rename an example file. --- ...ongTypeFormatArguments.cpp => WrongTypeFormatArgumentsBad.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cpp/ql/src/Likely Bugs/Format/{WrongTypeFormatArguments.cpp => WrongTypeFormatArgumentsBad.cpp} (100%) diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.cpp b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsBad.cpp similarity index 100% rename from cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.cpp rename to cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsBad.cpp From e22159ab5d4e15c6b99ac236303d5b380c1fb06d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 14:20:02 +0100 Subject: [PATCH 043/118] C++: Update WrongTypeFormatArguments.qhelp. --- .../Format/WrongTypeFormatArguments.qhelp | 27 +++++++++++-------- .../Format/WrongTypeFormatArgumentsBad.cpp | 2 +- .../Format/WrongTypeFormatArgumentsGood.cpp | 4 +++ 3 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsGood.cpp diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp index 02bfd391a33..6b3393febe1 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp @@ -4,29 +4,34 @@

    Each call to the printf function or a related function should include -the type and sequence of arguments defined by the format. If the function is passed arguments +the type and sequence of arguments defined by the format. If the function is passed arguments of a different type or in a different sequence then the arguments are reinterpreted to fit the type and sequence expected, resulting in unpredictable behavior.

    -

    Review the format and arguments expected by the highlighted function calls. Update either -the format or the arguments so that the expected type and sequence of arguments are passed to +

    Review the format and arguments expected by the highlighted function calls. Update either +the format or the arguments so that the expected type and sequence of arguments are passed to the function.

    - + + +

    In the following example, the wrong format specifier is given for an integer format argument:

    + + + +

    The corrected version uses %i as the format specifier for the integer format argument:

    + +
    -
  • CERT C Coding -Standard: FIO30-C. Exclude user input from format strings.
  • -
  • cplusplus.com: C++ Functions.
  • -
  • CRT Alphabetical Function Reference: printf, _printf_l, wprintf, _wprintf_l.
  • - - - +
  • Microsoft Learn: Format specification syntax: printf and wprintf functions.
  • +
  • cplusplus.com:printf
  • +
  • CERT C Coding" +Standard: FIO47-C. Use valid format strings.
  • diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsBad.cpp b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsBad.cpp index c3dd09c3071..046233af1b0 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsBad.cpp +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsBad.cpp @@ -1,4 +1,4 @@ int main() { - printf("%s\n", 42); //printf will treat 42 as a char*, will most likely segfault + printf("%s\n", 42); // BAD: printf will treat 42 as a char*, will most likely segfault return 0; } diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsGood.cpp b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsGood.cpp new file mode 100644 index 00000000000..0bd3fb5c439 --- /dev/null +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArgumentsGood.cpp @@ -0,0 +1,4 @@ +int main() { + printf("%i\n", 42); // GOOD: printf will treat 42 as an int + return 0; +} From 06d8892e03008533712bcabfbd94daae4d335567 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 14:22:27 +0100 Subject: [PATCH 044/118] C++: Rename an example file. --- .../{StrncpyFlippedArgs.cpp => StrncpyFlippedArgsBad.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cpp/ql/src/Likely Bugs/Memory Management/{StrncpyFlippedArgs.cpp => StrncpyFlippedArgsBad.cpp} (100%) diff --git a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.cpp b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsBad.cpp similarity index 100% rename from cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.cpp rename to cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsBad.cpp From 8a261b7e7a2ac760daa54dd126f13fcf78290a0a Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 14:31:26 +0100 Subject: [PATCH 045/118] C++: Update StrncpyFlippedArgs.qhelp. --- .../Memory Management/StrncpyFlippedArgs.qhelp | 9 +++++++-- .../Memory Management/StrncpyFlippedArgsBad.cpp | 11 +++++++++-- .../Memory Management/StrncpyFlippedArgsGood.cpp | 10 ++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsGood.cpp diff --git a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp index 2e297116710..9ba2b7c7c8e 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp +++ b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp @@ -3,7 +3,7 @@ "qhelp.dtd"> -

    The standard library function strncpy copies a source string to a destination buffer. The third argument defines the maximum number of characters to copy and should be less than +

    The standard library function strncpy copies a source string to a destination buffer. The third argument defines the maximum number of characters to copy and should be less than or equal to the size of the destination buffer. Calls of the form strncpy(dest, src, strlen(src)) or strncpy(dest, src, sizeof(src)) incorrectly set the third argument to the size of the source buffer. Executing a call of this type may cause a buffer overflow. Buffer overflows can lead to anything from a segmentation fault to a security vulnerability.

    @@ -12,9 +12,14 @@ or equal to the size of the destination buffer. Calls of the form strncpy( not the source buffer.

    - +

    In the following examples, the size of the source buffer is incorrectly used as a parameter to strncpy:

    + + +

    The corrected version uses the size of the destination buffer, or a variable containing the size of the destination buffer as the size parameter to strncpy:

    + + diff --git a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsBad.cpp b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsBad.cpp index 07acc91cd5a..952550b2638 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsBad.cpp +++ b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsBad.cpp @@ -1,2 +1,9 @@ -strncpy(dest, src, sizeof(src)); //wrong: size of dest should be used -strncpy(dest, src, strlen(src)); //wrong: size of dest should be used +char src[256]; +char dest1[128]; + +... + +strncpy(dest1, src, sizeof(src)); // wrong: size of dest should be used + +char *dest2 = (char *)malloc(sz1 + sz2 + sz3); +strncpy(dest2, src, strlen(src)); // wrong: size of dest should be used diff --git a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsGood.cpp b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsGood.cpp new file mode 100644 index 00000000000..22fc4ebd222 --- /dev/null +++ b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgsGood.cpp @@ -0,0 +1,10 @@ +char src[256]; +char dest1[128]; + +... + +strncpy(dest1, src, sizeof(dest1)); // correct + +size_t destSize = sz1 + sz2 + sz3; +char *dest2 = (char *)malloc(destSize); +strncpy(dest2, src, destSize); // correct From 8f682ef4e4fd492169f384da3fc03f44fe3753e6 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 14:17:11 +0100 Subject: [PATCH 046/118] C++: Improve quality of some qhelp references. --- .../src/Likely Bugs/Format/TooManyFormatArguments.qhelp | 4 +--- .../Format/WrongNumberOfFormatArguments.qhelp | 9 +++------ .../Likely Bugs/Format/WrongTypeFormatArguments.qhelp | 3 +-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.qhelp b/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.qhelp index bbd64254d54..b4df60cbac7 100644 --- a/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.qhelp +++ b/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.qhelp @@ -22,10 +22,8 @@ function.
    -
  • cplusplus.com: C++ Functions.
  • +
  • CERT C Coding Standard: FIO47-C. Use valid format strings.
  • Microsoft C Runtime Library Reference: printf, wprintf.
  • - -
    diff --git a/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.qhelp b/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.qhelp index 66344e93f22..bb4687b2d9a 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.qhelp +++ b/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.qhelp @@ -19,8 +19,8 @@ contents. -

    Review the format and arguments expected by the highlighted function calls. Update either -the format or the arguments so that the expected number of arguments are passed to the +

    Review the format and arguments expected by the highlighted function calls. Update either +the format or the arguments so that the expected number of arguments are passed to the function.

    @@ -30,11 +30,8 @@ function. -
  • CERT C Coding -Standard: FIO30-C. Exclude user input from format strings.
  • -
  • cplusplus.com: C++ Functions.
  • +
  • CERT C Coding Standard: FIO47-C. Use valid format strings.
  • Microsoft C Runtime Library Reference: printf, wprintf.
  • -
    diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp index 6b3393febe1..476d37fb300 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp @@ -30,8 +30,7 @@ the function.
  • Microsoft Learn: Format specification syntax: printf and wprintf functions.
  • cplusplus.com:printf
  • -
  • CERT C Coding" -Standard: FIO47-C. Use valid format strings.
  • +
  • CERT C Coding Standard: FIO47-C. Use valid format strings.
  • From f4e4e238ba2da04b4a55cb81218084f7398d3981 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 16:09:03 +0100 Subject: [PATCH 047/118] C++: Add test cases for IncorrectNotOperatorUsage.ql. --- .../IncorrectNotOperatorUsage.cpp | 5 ++--- .../IncorrectNotOperatorUsage.cpp | 21 ++++++++++++++++++- .../IncorrectNotOperatorUsage.expected | 1 + 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp index c3640a66ab6..c345e5a88a9 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp +++ b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp @@ -4,17 +4,16 @@ void f_warning(int i) { // The usage of the logical not operator in this case is unlikely to be correct // as the output is being used as an operator for a bit-wise and operation - if (i & !FLAGS) + if (i & !FLAGS) { // code } } - void f_fixed(int i) { if (i & ~FLAGS) // Changing the logical not operator for the bit-wise not operator would fix this logic { // code } -} \ No newline at end of file +} diff --git a/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.cpp b/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.cpp index 90c21ca90f3..ac3f1ab3ed5 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.cpp +++ b/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.cpp @@ -3,7 +3,7 @@ void C6317_positive(int i) { - if (i & !FLAGS) // BUG + if (i & !FLAGS) // BUG { } } @@ -71,3 +71,22 @@ void macroUsage(unsigned int arg1, unsigned int arg2) } } + +void bool_examples(bool a, bool b) +{ + if (a & !b) // dubious (confusing intent, but shouldn't produce a wrong result) + { + } + + if (a & ~b) + { + } + + if (a && ~b) + { + } + + if (a && !b) + { + } +} diff --git a/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.expected b/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.expected index a5bbea858da..9c6d4154bf5 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.expected +++ b/cpp/ql/test/query-tests/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage/IncorrectNotOperatorUsage.expected @@ -14,3 +14,4 @@ | IncorrectNotOperatorUsage.cpp:48:9:48:18 | ... \| ... | Usage of a logical not (!) expression as a bitwise operator. | | IncorrectNotOperatorUsage.cpp:49:9:49:20 | ... \| ... | Usage of a logical not (!) expression as a bitwise operator. | | IncorrectNotOperatorUsage.cpp:70:10:70:34 | ... \| ... | Usage of a logical not (!) expression as a bitwise operator. | +| IncorrectNotOperatorUsage.cpp:77:9:77:14 | ... & ... | Usage of a logical not (!) expression as a bitwise operator. | From 8a04840f933cd6efba82bcba6c3c905344b07abd Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 16:32:45 +0100 Subject: [PATCH 048/118] C++: Improve qhelp for IncorrectNotOperatorUsage.ql, including mention of an alternative fix. --- .../Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp | 4 ++-- .../Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp index c345e5a88a9..29eef7c2b1f 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp +++ b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.cpp @@ -2,7 +2,7 @@ void f_warning(int i) { - // The usage of the logical not operator in this case is unlikely to be correct + // BAD: the usage of the logical not operator in this case is unlikely to be correct // as the output is being used as an operator for a bit-wise and operation if (i & !FLAGS) { @@ -12,7 +12,7 @@ void f_warning(int i) void f_fixed(int i) { - if (i & ~FLAGS) // Changing the logical not operator for the bit-wise not operator would fix this logic + if (i & ~FLAGS) // GOOD: Changing the logical not operator for the bit-wise not operator would fix this logic { // code } diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp index bac09fe9cf1..bd89593d96c 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp +++ b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp @@ -16,7 +16,9 @@

    Carefully inspect the flagged expressions. Consider the intent in the code logic, and decide whether it is necessary to change the not operator.

    +

    Here is an example of this issue and how it can be fixed:

    +

    In other cases, particularly when the expressions have bool type, the fix may instead be of the form a && !b

  • From 669fc925e0c562d4f880ad2039811ad4d8932b14 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 17:24:20 +0100 Subject: [PATCH 049/118] C++: Fix qhelp formatting. --- .../Likely Typos/IncorrectNotOperatorUsage.qhelp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp index bd89593d96c..251e26d50f7 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp +++ b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp @@ -16,9 +16,13 @@

    Carefully inspect the flagged expressions. Consider the intent in the code logic, and decide whether it is necessary to change the not operator.

    +

    Here is an example of this issue and how it can be fixed:

    - + + +

    In other cases, particularly when the expressions have bool type, the fix may instead be of the form a && !b

    +
  • From ecbf7aef181553960e87b231c1668655106183c8 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 17:26:24 +0100 Subject: [PATCH 050/118] C++: Fix qhelp formatting. --- .../Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp index 9ba2b7c7c8e..4ef13551ad2 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp +++ b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp @@ -13,15 +13,16 @@ not the source buffer.

    +

    In the following examples, the size of the source buffer is incorrectly used as a parameter to strncpy:

    - +

    The corrected version uses the size of the destination buffer, or a variable containing the size of the destination buffer as the size parameter to strncpy:

    - - + +
  • cplusplus.com: strncpy.
  • From 657402b42f06ef5d6278c2a0cce0f6f2272beab7 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 17:31:09 +0100 Subject: [PATCH 051/118] C++: Fix % character in qhelp. --- cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp index 476d37fb300..055adeb741f 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.qhelp @@ -21,7 +21,7 @@ the function. -

    The corrected version uses %i as the format specifier for the integer format argument:

    +

    The corrected version uses %i as the format specifier for the integer format argument:

    From 08e08a2b3ac4dcdf31896ac4f8841a17328dbbfc Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 17:32:24 +0100 Subject: [PATCH 052/118] C++: Qhelp punctuation. --- .../Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp index 251e26d50f7..a33685bdb6f 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp +++ b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp @@ -21,7 +21,7 @@ -

    In other cases, particularly when the expressions have bool type, the fix may instead be of the form a && !b

    +

    In other cases, particularly when the expressions have bool type, the fix may instead be of the form a && !b

    . From 73cc211779611c30afe5879746edb68eaa43baa5 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 17:36:35 +0100 Subject: [PATCH 053/118] C++: Fix qhelp error. --- .../Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp index a33685bdb6f..3b5824c314a 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp +++ b/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.qhelp @@ -21,7 +21,7 @@ -

    In other cases, particularly when the expressions have bool type, the fix may instead be of the form a && !b

    . +

    In other cases, particularly when the expressions have bool type, the fix may instead be of the form a && !b.

    From f5431abb1095ecf3ca9a27d4f7c8ad92bfc47995 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 May 2024 17:37:52 +0100 Subject: [PATCH 054/118] C++: Fix strncpy reference link (the old link was broken). --- .../src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp index 4ef13551ad2..201b9057499 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp +++ b/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.qhelp @@ -25,7 +25,7 @@ not the source buffer.

    -
  • cplusplus.com: strncpy.
  • +
  • cplusplus.com: strncpy.
  • I. Gerg. An Overview and Example of the Buffer-Overflow Exploit. IANewsletter vol 7 no 4. 2005.
  • From e64a2d6c9c318749567eccfbfa4cf6c5dc026ada Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 29 Apr 2024 13:24:32 +0200 Subject: [PATCH 055/118] C#: Align telemetry implementation with Java. --- .../security/dataflow/CodeInjectionQuery.qll | 3 +- .../dataflow/ConditionalBypassQuery.qll | 5 +- .../ExposureOfPrivateInformationQuery.qll | 3 +- .../dataflow/HardcodedCredentialsQuery.qll | 3 +- .../security/dataflow/LDAPInjectionQuery.qll | 3 +- .../security/dataflow/LogForgingQuery.qll | 3 +- .../dataflow/MissingXMLValidationQuery.qll | 3 +- .../csharp/security/dataflow/ReDoSQuery.qll | 3 +- .../security/dataflow/RegexInjectionQuery.qll | 3 +- .../dataflow/ResourceInjectionQuery.qll | 3 +- .../security/dataflow/SqlInjectionQuery.qll | 3 +- .../security/dataflow/TaintedPathQuery.qll | 3 +- .../dataflow/UnsafeDeserializationQuery.qll | 3 +- .../security/dataflow/UrlRedirectQuery.qll | 3 +- .../dataflow/XMLEntityInjectionQuery.qll | 3 +- .../security/dataflow/XPathInjectionQuery.qll | 3 +- .../csharp/security/dataflow/ZipSlipQuery.qll | 3 +- .../security/dataflow/flowsinks/AllSinks.qll | 84 ------------------- .../security/dataflow/flowsinks/ApiSinks.qll | 35 ++++++++ .../flowsinks/ExternalLocationSink.qll | 3 +- .../security/dataflow/flowsinks/FlowSinks.qll | 23 +++++ .../dataflow/flowsinks/ParallelSink.qll | 3 +- .../security/dataflow/flowsinks/Remote.qll | 3 +- .../dataflow/flowsources/AllSources.qll | 77 ----------------- .../dataflow/flowsources/ApiSources.qll | 14 ++++ .../dataflow/flowsources/FlowSources.qll | 15 ++++ csharp/ql/src/Telemetry/ExternalApi.qll | 8 +- 27 files changed, 132 insertions(+), 186 deletions(-) delete mode 100644 csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/AllSinks.qll create mode 100644 csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll create mode 100644 csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/FlowSinks.qll delete mode 100644 csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/AllSources.qll create mode 100644 csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/CodeInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/CodeInjectionQuery.qll index 1256ae5a7ee..e33c4e37d28 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/CodeInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/CodeInjectionQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.codedom.Compiler private import semmle.code.csharp.security.Sanitizers @@ -16,7 +17,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for user input treated as code vulnerabilities. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for user input treated as code vulnerabilities. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ConditionalBypassQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ConditionalBypassQuery.qll index a8938ecc6c9..cd7119a36af 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ConditionalBypassQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ConditionalBypassQuery.qll @@ -6,6 +6,7 @@ import csharp private import semmle.code.csharp.controlflow.Guards private import semmle.code.csharp.controlflow.BasicBlocks +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.Net @@ -14,12 +15,12 @@ private import semmle.code.csharp.security.SensitiveActions /** * A data flow source for user-controlled bypass of sensitive method. */ -abstract class Source extends DataFlow::Node { } +abstract class Source extends ApiSourceNode { } /** * A data flow sink for user-controlled bypass of sensitive method. */ -abstract class Sink extends DataFlow::ExprNode { +abstract class Sink extends ApiSinkExprNode { /** Gets the 'MethodCall' which is considered sensitive. */ abstract MethodCall getSensitiveMethodCall(); } diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ExposureOfPrivateInformationQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ExposureOfPrivateInformationQuery.qll index 03db7fadf81..1e5f5ae8256 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ExposureOfPrivateInformationQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ExposureOfPrivateInformationQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.security.dataflow.flowsinks.ExternalLocationSink private import semmle.code.csharp.security.PrivateData @@ -15,7 +16,7 @@ abstract class Source extends DataFlow::ExprNode { } /** * A data flow sink for private information flowing unencrypted to an external location. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for private information flowing unencrypted to an external location. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/HardcodedCredentialsQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/HardcodedCredentialsQuery.qll index dd6669579e1..63a0bb50732 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/HardcodedCredentialsQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/HardcodedCredentialsQuery.qll @@ -9,6 +9,7 @@ private import semmle.code.csharp.frameworks.Moq private import semmle.code.csharp.frameworks.system.web.Security private import semmle.code.csharp.frameworks.system.security.cryptography.X509Certificates private import semmle.code.csharp.frameworks.Test +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks /** * A data flow source for hard coded credentials. @@ -18,7 +19,7 @@ abstract class Source extends DataFlow::ExprNode { } /** * A data flow sink for hard coded credentials. */ -abstract class Sink extends DataFlow::ExprNode { +abstract class Sink extends ApiSinkExprNode { /** * Gets a description of this sink, including a placeholder for the sink and a placeholder for * the supplementary element. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LDAPInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LDAPInjectionQuery.qll index 58a34f7604b..78800f39209 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LDAPInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LDAPInjectionQuery.qll @@ -4,6 +4,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.DirectoryServices private import semmle.code.csharp.frameworks.system.directoryservices.Protocols @@ -18,7 +19,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for unvalidated user input that is used to construct LDAP queries. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for unvalidated user input that is used to construct LDAP queries. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll index ed6e69f0709..f0153fea2d4 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.text.RegularExpressions @@ -18,7 +19,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for untrusted user input used in log entries. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for untrusted user input used in log entries. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/MissingXMLValidationQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/MissingXMLValidationQuery.qll index 914239bf7d5..b2934d31eda 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/MissingXMLValidationQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/MissingXMLValidationQuery.qll @@ -4,6 +4,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.Xml private import semmle.code.csharp.security.Sanitizers @@ -18,7 +19,7 @@ abstract class Source extends DataFlow::Node { } * A data flow sink for untrusted user input processed as XML without validation against a known * schema. */ -abstract class Sink extends DataFlow::ExprNode { +abstract class Sink extends ApiSinkExprNode { /** Gets a string describing the reason why this is a sink. */ abstract string getReason(); } diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll index 84d12fca0cc..bf4fbd99323 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll @@ -5,6 +5,7 @@ import csharp private import semmle.code.csharp.dataflow.DataFlow2 +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.text.RegularExpressions private import semmle.code.csharp.security.Sanitizers @@ -17,7 +18,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for untrusted user input used in dangerous regular expression operations. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for untrusted user input used in dangerous regular expression operations. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/RegexInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/RegexInjectionQuery.qll index 501ede13f29..1a053c29f24 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/RegexInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/RegexInjectionQuery.qll @@ -4,6 +4,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.text.RegularExpressions private import semmle.code.csharp.security.Sanitizers @@ -16,7 +17,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for untrusted user input used to construct regular expressions. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for untrusted user input used to construct regular expressions. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ResourceInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ResourceInjectionQuery.qll index a66283de02a..fb016dcddae 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ResourceInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ResourceInjectionQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.Data private import semmle.code.csharp.security.Sanitizers @@ -15,7 +16,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for untrusted user input used in resource descriptors. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for untrusted user input used in resource descriptors. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/SqlInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/SqlInjectionQuery.qll index b7b198bbca0..6473aa58e1c 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/SqlInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/SqlInjectionQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.Sql private import semmle.code.csharp.security.Sanitizers @@ -16,7 +17,7 @@ abstract class Source extends DataFlow::Node { } /** * A sink for SQL injection vulnerabilities. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for SQL injection vulnerabilities. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/TaintedPathQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/TaintedPathQuery.qll index bbd32b58353..ca2b13439ce 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/TaintedPathQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/TaintedPathQuery.qll @@ -5,6 +5,7 @@ import csharp private import semmle.code.csharp.controlflow.Guards +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.IO private import semmle.code.csharp.frameworks.system.Web @@ -18,7 +19,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for uncontrolled data in path expression vulnerabilities. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for uncontrolled data in path expression vulnerabilities. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/UnsafeDeserializationQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/UnsafeDeserializationQuery.qll index 6de1305a11d..a5341aca42f 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/UnsafeDeserializationQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/UnsafeDeserializationQuery.qll @@ -6,6 +6,7 @@ import csharp private import semmle.code.csharp.serialization.Deserializers private import semmle.code.csharp.dataflow.TaintTracking2 +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources /** @@ -16,7 +17,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for unsafe deserialization vulnerabilities. */ -abstract class Sink extends DataFlow::Node { } +abstract class Sink extends ApiSinkNode { } /** * A data flow sink for unsafe deserialization vulnerabilities to an instance method. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/UrlRedirectQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/UrlRedirectQuery.qll index 9a5ec46cb37..b21d5846bf5 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/UrlRedirectQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/UrlRedirectQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.controlflow.Guards private import semmle.code.csharp.frameworks.Format @@ -20,7 +21,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for unvalidated URL redirect vulnerabilities. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for unvalidated URL redirect vulnerabilities. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/XMLEntityInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/XMLEntityInjectionQuery.qll index 7e7fd61fb1c..0bb842adf79 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/XMLEntityInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/XMLEntityInjectionQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.text.RegularExpressions @@ -19,7 +20,7 @@ private class ThreatModelSource extends Source instanceof ThreatModelFlowSource /** * A data flow sink for untrusted user input used in XML processing. */ -abstract class Sink extends DataFlow::ExprNode { +abstract class Sink extends ApiSinkExprNode { /** * Gets the reason for the insecurity of this sink. */ diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/XPathInjectionQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/XPathInjectionQuery.qll index 1edddf45f56..c471a432425 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/XPathInjectionQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/XPathInjectionQuery.qll @@ -3,6 +3,7 @@ */ import csharp +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks private import semmle.code.csharp.security.dataflow.flowsources.FlowSources private import semmle.code.csharp.frameworks.system.xml.XPath private import semmle.code.csharp.frameworks.system.Xml @@ -16,7 +17,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for untrusted user input used in XPath expression. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for untrusted user input used in XPath expression. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ZipSlipQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ZipSlipQuery.qll index a83bb8b4f5a..93e7b601585 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/ZipSlipQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/ZipSlipQuery.qll @@ -4,6 +4,7 @@ import csharp private import semmle.code.csharp.controlflow.Guards +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks /** * A data flow source for unsafe zip extraction. @@ -13,7 +14,7 @@ abstract class Source extends DataFlow::Node { } /** * A data flow sink for unsafe zip extraction. */ -abstract class Sink extends DataFlow::ExprNode { } +abstract class Sink extends ApiSinkExprNode { } /** * A sanitizer for unsafe zip extraction. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/AllSinks.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/AllSinks.qll deleted file mode 100644 index bf601bdf9b6..00000000000 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/AllSinks.qll +++ /dev/null @@ -1,84 +0,0 @@ -/** Provides classes representing various flow sinks for data flow / taint tracking. */ - -private import semmle.code.csharp.dataflow.internal.ExternalFlow - -/** - * A data flow sink node. - */ -abstract class SinkNode extends DataFlow::Node { } - -/** - * Module that adds all sinks to `SinkNode`, excluding sinks for cryptography based - * queries, and queries where sinks are not succifiently explicit. - */ -private module AllSinks { - private import ParallelSink as ParallelSink - private import Remote as Remote - private import semmle.code.csharp.security.dataflow.CodeInjectionQuery as CodeInjectionQuery - private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery - private import semmle.code.csharp.security.dataflow.ExposureOfPrivateInformationQuery as ExposureOfPrivateInformationQuery - private import semmle.code.csharp.security.dataflow.HardcodedCredentialsQuery as HardcodedCredentialsQuery - private import semmle.code.csharp.security.dataflow.LDAPInjectionQuery as LdapInjectionQuery - private import semmle.code.csharp.security.dataflow.LogForgingQuery as LogForgingQuery - private import semmle.code.csharp.security.dataflow.MissingXMLValidationQuery as MissingXmlValidationQuery - private import semmle.code.csharp.security.dataflow.ReDoSQuery as ReDosQuery - private import semmle.code.csharp.security.dataflow.RegexInjectionQuery as RegexInjectionQuery - private import semmle.code.csharp.security.dataflow.ResourceInjectionQuery as ResourceInjectionQuery - private import semmle.code.csharp.security.dataflow.SqlInjectionQuery as SqlInjectionQuery - private import semmle.code.csharp.security.dataflow.TaintedPathQuery as TaintedPathQuery - private import semmle.code.csharp.security.dataflow.UnsafeDeserializationQuery as UnsafeDeserializationQuery - private import semmle.code.csharp.security.dataflow.UrlRedirectQuery as UrlRedirectQuery - private import semmle.code.csharp.security.dataflow.XMLEntityInjectionQuery as XmlEntityInjectionQuery - private import semmle.code.csharp.security.dataflow.XPathInjectionQuery as XpathInjectionQuery - private import semmle.code.csharp.security.dataflow.XSSSinks as XssSinks - private import semmle.code.csharp.security.dataflow.ZipSlipQuery as ZipSlipQuery - - private class ParallelSink extends SinkNode instanceof ParallelSink::ParallelSink { } - - private class RemoteSinkFlowSinks extends SinkNode instanceof Remote::RemoteFlowSink { } - - private class CodeInjectionSink extends SinkNode instanceof CodeInjectionQuery::Sink { } - - private class ConditionalBypassSink extends SinkNode instanceof ConditionalBypassQuery::Sink { } - - private class ExposureOfPrivateInformationSink extends SinkNode instanceof ExposureOfPrivateInformationQuery::Sink - { } - - private class HardcodedCredentialsSink extends SinkNode instanceof HardcodedCredentialsQuery::Sink - { } - - private class LdapInjectionSink extends SinkNode instanceof LdapInjectionQuery::Sink { } - - private class LogForgingSink extends SinkNode instanceof LogForgingQuery::Sink { } - - private class MissingXmlValidationSink extends SinkNode instanceof MissingXmlValidationQuery::Sink - { } - - private class ReDosSink extends SinkNode instanceof ReDosQuery::Sink { } - - private class RegexInjectionSink extends SinkNode instanceof RegexInjectionQuery::Sink { } - - private class ResourceInjectionSink extends SinkNode instanceof ResourceInjectionQuery::Sink { } - - private class SqlInjectionSink extends SinkNode instanceof SqlInjectionQuery::Sink { } - - private class TaintedPathSink extends SinkNode instanceof TaintedPathQuery::Sink { } - - private class UnsafeDeserializationSink extends SinkNode instanceof UnsafeDeserializationQuery::Sink - { } - - private class UrlRedirectSink extends SinkNode instanceof UrlRedirectQuery::Sink { } - - private class XmlEntityInjectionSink extends SinkNode instanceof XmlEntityInjectionQuery::Sink { } - - private class XpathInjectionSink extends SinkNode instanceof XpathInjectionQuery::Sink { } - - private class XssSink extends SinkNode instanceof XssSinks::Sink { } - - /** - * Add all models as data sinks. - */ - private class SinkNodeExternal extends SinkNode { - SinkNodeExternal() { sinkNode(this, _) } - } -} diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll new file mode 100644 index 00000000000..7a069adb2ed --- /dev/null +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll @@ -0,0 +1,35 @@ +/** Provides classes representing various flow sinks for data flow / taint tracking. */ + +private import semmle.code.csharp.dataflow.internal.ExternalFlow +private import semmle.code.csharp.security.dataflow.flowsinks.FlowSinks + +/** + * A data flow sink node. + */ +final class SinkNode = ApiSinkNode; + +/** + * Module that adds all API like sinks to `SinkNode`, excluding sinks for cryptography based + * queries, and queries where sinks are not succifiently defined (eg. using broad method name matching). + */ +private module AllApiSinks { + private import ParallelSink + private import Remote + private import semmle.code.csharp.security.dataflow.CodeInjectionQuery as CodeInjectionQuery + private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery + private import semmle.code.csharp.security.dataflow.ExposureOfPrivateInformationQuery as ExposureOfPrivateInformationQuery + private import semmle.code.csharp.security.dataflow.HardcodedCredentialsQuery as HardcodedCredentialsQuery + private import semmle.code.csharp.security.dataflow.LDAPInjectionQuery as LdapInjectionQuery + private import semmle.code.csharp.security.dataflow.LogForgingQuery as LogForgingQuery + private import semmle.code.csharp.security.dataflow.MissingXMLValidationQuery as MissingXmlValidationQuery + private import semmle.code.csharp.security.dataflow.ReDoSQuery as ReDosQuery + private import semmle.code.csharp.security.dataflow.RegexInjectionQuery as RegexInjectionQuery + private import semmle.code.csharp.security.dataflow.ResourceInjectionQuery as ResourceInjectionQuery + private import semmle.code.csharp.security.dataflow.SqlInjectionQuery as SqlInjectionQuery + private import semmle.code.csharp.security.dataflow.TaintedPathQuery as TaintedPathQuery + private import semmle.code.csharp.security.dataflow.UnsafeDeserializationQuery as UnsafeDeserializationQuery + private import semmle.code.csharp.security.dataflow.UrlRedirectQuery as UrlRedirectQuery + private import semmle.code.csharp.security.dataflow.XMLEntityInjectionQuery as XmlEntityInjectionQuery + private import semmle.code.csharp.security.dataflow.XPathInjectionQuery as XpathInjectionQuery + private import semmle.code.csharp.security.dataflow.ZipSlipQuery as ZipSlipQuery +} diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll index abd1ad92733..3bcfdde669a 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll @@ -3,6 +3,7 @@ */ import csharp +private import FlowSinks private import Remote private import semmle.code.csharp.commons.Loggers private import semmle.code.csharp.frameworks.system.Web @@ -16,7 +17,7 @@ private import semmle.code.csharp.dataflow.internal.ExternalFlow * which the application may have no access control. For example, files on a local or remote * filesystem (including log files and cookies). */ -abstract class ExternalLocationSink extends DataFlow::ExprNode { } +abstract class ExternalLocationSink extends ApiSinkExprNode { } private class ExternalModelSink extends ExternalLocationSink { ExternalModelSink() { sinkNode(this, "file-content-store") } diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/FlowSinks.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/FlowSinks.qll new file mode 100644 index 00000000000..0c5bf14e65c --- /dev/null +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/FlowSinks.qll @@ -0,0 +1,23 @@ +/** Provides classes representing various flow sinks for data flow / taint tracking. */ + +private import csharp +private import semmle.code.csharp.dataflow.internal.ExternalFlow + +/** + * A data flow sink node for an API, which should be considered + * supported from a modeling perspective. + */ +abstract class ApiSinkNode extends DataFlow::Node { } + +/** + * A data flow sink expression node for an API, which should be considered + * supported from a modeling perspective. + */ +abstract class ApiSinkExprNode extends ApiSinkNode, DataFlow::ExprNode { } + +/** + * Add all sink models as data sinks. + */ +private class ApiSinkNodeExternal extends ApiSinkNode { + ApiSinkNodeExternal() { sinkNode(this, _) } +} diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ParallelSink.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ParallelSink.qll index 5e53c9bd8fd..1546d72887d 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ParallelSink.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ParallelSink.qll @@ -3,11 +3,12 @@ */ import csharp +private import FlowSinks /** * A data flow sink node for parallel execution. */ -abstract class ParallelSink extends DataFlow::Node { } +abstract class ParallelSink extends ApiSinkNode { } /** * A data flow sink node for lambda parallel sink. diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll index 0770a948b09..b58beb38ca5 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll @@ -5,12 +5,13 @@ import csharp private import Email::Email private import ExternalLocationSink +private import FlowSinks private import Html private import semmle.code.csharp.security.dataflow.XSSSinks as XssSinks private import semmle.code.csharp.frameworks.system.web.UI /** A data flow sink of remote user output. */ -abstract class RemoteFlowSink extends DataFlow::Node { } +abstract class RemoteFlowSink extends ApiSinkNode { } /** * A value written to the `[Inner]Text` property of an object defined in the diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/AllSources.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/AllSources.qll deleted file mode 100644 index 7d05500446a..00000000000 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/AllSources.qll +++ /dev/null @@ -1,77 +0,0 @@ -/** Provides classes representing various flow sources for data flow / taint tracking. */ - -private import semmle.code.csharp.dataflow.internal.ExternalFlow - -/** - * A data flow source node. - */ -abstract class SourceNode extends DataFlow::Node { } - -/** - * Module that adds all sources to `SourceNode`, excluding source for cryptography based - * queries, and queries where sources are not succifiently explicit or mainly hardcoded constants. - */ -private module AllSources { - private import FlowSources as FlowSources - private import semmle.code.csharp.security.cryptography.HardcodedSymmetricEncryptionKey - private import semmle.code.csharp.security.dataflow.CleartextStorageQuery as CleartextStorageQuery - private import semmle.code.csharp.security.dataflow.CodeInjectionQuery as CodeInjectionQuery - private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery - private import semmle.code.csharp.security.dataflow.ExposureOfPrivateInformationQuery as ExposureOfPrivateInformationQuery - private import semmle.code.csharp.security.dataflow.HardcodedCredentialsQuery as HardcodedCredentialsQuery - private import semmle.code.csharp.security.dataflow.LDAPInjectionQuery as LdapInjectionQuery - private import semmle.code.csharp.security.dataflow.LogForgingQuery as LogForgingQuery - private import semmle.code.csharp.security.dataflow.MissingXMLValidationQuery as MissingXmlValidationQuery - private import semmle.code.csharp.security.dataflow.ReDoSQuery as ReDosQuery - private import semmle.code.csharp.security.dataflow.RegexInjectionQuery as RegexInjectionQuery - private import semmle.code.csharp.security.dataflow.ResourceInjectionQuery as ResourceInjectionQuery - private import semmle.code.csharp.security.dataflow.SqlInjectionQuery as SqlInjectionQuery - private import semmle.code.csharp.security.dataflow.TaintedPathQuery as TaintedPathQuery - private import semmle.code.csharp.security.dataflow.UnsafeDeserializationQuery as UnsafeDeserializationQuery - private import semmle.code.csharp.security.dataflow.UrlRedirectQuery as UrlRedirectQuery - private import semmle.code.csharp.security.dataflow.XMLEntityInjectionQuery as XmlEntityInjectionQuery - private import semmle.code.csharp.security.dataflow.XPathInjectionQuery as XpathInjectionQuery - private import semmle.code.csharp.security.dataflow.ZipSlipQuery as ZipSlipQuery - - private class FlowSourcesSources extends SourceNode instanceof FlowSources::SourceNode { } - - private class CodeInjectionSource extends SourceNode instanceof CodeInjectionQuery::Source { } - - private class ConditionalBypassSource extends SourceNode instanceof ConditionalBypassQuery::Source - { } - - private class LdapInjectionSource extends SourceNode instanceof LdapInjectionQuery::Source { } - - private class LogForgingSource extends SourceNode instanceof LogForgingQuery::Source { } - - private class MissingXmlValidationSource extends SourceNode instanceof MissingXmlValidationQuery::Source - { } - - private class ReDosSource extends SourceNode instanceof ReDosQuery::Source { } - - private class RegexInjectionSource extends SourceNode instanceof RegexInjectionQuery::Source { } - - private class ResourceInjectionSource extends SourceNode instanceof ResourceInjectionQuery::Source - { } - - private class SqlInjectionSource extends SourceNode instanceof SqlInjectionQuery::Source { } - - private class TaintedPathSource extends SourceNode instanceof TaintedPathQuery::Source { } - - private class UnsafeDeserializationSource extends SourceNode instanceof UnsafeDeserializationQuery::Source - { } - - private class UrlRedirectSource extends SourceNode instanceof UrlRedirectQuery::Source { } - - private class XmlEntityInjectionSource extends SourceNode instanceof XmlEntityInjectionQuery::Source - { } - - private class XpathInjectionSource extends SourceNode instanceof XpathInjectionQuery::Source { } - - /** - * Add all models as data sources. - */ - private class SourceNodeExternal extends SourceNode { - SourceNodeExternal() { sourceNode(this, _) } - } -} diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll new file mode 100644 index 00000000000..01d838f2f94 --- /dev/null +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll @@ -0,0 +1,14 @@ +/** Provides classes representing various flow sources for data flow / taint tracking. */ + +private import FlowSources as FlowSources + +final class SourceNode = FlowSources::SourceNode; + +/** + * Module that adds all API like sources to `SourceNode`, excluding some sources for cryptography based + * queries, and queries where sources are not succifiently defined (eg. using broad method name matching). + */ +private module AllApiSources { + private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery + private import semmle.code.csharp.security.dataflow.ZipSlipQuery as ZipSlipQuery +} diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/FlowSources.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/FlowSources.qll index a5ada1cbaf8..c610b3de4c7 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/FlowSources.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/FlowSources.qll @@ -32,3 +32,18 @@ class ThreatModelFlowSource extends DataFlow::Node { ) } } + +/** + * A data flow source node for an API, which should be considered + * supported from a modeling perspective. + */ +abstract class ApiSourceNode extends DataFlow::Node { } + +private class AddSourceNodes extends ApiSourceNode instanceof SourceNode { } + +/** + * Add all source models as data sources. + */ +private class ApiSourceNodeExternal extends ApiSourceNode { + ApiSourceNodeExternal() { sourceNode(this, _) } +} diff --git a/csharp/ql/src/Telemetry/ExternalApi.qll b/csharp/ql/src/Telemetry/ExternalApi.qll index a710cdf7cfd..270db8b0d19 100644 --- a/csharp/ql/src/Telemetry/ExternalApi.qll +++ b/csharp/ql/src/Telemetry/ExternalApi.qll @@ -8,8 +8,8 @@ private import semmle.code.csharp.dataflow.internal.DataFlowDispatch as DataFlow private import semmle.code.csharp.dataflow.internal.ExternalFlow private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl private import semmle.code.csharp.dataflow.internal.TaintTrackingPrivate -private import semmle.code.csharp.security.dataflow.flowsources.AllSources -private import semmle.code.csharp.security.dataflow.flowsinks.AllSinks +private import semmle.code.csharp.security.dataflow.flowsources.ApiSources as ApiSources +private import semmle.code.csharp.security.dataflow.flowsinks.ApiSinks as ApiSinks private import TestLibrary /** Holds if the given callable is not worth supporting. */ @@ -85,11 +85,11 @@ class ExternalApi extends Callable { /** Holds if this API is a known source. */ pragma[nomagic] - predicate isSource() { this.getAnOutput() instanceof SourceNode } + predicate isSource() { this.getAnOutput() instanceof ApiSources::SourceNode } /** Holds if this API is a known sink. */ pragma[nomagic] - predicate isSink() { this.getAnInput() instanceof SinkNode } + predicate isSink() { this.getAnInput() instanceof ApiSinks::SinkNode } /** Holds if this API is a known neutral. */ pragma[nomagic] From 31c427e64c030e0cdaeb26b7c571e05124ba00f0 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 3 May 2024 13:04:42 +0200 Subject: [PATCH 056/118] Bazel/Go: add more explanation in `gen.py` --- go/gen.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/go/gen.py b/go/gen.py index ebb57b2a685..0e9005571ea 100644 --- a/go/gen.py +++ b/go/gen.py @@ -1,3 +1,12 @@ +""" +Update generated files related to Go in the repo. Using --force will regenerate all files from scratch. + +In particular the script will: +1. update the `vendor` dir with `go work vendor` (using a go toolchain provided by bazel) +2. update `BUILD.bazel` files using gazelle +3. update `ql/lib/go.dbscheme` using a compiled `go-dbschemegen` +""" + import sys import pathlib import subprocess @@ -7,9 +16,9 @@ import shutil from python.runfiles import runfiles def options(): - p = argparse.ArgumentParser(description="Update generated checked in files in the Go pack") + p = argparse.ArgumentParser(description="Update generated files related to Go in the repo") p.add_argument("--force", "-f", action="store_true", help="Regenerate all files from scratch rather than updating them") - p.add_argument("generators", nargs=3) + p.add_argument("executables", nargs=3, help="Internally provided executables") return p.parse_args() opts = options() @@ -23,7 +32,7 @@ except KeyError: go_extractor_dir = workspace_dir / "go" / "extractor" go_dbscheme = workspace_dir / "go" / "ql" / "lib" / "go.dbscheme" r = runfiles.Create() -go, gazelle, go_gen_dbscheme = map(r.Rlocation, opts.generators) +go, gazelle, go_gen_dbscheme = map(r.Rlocation, opts.executables) if opts.force: @@ -43,13 +52,16 @@ if opts.force: print("running gazelle") subprocess.check_call([gazelle]) +# we want to stamp all newly generated `BUILD.bazel` files with a header build_files_to_update = set(go_extractor_dir.glob("*/**/BUILD.bazel")) +# if --force, all files are new if not opts.force: + # otherwise, subtract the files that existed at the start build_files_to_update -= existing_build_files - # these are always refreshed + # but bring back the `vendor` ones, as the vendor update step always clears them build_files_to_update.update(go_extractor_dir.glob("vendor/**/BUILD.bazel")) -print("adding header to generated BUILD files") +print("adding header to newly generated BUILD files") for build_file in build_files_to_update: contents = build_file.read_text() build_file.write_text(f"# generated running `bazel run //go/gazelle`, do not edit\n\n{contents}") From 8f0b88497a89ed9cce41c659528175427d61bf85 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 3 May 2024 13:07:56 +0200 Subject: [PATCH 057/118] Bazel/Go: be more specific in `go/extractor/BUILD.bazel` comments --- go/extractor/BUILD.bazel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index 32eaa8fda74..297ca52c8b8 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -4,7 +4,7 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_files") # gazelle:prefix github.com/github/codeql-go/extractor # gazelle:map_kind go_binary codeql_go_binary //go:rules.bzl -# following target is kept up to date by `bazel run //go:gen`, do not edit directly +# the immediately following `extractor` target is kept up to date by `bazel run //go:gen`, do not edit directly go_library( name = "extractor", srcs = [ @@ -25,6 +25,7 @@ go_library( ], ) +# notice that these other targets are not generated java_library( name = "tokenizer-deps", srcs = [ From ff85db36e2bb8ce248696a6dd1ec127a798d65db Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 3 May 2024 13:58:11 +0200 Subject: [PATCH 058/118] exclude credentials as kind `key` from hardcoded-credentials when the key looks like a dummy password --- javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql b/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql index 3cc63e51dcf..1c13ad78bfa 100644 --- a/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql +++ b/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql @@ -30,7 +30,7 @@ where // exclude dummy passwords and templates not ( sink.getNode().(Sink).(DefaultCredentialsSink).getKind() = - ["password", "credentials", "token"] and + ["password", "credentials", "token", "key"] and PasswordHeuristics::isDummyPassword(val) or sink.getNode().(Sink).getKind() = "authorization header" and From d9e8e0e00aee0f2184e81493fc1c1db25212a45a Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 3 May 2024 13:58:37 +0200 Subject: [PATCH 059/118] use some more standard values for credentials-kind for NodeJS client credentials --- javascript/ql/lib/semmle/javascript/frameworks/NodeJSLib.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/NodeJSLib.qll b/javascript/ql/lib/semmle/javascript/frameworks/NodeJSLib.qll index b3d93383ed7..98bb0f615b6 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/NodeJSLib.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/NodeJSLib.qll @@ -1003,7 +1003,7 @@ module NodeJSLib { exists(ClientRequestLoginCallback callback | this = callback.getACall().getArgument(0)) } - override string getCredentialsKind() { result = "Node.js http(s) client login username" } + override string getCredentialsKind() { result = "user name" } } /** @@ -1014,7 +1014,7 @@ module NodeJSLib { exists(ClientRequestLoginCallback callback | this = callback.getACall().getArgument(1)) } - override string getCredentialsKind() { result = "Node.js http(s) client login password" } + override string getCredentialsKind() { result = "password" } } /** From 2132c7bf967e6975827ce8a35b3511cf8297d3f2 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 3 May 2024 14:52:17 +0200 Subject: [PATCH 060/118] Bazel/Go: make `@codeql//go:gen` runnable from internal repo --- go/BUILD.bazel | 22 +++++++--------------- go/gen.py | 12 +++++++++--- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/go/BUILD.bazel b/go/BUILD.bazel index 6c80e7cb258..e0da93475a2 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -1,13 +1,14 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary") -load("@gazelle//:def.bzl", "gazelle") load("@rules_pkg//pkg:install.bzl", "pkg_install") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") load("@rules_pkg//pkg:zip.bzl", "pkg_zip") load("//:defs.bzl", "codeql_platform") -gazelle( +native_binary( name = "gazelle", - extra_args = ["go/extractor"], + src = "@gazelle//cmd/gazelle", + out = "gazelle.exe", + args = ["go/extractor"], ) _gen_binaries = [ @@ -24,9 +25,9 @@ py_binary( deps = ["@rules_python//python/runfiles"], ) -# this is an internal copy of the dbscheme to be used by extractor-pack -# this allows the extractor-pack target to be independent and up-to-date with respect to -# having run //go:gen to update the checked in files +# this is an instance of the dbscheme kept in the bazel build tree +# this allows everything that bazel builds to be up-to-date, +# independently from whether //go:gen was already run to update the checked in files genrule( name = "dbscheme", outs = ["go.dbscheme"], @@ -108,12 +109,3 @@ py_binary( main = "create_extractor_pack.py", deps = ["@rules_python//python/runfiles"], ) - -native_binary( - name = "gen-dbscheme", - src = "//go/extractor/cli/go-gen-dbscheme", - out = "go-gen-dbscheme", - args = [ - "$$BUILD_WORKSPACE_DIRECTORY/go/ql/lib/go.dbscheme", - ], -) diff --git a/go/gen.py b/go/gen.py index 0e9005571ea..6f8d47d7096 100644 --- a/go/gen.py +++ b/go/gen.py @@ -24,12 +24,18 @@ def options(): opts = options() try: - workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']) + workspace_dir = pathlib.Path(os.environ.pop('BUILD_WORKSPACE_DIRECTORY')) except KeyError: print("this should be run with bazel run", file=sys.stderr) sys.exit(1) go_extractor_dir = workspace_dir / "go" / "extractor" + +if not go_extractor_dir.exists(): + # internal repo? + workspace_dir /= "ql" + go_extractor_dir = workspace_dir / "go" / "extractor" + go_dbscheme = workspace_dir / "go" / "ql" / "lib" / "go.dbscheme" r = runfiles.Create() go, gazelle, go_gen_dbscheme = map(r.Rlocation, opts.executables) @@ -49,8 +55,8 @@ if opts.force: for build_file in existing_build_files: build_file.unlink() -print("running gazelle") -subprocess.check_call([gazelle]) +print("running gazelle", gazelle, go_extractor_dir) +subprocess.check_call([gazelle, "go/extractor"], cwd=workspace_dir) # we want to stamp all newly generated `BUILD.bazel` files with a header build_files_to_update = set(go_extractor_dir.glob("*/**/BUILD.bazel")) From 471303bd7ce7e45182cc586db60344f7bae86858 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 3 May 2024 14:56:17 +0200 Subject: [PATCH 061/118] Bazel/Go: remove unneeded comment --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index d069d320f07..27479e1978f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -55,7 +55,7 @@ node.toolchain( use_repo(node, "nodejs", "nodejs_toolchains") go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.22.2") # default +go_sdk.download(version = "1.22.2") register_toolchains( "@nodejs_toolchains//:all", From 17990da205995d0fcd7f052287ba9ecb15616e69 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 3 May 2024 15:58:43 +0200 Subject: [PATCH 062/118] Update go/extractor/BUILD.bazel Co-authored-by: Cornelius Riemenschneider --- go/extractor/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index 297ca52c8b8..6047eea6860 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -25,7 +25,7 @@ go_library( ], ) -# notice that these other targets are not generated +# the other targets are not generated java_library( name = "tokenizer-deps", srcs = [ From 7a1b85aa56063210db75f5394c68d38f014b7967 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 3 May 2024 16:04:21 +0100 Subject: [PATCH 063/118] C++: Add FP test. --- .../IteratorToExpiredContainer.expected | 1 + .../semmle/tests/IteratorToExpiredContainer/test.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected index f47e5d655b9..5bb295dc02a 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected @@ -4,3 +4,4 @@ | test.cpp:702:27:702:27 | call to operator[] | This object is destroyed at the end of the full-expression. | | test.cpp:727:23:727:23 | call to operator[] | This object is destroyed at the end of the full-expression. | | test.cpp:735:23:735:23 | call to operator[] | This object is destroyed at the end of the full-expression. | +| test.cpp:803:3:803:3 | pointer to ~vector output argument | This object is destroyed at the end of the full-expression. | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp index 85d9c4b57ad..0dc97ece06d 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp @@ -792,4 +792,13 @@ void test4() { // function we may end up in the destructor call `chunk.~A()`in `A.foo`. This destructor // call can flow to `begin` through the back-edge and cause a strange FP. auto zero = A().size(); +} + +void test5(int i) +{ + while(i < 10) { + const auto& vvs = returnValue(); + for(const auto& vs : vvs) { } + ++i; + } // GOOD [FALSE POSITIVE] } \ No newline at end of file From 77128de105d35ada1e379a6dea61d3939e6cab6e Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 3 May 2024 17:44:29 +0200 Subject: [PATCH 064/118] Bazel/Go: make installer work from internal repo and on windows It turns out everything that is needed for the installer to work on windows is enabling runfiles. This also requires symlinks to avoid excessive copying of files. --- .bazelrc | 3 +++ go/BUILD.bazel | 24 +++--------------------- go/create_extractor_pack.py | 24 ++++++++++-------------- 3 files changed, 16 insertions(+), 35 deletions(-) mode change 100644 => 100755 go/create_extractor_pack.py diff --git a/.bazelrc b/.bazelrc index 0a49f682da3..36111310779 100644 --- a/.bazelrc +++ b/.bazelrc @@ -14,6 +14,9 @@ build:linux --cxxopt=-std=c++20 build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64 build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor +# this requires developer mode, but is required to have pack installer functioning +common:windows --windows_enable_symlinks --enable_runfiles + common --registry=file:///%workspace%/misc/bazel/registry common --registry=https://bcr.bazel.build diff --git a/go/BUILD.bazel b/go/BUILD.bazel index e0da93475a2..4fb73a51fb6 100644 --- a/go/BUILD.bazel +++ b/go/BUILD.bazel @@ -1,7 +1,6 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary") load("@rules_pkg//pkg:install.bzl", "pkg_install") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") -load("@rules_pkg//pkg:zip.bzl", "pkg_zip") load("//:defs.bzl", "codeql_platform") native_binary( @@ -81,31 +80,14 @@ pkg_filegroup( ) pkg_install( - name = "_extractor-pack-installer", + name = "_extractor_pack", srcs = [":extractor-pack"], ) -# rules_pkg installer is currently broken on Windows -# see https://github.com/bazelbuild/rules_pkg/issues/387 -# for now, work around it using an archive -pkg_zip( - name = "_extractor-pack-zip", - srcs = [":extractor-pack"], -) - -alias( - name = "_create-extractor-pack-arg", - actual = select({ - "@platforms//os:windows": ":_extractor-pack-zip", - "//conditions:default": ":_extractor-pack-installer", - }), -) - py_binary( name = "create-extractor-pack", srcs = ["create_extractor_pack.py"], - args = ["$(rlocationpath :_create-extractor-pack-arg)"], - data = [":_create-extractor-pack-arg"], + env = {"REPO_NAME": repo_name()}, main = "create_extractor_pack.py", - deps = ["@rules_python//python/runfiles"], + deps = ["_extractor_pack"], ) diff --git a/go/create_extractor_pack.py b/go/create_extractor_pack.py old mode 100644 new mode 100755 index a1154a777d8..4d194ab93e4 --- a/go/create_extractor_pack.py +++ b/go/create_extractor_pack.py @@ -1,26 +1,22 @@ +#!/usr/bin/env python3 import os import pathlib import shutil import sys import subprocess -import zipfile -from python.runfiles import runfiles try: workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']) except KeyError: - print("this should be run with bazel run", file=sys.stderr) - sys.exit(1) + res = subprocess.run(["bazel", "run", ":create-extractor-pack"], cwd=pathlib.Path(__file__).parent) + sys.exit(res.returncode) -dest_dir = workspace_dir / 'go' / 'build' / 'codeql-extractor-go' -installer_or_zip = pathlib.Path(runfiles.Create().Rlocation(sys.argv[1])) +from go._extractor_pack_install_script import main +if os.environ['REPO_NAME'] == 'codeql~': + workspace_dir /= 'ql' + +dest_dir = workspace_dir / 'go' / 'build' / 'codeql-extractor-pack' shutil.rmtree(dest_dir, ignore_errors=True) - -if installer_or_zip.suffix == '.zip': - dest_dir.mkdir() - with zipfile.ZipFile(installer_or_zip) as pack: - pack.extractall(dest_dir) -else: - os.environ['DESTDIR'] = str(dest_dir) - subprocess.check_call([installer_or_zip]) +os.environ['DESTDIR'] = str(dest_dir) +main(sys.argv) From b209fc67cbdd9b366239f877f7734e852c0e1071 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 3 May 2024 19:34:18 +0200 Subject: [PATCH 065/118] test the change to hardcoded-credentials --- .../CWE-798/HardcodedCredentials.expected | 24 +++++++++++-------- .../Security/CWE-798/HardcodedCredentials.js | 8 +++++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected index 3635090cb43..0a9edfb64f8 100644 --- a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected +++ b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected @@ -153,12 +153,12 @@ nodes | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | -| HardcodedCredentials.js:160:38:160:48 | "change_me" | -| HardcodedCredentials.js:160:38:160:48 | "change_me" | -| HardcodedCredentials.js:160:38:160:48 | "change_me" | -| HardcodedCredentials.js:161:41:161:51 | 'change_me' | -| HardcodedCredentials.js:161:41:161:51 | 'change_me' | -| HardcodedCredentials.js:161:41:161:51 | 'change_me' | +| HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | +| HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | +| HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | +| HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | +| HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | +| HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | | HardcodedCredentials.js:164:35:164:45 | 'change_me' | | HardcodedCredentials.js:164:35:164:45 | 'change_me' | | HardcodedCredentials.js:164:35:164:45 | 'change_me' | @@ -271,6 +271,9 @@ nodes | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | +| HardcodedCredentials.js:299:44:299:52 | 'mytoken' | +| HardcodedCredentials.js:299:44:299:52 | 'mytoken' | +| HardcodedCredentials.js:299:44:299:52 | 'mytoken' | edges | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | @@ -326,8 +329,8 @@ edges | HardcodedCredentials.js:130:44:130:53 | 'hgfedcba' | HardcodedCredentials.js:130:44:130:53 | 'hgfedcba' | | HardcodedCredentials.js:131:52:131:61 | 'hgfedcba' | HardcodedCredentials.js:131:52:131:61 | 'hgfedcba' | | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | -| HardcodedCredentials.js:160:38:160:48 | "change_me" | HardcodedCredentials.js:160:38:160:48 | "change_me" | -| HardcodedCredentials.js:161:41:161:51 | 'change_me' | HardcodedCredentials.js:161:41:161:51 | 'change_me' | +| HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | +| HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | | HardcodedCredentials.js:164:35:164:45 | 'change_me' | HardcodedCredentials.js:164:35:164:45 | 'change_me' | | HardcodedCredentials.js:171:11:171:25 | USER | HardcodedCredentials.js:173:35:173:38 | USER | | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:171:11:171:25 | USER | @@ -399,6 +402,7 @@ edges | HardcodedCredentials.js:293:37:293:65 | `Basic ... xxxxxx` | HardcodedCredentials.js:293:37:293:65 | `Basic ... xxxxxx` | | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | +| HardcodedCredentials.js:299:44:299:52 | 'mytoken' | HardcodedCredentials.js:299:44:299:52 | 'mytoken' | #select | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | The hard-coded value "dbuser" is used as $@. | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | user name | | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | The hard-coded value "hgfedcba" is used as $@. | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | password | @@ -448,8 +452,8 @@ edges | HardcodedCredentials.js:130:44:130:53 | 'hgfedcba' | HardcodedCredentials.js:130:44:130:53 | 'hgfedcba' | HardcodedCredentials.js:130:44:130:53 | 'hgfedcba' | The hard-coded value "hgfedcba" is used as $@. | HardcodedCredentials.js:130:44:130:53 | 'hgfedcba' | key | | HardcodedCredentials.js:131:52:131:61 | 'hgfedcba' | HardcodedCredentials.js:131:52:131:61 | 'hgfedcba' | HardcodedCredentials.js:131:52:131:61 | 'hgfedcba' | The hard-coded value "hgfedcba" is used as $@. | HardcodedCredentials.js:131:52:131:61 | 'hgfedcba' | key | | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | The hard-coded value "hgfedcba" is used as $@. | HardcodedCredentials.js:135:41:135:50 | "hgfedcba" | key | -| HardcodedCredentials.js:160:38:160:48 | "change_me" | HardcodedCredentials.js:160:38:160:48 | "change_me" | HardcodedCredentials.js:160:38:160:48 | "change_me" | The hard-coded value "change_me" is used as $@. | HardcodedCredentials.js:160:38:160:48 | "change_me" | key | -| HardcodedCredentials.js:161:41:161:51 | 'change_me' | HardcodedCredentials.js:161:41:161:51 | 'change_me' | HardcodedCredentials.js:161:41:161:51 | 'change_me' | The hard-coded value "change_me" is used as $@. | HardcodedCredentials.js:161:41:161:51 | 'change_me' | key | +| HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | The hard-coded value "oiuneawrgiyubaegr" is used as $@. | HardcodedCredentials.js:160:38:160:56 | "oiuneawrgiyubaegr" | key | +| HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | The hard-coded value "oiuneawrgiyubaegr" is used as $@. | HardcodedCredentials.js:161:41:161:59 | 'oiuneawrgiyubaegr' | key | | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:178:30:178:44 | `Basic ${AUTH}` | The hard-coded value "sdsdag" is used as $@. | HardcodedCredentials.js:178:30:178:44 | `Basic ${AUTH}` | authorization header | | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:188:30:188:44 | `Basic ${AUTH}` | The hard-coded value "sdsdag" is used as $@. | HardcodedCredentials.js:188:30:188:44 | `Basic ${AUTH}` | authorization header | | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:171:18:171:25 | 'sdsdag' | HardcodedCredentials.js:195:37:195:51 | `Basic ${AUTH}` | The hard-coded value "sdsdag" is used as $@. | HardcodedCredentials.js:195:37:195:51 | `Basic ${AUTH}` | authorization header | diff --git a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js index 8482d5106fe..b033764f264 100644 --- a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js +++ b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js @@ -157,8 +157,8 @@ })(); (function(){ - require("cookie-session")({ secret: "change_me" }); // NOT OK - require('crypto').createHmac('sha256', 'change_me'); // NOT OK + require("cookie-session")({ secret: "oiuneawrgiyubaegr" }); // NOT OK + require('crypto').createHmac('sha256', 'oiuneawrgiyubaegr'); // NOT OK var basicAuth = require('express-basic-auth'); basicAuth({users: { [adminName]: 'change_me' }}); // OK @@ -294,3 +294,7 @@ headers.append("Authorization", `Basic sdsdag:aaaiuogrweuibgbbbbb`); // NOT OK headers.append("Authorization", `Basic sdsdag:000000000000001`); // OK }); + +(function () { + require('crypto').createHmac('sha256', 'mytoken'); // OK +})(); \ No newline at end of file From 39a8b49222c3f3765ed348d70d612a2babedb6ed Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 3 May 2024 19:37:31 +0200 Subject: [PATCH 066/118] add qhelp recommendation that you can use an obvious placeholder value --- .../src/Security/CWE-798/HardcodedCredentials.qhelp | 4 ++++ .../Security/CWE-798/HardcodedCredentials.expected | 13 +++++++++++++ .../Security/CWE-798/HardcodedCredentials.js | 3 +++ 3 files changed, 20 insertions(+) diff --git a/javascript/ql/src/Security/CWE-798/HardcodedCredentials.qhelp b/javascript/ql/src/Security/CWE-798/HardcodedCredentials.qhelp index adcd6fc4715..b2d00e38c28 100644 --- a/javascript/ql/src/Security/CWE-798/HardcodedCredentials.qhelp +++ b/javascript/ql/src/Security/CWE-798/HardcodedCredentials.qhelp @@ -19,6 +19,10 @@ If possible, store configuration files including credential data separately from the source code, in a secure location with restricted access.

    +

    + If the credentials are a placeholder value, make sure the value is obviously a placeholder by + using a name such as "SampleToken" or "MyPassword". +

    diff --git a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected index 0a9edfb64f8..fc41f193149 100644 --- a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected +++ b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.expected @@ -274,6 +274,15 @@ nodes | HardcodedCredentials.js:299:44:299:52 | 'mytoken' | | HardcodedCredentials.js:299:44:299:52 | 'mytoken' | | HardcodedCredentials.js:299:44:299:52 | 'mytoken' | +| HardcodedCredentials.js:300:44:300:56 | 'SampleToken' | +| HardcodedCredentials.js:300:44:300:56 | 'SampleToken' | +| HardcodedCredentials.js:300:44:300:56 | 'SampleToken' | +| HardcodedCredentials.js:301:44:301:55 | 'MyPassword' | +| HardcodedCredentials.js:301:44:301:55 | 'MyPassword' | +| HardcodedCredentials.js:301:44:301:55 | 'MyPassword' | +| HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | +| HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | +| HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | edges | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | @@ -403,6 +412,9 @@ edges | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | HardcodedCredentials.js:295:37:295:66 | `Basic ... 000001` | | HardcodedCredentials.js:299:44:299:52 | 'mytoken' | HardcodedCredentials.js:299:44:299:52 | 'mytoken' | +| HardcodedCredentials.js:300:44:300:56 | 'SampleToken' | HardcodedCredentials.js:300:44:300:56 | 'SampleToken' | +| HardcodedCredentials.js:301:44:301:55 | 'MyPassword' | HardcodedCredentials.js:301:44:301:55 | 'MyPassword' | +| HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | #select | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | The hard-coded value "dbuser" is used as $@. | HardcodedCredentials.js:5:15:5:22 | 'dbuser' | user name | | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | The hard-coded value "hgfedcba" is used as $@. | HardcodedCredentials.js:8:19:8:28 | 'hgfedcba' | password | @@ -468,3 +480,4 @@ edges | HardcodedCredentials.js:245:22:245:44 | "myHard ... ateKey" | HardcodedCredentials.js:245:22:245:44 | "myHard ... ateKey" | HardcodedCredentials.js:246:42:246:51 | privateKey | The hard-coded value "myHardCodedPrivateKey" is used as $@. | HardcodedCredentials.js:246:42:246:51 | privateKey | key | | HardcodedCredentials.js:292:37:292:57 | `Basic ... sdsdag` | HardcodedCredentials.js:292:37:292:57 | `Basic ... sdsdag` | HardcodedCredentials.js:292:37:292:57 | `Basic ... sdsdag` | The hard-coded value "Basic sdsdag:sdsdag" is used as $@. | HardcodedCredentials.js:292:37:292:57 | `Basic ... sdsdag` | authorization header | | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | The hard-coded value "Basic sdsdag:aaaiuogrweuibgbbbbb" is used as $@. | HardcodedCredentials.js:294:37:294:70 | `Basic ... gbbbbb` | authorization header | +| HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | The hard-coded value "iubfewiaaweiybgaeuybgera" is used as $@. | HardcodedCredentials.js:302:44:302:69 | 'iubfew ... ybgera' | key | diff --git a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js index b033764f264..d1543f16dc7 100644 --- a/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js +++ b/javascript/ql/test/query-tests/Security/CWE-798/HardcodedCredentials.js @@ -297,4 +297,7 @@ (function () { require('crypto').createHmac('sha256', 'mytoken'); // OK + require('crypto').createHmac('sha256', 'SampleToken'); // OK + require('crypto').createHmac('sha256', 'MyPassword'); // OK + require('crypto').createHmac('sha256', 'iubfewiaaweiybgaeuybgera'); // NOT OK })(); \ No newline at end of file From 105984f7de7e13b49d8875b0fba6608ec80e3929 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 10:01:34 +0200 Subject: [PATCH 067/118] Java: Make param module for MaD inline test. --- .../CaptureTypeBasedSummaryModels.ql | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql index fe77abaa6df..88932d3a1ef 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql @@ -1,26 +1,44 @@ import java import utils.modelgenerator.internal.CaptureTypeBasedSummaryModels -private string expects() { - exists(Javadoc doc | - doc.getChild(0).toString().regexpCapture(" *(SPURIOUS-)?MaD=(.*)", 2) = result - ) +signature module InlineMadTestConfigSig { + /** + * Gets a relevant code comment, if any. + */ + string getComment(); + + /** + * Gets an identified summary, if any. + */ + string getCapturedSummary(); } -private string flows() { result = captureFlow(_) } +module InlineMadTest { + private string expects() { + Input::getComment().regexpCapture(" *(SPURIOUS-)?MaD=(.*)", 2) = result + } -query predicate unexpectedSummary(string msg) { - exists(string flow | - flow = flows() and - not flow = expects() and - msg = "Unexpected summary found: " + flow - ) + query predicate unexpectedSummary(string msg) { + exists(string flow | + flow = Input::getCapturedSummary() and + not flow = expects() and + msg = "Unexpected summary found: " + flow + ) + } + + query predicate expectedSummary(string msg) { + exists(string e | + e = expects() and + not e = Input::getCapturedSummary() and + msg = "Expected summary missing: " + e + ) + } } -query predicate expectedSummary(string msg) { - exists(string e | - e = expects() and - not e = flows() and - msg = "Expected summary missing: " + e - ) +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getComment() { result = any(Javadoc doc).getChild(0).toString() } + + string getCapturedSummary() { result = captureFlow(_) } } + +import InlineMadTest From 6815bcaa80027a01665d5783821d4fe4fb3fea85 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 10:19:39 +0200 Subject: [PATCH 068/118] Java: Move param module into TestUtilities. --- java/ql/test/TestUtilities/InlineMadTest.qll | 33 +++++++++++++++++ .../CaptureTypeBasedSummaryModels.ql | 35 +------------------ 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 java/ql/test/TestUtilities/InlineMadTest.qll diff --git a/java/ql/test/TestUtilities/InlineMadTest.qll b/java/ql/test/TestUtilities/InlineMadTest.qll new file mode 100644 index 00000000000..64badab0dca --- /dev/null +++ b/java/ql/test/TestUtilities/InlineMadTest.qll @@ -0,0 +1,33 @@ +signature module InlineMadTestConfigSig { + /** + * Gets a relevant code comment, if any. + */ + string getComment(); + + /** + * Gets an identified summary, if any. + */ + string getCapturedSummary(); +} + +module InlineMadTest { + private string expects() { + Input::getComment().regexpCapture(" *(SPURIOUS-)?MaD=(.*)", 2) = result + } + + query predicate unexpectedSummary(string msg) { + exists(string flow | + flow = Input::getCapturedSummary() and + not flow = expects() and + msg = "Unexpected summary found: " + flow + ) + } + + query predicate expectedSummary(string msg) { + exists(string e | + e = expects() and + not e = Input::getCapturedSummary() and + msg = "Expected summary missing: " + e + ) + } +} diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql index 88932d3a1ef..c5c509ac326 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql @@ -1,40 +1,7 @@ import java +import TestUtilities.InlineMadTest import utils.modelgenerator.internal.CaptureTypeBasedSummaryModels -signature module InlineMadTestConfigSig { - /** - * Gets a relevant code comment, if any. - */ - string getComment(); - - /** - * Gets an identified summary, if any. - */ - string getCapturedSummary(); -} - -module InlineMadTest { - private string expects() { - Input::getComment().regexpCapture(" *(SPURIOUS-)?MaD=(.*)", 2) = result - } - - query predicate unexpectedSummary(string msg) { - exists(string flow | - flow = Input::getCapturedSummary() and - not flow = expects() and - msg = "Unexpected summary found: " + flow - ) - } - - query predicate expectedSummary(string msg) { - exists(string e | - e = expects() and - not e = Input::getCapturedSummary() and - msg = "Expected summary missing: " + e - ) - } -} - module InlineMadTestConfig implements InlineMadTestConfigSig { string getComment() { result = any(Javadoc doc).getChild(0).toString() } From 7cb8a6c52f9219abd305b3e2a7d6e4f3c29f3eac Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 11:01:23 +0200 Subject: [PATCH 069/118] Java: Inline models as data expected output as comments in the java files and add a test. --- .../dataflow/CaptureModels.expected | 2 + .../modelgenerator/dataflow/CaptureModels.ql | 11 + .../modelgenerator/dataflow/p/Factory.java | 42 ++-- .../modelgenerator/dataflow/p/FinalClass.java | 18 +- .../modelgenerator/dataflow/p/FluentAPI.java | 18 +- .../dataflow/p/ImmutablePojo.java | 37 ++-- .../dataflow/p/InnerClasses.java | 29 +-- .../dataflow/p/InnerHolder.java | 57 ++--- .../modelgenerator/dataflow/p/Joiner.java | 203 +++++++++--------- .../dataflow/p/MultipleImpl2.java | 29 +-- .../dataflow/p/MultipleImpls.java | 59 ++--- .../modelgenerator/dataflow/p/ParamFlow.java | 97 +++++---- .../utils/modelgenerator/dataflow/p/Pojo.java | 148 +++++++------ .../p/PrivateFlowViaPublicInterface.java | 82 +++---- 14 files changed, 439 insertions(+), 393 deletions(-) create mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected create mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected new file mode 100644 index 00000000000..ee55a9c6ba6 --- /dev/null +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected @@ -0,0 +1,2 @@ +unexpectedSummary +expectedSummary diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql new file mode 100644 index 00000000000..1a2dbd03d7a --- /dev/null +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql @@ -0,0 +1,11 @@ +import java +import utils.modelgenerator.internal.CaptureSummaryFlowQuery +import TestUtilities.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getComment() { result = any(Javadoc doc).getChild(0).toString() } + + string getCapturedSummary() { result = captureFlow(_) } +} + +import InlineMadTest diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java index a6e7ce5fff6..84b55a812c9 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java @@ -2,29 +2,31 @@ package p; public final class Factory { - private String value; + private String value; - private int intValue; + private int intValue; - public static Factory create(String value, int foo) { - return new Factory(value, foo); - } + // MaD=p;Factory;false;create;(String,int);;Argument[0];ReturnValue;taint;df-generated + public static Factory create(String value, int foo) { + return new Factory(value, foo); + } - public static Factory create(String value) { - return new Factory(value, 0); - } + // MaD=p;Factory;false;create;(String);;Argument[0];ReturnValue;taint;df-generated + public static Factory create(String value) { + return new Factory(value, 0); + } - private Factory(String value, int intValue) { - this.value = value; - this.intValue = intValue; - } + private Factory(String value, int intValue) { + this.value = value; + this.intValue = intValue; + } - public String getValue() { - return value; - } + // MaD=p;Factory;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + public String getValue() { + return value; + } - public int getIntValue() { - return intValue; - } - -} \ No newline at end of file + public int getIntValue() { + return intValue; + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java index 224fc44a0bc..5073f435233 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java @@ -2,14 +2,14 @@ package p; public final class FinalClass { - private static final String C = "constant"; + private static final String C = "constant"; - public String returnsInput(String input) { - return input; - } + // MaD=p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated + public String returnsInput(String input) { + return input; + } - public String returnsConstant() { - return C; - } - -} \ No newline at end of file + public String returnsConstant() { + return C; + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java index 65887625d27..2bb2bb97604 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java @@ -2,14 +2,14 @@ package p; public final class FluentAPI { - public FluentAPI returnsThis(String input) { - return this; - } + // MaD=p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;df-generated + public FluentAPI returnsThis(String input) { + return this; + } - public class Inner { - public FluentAPI notThis(String input) { - return FluentAPI.this; - } + public class Inner { + public FluentAPI notThis(String input) { + return FluentAPI.this; } - -} \ No newline at end of file + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java index 660c1970bd3..38a9b472f62 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java @@ -2,25 +2,28 @@ package p; public final class ImmutablePojo { - private final String value; + private final String value; - private final long x; + private final long x; - public ImmutablePojo(String value, int x) { - this.value = value; - this.x = x; - } + // MaD=p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this];taint;df-generated + public ImmutablePojo(String value, int x) { + this.value = value; + this.x = x; + } - public String getValue() { - return value; - } + // MaD=p;ImmutablePojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + public String getValue() { + return value; + } - public long getX() { - return x; - } + public long getX() { + return x; + } - public String or(String defaultValue) { - return value != null ? value : defaultValue; - } - -} \ No newline at end of file + // MaD=p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;taint;df-generated + // MaD=p;ImmutablePojo;false;or;(String);;Argument[this];ReturnValue;taint;df-generated + public String or(String defaultValue) { + return value != null ? value : defaultValue; + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java b/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java index 936166eddf3..54f014fec93 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java @@ -1,21 +1,22 @@ package p; public class InnerClasses { - - class IgnoreMe { - public String no(String input) { - return input; - } - } - - public class CaptureMe { - public String yesCm(String input) { - return input; - } - } - public String yes(String input) { - return input; + class IgnoreMe { + public String no(String input) { + return input; } + } + public class CaptureMe { + // MaD=p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;taint;df-generated + public String yesCm(String input) { + return input; + } + } + + // MaD=p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;taint;df-generated + public String yes(String input) { + return input; + } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java b/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java index 5dc07cadd51..ef872942191 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java @@ -2,36 +2,39 @@ package p; public final class InnerHolder { - private class Context { - private String value; + private class Context { + private String value; - Context(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - } - - private Context context = null; - - private StringBuilder sb = new StringBuilder(); - - public void setContext(String value) { - context = new Context(value); - } - - public void explicitSetContext(String value) { - this.context = new Context(value); - } - - public void append(String value) { - sb.append(value); + Context(String value) { + this.value = value; } public String getValue() { - return context.getValue(); + return value; } + } -} \ No newline at end of file + private Context context = null; + + private StringBuilder sb = new StringBuilder(); + + // MaD=p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this];taint;df-generated + public void setContext(String value) { + context = new Context(value); + } + + // MaD=p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this];taint;df-generated + public void explicitSetContext(String value) { + this.context = new Context(value); + } + + // MaD=p;InnerHolder;false;append;(String);;Argument[0];Argument[this];taint;df-generated + public void append(String value) { + sb.append(value); + } + + // MaD=p;InnerHolder;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + public String getValue() { + return context.getValue(); + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java index d9869815bc5..daa939ebe51 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java @@ -4,115 +4,122 @@ import java.util.Arrays; import java.util.Objects; public final class Joiner { - private final String prefix; - private final String delimiter; - private final String suffix; - private String[] elts; - private int size; - private int len; - private String emptyValue; - public Joiner(CharSequence delimiter) { - this(delimiter, "", ""); - } + private final String prefix; + private final String delimiter; + private final String suffix; + private String[] elts; + private int size; + private int len; + private String emptyValue; - public Joiner(CharSequence delimiter, - CharSequence prefix, - CharSequence suffix) { - Objects.requireNonNull(prefix, "The prefix must not be null"); - Objects.requireNonNull(delimiter, "The delimiter must not be null"); - Objects.requireNonNull(suffix, "The suffix must not be null"); - this.prefix = prefix.toString(); - this.delimiter = delimiter.toString(); - this.suffix = suffix.toString(); - checkAddLength(0, 0); - } + // MaD=p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this];taint;df-generated + public Joiner(CharSequence delimiter) { + this(delimiter, "", ""); + } - public Joiner setEmptyValue(CharSequence emptyValue) { - this.emptyValue = Objects.requireNonNull(emptyValue, - "The empty value must not be null").toString(); - return this; - } + // MaD=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this];taint;df-generated + // MaD=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[1];Argument[this];taint;df-generated + // MaD=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[2];Argument[this];taint;df-generated + public Joiner(CharSequence delimiter, CharSequence prefix, CharSequence suffix) { + Objects.requireNonNull(prefix, "The prefix must not be null"); + Objects.requireNonNull(delimiter, "The delimiter must not be null"); + Objects.requireNonNull(suffix, "The suffix must not be null"); + this.prefix = prefix.toString(); + this.delimiter = delimiter.toString(); + this.suffix = suffix.toString(); + checkAddLength(0, 0); + } - private static int getChars(String s, char[] chars, int start) { - int len = s.length(); - s.getChars(0, len, chars, start); - return len; - } + // MaD=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[0];Argument[this];taint;df-generated + // MaD=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;df-generated + public Joiner setEmptyValue(CharSequence emptyValue) { + this.emptyValue = + Objects.requireNonNull(emptyValue, "The empty value must not be null").toString(); + return this; + } - @Override - public String toString() { - final String[] elts = this.elts; - if (elts == null && emptyValue != null) { - return emptyValue; - } - final int size = this.size; - final int addLen = prefix.length() + suffix.length(); - if (addLen == 0) { - compactElts(); - return size == 0 ? "" : elts[0]; - } - final String delimiter = this.delimiter; - final char[] chars = new char[len + addLen]; - int k = getChars(prefix, chars, 0); - if (size > 0) { - k += getChars(elts[0], chars, k); - for (int i = 1; i < size; i++) { - k += getChars(delimiter, chars, k); - k += getChars(elts[i], chars, k); - } - } - k += getChars(suffix, chars, k); - return new String(chars); - } + private static int getChars(String s, char[] chars, int start) { + int len = s.length(); + s.getChars(0, len, chars, start); + return len; + } - public Joiner add(CharSequence newElement) { - final String elt = String.valueOf(newElement); - if (elts == null) { - elts = new String[8]; - } else { - if (size == elts.length) - elts = Arrays.copyOf(elts, 2 * size); - len = checkAddLength(len, delimiter.length()); - } - len = checkAddLength(len, elt.length()); - elts[size++] = elt; - return this; + @Override + public String toString() { + final String[] elts = this.elts; + if (elts == null && emptyValue != null) { + return emptyValue; } + final int size = this.size; + final int addLen = prefix.length() + suffix.length(); + if (addLen == 0) { + compactElts(); + return size == 0 ? "" : elts[0]; + } + final String delimiter = this.delimiter; + final char[] chars = new char[len + addLen]; + int k = getChars(prefix, chars, 0); + if (size > 0) { + k += getChars(elts[0], chars, k); + for (int i = 1; i < size; i++) { + k += getChars(delimiter, chars, k); + k += getChars(elts[i], chars, k); + } + } + k += getChars(suffix, chars, k); + return new String(chars); + } - private int checkAddLength(int oldLen, int inc) { - long newLen = (long)oldLen + (long)inc; - long tmpLen = newLen + (long)prefix.length() + (long)suffix.length(); - if (tmpLen != (int)tmpLen) { - throw new OutOfMemoryError("Requested array size exceeds VM limit"); - } - return (int)newLen; + // MaD=p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;df-generated + public Joiner add(CharSequence newElement) { + final String elt = String.valueOf(newElement); + if (elts == null) { + elts = new String[8]; + } else { + if (size == elts.length) elts = Arrays.copyOf(elts, 2 * size); + len = checkAddLength(len, delimiter.length()); } + len = checkAddLength(len, elt.length()); + elts[size++] = elt; + return this; + } - public Joiner merge(Joiner other) { - Objects.requireNonNull(other); - if (other.elts == null) { - return this; - } - other.compactElts(); - return add(other.elts[0]); + private int checkAddLength(int oldLen, int inc) { + long newLen = (long) oldLen + (long) inc; + long tmpLen = newLen + (long) prefix.length() + (long) suffix.length(); + if (tmpLen != (int) tmpLen) { + throw new OutOfMemoryError("Requested array size exceeds VM limit"); } + return (int) newLen; + } - private void compactElts() { - if (size > 1) { - final char[] chars = new char[len]; - int i = 1, k = getChars(elts[0], chars, 0); - do { - k += getChars(delimiter, chars, k); - k += getChars(elts[i], chars, k); - elts[i] = null; - } while (++i < size); - size = 1; - elts[0] = new String(chars); - } + // MaD=p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;df-generated + public Joiner merge(Joiner other) { + Objects.requireNonNull(other); + if (other.elts == null) { + return this; } + other.compactElts(); + return add(other.elts[0]); + } - public int length() { - return (size == 0 && emptyValue != null) ? emptyValue.length() : - len + prefix.length() + suffix.length(); + private void compactElts() { + if (size > 1) { + final char[] chars = new char[len]; + int i = 1, k = getChars(elts[0], chars, 0); + do { + k += getChars(delimiter, chars, k); + k += getChars(elts[i], chars, k); + elts[i] = null; + } while (++i < size); + size = 1; + elts[0] = new String(chars); } -} \ No newline at end of file + } + + public int length() { + return (size == 0 && emptyValue != null) + ? emptyValue.length() + : len + prefix.length() + suffix.length(); + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java index 9de2d59b2e4..7c2e2ed9211 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java @@ -2,22 +2,23 @@ package p; class MultipleImpl2 { - // Multiple implementations of the same interface. - // This is used to test that we only generate a summary model and - // not neutral summary model for `IInterface.m`. - public interface IInterface { - Object m(Object value); - } + // Multiple implementations of the same interface. + // This is used to test that we only generate a summary model and + // not neutral summary model for `IInterface.m`. + public interface IInterface { + // MaD=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated + Object m(Object value); + } - public class Impl1 implements IInterface { - public Object m(Object value) { - return null; - } + public class Impl1 implements IInterface { + public Object m(Object value) { + return null; } + } - public class Impl2 implements IInterface { - public Object m(Object value) { - return value; - } + public class Impl2 implements IInterface { + public Object m(Object value) { + return value; } + } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java index a6697393dbc..8cdde304bd5 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java @@ -4,35 +4,38 @@ import java.util.concurrent.Callable; public class MultipleImpls { - public static interface Strategy { - String doSomething(String value); + public static interface Strategy { + // MaD=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated + // MaD=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated + String doSomething(String value); + } + + public static class Strat1 implements Strategy { + public String doSomething(String value) { + return value; + } + } + + // implements in different library should not count as impl + public static class Strat3 implements Callable { + + @Override + public String call() throws Exception { + return null; + } + } + + public static class Strat2 implements Strategy { + private String foo; + + public String doSomething(String value) { + this.foo = value; + return "none"; } - public static class Strat1 implements Strategy { - public String doSomething(String value) { - return value; - } - } - - // implements in different library should not count as impl - public static class Strat3 implements Callable { - - @Override - public String call() throws Exception { - return null; - } - - } - public static class Strat2 implements Strategy { - private String foo; - - public String doSomething(String value) { - this.foo = value; - return "none"; - } - - public String getValue() { - return this.foo; - } + // MaD=p;MultipleImpls$Strat2;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + public String getValue() { + return this.foo; } + } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java index 8b58c377316..7d9dac157c2 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java @@ -1,64 +1,71 @@ package p; -import java.util.Iterator; -import java.util.List; import java.io.IOException; import java.io.OutputStream; - +import java.util.Iterator; +import java.util.List; public class ParamFlow { - public String returnsInput(String input) { - return input; - } + // MaD=p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated + public String returnsInput(String input) { + return input; + } - public int ignorePrimitiveReturnValue(String input) { - return input.length(); - } + public int ignorePrimitiveReturnValue(String input) { + return input.length(); + } - public String returnMultipleParameters(String one, String two) { - if (System.currentTimeMillis() > 100) { - return two; - } - return one; + // MaD=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;taint;df-generated + // MaD=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;taint;df-generated + public String returnMultipleParameters(String one, String two) { + if (System.currentTimeMillis() > 100) { + return two; } + return one; + } - public String returnArrayElement(String[] input) { - return input[0]; - } + // MaD=p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated + public String returnArrayElement(String[] input) { + return input[0]; + } - public String returnVarArgElement(String... input) { - return input[0]; - } + // MaD=p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated + public String returnVarArgElement(String... input) { + return input[0]; + } - public String returnCollectionElement(List input) { - return input.get(0); - } + // MaD=p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;taint;df-generated + public String returnCollectionElement(List input) { + return input.get(0); + } - public String returnIteratorElement(Iterator input) { - return input.next(); - } + // MaD=p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;taint;df-generated + public String returnIteratorElement(Iterator input) { + return input.next(); + } - public String returnIterableElement(Iterable input) { - return input.iterator().next(); - } + // MaD=p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;taint;df-generated + public String returnIterableElement(Iterable input) { + return input.iterator().next(); + } - public Class mapType(Class input) { - return input; - } + public Class mapType(Class input) { + return input; + } - public void writeChunked(byte[] data, OutputStream output) - throws IOException { - output.write(data, 0, data.length); - } - - public void writeChunked(char[] data, OutputStream output) - throws IOException { - output.write(String.valueOf(data).getBytes(), 0, data.length); - } + // MaD=p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;df-generated + public void writeChunked(byte[] data, OutputStream output) throws IOException { + output.write(data, 0, data.length); + } - public void addTo(String data, List target) { - target.add(data); - } + // MaD=p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;df-generated + public void writeChunked(char[] data, OutputStream output) throws IOException { + output.write(String.valueOf(data).getBytes(), 0, data.length); + } -} \ No newline at end of file + // MaD=p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;taint;df-generated + public void addTo(String data, List target) { + target.add(data); + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java index 40dfa56ae86..15fbda5bc79 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java @@ -8,91 +8,97 @@ import java.util.List; public final class Pojo { - private class Holder { - private String value; - - Holder(String value) { - this.value = value; - } - - int length() { - return value.length(); - } - } - + private class Holder { private String value; - private int intValue = 2; - - private byte[] byteArray = new byte[] {1, 2, 3} ; - private float[] floatArray = new float[] {1, 2, 3} ; - private char[] charArray = new char[] {'a', 'b', 'c'} ; - private List charList = Arrays.asList('a', 'b', 'c'); - private Byte[] byteObjectArray = new Byte[] { 1, 2, 3 }; - - public String getValue() { - return value; + Holder(String value) { + this.value = value; } - public void setValue(String value) { - this.value = value; + int length() { + return value.length(); } + } - public int doNotSetValue(String value) { - Holder h = new Holder(value); - return h.length(); - } + private String value; - public int getIntValue() { - return intValue; - } + private int intValue = 2; - public Integer getBoxedValue() { - return Integer.valueOf(intValue); - } + private byte[] byteArray = new byte[] {1, 2, 3}; + private float[] floatArray = new float[] {1, 2, 3}; + private char[] charArray = new char[] {'a', 'b', 'c'}; + private List charList = Arrays.asList('a', 'b', 'c'); + private Byte[] byteObjectArray = new Byte[] {1, 2, 3}; - public int[] getPrimitiveArray() { - return new int[] { intValue }; - } + // MaD=p;Pojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + public String getValue() { + return value; + } - public char[] getCharArray() { - return charArray; - } + // MaD=p;Pojo;false;setValue;(String);;Argument[0];Argument[this];taint;df-generated + public void setValue(String value) { + this.value = value; + } - public byte[] getByteArray() { - return byteArray; - } - - public float[] getFloatArray() { - return floatArray; - } + public int doNotSetValue(String value) { + Holder h = new Holder(value); + return h.length(); + } - public Integer[] getBoxedArray() { - return new Integer[] { Integer.valueOf(intValue) }; - } - - public Collection getBoxedCollection() { - return List.of(Integer.valueOf(intValue)); - } + public int getIntValue() { + return intValue; + } - public List getBoxedChars() { - return charList; - } + public Integer getBoxedValue() { + return Integer.valueOf(intValue); + } - public Byte[] getBoxedBytes() { - return byteObjectArray; - } - - public BigInteger getBigInt() { - return BigInteger.valueOf(intValue); - } + public int[] getPrimitiveArray() { + return new int[] {intValue}; + } - public BigDecimal getBigDecimal() { - return new BigDecimal(value); - } + // MaD=p;Pojo;false;getCharArray;();;Argument[this];ReturnValue;taint;df-generated + public char[] getCharArray() { + return charArray; + } - public void fillIn(List target) { - target.add(value); - } + // MaD=p;Pojo;false;getByteArray;();;Argument[this];ReturnValue;taint;df-generated + public byte[] getByteArray() { + return byteArray; + } -} \ No newline at end of file + public float[] getFloatArray() { + return floatArray; + } + + public Integer[] getBoxedArray() { + return new Integer[] {Integer.valueOf(intValue)}; + } + + public Collection getBoxedCollection() { + return List.of(Integer.valueOf(intValue)); + } + + // MaD=p;Pojo;false;getBoxedChars;();;Argument[this];ReturnValue;taint;df-generated + public List getBoxedChars() { + return charList; + } + + // MaD=p;Pojo;false;getBoxedBytes;();;Argument[this];ReturnValue;taint;df-generated + public Byte[] getBoxedBytes() { + return byteObjectArray; + } + + public BigInteger getBigInt() { + return BigInteger.valueOf(intValue); + } + + public BigDecimal getBigDecimal() { + return new BigDecimal(value); + } + + // MaD=p;Pojo;false;fillIn;(List);;Argument[this];Argument[0].Element;taint;df-generated + public void fillIn(List target) { + target.add(value); + } +} diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java index 59247bfe471..13a2897f08a 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java @@ -7,55 +7,55 @@ import java.io.OutputStream; public class PrivateFlowViaPublicInterface { - static class RandomPojo { - public File someFile = new File("someFile"); - } - public static interface SPI { - OutputStream openStream() throws IOException; + static class RandomPojo { + public File someFile = new File("someFile"); + } - default OutputStream openStreamNone() throws IOException { - return null; - }; + public static interface SPI { + // MaD=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated + OutputStream openStream() throws IOException; + + default OutputStream openStreamNone() throws IOException { + return null; + } + ; + } + + private static final class PrivateImplWithSink implements SPI { + + private File file; + + public PrivateImplWithSink(File file) { + this.file = file; } - private static final class PrivateImplWithSink implements SPI { - - private File file; - - public PrivateImplWithSink(File file) { - this.file = file; - } - - @Override - public OutputStream openStream() throws IOException { - return new FileOutputStream(file); - } - + @Override + public OutputStream openStream() throws IOException { + return new FileOutputStream(file); } - - private static final class PrivateImplWithRandomField implements SPI { + } - public PrivateImplWithRandomField(File file) { - } + private static final class PrivateImplWithRandomField implements SPI { - @Override - public OutputStream openStream() throws IOException { - return null; - } - - @Override - public OutputStream openStreamNone() throws IOException { - return new FileOutputStream(new RandomPojo().someFile); - } + public PrivateImplWithRandomField(File file) {} + @Override + public OutputStream openStream() throws IOException { + return null; } - public static SPI createAnSPI(File file) { - return new PrivateImplWithSink(file); - } - - public static SPI createAnSPIWithoutTrackingFile(File file) { - return new PrivateImplWithRandomField(file); + @Override + public OutputStream openStreamNone() throws IOException { + return new FileOutputStream(new RandomPojo().someFile); } + } -} \ No newline at end of file + // MaD=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated + public static SPI createAnSPI(File file) { + return new PrivateImplWithSink(file); + } + + public static SPI createAnSPIWithoutTrackingFile(File file) { + return new PrivateImplWithRandomField(file); + } +} From a33393d452d8ec5758deb979ae75fbee2eefe74e Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 11:02:04 +0200 Subject: [PATCH 070/118] Java: Delete old summary models expected output. --- .../dataflow/CaptureSummaryModels.expected | 47 ------------------- .../dataflow/CaptureSummaryModels.qlref | 1 - 2 files changed, 48 deletions(-) delete mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected delete mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.qlref diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected deleted file mode 100644 index 50536e850d9..00000000000 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected +++ /dev/null @@ -1,47 +0,0 @@ -| p;Factory;false;create;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;Factory;false;create;(String,int);;Argument[0];ReturnValue;taint;df-generated | -| p;Factory;false;getValue;();;Argument[this];ReturnValue;taint;df-generated | -| p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;df-generated | -| p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this];taint;df-generated | -| p;ImmutablePojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated | -| p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;ImmutablePojo;false;or;(String);;Argument[this];ReturnValue;taint;df-generated | -| p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;InnerHolder;false;append;(String);;Argument[0];Argument[this];taint;df-generated | -| p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this];taint;df-generated | -| p;InnerHolder;false;getValue;();;Argument[this];ReturnValue;taint;df-generated | -| p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this];taint;df-generated | -| p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this];taint;df-generated | -| p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this];taint;df-generated | -| p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[1];Argument[this];taint;df-generated | -| p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[2];Argument[this];taint;df-generated | -| p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;df-generated | -| p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;df-generated | -| p;Joiner;false;setEmptyValue;(CharSequence);;Argument[0];Argument[this];taint;df-generated | -| p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;df-generated | -| p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated | -| p;MultipleImpls$Strat2;true;getValue;();;Argument[this];ReturnValue;taint;df-generated | -| p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated | -| p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;taint;df-generated | -| p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated | -| p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated | -| p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;df-generated | -| p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;df-generated | -| p;Pojo;false;fillIn;(List);;Argument[this];Argument[0].Element;taint;df-generated | -| p;Pojo;false;getBoxedBytes;();;Argument[this];ReturnValue;taint;df-generated | -| p;Pojo;false;getBoxedChars;();;Argument[this];ReturnValue;taint;df-generated | -| p;Pojo;false;getByteArray;();;Argument[this];ReturnValue;taint;df-generated | -| p;Pojo;false;getCharArray;();;Argument[this];ReturnValue;taint;df-generated | -| p;Pojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated | -| p;Pojo;false;setValue;(String);;Argument[0];Argument[this];taint;df-generated | -| p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated | -| p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated | diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.qlref b/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.qlref deleted file mode 100644 index d751f3823f3..00000000000 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.qlref +++ /dev/null @@ -1 +0,0 @@ -utils/modelgenerator/CaptureSummaryModels.ql \ No newline at end of file From 5b184c179adfcc4a5f3accf86cb617ebdf9a7275 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 6 May 2024 12:47:51 +0200 Subject: [PATCH 071/118] Bazel/Go: add some comments --- go/extractor/BUILD.bazel | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index 6047eea6860..7e576927f66 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -25,7 +25,9 @@ go_library( ], ) -# the other targets are not generated +# the other targets are not generated by gazelle + +# this is separate from `tokenizer-jar` below because we don't want these compiled class files in the pack java_library( name = "tokenizer-deps", srcs = [ @@ -36,6 +38,7 @@ java_library( ], ) +# we only need these compiled class files in the pack java_library( name = "tokenizer-jar", srcs = [ @@ -51,7 +54,7 @@ pkg_files( srcs = [":tokenizer-jar"], prefix = "tools", renames = { - ":tokenizer-jar": "tokenizer.jar", + ":tokenizer-jar": "tokenizer.jar", # name is `libtokenizer.jar` by default }, visibility = ["//go:__pkg__"], ) From 51e7f3be1a0b3cd3af06ef939253f3e28676f7d0 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 13:03:38 +0200 Subject: [PATCH 072/118] Java: Rename MaD to summary. --- java/ql/test/TestUtilities/InlineMadTest.qll | 9 +- .../modelgenerator/dataflow/p/Factory.java | 6 +- .../modelgenerator/dataflow/p/FinalClass.java | 2 +- .../modelgenerator/dataflow/p/FluentAPI.java | 2 +- .../dataflow/p/ImmutablePojo.java | 8 +- .../dataflow/p/InnerClasses.java | 4 +- .../dataflow/p/InnerHolder.java | 8 +- .../modelgenerator/dataflow/p/Joiner.java | 16 +- .../dataflow/p/MultipleImpl2.java | 2 +- .../dataflow/p/MultipleImpls.java | 6 +- .../modelgenerator/dataflow/p/ParamFlow.java | 22 +- .../utils/modelgenerator/dataflow/p/Pojo.java | 14 +- .../p/PrivateFlowViaPublicInterface.java | 4 +- .../typebasedflow/p/MyFunction.java | 10 +- .../typebasedflow/p/Stream.java | 404 +++++++++--------- .../typebasedflow/p/TypeBasedCollection.java | 30 +- .../typebasedflow/p/TypeBasedComplex.java | 142 +++--- .../typebasedflow/p/TypeBasedSimple.java | 58 ++- 18 files changed, 369 insertions(+), 378 deletions(-) diff --git a/java/ql/test/TestUtilities/InlineMadTest.qll b/java/ql/test/TestUtilities/InlineMadTest.qll index 64badab0dca..3e9aee7eb9e 100644 --- a/java/ql/test/TestUtilities/InlineMadTest.qll +++ b/java/ql/test/TestUtilities/InlineMadTest.qll @@ -11,21 +11,22 @@ signature module InlineMadTestConfigSig { } module InlineMadTest { - private string expects() { - Input::getComment().regexpCapture(" *(SPURIOUS-)?MaD=(.*)", 2) = result + bindingset[kind] + private string expects(string kind) { + Input::getComment().regexpCapture(" *(SPURIOUS-)?" + kind + "=(.*)", 2) = result } query predicate unexpectedSummary(string msg) { exists(string flow | flow = Input::getCapturedSummary() and - not flow = expects() and + not flow = expects("summary") and msg = "Unexpected summary found: " + flow ) } query predicate expectedSummary(string msg) { exists(string e | - e = expects() and + e = expects("summary") and not e = Input::getCapturedSummary() and msg = "Expected summary missing: " + e ) diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java index 84b55a812c9..57d26429a93 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java @@ -6,12 +6,12 @@ public final class Factory { private int intValue; - // MaD=p;Factory;false;create;(String,int);;Argument[0];ReturnValue;taint;df-generated + // summary=p;Factory;false;create;(String,int);;Argument[0];ReturnValue;taint;df-generated public static Factory create(String value, int foo) { return new Factory(value, foo); } - // MaD=p;Factory;false;create;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;Factory;false;create;(String);;Argument[0];ReturnValue;taint;df-generated public static Factory create(String value) { return new Factory(value, 0); } @@ -21,7 +21,7 @@ public final class Factory { this.intValue = intValue; } - // MaD=p;Factory;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;Factory;false;getValue;();;Argument[this];ReturnValue;taint;df-generated public String getValue() { return value; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java index 5073f435233..82a39533ce1 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java @@ -4,7 +4,7 @@ public final class FinalClass { private static final String C = "constant"; - // MaD=p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated public String returnsInput(String input) { return input; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java index 2bb2bb97604..38fbb286bb0 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java @@ -2,7 +2,7 @@ package p; public final class FluentAPI { - // MaD=p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;df-generated + // summary=p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;df-generated public FluentAPI returnsThis(String input) { return this; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java index 38a9b472f62..1b39856b445 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java @@ -6,13 +6,13 @@ public final class ImmutablePojo { private final long x; - // MaD=p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this];taint;df-generated + // summary=p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this];taint;df-generated public ImmutablePojo(String value, int x) { this.value = value; this.x = x; } - // MaD=p;ImmutablePojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;ImmutablePojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated public String getValue() { return value; } @@ -21,8 +21,8 @@ public final class ImmutablePojo { return x; } - // MaD=p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;taint;df-generated - // MaD=p;ImmutablePojo;false;or;(String);;Argument[this];ReturnValue;taint;df-generated + // summary=p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;ImmutablePojo;false;or;(String);;Argument[this];ReturnValue;taint;df-generated public String or(String defaultValue) { return value != null ? value : defaultValue; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java b/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java index 54f014fec93..5b6a8427a3f 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java @@ -9,13 +9,13 @@ public class InnerClasses { } public class CaptureMe { - // MaD=p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;taint;df-generated public String yesCm(String input) { return input; } } - // MaD=p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;taint;df-generated public String yes(String input) { return input; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java b/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java index ef872942191..e09680dad52 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java @@ -18,22 +18,22 @@ public final class InnerHolder { private StringBuilder sb = new StringBuilder(); - // MaD=p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this];taint;df-generated + // summary=p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this];taint;df-generated public void setContext(String value) { context = new Context(value); } - // MaD=p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this];taint;df-generated + // summary=p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this];taint;df-generated public void explicitSetContext(String value) { this.context = new Context(value); } - // MaD=p;InnerHolder;false;append;(String);;Argument[0];Argument[this];taint;df-generated + // summary=p;InnerHolder;false;append;(String);;Argument[0];Argument[this];taint;df-generated public void append(String value) { sb.append(value); } - // MaD=p;InnerHolder;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;InnerHolder;false;getValue;();;Argument[this];ReturnValue;taint;df-generated public String getValue() { return context.getValue(); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java index daa939ebe51..60edb0fb71e 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java @@ -12,14 +12,14 @@ public final class Joiner { private int len; private String emptyValue; - // MaD=p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this];taint;df-generated + // summary=p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this];taint;df-generated public Joiner(CharSequence delimiter) { this(delimiter, "", ""); } - // MaD=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this];taint;df-generated - // MaD=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[1];Argument[this];taint;df-generated - // MaD=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[2];Argument[this];taint;df-generated + // summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this];taint;df-generated + // summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[1];Argument[this];taint;df-generated + // summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[2];Argument[this];taint;df-generated public Joiner(CharSequence delimiter, CharSequence prefix, CharSequence suffix) { Objects.requireNonNull(prefix, "The prefix must not be null"); Objects.requireNonNull(delimiter, "The delimiter must not be null"); @@ -30,8 +30,8 @@ public final class Joiner { checkAddLength(0, 0); } - // MaD=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[0];Argument[this];taint;df-generated - // MaD=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;df-generated + // summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[0];Argument[this];taint;df-generated + // summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;df-generated public Joiner setEmptyValue(CharSequence emptyValue) { this.emptyValue = Objects.requireNonNull(emptyValue, "The empty value must not be null").toString(); @@ -70,7 +70,7 @@ public final class Joiner { return new String(chars); } - // MaD=p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;df-generated + // summary=p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;df-generated public Joiner add(CharSequence newElement) { final String elt = String.valueOf(newElement); if (elts == null) { @@ -93,7 +93,7 @@ public final class Joiner { return (int) newLen; } - // MaD=p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;df-generated + // summary=p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;df-generated public Joiner merge(Joiner other) { Objects.requireNonNull(other); if (other.elts == null) { diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java index 7c2e2ed9211..dc67d0dfe6c 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java @@ -6,7 +6,7 @@ class MultipleImpl2 { // This is used to test that we only generate a summary model and // not neutral summary model for `IInterface.m`. public interface IInterface { - // MaD=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated + // summary=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated Object m(Object value); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java index 8cdde304bd5..8fccdf76ab7 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java @@ -5,8 +5,8 @@ import java.util.concurrent.Callable; public class MultipleImpls { public static interface Strategy { - // MaD=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated - // MaD=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated + // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated String doSomething(String value); } @@ -33,7 +33,7 @@ public class MultipleImpls { return "none"; } - // MaD=p;MultipleImpls$Strat2;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;MultipleImpls$Strat2;true;getValue;();;Argument[this];ReturnValue;taint;df-generated public String getValue() { return this.foo; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java index 7d9dac157c2..5c47e292a6b 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java @@ -7,7 +7,7 @@ import java.util.List; public class ParamFlow { - // MaD=p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated public String returnsInput(String input) { return input; } @@ -16,8 +16,8 @@ public class ParamFlow { return input.length(); } - // MaD=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;taint;df-generated - // MaD=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;taint;df-generated public String returnMultipleParameters(String one, String two) { if (System.currentTimeMillis() > 100) { return two; @@ -25,27 +25,27 @@ public class ParamFlow { return one; } - // MaD=p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated public String returnArrayElement(String[] input) { return input[0]; } - // MaD=p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated public String returnVarArgElement(String... input) { return input[0]; } - // MaD=p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;taint;df-generated public String returnCollectionElement(List input) { return input.get(0); } - // MaD=p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;taint;df-generated public String returnIteratorElement(Iterator input) { return input.next(); } - // MaD=p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;taint;df-generated + // summary=p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;taint;df-generated public String returnIterableElement(Iterable input) { return input.iterator().next(); } @@ -54,17 +54,17 @@ public class ParamFlow { return input; } - // MaD=p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;df-generated + // summary=p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;df-generated public void writeChunked(byte[] data, OutputStream output) throws IOException { output.write(data, 0, data.length); } - // MaD=p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;df-generated + // summary=p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;df-generated public void writeChunked(char[] data, OutputStream output) throws IOException { output.write(String.valueOf(data).getBytes(), 0, data.length); } - // MaD=p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;taint;df-generated + // summary=p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;taint;df-generated public void addTo(String data, List target) { target.add(data); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java index 15fbda5bc79..524e448ef81 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java @@ -30,12 +30,12 @@ public final class Pojo { private List charList = Arrays.asList('a', 'b', 'c'); private Byte[] byteObjectArray = new Byte[] {1, 2, 3}; - // MaD=p;Pojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;Pojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated public String getValue() { return value; } - // MaD=p;Pojo;false;setValue;(String);;Argument[0];Argument[this];taint;df-generated + // summary=p;Pojo;false;setValue;(String);;Argument[0];Argument[this];taint;df-generated public void setValue(String value) { this.value = value; } @@ -57,12 +57,12 @@ public final class Pojo { return new int[] {intValue}; } - // MaD=p;Pojo;false;getCharArray;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;Pojo;false;getCharArray;();;Argument[this];ReturnValue;taint;df-generated public char[] getCharArray() { return charArray; } - // MaD=p;Pojo;false;getByteArray;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;Pojo;false;getByteArray;();;Argument[this];ReturnValue;taint;df-generated public byte[] getByteArray() { return byteArray; } @@ -79,12 +79,12 @@ public final class Pojo { return List.of(Integer.valueOf(intValue)); } - // MaD=p;Pojo;false;getBoxedChars;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;Pojo;false;getBoxedChars;();;Argument[this];ReturnValue;taint;df-generated public List getBoxedChars() { return charList; } - // MaD=p;Pojo;false;getBoxedBytes;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;Pojo;false;getBoxedBytes;();;Argument[this];ReturnValue;taint;df-generated public Byte[] getBoxedBytes() { return byteObjectArray; } @@ -97,7 +97,7 @@ public final class Pojo { return new BigDecimal(value); } - // MaD=p;Pojo;false;fillIn;(List);;Argument[this];Argument[0].Element;taint;df-generated + // summary=p;Pojo;false;fillIn;(List);;Argument[this];Argument[0].Element;taint;df-generated public void fillIn(List target) { target.add(value); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java index 13a2897f08a..6b5dbca3e11 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java @@ -12,7 +12,7 @@ public class PrivateFlowViaPublicInterface { } public static interface SPI { - // MaD=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated + // summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated OutputStream openStream() throws IOException; default OutputStream openStreamNone() throws IOException { @@ -50,7 +50,7 @@ public class PrivateFlowViaPublicInterface { } } - // MaD=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated + // summary=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated public static SPI createAnSPI(File file) { return new PrivateImplWithSink(file); } diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/p/MyFunction.java b/java/ql/test/utils/modelgenerator/typebasedflow/p/MyFunction.java index 04683952f83..e3589bf5f6c 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/p/MyFunction.java +++ b/java/ql/test/utils/modelgenerator/typebasedflow/p/MyFunction.java @@ -3,8 +3,8 @@ package p; @FunctionalInterface public interface MyFunction { - // MaD=p;MyFunction;true;apply;(Object,Object);;Argument[this].SyntheticField[ArgType2];ReturnValue;value;tb-generated - // MaD=p;MyFunction;true;apply;(Object,Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated - // MaD=p;MyFunction;true;apply;(Object,Object);;Argument[1];Argument[this].SyntheticField[ArgType1];value;tb-generated - T3 apply(T1 x, T2 y); -} \ No newline at end of file + // summary=p;MyFunction;true;apply;(Object,Object);;Argument[this].SyntheticField[ArgType2];ReturnValue;value;tb-generated + // summary=p;MyFunction;true;apply;(Object,Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated + // summary=p;MyFunction;true;apply;(Object,Object);;Argument[1];Argument[this].SyntheticField[ArgType1];value;tb-generated + T3 apply(T1 x, T2 y); +} diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/p/Stream.java b/java/ql/test/utils/modelgenerator/typebasedflow/p/Stream.java index 86d25088645..8e99fc7ca7c 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/p/Stream.java +++ b/java/ql/test/utils/modelgenerator/typebasedflow/p/Stream.java @@ -2,246 +2,244 @@ package p; import java.util.*; import java.util.function.*; -import java.util.stream.LongStream; -import java.util.stream.IntStream; -import java.util.stream.DoubleStream; import java.util.stream.Collector; +import java.util.stream.DoubleStream; +import java.util.stream.IntStream; +import java.util.stream.LongStream; -/** - * This is a stub implementation of the Java Stream API. - */ +/** This is a stub implementation of the Java Stream API. */ public class Stream { - // MaD=p;Stream;true;iterator;();;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Iterator iterator() { - return null; - } + // summary=p;Stream;true;iterator;();;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Iterator iterator() { + return null; + } - // MaD=p;Stream;true;allMatch;(Predicate);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public boolean allMatch(Predicate predicate) { - return false; - } + // summary=p;Stream;true;allMatch;(Predicate);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public boolean allMatch(Predicate predicate) { + return false; + } - // MaD=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[this].Element;Argument[1].Parameter[1];value;tb-generated - // MaD=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;Argument[2].Parameter[0];value;tb-generated - // MaD=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;Argument[2].Parameter[1];value;tb-generated - // MaD=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;ReturnValue;value;tb-generated - public R collect(Supplier supplier, BiConsumer accumulator, BiConsumer combiner) { - return null; - } + // summary=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[this].Element;Argument[1].Parameter[1];value;tb-generated + // summary=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;Argument[2].Parameter[0];value;tb-generated + // summary=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;Argument[2].Parameter[1];value;tb-generated + // summary=p;Stream;true;collect;(Supplier,BiConsumer,BiConsumer);;Argument[0].ReturnValue;ReturnValue;value;tb-generated + public R collect( + Supplier supplier, BiConsumer accumulator, BiConsumer combiner) { + return null; + } - // Collector is not a functional interface, so this is not supported - public R collect(Collector collector) { - return null; - } + // Collector is not a functional interface, so this is not supported + public R collect(Collector collector) { + return null; + } - // MaD=p;Stream;true;concat;(Stream,Stream);;Argument[0].Element;ReturnValue.Element;value;tb-generated - // MaD=p;Stream;true;concat;(Stream,Stream);;Argument[1].Element;ReturnValue.Element;value;tb-generated - public static Stream concat(Stream a, Stream b) { - return null; - } + // summary=p;Stream;true;concat;(Stream,Stream);;Argument[0].Element;ReturnValue.Element;value;tb-generated + // summary=p;Stream;true;concat;(Stream,Stream);;Argument[1].Element;ReturnValue.Element;value;tb-generated + public static Stream concat(Stream a, Stream b) { + return null; + } - // MaD=p;Stream;true;distinct;();;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream distinct() { - return null; - } + // summary=p;Stream;true;distinct;();;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream distinct() { + return null; + } - public static Stream empty() { - return null; - } + public static Stream empty() { + return null; + } - // MaD=p;Stream;true;filter;(Predicate);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;filter;(Predicate);;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream filter(Predicate predicate) { - return null; - } + // summary=p;Stream;true;filter;(Predicate);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;filter;(Predicate);;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream filter(Predicate predicate) { + return null; + } - // MaD=p;Stream;true;findAny;();;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public Optional findAny() { - return null; - } + // summary=p;Stream;true;findAny;();;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public Optional findAny() { + return null; + } - // MaD=p;Stream;true;findFirst;();;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public Optional findFirst() { - return null; - } + // summary=p;Stream;true;findFirst;();;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public Optional findFirst() { + return null; + } - // MaD=p;Stream;true;flatMap;(Function);;Argument[0].ReturnValue.Element;ReturnValue.Element;value;tb-generated - // MaD=p;Stream;true;flatMap;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public Stream flatMap(Function> mapper) { - return null; - } + // summary=p;Stream;true;flatMap;(Function);;Argument[0].ReturnValue.Element;ReturnValue.Element;value;tb-generated + // summary=p;Stream;true;flatMap;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public Stream flatMap(Function> mapper) { + return null; + } - // MaD=p;Stream;true;flatMapToDouble;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public DoubleStream flatMapToDouble(Function mapper) { - return null; - } + // summary=p;Stream;true;flatMapToDouble;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public DoubleStream flatMapToDouble(Function mapper) { + return null; + } - // MaD=p;Stream;true;flatMapToInt;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public IntStream flatMapToInt(Function mapper) { - return null; - } + // summary=p;Stream;true;flatMapToInt;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public IntStream flatMapToInt(Function mapper) { + return null; + } - // MaD=p;Stream;true;flatMapToLong;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public LongStream flatMapToLong(Function mapper) { - return null; - } + // summary=p;Stream;true;flatMapToLong;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public LongStream flatMapToLong(Function mapper) { + return null; + } - // MaD=p;Stream;true;forEach;(Consumer);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public void forEach(Consumer action) { - } + // summary=p;Stream;true;forEach;(Consumer);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public void forEach(Consumer action) {} - // MaD=p;Stream;true;forEachOrdered;(Consumer);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public void forEachOrdered(Consumer action) { - } + // summary=p;Stream;true;forEachOrdered;(Consumer);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public void forEachOrdered(Consumer action) {} - // MaD=p;Stream;true;generate;(Supplier);;Argument[0].ReturnValue;ReturnValue.Element;value;tb-generated - public static Stream generate(Supplier s) { - return null; - } + // summary=p;Stream;true;generate;(Supplier);;Argument[0].ReturnValue;ReturnValue.Element;value;tb-generated + public static Stream generate(Supplier s) { + return null; + } - // MaD=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[0];Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[0];ReturnValue.Element;value;tb-generated - // MaD=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[1].ReturnValue;ReturnValue.Element;value;tb-generated - public static Stream iterate(T seed, UnaryOperator f) { - return null; - } + // summary=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[0];Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[0];ReturnValue.Element;value;tb-generated + // summary=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;iterate;(Object,UnaryOperator);;Argument[1].ReturnValue;ReturnValue.Element;value;tb-generated + public static Stream iterate(T seed, UnaryOperator f) { + return null; + } - // MaD=p;Stream;true;limit;(long);;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream limit(long maxSize) { - return null; - } + // summary=p;Stream;true;limit;(long);;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream limit(long maxSize) { + return null; + } - // MaD=p;Stream;true;map;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;map;(Function);;Argument[0].ReturnValue;ReturnValue.Element;value;tb-generated - public Stream map(Function mapper) { - return null; - } + // summary=p;Stream;true;map;(Function);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;map;(Function);;Argument[0].ReturnValue;ReturnValue.Element;value;tb-generated + public Stream map(Function mapper) { + return null; + } - // MaD=p;Stream;true;mapToDouble;(ToDoubleFunction);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public DoubleStream mapToDouble(ToDoubleFunction mapper) { - return null; - } + // summary=p;Stream;true;mapToDouble;(ToDoubleFunction);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public DoubleStream mapToDouble(ToDoubleFunction mapper) { + return null; + } - // MaD=p;Stream;true;mapToInt;(ToIntFunction);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public IntStream mapToInt(ToIntFunction mapper) { - return null; - } + // summary=p;Stream;true;mapToInt;(ToIntFunction);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public IntStream mapToInt(ToIntFunction mapper) { + return null; + } - // MaD=p;Stream;true;mapToLong;(ToLongFunction);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public LongStream mapToLong(ToLongFunction mapper) { - return null; - } + // summary=p;Stream;true;mapToLong;(ToLongFunction);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public LongStream mapToLong(ToLongFunction mapper) { + return null; + } - // MaD=p;Stream;true;max;(Comparator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;max;(Comparator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated - // MaD=p;Stream;true;max;(Comparator);;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public Optional max(Comparator comparator) { - return null; - } + // summary=p;Stream;true;max;(Comparator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;max;(Comparator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated + // summary=p;Stream;true;max;(Comparator);;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public Optional max(Comparator comparator) { + return null; + } - // MaD=p;Stream;true;min;(Comparator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;min;(Comparator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated - // MaD=p;Stream;true;min;(Comparator);;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public Optional min(Comparator comparator) { - return null; - } + // summary=p;Stream;true;min;(Comparator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;min;(Comparator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated + // summary=p;Stream;true;min;(Comparator);;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public Optional min(Comparator comparator) { + return null; + } - // MaD=p;Stream;true;noneMatch;(Predicate);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - public boolean noneMatch(Predicate predicate) { - return false; - } + // summary=p;Stream;true;noneMatch;(Predicate);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + public boolean noneMatch(Predicate predicate) { + return false; + } - // MaD=p;Stream;true;of;(Object[]);;Argument[0].ArrayElement;ReturnValue.Element;value;tb-generated - public static Stream of(T... t) { - return null; - } + // summary=p;Stream;true;of;(Object[]);;Argument[0].ArrayElement;ReturnValue.Element;value;tb-generated + public static Stream of(T... t) { + return null; + } - // MaD=p;Stream;true;of;(Object);;Argument[0];ReturnValue.Element;value;tb-generated - public static Stream of(T t) { - return null; - } + // summary=p;Stream;true;of;(Object);;Argument[0];ReturnValue.Element;value;tb-generated + public static Stream of(T t) { + return null; + } - // MaD=p;Stream;true;peek;(Consumer);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;peek;(Consumer);;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream peek(Consumer action) { - return null; - } + // summary=p;Stream;true;peek;(Consumer);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;peek;(Consumer);;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream peek(Consumer action) { + return null; + } - // The generated models are only partially correct. - // MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - // MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;Argument[0].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;ReturnValue.SyntheticField[ArgType0];value;tb-generated - // SPURIOUS-MaD=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;Argument[this].Element;value;tb-generated - public Optional reduce(BinaryOperator accumulator) { - return null; - } + // The generated models are only partially correct. + // summary=p;Stream;true;reduce;(BinaryOperator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(BinaryOperator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(BinaryOperator);;Argument[this].Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + // summary=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;Argument[0].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;ReturnValue.SyntheticField[ArgType0];value;tb-generated + // SPURIOUS-summary=p;Stream;true;reduce;(BinaryOperator);;Argument[0].ReturnValue;Argument[this].Element;value;tb-generated + public Optional reduce(BinaryOperator accumulator) { + return null; + } - // The generated models are only partially correct. - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[this].Element;Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[this].Element;Argument[1].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];Argument[1].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];ReturnValue;value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;ReturnValue;value;tb-generated - // SPURIOUS-MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[this].Element;ReturnValue;value;tb-generated - // SPURIOUS-MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];Argument[this].Element;value;tb-generated - // SPURIOUS-MaD=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;Argument[this].Element;value;tb-generated - public T reduce(T identity, BinaryOperator accumulator) { - return null; - } + // The generated models are only partially correct. + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[this].Element;Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[this].Element;Argument[1].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];Argument[1].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];ReturnValue;value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;ReturnValue;value;tb-generated + // SPURIOUS-summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[this].Element;ReturnValue;value;tb-generated + // SPURIOUS-summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[0];Argument[this].Element;value;tb-generated + // SPURIOUS-summary=p;Stream;true;reduce;(Object,BinaryOperator);;Argument[1].ReturnValue;Argument[this].Element;value;tb-generated + public T reduce(T identity, BinaryOperator accumulator) { + return null; + } - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[this].Element;Argument[1].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];Argument[2].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];Argument[2].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];ReturnValue;value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;Argument[2].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;Argument[2].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;ReturnValue;value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;Argument[1].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;Argument[2].Parameter[0];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;Argument[2].Parameter[1];value;tb-generated - // MaD=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;ReturnValue;value;tb-generated - public U reduce(U identity, BiFunction accumulator, BinaryOperator combiner) { - return null; - } + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[this].Element;Argument[1].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];Argument[2].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];Argument[2].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[0];ReturnValue;value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;Argument[2].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;Argument[2].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[1].ReturnValue;ReturnValue;value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;Argument[1].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;Argument[2].Parameter[0];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;Argument[2].Parameter[1];value;tb-generated + // summary=p;Stream;true;reduce;(Object,BiFunction,BinaryOperator);;Argument[2].ReturnValue;ReturnValue;value;tb-generated + public U reduce( + U identity, BiFunction accumulator, BinaryOperator combiner) { + return null; + } - // MaD=p;Stream;true;skip;(long);;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream skip(long n) { - return null; - } + // summary=p;Stream;true;skip;(long);;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream skip(long n) { + return null; + } - // MaD=p;Stream;true;sorted;();;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream sorted() { - return null; - } + // summary=p;Stream;true;sorted;();;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream sorted() { + return null; + } - // MaD=p;Stream;true;sorted;(Comparator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;Stream;true;sorted;(Comparator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated - // MaD=p;Stream;true;sorted;(Comparator);;Argument[this].Element;ReturnValue.Element;value;tb-generated - public Stream sorted(Comparator comparator) { - return null; - } + // summary=p;Stream;true;sorted;(Comparator);;Argument[this].Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;Stream;true;sorted;(Comparator);;Argument[this].Element;Argument[0].Parameter[1];value;tb-generated + // summary=p;Stream;true;sorted;(Comparator);;Argument[this].Element;ReturnValue.Element;value;tb-generated + public Stream sorted(Comparator comparator) { + return null; + } - // Models can never be generated correctly based on the type information - // as it involves downcasting. - public Object[] toArray() { - return null; - } + // Models can never be generated correctly based on the type information + // as it involves downcasting. + public Object[] toArray() { + return null; + } - // The generated result is only partially correct as there is no mentioning of - // the type T in the method definition. - // MaD=p;Stream;true;toArray;(IntFunction);;Argument[0].ReturnValue.ArrayElement;ReturnValue.ArrayElement;value;tb-generated - public A[] toArray(IntFunction generator) { - return null; - } -} \ No newline at end of file + // The generated result is only partially correct as there is no mentioning of + // the type T in the method definition. + // summary=p;Stream;true;toArray;(IntFunction);;Argument[0].ReturnValue.ArrayElement;ReturnValue.ArrayElement;value;tb-generated + public A[] toArray(IntFunction generator) { + return null; + } +} diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedCollection.java b/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedCollection.java index b1c95dc415a..e66189e7ded 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedCollection.java +++ b/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedCollection.java @@ -1,25 +1,23 @@ package p; -import java.util.List; import java.util.ArrayList; +import java.util.List; public class TypeBasedCollection extends ArrayList { - // MaD=p;TypeBasedCollection;true;addT;(Object);;Argument[0];Argument[this].Element;value;tb-generated - public void addT(T x) { - } + // summary=p;TypeBasedCollection;true;addT;(Object);;Argument[0];Argument[this].Element;value;tb-generated + public void addT(T x) {} - // MaD=p;TypeBasedCollection;true;addManyT;(List);;Argument[0].Element;Argument[this].Element;value;tb-generated - public void addManyT(List xs) { - } + // summary=p;TypeBasedCollection;true;addManyT;(List);;Argument[0].Element;Argument[this].Element;value;tb-generated + public void addManyT(List xs) {} - // MaD=p;TypeBasedCollection;true;firstT;();;Argument[this].Element;ReturnValue;value;tb-generated - public T firstT() { - return null; - } + // summary=p;TypeBasedCollection;true;firstT;();;Argument[this].Element;ReturnValue;value;tb-generated + public T firstT() { + return null; + } - // MaD=p;TypeBasedCollection;true;getManyT;();;Argument[this].Element;ReturnValue.Element;value;tb-generated - public List getManyT() { - return null; - } -} \ No newline at end of file + // summary=p;TypeBasedCollection;true;getManyT;();;Argument[this].Element;ReturnValue.Element;value;tb-generated + public List getManyT() { + return null; + } +} diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedComplex.java b/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedComplex.java index ffca17457a0..a6e6c220475 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedComplex.java +++ b/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedComplex.java @@ -5,87 +5,85 @@ import java.util.function.Function; public class TypeBasedComplex { - // MaD=p;TypeBasedComplex;true;addMany;(List);;Argument[0].Element;Argument[this].SyntheticField[ArgType0];value;tb-generated - public void addMany(List xs) { - } + // summary=p;TypeBasedComplex;true;addMany;(List);;Argument[0].Element;Argument[this].SyntheticField[ArgType0];value;tb-generated + public void addMany(List xs) {} - // MaD=p;TypeBasedComplex;true;getMany;();;Argument[this].SyntheticField[ArgType0];ReturnValue.Element;value;tb-generated - public List getMany() { - return null; - } + // summary=p;TypeBasedComplex;true;getMany;();;Argument[this].SyntheticField[ArgType0];ReturnValue.Element;value;tb-generated + public List getMany() { + return null; + } - // MaD=p;TypeBasedComplex;true;apply;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - public Integer apply(Function f) { - return null; - } + // summary=p;TypeBasedComplex;true;apply;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + public Integer apply(Function f) { + return null; + } - // A method that doesn't mention `T` in its type signature. - // This is for testing that we don't generate a summary that involves the - // implicit field for `T`. - // MaD=p;TypeBasedComplex;true;apply2;(Object,Function);;Argument[0];Argument[1].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;apply2;(Object,Function);;Argument[1].ReturnValue;ReturnValue;value;tb-generated - public T2 apply2(T1 x, Function f) { - return null; - } + // A method that doesn't mention `T` in its type signature. + // This is for testing that we don't generate a summary that involves the + // implicit field for `T`. + // summary=p;TypeBasedComplex;true;apply2;(Object,Function);;Argument[0];Argument[1].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;apply2;(Object,Function);;Argument[1].ReturnValue;ReturnValue;value;tb-generated + public T2 apply2(T1 x, Function f) { + return null; + } - // MaD=p;TypeBasedComplex;true;flatMap;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;flatMap;(Function);;Argument[this].SyntheticField[ArgType0];ReturnValue.SyntheticField[ArgType0];value;tb-generated - // MaD=p;TypeBasedComplex;true;flatMap;(Function);;Argument[0].ReturnValue.Element;Argument[this].SyntheticField[ArgType0];value;tb-generated - // MaD=p;TypeBasedComplex;true;flatMap;(Function);;Argument[0].ReturnValue.Element;Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;flatMap;(Function);;Argument[0].ReturnValue.Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public TypeBasedComplex flatMap(Function> f) { - return null; - } + // summary=p;TypeBasedComplex;true;flatMap;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;flatMap;(Function);;Argument[this].SyntheticField[ArgType0];ReturnValue.SyntheticField[ArgType0];value;tb-generated + // summary=p;TypeBasedComplex;true;flatMap;(Function);;Argument[0].ReturnValue.Element;Argument[this].SyntheticField[ArgType0];value;tb-generated + // summary=p;TypeBasedComplex;true;flatMap;(Function);;Argument[0].ReturnValue.Element;Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;flatMap;(Function);;Argument[0].ReturnValue.Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public TypeBasedComplex flatMap(Function> f) { + return null; + } - // MaD=p;TypeBasedComplex;true;flatMap2;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;flatMap2;(Function);;Argument[0].ReturnValue.Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public TypeBasedComplex flatMap2(Function> f) { - return null; - } + // summary=p;TypeBasedComplex;true;flatMap2;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;flatMap2;(Function);;Argument[0].ReturnValue.Element;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public TypeBasedComplex flatMap2(Function> f) { + return null; + } - // MaD=p;TypeBasedComplex;true;map;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;map;(Function);;Argument[0].ReturnValue;ReturnValue;value;tb-generated - public S map(Function f) { - return null; - } + // summary=p;TypeBasedComplex;true;map;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;map;(Function);;Argument[0].ReturnValue;ReturnValue;value;tb-generated + public S map(Function f) { + return null; + } - // MaD=p;TypeBasedComplex;true;mapComplex;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;mapComplex;(Function);;Argument[0].ReturnValue;ReturnValue.SyntheticField[ArgType0];value;tb-generated - public TypeBasedComplex mapComplex(Function f) { - return null; - } + // summary=p;TypeBasedComplex;true;mapComplex;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;mapComplex;(Function);;Argument[0].ReturnValue;ReturnValue.SyntheticField[ArgType0];value;tb-generated + public TypeBasedComplex mapComplex(Function f) { + return null; + } - // MaD=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[this].SyntheticField[ArgType0];ReturnValue.SyntheticField[ArgType0];value;tb-generated - // MaD=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[0].ReturnValue.SyntheticField[ArgType0];Argument[this].SyntheticField[ArgType0];value;tb-generated - // MaD=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[0].ReturnValue.SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[0].ReturnValue.SyntheticField[ArgType0];ReturnValue.SyntheticField[ArgType0];value;tb-generated - public TypeBasedComplex returnComplex(Function> f) { - return null; - } + // summary=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[this].SyntheticField[ArgType0];ReturnValue.SyntheticField[ArgType0];value;tb-generated + // summary=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[0].ReturnValue.SyntheticField[ArgType0];Argument[this].SyntheticField[ArgType0];value;tb-generated + // summary=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[0].ReturnValue.SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;returnComplex;(Function);;Argument[0].ReturnValue.SyntheticField[ArgType0];ReturnValue.SyntheticField[ArgType0];value;tb-generated + public TypeBasedComplex returnComplex(Function> f) { + return null; + } - // MaD=p;TypeBasedComplex;true;set;(Integer,Function);;Argument[1].ReturnValue;Argument[this].SyntheticField[ArgType0];value;tb-generated - public void set(Integer x, Function f) { - } + // summary=p;TypeBasedComplex;true;set;(Integer,Function);;Argument[1].ReturnValue;Argument[this].SyntheticField[ArgType0];value;tb-generated + public void set(Integer x, Function f) {} - // MaD=p;TypeBasedComplex;true;applyMyFunction;(MyFunction,Integer);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;applyMyFunction;(MyFunction,Integer);;Argument[0].ReturnValue;Argument[this].SyntheticField[ArgType0];value;tb-generated - // MaD=p;TypeBasedComplex;true;applyMyFunction;(MyFunction,Integer);;Argument[0].ReturnValue;Argument[0].Parameter[0];value;tb-generated - public Integer applyMyFunction(MyFunction f, Integer x) { - return null; - } + // summary=p;TypeBasedComplex;true;applyMyFunction;(MyFunction,Integer);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;applyMyFunction;(MyFunction,Integer);;Argument[0].ReturnValue;Argument[this].SyntheticField[ArgType0];value;tb-generated + // summary=p;TypeBasedComplex;true;applyMyFunction;(MyFunction,Integer);;Argument[0].ReturnValue;Argument[0].Parameter[0];value;tb-generated + public Integer applyMyFunction(MyFunction f, Integer x) { + return null; + } - // MaD=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object);;Argument[0].ReturnValue;ReturnValue;value;tb-generated - // MaD=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object);;Argument[1];Argument[0].Parameter[1];value;tb-generated - public S2 applyMyFunctionGeneric(MyFunction f, S1 x) { - return null; - } + // summary=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object);;Argument[this].SyntheticField[ArgType0];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object);;Argument[0].ReturnValue;ReturnValue;value;tb-generated + // summary=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object);;Argument[1];Argument[0].Parameter[1];value;tb-generated + public S2 applyMyFunctionGeneric(MyFunction f, S1 x) { + return null; + } - // MaD=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object,Object);;Argument[0].ReturnValue;ReturnValue;value;tb-generated - // MaD=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object,Object);;Argument[1];Argument[0].Parameter[0];value;tb-generated - // MaD=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object,Object);;Argument[2];Argument[0].Parameter[1];value;tb-generated - public S3 applyMyFunctionGeneric(MyFunction f, S1 x, S2 y) { - return null; - } -} \ No newline at end of file + // summary=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object,Object);;Argument[0].ReturnValue;ReturnValue;value;tb-generated + // summary=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object,Object);;Argument[1];Argument[0].Parameter[0];value;tb-generated + // summary=p;TypeBasedComplex;true;applyMyFunctionGeneric;(MyFunction,Object,Object);;Argument[2];Argument[0].Parameter[1];value;tb-generated + public S3 applyMyFunctionGeneric(MyFunction f, S1 x, S2 y) { + return null; + } +} diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedSimple.java b/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedSimple.java index 8715bc2feeb..17b710922eb 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedSimple.java +++ b/java/ql/test/utils/modelgenerator/typebasedflow/p/TypeBasedSimple.java @@ -2,41 +2,37 @@ package p; public class TypeBasedSimple { - // MaD=p;TypeBasedSimple;true;TypeBasedSimple;(Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated - public TypeBasedSimple(T t) { - } + // summary=p;TypeBasedSimple;true;TypeBasedSimple;(Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated + public TypeBasedSimple(T t) {} - // MaD=p;TypeBasedSimple;true;get;();;Argument[this].SyntheticField[ArgType0];ReturnValue;value;tb-generated - public T get() { - return null; - } + // summary=p;TypeBasedSimple;true;get;();;Argument[this].SyntheticField[ArgType0];ReturnValue;value;tb-generated + public T get() { + return null; + } - // MaD=p;TypeBasedSimple;true;get;(Object);;Argument[this].SyntheticField[ArgType0];ReturnValue;value;tb-generated - public T get(Object o) { - return null; - } + // summary=p;TypeBasedSimple;true;get;(Object);;Argument[this].SyntheticField[ArgType0];ReturnValue;value;tb-generated + public T get(Object o) { + return null; + } - // MaD=p;TypeBasedSimple;true;id;(Object);;Argument[this].SyntheticField[ArgType0];ReturnValue;value;tb-generated - // MaD=p;TypeBasedSimple;true;id;(Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated - // MaD=p;TypeBasedSimple;true;id;(Object);;Argument[0];ReturnValue;value;tb-generated - public T id(T x) { - return null; - } + // summary=p;TypeBasedSimple;true;id;(Object);;Argument[this].SyntheticField[ArgType0];ReturnValue;value;tb-generated + // summary=p;TypeBasedSimple;true;id;(Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated + // summary=p;TypeBasedSimple;true;id;(Object);;Argument[0];ReturnValue;value;tb-generated + public T id(T x) { + return null; + } - // MaD=p;TypeBasedSimple;true;id2;(Object);;Argument[0];ReturnValue;value;tb-generated - public S id2(S x) { - return null; - } + // summary=p;TypeBasedSimple;true;id2;(Object);;Argument[0];ReturnValue;value;tb-generated + public S id2(S x) { + return null; + } - // MaD=p;TypeBasedSimple;true;set;(Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated - public void set(T x) { - } + // summary=p;TypeBasedSimple;true;set;(Object);;Argument[0];Argument[this].SyntheticField[ArgType0];value;tb-generated + public void set(T x) {} - // MaD=p;TypeBasedSimple;true;set;(int,Object);;Argument[1];Argument[this].SyntheticField[ArgType0];value;tb-generated - public void set(int x, T y) { - } + // summary=p;TypeBasedSimple;true;set;(int,Object);;Argument[1];Argument[this].SyntheticField[ArgType0];value;tb-generated + public void set(int x, T y) {} - // No summary as S is unrelated to T - public void set2(S x) { - } -} \ No newline at end of file + // No summary as S is unrelated to T + public void set2(S x) {} +} From 95ddd6ec743c8773ee94e5519ad8f97849c1491c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 13:34:03 +0200 Subject: [PATCH 073/118] Java: Generalize the inline mad test to allow further re-use. --- java/ql/test/TestUtilities/InlineMadTest.qll | 62 ++++++++++++------- .../dataflow/CaptureModels.expected | 4 +- .../modelgenerator/dataflow/CaptureModels.ql | 4 +- .../CaptureTypeBasedSummaryModels.expected | 4 +- .../CaptureTypeBasedSummaryModels.ql | 4 +- 5 files changed, 47 insertions(+), 31 deletions(-) diff --git a/java/ql/test/TestUtilities/InlineMadTest.qll b/java/ql/test/TestUtilities/InlineMadTest.qll index 3e9aee7eb9e..a5602036a8c 100644 --- a/java/ql/test/TestUtilities/InlineMadTest.qll +++ b/java/ql/test/TestUtilities/InlineMadTest.qll @@ -1,34 +1,50 @@ -signature module InlineMadTestConfigSig { +import java + +private signature module InlineMadTestLangSig { /** * Gets a relevant code comment, if any. */ string getComment(); +} + +signature module InlineMadTestConfigSig { + /** + * Gets the kind of the captured model. + */ + string getKind(); /** - * Gets an identified summary, if any. + * Gets a captured model, if any. */ - string getCapturedSummary(); + string getCapturedModel(); +} + +private module InlineMadTestImpl { + private string expects() { + Lang::getComment().regexpCapture(" *(SPURIOUS-)?" + Input::getKind() + "=(.*)", 2) = result + } + + query predicate unexpectedModel(string msg) { + exists(string flow | + flow = Input::getCapturedModel() and + not flow = expects() and + msg = "Unexpected " + Input::getKind() + " found: " + flow + ) + } + + query predicate expectedModel(string msg) { + exists(string e | + e = expects() and + not e = Input::getCapturedModel() and + msg = "Expected " + Input::getKind() + " missing: " + e + ) + } +} + +private module InlineMadTestLang implements InlineMadTestLangSig { + string getComment() { result = any(Javadoc doc).getChild(0).toString() } } module InlineMadTest { - bindingset[kind] - private string expects(string kind) { - Input::getComment().regexpCapture(" *(SPURIOUS-)?" + kind + "=(.*)", 2) = result - } - - query predicate unexpectedSummary(string msg) { - exists(string flow | - flow = Input::getCapturedSummary() and - not flow = expects("summary") and - msg = "Unexpected summary found: " + flow - ) - } - - query predicate expectedSummary(string msg) { - exists(string e | - e = expects("summary") and - not e = Input::getCapturedSummary() and - msg = "Expected summary missing: " + e - ) - } + import InlineMadTestImpl } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected index ee55a9c6ba6..cb6fc390349 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected @@ -1,2 +1,2 @@ -unexpectedSummary -expectedSummary +unexpectedModel +expectedModel diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql index 1a2dbd03d7a..821e8e8f0e7 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql @@ -3,9 +3,9 @@ import utils.modelgenerator.internal.CaptureSummaryFlowQuery import TestUtilities.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getComment() { result = any(Javadoc doc).getChild(0).toString() } + string getCapturedModel() { result = captureFlow(_) } - string getCapturedSummary() { result = captureFlow(_) } + string getKind() { result = "summary" } } import InlineMadTest diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.expected b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.expected index ee55a9c6ba6..cb6fc390349 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.expected +++ b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.expected @@ -1,2 +1,2 @@ -unexpectedSummary -expectedSummary +unexpectedModel +expectedModel diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql index c5c509ac326..e3b64cca785 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql @@ -3,9 +3,9 @@ import TestUtilities.InlineMadTest import utils.modelgenerator.internal.CaptureTypeBasedSummaryModels module InlineMadTestConfig implements InlineMadTestConfigSig { - string getComment() { result = any(Javadoc doc).getChild(0).toString() } + string getCapturedModel() { result = captureFlow(_) } - string getCapturedSummary() { result = captureFlow(_) } + string getKind() { result = "summary" } } import InlineMadTest From 73df4fa920bfdef11cd8ecb094092f103bfa4850 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 6 May 2024 14:55:35 +0200 Subject: [PATCH 074/118] Go: fix Windows installation --- .bazelrc | 3 ++- go/create_extractor_pack.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index 36111310779..c2b4d3b7f03 100644 --- a/.bazelrc +++ b/.bazelrc @@ -15,7 +15,8 @@ build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64 build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor # this requires developer mode, but is required to have pack installer functioning -common:windows --windows_enable_symlinks --enable_runfiles +startup --windows_enable_symlinks +common --enable_runfiles common --registry=file:///%workspace%/misc/bazel/registry common --registry=https://bcr.bazel.build diff --git a/go/create_extractor_pack.py b/go/create_extractor_pack.py index 4d194ab93e4..427f0c37c36 100755 --- a/go/create_extractor_pack.py +++ b/go/create_extractor_pack.py @@ -13,10 +13,14 @@ except KeyError: from go._extractor_pack_install_script import main -if os.environ['REPO_NAME'] == 'codeql~': - workspace_dir /= 'ql' +build_dir = workspace_dir / 'go' / 'build' -dest_dir = workspace_dir / 'go' / 'build' / 'codeql-extractor-pack' +if not build_dir.exists(): + # we probably are in the internal repo + workspace_dir /= 'ql' + build_dir = workspace_dir / 'go' / 'build' + +dest_dir = build_dir / 'codeql-extractor-pack' shutil.rmtree(dest_dir, ignore_errors=True) os.environ['DESTDIR'] = str(dest_dir) main(sys.argv) From 54c9aea251b1e011e853f5c36ba397af3fa302f4 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 6 May 2024 15:47:02 +0200 Subject: [PATCH 075/118] Bazel: fix lfs lazy rule when all objects are local --- misc/bazel/internal/git_lfs_probe.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/misc/bazel/internal/git_lfs_probe.py b/misc/bazel/internal/git_lfs_probe.py index cde509af711..f0a4dfd4117 100755 --- a/misc/bazel/internal/git_lfs_probe.py +++ b/misc/bazel/internal/git_lfs_probe.py @@ -82,18 +82,22 @@ def get_endpoint(): # see https://github.com/git-lfs/git-lfs/blob/310d1b4a7d01e8d9d884447df4635c7a9c7642c2/docs/api/basic-transfers.md def get_locations(objects): + ret = ["local" for _ in objects] endpoint = get_endpoint() indexes = [i for i, o in enumerate(objects) if o] - ret = ["local" for _ in objects] + if not indexes: + # all objects are local, do not send an empty request as that would be an error + return ret + data = { + "operation": "download", + "transfers": ["basic"], + "objects": [objects[i] for i in indexes], + "hash_algo": "sha256", + } req = urllib.request.Request( f"{endpoint.href}/objects/batch", headers=endpoint.headers, - data=json.dumps({ - "operation": "download", - "transfers": ["basic"], - "objects": [o for o in objects if o], - "hash_algo": "sha256", - }).encode("ascii"), + data=json.dumps(data).encode("ascii"), ) with urllib.request.urlopen(req) as resp: data = json.load(resp) From a8549d2e233938c043fdd9632f4d013ce8ec2165 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 13:56:36 +0200 Subject: [PATCH 076/118] Java: Convert remaining tests to inline flow tests. --- .../dataflow/CaptureNeutralModels.expected | 27 +----------- .../dataflow/CaptureNeutralModels.ql | 11 +++++ .../dataflow/CaptureNeutralModels.qlref | 1 - .../dataflow/CaptureSinkModels.expected | 7 +-- .../dataflow/CaptureSinkModels.ql | 11 +++++ .../dataflow/CaptureSinkModels.qlref | 1 - .../dataflow/CaptureSourceModels.expected | 7 +-- .../dataflow/CaptureSourceModels.ql | 11 +++++ .../dataflow/CaptureSourceModels.qlref | 1 - ...expected => CaptureSummaryModels.expected} | 0 ...ptureModels.ql => CaptureSummaryModels.ql} | 0 .../modelgenerator/dataflow/p/Factory.java | 1 + .../modelgenerator/dataflow/p/FinalClass.java | 1 + .../modelgenerator/dataflow/p/FluentAPI.java | 1 + .../dataflow/p/ImmutablePojo.java | 1 + .../modelgenerator/dataflow/p/Joiner.java | 1 + .../modelgenerator/dataflow/p/ParamFlow.java | 2 + .../utils/modelgenerator/dataflow/p/Pojo.java | 9 ++++ .../p/PrivateFlowViaPublicInterface.java | 3 ++ .../modelgenerator/dataflow/p/Sinks.java | 41 ++++++++++------- .../modelgenerator/dataflow/p/Sources.java | 44 +++++++++++-------- 21 files changed, 108 insertions(+), 73 deletions(-) create mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql delete mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.qlref create mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql delete mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.qlref create mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql delete mode 100644 java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.qlref rename java/ql/test/utils/modelgenerator/dataflow/{CaptureModels.expected => CaptureSummaryModels.expected} (100%) rename java/ql/test/utils/modelgenerator/dataflow/{CaptureModels.ql => CaptureSummaryModels.ql} (100%) diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected index df6a7bfc854..cb6fc390349 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected @@ -1,25 +1,2 @@ -| p;Factory;getIntValue;();summary;df-generated | -| p;FinalClass;returnsConstant;();summary;df-generated | -| p;FluentAPI$Inner;notThis;(String);summary;df-generated | -| p;ImmutablePojo;getX;();summary;df-generated | -| p;Joiner;length;();summary;df-generated | -| p;ParamFlow;ignorePrimitiveReturnValue;(String);summary;df-generated | -| p;ParamFlow;mapType;(Class);summary;df-generated | -| p;Pojo;doNotSetValue;(String);summary;df-generated | -| p;Pojo;getBigDecimal;();summary;df-generated | -| p;Pojo;getBigInt;();summary;df-generated | -| p;Pojo;getBoxedArray;();summary;df-generated | -| p;Pojo;getBoxedCollection;();summary;df-generated | -| p;Pojo;getBoxedValue;();summary;df-generated | -| p;Pojo;getFloatArray;();summary;df-generated | -| p;Pojo;getIntValue;();summary;df-generated | -| p;Pojo;getPrimitiveArray;();summary;df-generated | -| p;PrivateFlowViaPublicInterface$SPI;openStreamNone;();summary;df-generated | -| p;PrivateFlowViaPublicInterface;createAnSPIWithoutTrackingFile;(File);summary;df-generated | -| p;Sinks;copyFileToDirectory;(Path,Path,CopyOption[]);summary;df-generated | -| p;Sinks;propagate;(String);summary;df-generated | -| p;Sinks;readUrl;(URL,Charset);summary;df-generated | -| p;Sources;readUrl;(URL);summary;df-generated | -| p;Sources;socketStream;();summary;df-generated | -| p;Sources;sourceToParameter;(InputStream[],List);summary;df-generated | -| p;Sources;wrappedSocketStream;();summary;df-generated | +unexpectedModel +expectedModel diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql new file mode 100644 index 00000000000..50bc36fe4eb --- /dev/null +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql @@ -0,0 +1,11 @@ +import java +import utils.modelgenerator.internal.CaptureSummaryFlowQuery +import TestUtilities.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel() { result = captureNoFlow(_) } + + string getKind() { result = "neutral" } +} + +import InlineMadTest diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.qlref b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.qlref deleted file mode 100644 index 851ddc0d294..00000000000 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.qlref +++ /dev/null @@ -1 +0,0 @@ -utils/modelgenerator/CaptureNeutralModels.ql \ No newline at end of file diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected index 799a1a37dd4..cb6fc390349 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected @@ -1,5 +1,2 @@ -| p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];path-injection;df-generated | -| p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[0];path-injection;df-generated | -| p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[1];path-injection;df-generated | -| p;Sinks;true;readUrl;(URL,Charset);;Argument[0];request-forgery;df-generated | -| p;Sources;true;readUrl;(URL);;Argument[0];request-forgery;df-generated | +unexpectedModel +expectedModel diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql new file mode 100644 index 00000000000..2bf1c378f2a --- /dev/null +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql @@ -0,0 +1,11 @@ +import java +import utils.modelgenerator.internal.CaptureModels +import TestUtilities.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel() { result = captureSink(_) } + + string getKind() { result = "sink" } +} + +import InlineMadTest diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.qlref b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.qlref deleted file mode 100644 index 36d2f144247..00000000000 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.qlref +++ /dev/null @@ -1 +0,0 @@ -utils/modelgenerator/CaptureSinkModels.ql \ No newline at end of file diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.expected index 0f8d0ff1f32..cb6fc390349 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.expected +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.expected @@ -1,5 +1,2 @@ -| p;Sources;true;readUrl;(URL);;ReturnValue;remote;df-generated | -| p;Sources;true;socketStream;();;ReturnValue;remote;df-generated | -| p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[0].ArrayElement;remote;df-generated | -| p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[1].Element;remote;df-generated | -| p;Sources;true;wrappedSocketStream;();;ReturnValue;remote;df-generated | +unexpectedModel +expectedModel diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql new file mode 100644 index 00000000000..e628bd19eb4 --- /dev/null +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql @@ -0,0 +1,11 @@ +import java +import utils.modelgenerator.internal.CaptureModels +import TestUtilities.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel() { result = captureSource(_) } + + string getKind() { result = "source" } +} + +import InlineMadTest diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.qlref b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.qlref deleted file mode 100644 index 6bbb499fc27..00000000000 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.qlref +++ /dev/null @@ -1 +0,0 @@ -utils/modelgenerator/CaptureSourceModels.ql \ No newline at end of file diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected similarity index 100% rename from java/ql/test/utils/modelgenerator/dataflow/CaptureModels.expected rename to java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql similarity index 100% rename from java/ql/test/utils/modelgenerator/dataflow/CaptureModels.ql rename to java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java index 57d26429a93..1887e0ca73e 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java @@ -26,6 +26,7 @@ public final class Factory { return value; } + // neutral=p;Factory;getIntValue;();summary;df-generated public int getIntValue() { return intValue; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java index 82a39533ce1..2638f818854 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java @@ -9,6 +9,7 @@ public final class FinalClass { return input; } + // neutral=p;FinalClass;returnsConstant;();summary;df-generated public String returnsConstant() { return C; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java index 38fbb286bb0..b7793e30666 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java @@ -8,6 +8,7 @@ public final class FluentAPI { } public class Inner { + // neutral=p;FluentAPI$Inner;notThis;(String);summary;df-generated public FluentAPI notThis(String input) { return FluentAPI.this; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java index 1b39856b445..0a2cf2d7dbd 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java @@ -17,6 +17,7 @@ public final class ImmutablePojo { return value; } + // neutral=p;ImmutablePojo;getX;();summary;df-generated public long getX() { return x; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java index 60edb0fb71e..10fc72c907f 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java @@ -117,6 +117,7 @@ public final class Joiner { } } + // neutral=p;Joiner;length;();summary;df-generated public int length() { return (size == 0 && emptyValue != null) ? emptyValue.length() diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java index 5c47e292a6b..d175ee9c71e 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java @@ -12,6 +12,7 @@ public class ParamFlow { return input; } + // neutral=p;ParamFlow;ignorePrimitiveReturnValue;(String);summary;df-generated public int ignorePrimitiveReturnValue(String input) { return input.length(); } @@ -50,6 +51,7 @@ public class ParamFlow { return input.iterator().next(); } + // neutral=p;ParamFlow;mapType;(Class);summary;df-generated public Class mapType(Class input) { return input; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java index 524e448ef81..9d5de0517e1 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java @@ -40,19 +40,23 @@ public final class Pojo { this.value = value; } + // neutral=p;Pojo;doNotSetValue;(String);summary;df-generated public int doNotSetValue(String value) { Holder h = new Holder(value); return h.length(); } + // neutral=p;Pojo;getIntValue;();summary;df-generated public int getIntValue() { return intValue; } + // neutral=p;Pojo;getBoxedValue;();summary;df-generated public Integer getBoxedValue() { return Integer.valueOf(intValue); } + // neutral=p;Pojo;getPrimitiveArray;();summary;df-generated public int[] getPrimitiveArray() { return new int[] {intValue}; } @@ -67,14 +71,17 @@ public final class Pojo { return byteArray; } + // neutral=p;Pojo;getFloatArray;();summary;df-generated public float[] getFloatArray() { return floatArray; } + // neutral=p;Pojo;getBoxedArray;();summary;df-generated public Integer[] getBoxedArray() { return new Integer[] {Integer.valueOf(intValue)}; } + // neutral=p;Pojo;getBoxedCollection;();summary;df-generated public Collection getBoxedCollection() { return List.of(Integer.valueOf(intValue)); } @@ -89,10 +96,12 @@ public final class Pojo { return byteObjectArray; } + // neutral=p;Pojo;getBigInt;();summary;df-generated public BigInteger getBigInt() { return BigInteger.valueOf(intValue); } + // neutral=p;Pojo;getBigDecimal;();summary;df-generated public BigDecimal getBigDecimal() { return new BigDecimal(value); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java index 6b5dbca3e11..75364887274 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java @@ -13,8 +13,10 @@ public class PrivateFlowViaPublicInterface { public static interface SPI { // summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated + // sink=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];path-injection;df-generated OutputStream openStream() throws IOException; + // neutral=p;PrivateFlowViaPublicInterface$SPI;openStreamNone;();summary;df-generated default OutputStream openStreamNone() throws IOException { return null; } @@ -55,6 +57,7 @@ public class PrivateFlowViaPublicInterface { return new PrivateImplWithSink(file); } + // neutral=p;PrivateFlowViaPublicInterface;createAnSPIWithoutTrackingFile;(File);summary;df-generated public static SPI createAnSPIWithoutTrackingFile(File file) { return new PrivateImplWithRandomField(file); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Sinks.java b/java/ql/test/utils/modelgenerator/dataflow/p/Sinks.java index 260f235920a..e9868b26073 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Sinks.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Sinks.java @@ -3,32 +3,39 @@ package p; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import java.nio.file.CopyOption; import java.nio.charset.Charset; +import java.nio.file.CopyOption; import java.nio.file.Files; import java.nio.file.Path; import java.util.logging.Logger; public class Sinks { - - public Path copyFileToDirectory(final Path sourceFile, final Path targetFile, final CopyOption... copyOptions) throws IOException { - return Files.copy(sourceFile, targetFile, copyOptions); - } - public String readUrl(final URL url, Charset encoding) throws IOException { - try (InputStream in = url.openStream()) { - byte[] bytes = in.readAllBytes(); - return new String(bytes, encoding); - } - } + // sink=p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[0];path-injection;df-generated + // sink=p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[1];path-injection;df-generated + // neutral=p;Sinks;copyFileToDirectory;(Path,Path,CopyOption[]);summary;df-generated + public Path copyFileToDirectory( + final Path sourceFile, final Path targetFile, final CopyOption... copyOptions) + throws IOException { + return Files.copy(sourceFile, targetFile, copyOptions); + } - public static void main(String[] args) throws IOException { - String foo = new Sinks().readUrl(new URL(args[0]), Charset.defaultCharset()); + // sink=p;Sinks;true;readUrl;(URL,Charset);;Argument[0];request-forgery;df-generated + // neutral=p;Sinks;readUrl;(URL,Charset);summary;df-generated + public String readUrl(final URL url, Charset encoding) throws IOException { + try (InputStream in = url.openStream()) { + byte[] bytes = in.readAllBytes(); + return new String(bytes, encoding); } + } - public void propagate(String s) { - Logger logger = Logger.getLogger(Sinks.class.getSimpleName()); - logger.warning(s); - } + public static void main(String[] args) throws IOException { + String foo = new Sinks().readUrl(new URL(args[0]), Charset.defaultCharset()); + } + // neutral=p;Sinks;propagate;(String);summary;df-generated + public void propagate(String s) { + Logger logger = Logger.getLogger(Sinks.class.getSimpleName()); + logger.warning(s); + } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Sources.java b/java/ql/test/utils/modelgenerator/dataflow/p/Sources.java index 7b008ff378f..436bf16797c 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Sources.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Sources.java @@ -4,29 +4,37 @@ import java.io.IOException; import java.io.InputStream; import java.net.ServerSocket; import java.net.URL; -import java.util.function.Consumer; import java.util.List; - public class Sources { - - public InputStream readUrl(final URL url) throws IOException { - return url.openConnection().getInputStream(); - } - public InputStream socketStream() throws IOException { - ServerSocket socket = new ServerSocket(123); - return socket.accept().getInputStream(); - } + // source=p;Sources;true;readUrl;(URL);;ReturnValue;remote;df-generated + // sink=p;Sources;true;readUrl;(URL);;Argument[0];request-forgery;df-generated + // neutral=p;Sources;readUrl;(URL);summary;df-generated + public InputStream readUrl(final URL url) throws IOException { + return url.openConnection().getInputStream(); + } - public InputStream wrappedSocketStream() throws IOException { - return socketStream(); - } + // source=p;Sources;true;socketStream;();;ReturnValue;remote;df-generated + // neutral=p;Sources;socketStream;();summary;df-generated + public InputStream socketStream() throws IOException { + ServerSocket socket = new ServerSocket(123); + return socket.accept().getInputStream(); + } - public void sourceToParameter(InputStream[] streams, List otherStreams) throws IOException { - ServerSocket socket = new ServerSocket(123); - streams[0] = socket.accept().getInputStream(); - otherStreams.add(socket.accept().getInputStream()); - } + // source=p;Sources;true;wrappedSocketStream;();;ReturnValue;remote;df-generated + // neutral=p;Sources;wrappedSocketStream;();summary;df-generated + public InputStream wrappedSocketStream() throws IOException { + return socketStream(); + } + // source=p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[0].ArrayElement;remote;df-generated + // source=p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[1].Element;remote;df-generated + // neutral=p;Sources;sourceToParameter;(InputStream[],List);summary;df-generated + public void sourceToParameter(InputStream[] streams, List otherStreams) + throws IOException { + ServerSocket socket = new ServerSocket(123); + streams[0] = socket.accept().getInputStream(); + otherStreams.add(socket.accept().getInputStream()); + } } From 92b3eda12d7605283a5616ec6b9e9a2681f221e5 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 6 May 2024 16:00:05 +0200 Subject: [PATCH 077/118] Bazel: move buildifier out of root `BUILD` See https://github.com/github/codeql/pull/16428 for details as to why this is necessary. --- .github/workflows/buildifier.yml | 2 +- .pre-commit-config.yaml | 2 +- BUILD.bazel | 9 --------- misc/bazel/BUILD.bazel | 9 +++++++++ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/buildifier.yml b/.github/workflows/buildifier.yml index 82444d0440a..b5d1e2244d5 100644 --- a/.github/workflows/buildifier.yml +++ b/.github/workflows/buildifier.yml @@ -24,5 +24,5 @@ jobs: extra_args: > buildifier --all-files 2>&1 || ( - echo -e "In order to format all bazel files, please run:\n bazel run //:buildifier"; exit 1 + echo -e "In order to format all bazel files, please run:\n bazel run //misc/bazel:buildifier"; exit 1 ) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7fddd1929d4..00c34e5df06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: name: Format bazel files files: \.(bazel|bzl) language: system - entry: bazel run //:buildifier + entry: bazel run //misc/bazel:buildifier pass_filenames: false - id: codeql-format diff --git a/BUILD.bazel b/BUILD.bazel index 3ccdcda5f12..e69de29bb2d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,9 +0,0 @@ -load("@buildifier_prebuilt//:rules.bzl", "buildifier") - -buildifier( - name = "buildifier", - exclude_patterns = [ - "./.git/*", - ], - lint_mode = "fix", -) diff --git a/misc/bazel/BUILD.bazel b/misc/bazel/BUILD.bazel index e69de29bb2d..3ccdcda5f12 100644 --- a/misc/bazel/BUILD.bazel +++ b/misc/bazel/BUILD.bazel @@ -0,0 +1,9 @@ +load("@buildifier_prebuilt//:rules.bzl", "buildifier") + +buildifier( + name = "buildifier", + exclude_patterns = [ + "./.git/*", + ], + lint_mode = "fix", +) From b53fa0f7f36db827d831fe13c0628e856d179f44 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 16:32:28 +0200 Subject: [PATCH 078/118] Java: Ensure that it is the callable for the model origin that carries the comment containing the model. --- java/ql/test/TestUtilities/InlineMadTest.qll | 34 +++++++++++-------- .../dataflow/CaptureNeutralModels.ql | 2 +- .../dataflow/CaptureSinkModels.ql | 2 +- .../dataflow/CaptureSourceModels.ql | 2 +- .../dataflow/CaptureSummaryModels.ql | 2 +- .../dataflow/p/MultipleImpl2.java | 2 +- .../dataflow/p/MultipleImpls.java | 4 +-- .../p/PrivateFlowViaPublicInterface.java | 6 ++-- .../CaptureTypeBasedSummaryModels.ql | 2 +- 9 files changed, 31 insertions(+), 25 deletions(-) diff --git a/java/ql/test/TestUtilities/InlineMadTest.qll b/java/ql/test/TestUtilities/InlineMadTest.qll index a5602036a8c..31206a6338c 100644 --- a/java/ql/test/TestUtilities/InlineMadTest.qll +++ b/java/ql/test/TestUtilities/InlineMadTest.qll @@ -2,47 +2,53 @@ import java private signature module InlineMadTestLangSig { /** - * Gets a relevant code comment, if any. + * Gets a relevant code comment for `c`, if any. */ - string getComment(); + string getComment(Callable c); } signature module InlineMadTestConfigSig { /** - * Gets the kind of the captured model. + * Gets the kind of a captured model. */ string getKind(); /** - * Gets a captured model, if any. + * Gets a captured model for `c`, if any. */ - string getCapturedModel(); + string getCapturedModel(Callable c); } private module InlineMadTestImpl { - private string expects() { - Lang::getComment().regexpCapture(" *(SPURIOUS-)?" + Input::getKind() + "=(.*)", 2) = result + private string expects(Callable c) { + Lang::getComment(c).regexpCapture(" *(SPURIOUS-)?" + Input::getKind() + "=(.*)", 2) = result } query predicate unexpectedModel(string msg) { - exists(string flow | - flow = Input::getCapturedModel() and - not flow = expects() and + exists(Callable c, string flow | + flow = Input::getCapturedModel(c) and + not flow = expects(c) and msg = "Unexpected " + Input::getKind() + " found: " + flow ) } query predicate expectedModel(string msg) { - exists(string e | - e = expects() and - not e = Input::getCapturedModel() and + exists(Callable c, string e | + e = expects(c) and + not e = Input::getCapturedModel(c) and msg = "Expected " + Input::getKind() + " missing: " + e ) } } private module InlineMadTestLang implements InlineMadTestLangSig { - string getComment() { result = any(Javadoc doc).getChild(0).toString() } + string getComment(Callable c) { + exists(Javadoc doc | + hasJavadoc(c, doc) and + isNormalComment(doc) and + result = doc.getChild(0).toString() + ) + } } module InlineMadTest { diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql index 50bc36fe4eb..e68730cc0ed 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureSummaryFlowQuery import TestUtilities.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel() { result = captureNoFlow(_) } + string getCapturedModel(Callable c) { result = captureNoFlow(c) } string getKind() { result = "neutral" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql index 2bf1c378f2a..1acde2ade49 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import TestUtilities.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel() { result = captureSink(_) } + string getCapturedModel(Callable c) { result = captureSink(c) } string getKind() { result = "sink" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql index e628bd19eb4..7596f4f8cc1 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import TestUtilities.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel() { result = captureSource(_) } + string getCapturedModel(Callable c) { result = captureSource(c) } string getKind() { result = "source" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql index 821e8e8f0e7..415ebab1343 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureSummaryFlowQuery import TestUtilities.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel() { result = captureFlow(_) } + string getCapturedModel(Callable c) { result = captureFlow(c) } string getKind() { result = "summary" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java index dc67d0dfe6c..3e5d9abd768 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java @@ -6,7 +6,6 @@ class MultipleImpl2 { // This is used to test that we only generate a summary model and // not neutral summary model for `IInterface.m`. public interface IInterface { - // summary=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated Object m(Object value); } @@ -17,6 +16,7 @@ class MultipleImpl2 { } public class Impl2 implements IInterface { + // summary=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated public Object m(Object value) { return value; } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java index 8fccdf76ab7..d2b4ac133b5 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java @@ -5,12 +5,11 @@ import java.util.concurrent.Callable; public class MultipleImpls { public static interface Strategy { - // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated - // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated String doSomething(String value); } public static class Strat1 implements Strategy { + // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated public String doSomething(String value) { return value; } @@ -28,6 +27,7 @@ public class MultipleImpls { public static class Strat2 implements Strategy { private String foo; + // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated public String doSomething(String value) { this.foo = value; return "none"; diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java index 75364887274..25c62172121 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java @@ -12,15 +12,12 @@ public class PrivateFlowViaPublicInterface { } public static interface SPI { - // summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated - // sink=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];path-injection;df-generated OutputStream openStream() throws IOException; // neutral=p;PrivateFlowViaPublicInterface$SPI;openStreamNone;();summary;df-generated default OutputStream openStreamNone() throws IOException { return null; } - ; } private static final class PrivateImplWithSink implements SPI { @@ -31,6 +28,8 @@ public class PrivateFlowViaPublicInterface { this.file = file; } + // summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated + // sink=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];path-injection;df-generated @Override public OutputStream openStream() throws IOException { return new FileOutputStream(file); @@ -46,6 +45,7 @@ public class PrivateFlowViaPublicInterface { return null; } + // neutral=p;PrivateFlowViaPublicInterface$SPI;openStreamNone;();summary;df-generated @Override public OutputStream openStreamNone() throws IOException { return new FileOutputStream(new RandomPojo().someFile); diff --git a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql index e3b64cca785..2bf4e08d2c1 100644 --- a/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/typebasedflow/CaptureTypeBasedSummaryModels.ql @@ -3,7 +3,7 @@ import TestUtilities.InlineMadTest import utils.modelgenerator.internal.CaptureTypeBasedSummaryModels module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel() { result = captureFlow(_) } + string getCapturedModel(Callable c) { result = captureFlow(c) } string getKind() { result = "summary" } } From 757cf8d43a2f2389557b4cf9f419e7a282c5e807 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 6 May 2024 14:26:30 +0200 Subject: [PATCH 079/118] C#: Fix a comment typo. --- .../semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll | 2 +- .../code/csharp/security/dataflow/flowsources/ApiSources.qll | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll index 7a069adb2ed..15c64b45ca0 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ApiSinks.qll @@ -10,7 +10,7 @@ final class SinkNode = ApiSinkNode; /** * Module that adds all API like sinks to `SinkNode`, excluding sinks for cryptography based - * queries, and queries where sinks are not succifiently defined (eg. using broad method name matching). + * queries, and queries where sinks are not sufficiently defined (eg. using broad method name matching). */ private module AllApiSinks { private import ParallelSink diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll index 01d838f2f94..2aa451831aa 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/ApiSources.qll @@ -6,7 +6,7 @@ final class SourceNode = FlowSources::SourceNode; /** * Module that adds all API like sources to `SourceNode`, excluding some sources for cryptography based - * queries, and queries where sources are not succifiently defined (eg. using broad method name matching). + * queries, and queries where sources are not sufficiently defined (eg. using broad method name matching). */ private module AllApiSources { private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery From 9b23635d0af2e31c113e2a2c93849838fb60826a Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Mon, 6 May 2024 17:47:55 +0200 Subject: [PATCH 080/118] C++: Add test case that shows that no destructors are attached to unwinds --- .../library-tests/ir/ir/PrintAST.expected | 35 +++++++++++ .../library-tests/ir/ir/aliased_ir.expected | 58 +++++++++++++++++++ cpp/ql/test/library-tests/ir/ir/ir.cpp | 9 +++ .../test/library-tests/ir/ir/raw_ir.expected | 50 ++++++++++++++++ 4 files changed, 152 insertions(+) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index cf5125b1ccf..811502f047e 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -22605,6 +22605,41 @@ ir.cpp: # 2530| ValueCategory = lvalue # 2530| getStmt(1): [LabelStmt] label ...: # 2531| getStmt(2): [ReturnStmt] return ... +# 2533| [TopLevelFunction] void destructor_possibly_not_handled() +# 2533| : +# 2533| getEntryPoint(): [BlockStmt] { ... } +# 2534| getStmt(0): [DeclStmt] declaration +# 2534| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2534| Type = [Class] ClassWithDestructor +# 2534| getVariable().getInitializer(): [Initializer] initializer for x +# 2534| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2534| Type = [VoidType] void +# 2534| ValueCategory = prvalue +# 2535| getStmt(1): [TryStmt] try { ... } +# 2535| getStmt(): [BlockStmt] { ... } +# 2536| getStmt(0): [ExprStmt] ExprStmt +# 2536| getExpr(): [ThrowExpr] throw ... +# 2536| Type = [IntType] int +# 2536| ValueCategory = prvalue +# 2536| getExpr(): [Literal] 42 +# 2536| Type = [IntType] int +# 2536| Value = [Literal] 42 +# 2536| ValueCategory = prvalue +# 2538| getChild(1): [Handler] +# 2538| getBlock(): [CatchBlock] { ... } +# 2540| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2540| Type = [VoidType] void +# 2540| ValueCategory = prvalue +# 2540| getQualifier(): [VariableAccess] x +# 2540| Type = [Class] ClassWithDestructor +# 2540| ValueCategory = lvalue +# 2540| getStmt(2): [ReturnStmt] return ... +# 2540| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2540| Type = [VoidType] void +# 2540| ValueCategory = prvalue +# 2540| getQualifier(): [VariableAccess] x +# 2540| Type = [Class] ClassWithDestructor +# 2540| ValueCategory = lvalue perf-regression.cpp: # 4| [CopyAssignmentOperator] Big& Big::operator=(Big const&) # 4| : diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index ae73ecd8f6f..b8585f346a2 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -18177,6 +18177,64 @@ ir.cpp: # 2521| v2521_8(void) = AliasedUse : ~m2530_17 # 2521| v2521_9(void) = ExitFunction : +# 2533| void destructor_possibly_not_handled() +# 2533| Block 0 +# 2533| v2533_1(void) = EnterFunction : +# 2533| m2533_2(unknown) = AliasedDefinition : +# 2533| m2533_3(unknown) = InitializeNonLocal : +# 2533| m2533_4(unknown) = Chi : total:m2533_2, partial:m2533_3 +# 2534| r2534_1(glval) = VariableAddress[x] : +# 2534| m2534_2(ClassWithDestructor) = Uninitialized[x] : &:r2534_1 +# 2534| r2534_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2534| v2534_4(void) = Call[ClassWithDestructor] : func:r2534_3, this:r2534_1 +# 2534| m2534_5(unknown) = ^CallSideEffect : ~m2533_4 +# 2534| m2534_6(unknown) = Chi : total:m2533_4, partial:m2534_5 +# 2534| m2534_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2534_1 +# 2534| m2534_8(ClassWithDestructor) = Chi : total:m2534_2, partial:m2534_7 +# 2536| r2536_1(glval) = VariableAddress[#throw2536:5] : +# 2536| r2536_2(int) = Constant[42] : +# 2536| m2536_3(int) = Store[#throw2536:5] : &:r2536_1, r2536_2 +# 2536| v2536_4(void) = ThrowValue : &:r2536_1, m2536_3 +#-----| Exception -> Block 3 + +# 2533| Block 1 +# 2533| m2533_5(unknown) = Phi : from 2:~m2534_6, from 4:~m2540_14 +# 2533| v2533_6(void) = AliasedUse : ~m2533_5 +# 2533| v2533_7(void) = ExitFunction : + +# 2533| Block 2 +# 2533| v2533_8(void) = Unwind : +#-----| Goto -> Block 1 + +# 2538| Block 3 +# 2538| v2538_1(void) = CatchByType[char] : +#-----| Exception -> Block 2 +#-----| Goto -> Block 4 + +# 2538| Block 4 +# 2538| r2538_2(glval) = VariableAddress[(unnamed parameter 0)] : +# 2538| m2538_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2538_2 +# 2538| v2538_4(void) = NoOp : +# 2540| r2540_1(glval) = VariableAddress[x] : +# 2540| r2540_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2540| v2540_3(void) = Call[~ClassWithDestructor] : func:r2540_2, this:r2540_1 +# 2540| m2540_4(unknown) = ^CallSideEffect : ~m2534_6 +# 2540| m2540_5(unknown) = Chi : total:m2534_6, partial:m2540_4 +# 2540| v2540_6(void) = ^IndirectReadSideEffect[-1] : &:r2540_1, m2534_8 +# 2540| m2540_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_1 +# 2540| m2540_8(ClassWithDestructor) = Chi : total:m2534_8, partial:m2540_7 +# 2540| v2540_9(void) = NoOp : +# 2540| r2540_10(glval) = VariableAddress[x] : +# 2540| r2540_11(glval) = FunctionAddress[~ClassWithDestructor] : +# 2540| v2540_12(void) = Call[~ClassWithDestructor] : func:r2540_11, this:r2540_10 +# 2540| m2540_13(unknown) = ^CallSideEffect : ~m2540_5 +# 2540| m2540_14(unknown) = Chi : total:m2540_5, partial:m2540_13 +# 2540| v2540_15(void) = ^IndirectReadSideEffect[-1] : &:r2540_10, m2540_8 +# 2540| m2540_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_10 +# 2540| m2540_17(ClassWithDestructor) = Chi : total:m2540_8, partial:m2540_16 +# 2533| v2533_9(void) = ReturnVoid : +#-----| Goto -> Block 1 + perf-regression.cpp: # 6| void Big::Big() # 6| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/ir.cpp b/cpp/ql/test/library-tests/ir/ir/ir.cpp index e6c8b90ea5c..35ea60715cc 100644 --- a/cpp/ql/test/library-tests/ir/ir/ir.cpp +++ b/cpp/ql/test/library-tests/ir/ir/ir.cpp @@ -2530,4 +2530,13 @@ void destruction_in_switch_3(int c) { } } +void destructor_possibly_not_handled() { + ClassWithDestructor x; + try { + throw 42; + } + catch(char) { + } +} + // semmle-extractor-options: -std=c++20 --clang diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 71796c4c39e..5693fc26f95 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -16553,6 +16553,56 @@ ir.cpp: # 2521| v2521_7(void) = AliasedUse : ~m? # 2521| v2521_8(void) = ExitFunction : +# 2533| void destructor_possibly_not_handled() +# 2533| Block 0 +# 2533| v2533_1(void) = EnterFunction : +# 2533| mu2533_2(unknown) = AliasedDefinition : +# 2533| mu2533_3(unknown) = InitializeNonLocal : +# 2534| r2534_1(glval) = VariableAddress[x] : +# 2534| mu2534_2(ClassWithDestructor) = Uninitialized[x] : &:r2534_1 +# 2534| r2534_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2534| v2534_4(void) = Call[ClassWithDestructor] : func:r2534_3, this:r2534_1 +# 2534| mu2534_5(unknown) = ^CallSideEffect : ~m? +# 2534| mu2534_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2534_1 +# 2536| r2536_1(glval) = VariableAddress[#throw2536:5] : +# 2536| r2536_2(int) = Constant[42] : +# 2536| mu2536_3(int) = Store[#throw2536:5] : &:r2536_1, r2536_2 +# 2536| v2536_4(void) = ThrowValue : &:r2536_1, ~m? +#-----| Exception -> Block 3 + +# 2533| Block 1 +# 2533| v2533_4(void) = AliasedUse : ~m? +# 2533| v2533_5(void) = ExitFunction : + +# 2533| Block 2 +# 2533| v2533_6(void) = Unwind : +#-----| Goto -> Block 1 + +# 2538| Block 3 +# 2538| v2538_1(void) = CatchByType[char] : +#-----| Exception -> Block 2 +#-----| Goto -> Block 4 + +# 2538| Block 4 +# 2538| r2538_2(glval) = VariableAddress[(unnamed parameter 0)] : +# 2538| mu2538_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2538_2 +# 2538| v2538_4(void) = NoOp : +# 2540| r2540_1(glval) = VariableAddress[x] : +# 2540| r2540_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2540| v2540_3(void) = Call[~ClassWithDestructor] : func:r2540_2, this:r2540_1 +# 2540| mu2540_4(unknown) = ^CallSideEffect : ~m? +# 2540| v2540_5(void) = ^IndirectReadSideEffect[-1] : &:r2540_1, ~m? +# 2540| mu2540_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_1 +# 2540| v2540_7(void) = NoOp : +# 2540| r2540_8(glval) = VariableAddress[x] : +# 2540| r2540_9(glval) = FunctionAddress[~ClassWithDestructor] : +# 2540| v2540_10(void) = Call[~ClassWithDestructor] : func:r2540_9, this:r2540_8 +# 2540| mu2540_11(unknown) = ^CallSideEffect : ~m? +# 2540| v2540_12(void) = ^IndirectReadSideEffect[-1] : &:r2540_8, ~m? +# 2540| mu2540_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_8 +# 2533| v2533_7(void) = ReturnVoid : +#-----| Goto -> Block 1 + perf-regression.cpp: # 6| void Big::Big() # 6| Block 0 From 07d51a55fdb1d44359c03070004bc4e6c5154fab Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 6 May 2024 18:49:28 +0100 Subject: [PATCH 081/118] C++: Assign a meaningful definition location to the address of an SSA variable when it's available. --- .../cpp/ir/dataflow/internal/SsaInternals.qll | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll index 924f68ef807..e1512366c70 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll @@ -9,6 +9,7 @@ private import semmle.code.cpp.models.interfaces.PartialFlow as PartialFlow private import semmle.code.cpp.models.interfaces.FunctionInputsAndOutputs as FIO private import semmle.code.cpp.ir.internal.IRCppLanguage private import semmle.code.cpp.ir.dataflow.internal.ModelUtil +private import semmle.code.cpp.ir.implementation.raw.internal.TranslatedInitialization private import DataFlowPrivate import SsaInternalsCommon @@ -329,6 +330,17 @@ private predicate sourceVariableHasBaseAndIndex(SourceVariable v, BaseSourceVari v.getIndirection() = ind } +/** + * Gets the instruction that computes the address that's used to + * initialize `v`. + */ +private Instruction getInitializationTargetAddress(IRVariable v) { + exists(TranslatedVariableInitialization init | + init.getIRVariable() = v and + result = init.getTargetAddress() + ) +} + /** An initial definition of an `IRVariable`'s address. */ private class DefAddressImpl extends DefImpl, TDefAddressImpl { BaseIRVariable v; @@ -347,8 +359,15 @@ private class DefAddressImpl extends DefImpl, TDefAddressImpl { final override Node0Impl getValue() { none() } final override predicate hasIndexInBlock(IRBlock block, int index) { - block = v.getIRVariable().getEnclosingIRFunction().getEntryBlock() and - index = 0 + exists(IRVariable var | var = v.getIRVariable() | + block.getInstruction(index) = getInitializationTargetAddress(var) + or + // If there is no translatated element that does initialization of the + // variable we place the SSA definition at the entry block of the function. + not exists(getInitializationTargetAddress(var)) and + block = var.getEnclosingIRFunction().getEntryBlock() and + index = 0 + ) } override Cpp::Location getLocation() { result = v.getIRVariable().getLocation() } From 53c2d2f1e78cc471c8ae6e8c5f74bc7fc2440811 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 6 May 2024 18:49:41 +0100 Subject: [PATCH 082/118] C++: Accept test changes. --- .../IteratorToExpiredContainer.expected | 2 -- .../CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected index 5bb295dc02a..126f1e8f4f7 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/IteratorToExpiredContainer.expected @@ -1,7 +1,5 @@ | test.cpp:680:30:680:30 | call to operator[] | This object is destroyed at the end of the full-expression. | | test.cpp:683:31:683:32 | call to at | This object is destroyed at the end of the full-expression. | -| test.cpp:689:46:689:58 | pointer to ~vector output argument | This object is destroyed at the end of the full-expression. | | test.cpp:702:27:702:27 | call to operator[] | This object is destroyed at the end of the full-expression. | | test.cpp:727:23:727:23 | call to operator[] | This object is destroyed at the end of the full-expression. | | test.cpp:735:23:735:23 | call to operator[] | This object is destroyed at the end of the full-expression. | -| test.cpp:803:3:803:3 | pointer to ~vector output argument | This object is destroyed at the end of the full-expression. | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp index 0dc97ece06d..bab492796f3 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-416/semmle/tests/IteratorToExpiredContainer/test.cpp @@ -686,7 +686,7 @@ void test() { for (auto x : returnRef()[0]) {} // GOOD for (auto x : returnRef().at(0)) {} // GOOD - for(auto it = returnValue().begin(); it != returnValue().end(); ++it) {} // BAD + for(auto it = returnValue().begin(); it != returnValue().end(); ++it) {} // BAD [NOT DETECTED] { auto v = returnValue(); @@ -800,5 +800,5 @@ void test5(int i) const auto& vvs = returnValue(); for(const auto& vs : vvs) { } ++i; - } // GOOD [FALSE POSITIVE] + } // GOOD } \ No newline at end of file From 5fe3ab789095d4033204574dd31348240f63ea45 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 7 May 2024 10:12:15 +0200 Subject: [PATCH 083/118] Java: Prepare for inline test sharing with C#. --- java/ql/test/TestUtilities/InlineMadTest.qll | 71 +++++++++++--------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/java/ql/test/TestUtilities/InlineMadTest.qll b/java/ql/test/TestUtilities/InlineMadTest.qll index 31206a6338c..a336fa6b3a9 100644 --- a/java/ql/test/TestUtilities/InlineMadTest.qll +++ b/java/ql/test/TestUtilities/InlineMadTest.qll @@ -1,49 +1,60 @@ -import java +import java as J private signature module InlineMadTestLangSig { + /** + * A base class of callables for modeling. + */ + class Callable; + /** * Gets a relevant code comment for `c`, if any. */ string getComment(Callable c); } -signature module InlineMadTestConfigSig { - /** - * Gets the kind of a captured model. - */ - string getKind(); +private module InlineMadTestImpl { + private class Callable = Lang::Callable; - /** - * Gets a captured model for `c`, if any. - */ - string getCapturedModel(Callable c); -} + signature module InlineMadTestConfigSig { + /** + * Gets the kind of a captured model. + */ + string getKind(); -private module InlineMadTestImpl { - private string expects(Callable c) { - Lang::getComment(c).regexpCapture(" *(SPURIOUS-)?" + Input::getKind() + "=(.*)", 2) = result + /** + * Gets a captured model for `c`, if any. + */ + string getCapturedModel(Callable c); } - query predicate unexpectedModel(string msg) { - exists(Callable c, string flow | - flow = Input::getCapturedModel(c) and - not flow = expects(c) and - msg = "Unexpected " + Input::getKind() + " found: " + flow - ) - } + module InlineMadTest { + private string expects(Callable c) { + Lang::getComment(c).regexpCapture(" *(SPURIOUS-)?" + Input::getKind() + "=(.*)", 2) = result + } - query predicate expectedModel(string msg) { - exists(Callable c, string e | - e = expects(c) and - not e = Input::getCapturedModel(c) and - msg = "Expected " + Input::getKind() + " missing: " + e - ) + query predicate unexpectedModel(string msg) { + exists(Callable c, string flow | + flow = Input::getCapturedModel(c) and + not flow = expects(c) and + msg = "Unexpected " + Input::getKind() + " found: " + flow + ) + } + + query predicate expectedModel(string msg) { + exists(Callable c, string e | + e = expects(c) and + not e = Input::getCapturedModel(c) and + msg = "Expected " + Input::getKind() + " missing: " + e + ) + } } } private module InlineMadTestLang implements InlineMadTestLangSig { + class Callable = J::Callable; + string getComment(Callable c) { - exists(Javadoc doc | + exists(J::Javadoc doc | hasJavadoc(c, doc) and isNormalComment(doc) and result = doc.getChild(0).toString() @@ -51,6 +62,4 @@ private module InlineMadTestLang implements InlineMadTestLangSig { } } -module InlineMadTest { - import InlineMadTestImpl -} +import InlineMadTestImpl From 4eea214cb44fba65e8699c6d1df68a0c6b6e4f80 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 3 May 2024 16:47:51 +0200 Subject: [PATCH 084/118] C++: Update test results after extractor changes --- .../library-tests/ir/ir/PrintAST.expected | 16 ++++ .../library-tests/ir/ir/aliased_ir.expected | 76 +++++++++++-------- .../test/library-tests/ir/ir/raw_ir.expected | 60 +++++++++------ 3 files changed, 98 insertions(+), 54 deletions(-) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index cf5125b1ccf..5a462665738 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -12159,8 +12159,12 @@ ir.cpp: # 1109| Type = [IntType] int # 1110| [Destructor] void std::vector::~vector() # 1110| : +# 1110| [Destructor] void std::vector::~vector() +# 1110| : # 1110| [Destructor] void std::vector::~vector() # 1110| : +# 1110| [Destructor] void std::vector::~vector() +# 1110| : # 1110| [Destructor] void std::vector::~vector() # 1110| : # 1115| [ConstMemberFunction] std::vector::iterator std::vector::begin() const @@ -20674,6 +20678,12 @@ ir.cpp: # 2309| getQualifier(): [VariableAccess] s2 # 2309| Type = [Struct] String # 2309| ValueCategory = lvalue +#-----| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +#-----| Type = [VoidType] void +#-----| ValueCategory = prvalue +#-----| getQualifier(): [ReuseExpr] reuse of temporary object +#-----| Type = [ClassTemplateInstantiation,Struct] vector +#-----| ValueCategory = xvalue # 2307| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) # 2307| Type = [ClassTemplateInstantiation,Struct] iterator # 2307| ValueCategory = lvalue @@ -22198,6 +22208,12 @@ ir.cpp: # 2431| Conversion = [IntegralConversion] integral conversion # 2431| Type = [IntType] int # 2431| ValueCategory = prvalue +#-----| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +#-----| Type = [VoidType] void +#-----| ValueCategory = prvalue +#-----| getQualifier(): [ReuseExpr] reuse of temporary object +#-----| Type = [ClassTemplateInstantiation,Struct] vector +#-----| ValueCategory = xvalue # 2430| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) # 2430| Type = [ClassTemplateInstantiation,Struct] iterator # 2430| ValueCategory = lvalue diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index ae73ecd8f6f..3d9766d78b6 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -16810,31 +16810,39 @@ ir.cpp: # 2307| r2307_90(glval>) = CopyValue : r2307_78 #-----| Goto (back edge) -> Block 4 -# 2311| Block 6 -# 2311| r2311_1(glval) = VariableAddress[s] : -# 2311| m2311_2(String) = Uninitialized[s] : &:r2311_1 -# 2311| m2311_3(unknown) = Chi : total:m2307_57, partial:m2311_2 -# 2311| r2311_4(glval) = FunctionAddress[String] : -# 2311| r2311_5(glval) = StringConstant["hello"] : -# 2311| r2311_6(char *) = Convert : r2311_5 -# 2311| v2311_7(void) = Call[String] : func:r2311_4, this:r2311_1, 0:r2311_6 -# 2311| m2311_8(unknown) = ^CallSideEffect : ~m2311_3 -# 2311| m2311_9(unknown) = Chi : total:m2311_3, partial:m2311_8 -# 2311| v2311_10(void) = ^BufferReadSideEffect[0] : &:r2311_6, ~m2301_3 -# 2311| m2311_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 -# 2311| m2311_12(unknown) = Chi : total:m2311_9, partial:m2311_11 -# 2311| r2311_13(glval) = VariableAddress[s2] : -# 2311| m2311_14(String) = Uninitialized[s2] : &:r2311_13 -# 2311| m2311_15(unknown) = Chi : total:m2311_12, partial:m2311_14 -# 2311| r2311_16(glval) = FunctionAddress[String] : -# 2311| r2311_17(glval) = StringConstant["world"] : -# 2311| r2311_18(char *) = Convert : r2311_17 -# 2311| v2311_19(void) = Call[String] : func:r2311_16, this:r2311_13, 0:r2311_18 -# 2311| m2311_20(unknown) = ^CallSideEffect : ~m2311_15 -# 2311| m2311_21(unknown) = Chi : total:m2311_15, partial:m2311_20 -# 2311| v2311_22(void) = ^BufferReadSideEffect[0] : &:r2311_18, ~m2301_3 -# 2311| m2311_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_13 -# 2311| m2311_24(unknown) = Chi : total:m2311_21, partial:m2311_23 +#-----| Block 6 +#-----| r0_18(glval>) = CopyValue : r2307_2 +#-----| r0_19(glval) = FunctionAddress[~vector] : +#-----| v0_20(void) = Call[~vector] : func:r0_19, this:r0_18 +#-----| m0_21(unknown) = ^CallSideEffect : ~m2307_57 +#-----| m0_22(unknown) = Chi : total:m2307_57, partial:m0_21 +#-----| v0_23(void) = ^IndirectReadSideEffect[-1] : &:r0_18, ~m0_22 +#-----| m0_24(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_18 +#-----| m0_25(unknown) = Chi : total:m0_22, partial:m0_24 +# 2311| r2311_1(glval) = VariableAddress[s] : +# 2311| m2311_2(String) = Uninitialized[s] : &:r2311_1 +# 2311| m2311_3(unknown) = Chi : total:m0_25, partial:m2311_2 +# 2311| r2311_4(glval) = FunctionAddress[String] : +# 2311| r2311_5(glval) = StringConstant["hello"] : +# 2311| r2311_6(char *) = Convert : r2311_5 +# 2311| v2311_7(void) = Call[String] : func:r2311_4, this:r2311_1, 0:r2311_6 +# 2311| m2311_8(unknown) = ^CallSideEffect : ~m2311_3 +# 2311| m2311_9(unknown) = Chi : total:m2311_3, partial:m2311_8 +# 2311| v2311_10(void) = ^BufferReadSideEffect[0] : &:r2311_6, ~m2301_3 +# 2311| m2311_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 +# 2311| m2311_12(unknown) = Chi : total:m2311_9, partial:m2311_11 +# 2311| r2311_13(glval) = VariableAddress[s2] : +# 2311| m2311_14(String) = Uninitialized[s2] : &:r2311_13 +# 2311| m2311_15(unknown) = Chi : total:m2311_12, partial:m2311_14 +# 2311| r2311_16(glval) = FunctionAddress[String] : +# 2311| r2311_17(glval) = StringConstant["world"] : +# 2311| r2311_18(char *) = Convert : r2311_17 +# 2311| v2311_19(void) = Call[String] : func:r2311_16, this:r2311_13, 0:r2311_18 +# 2311| m2311_20(unknown) = ^CallSideEffect : ~m2311_15 +# 2311| m2311_21(unknown) = Chi : total:m2311_15, partial:m2311_20 +# 2311| v2311_22(void) = ^BufferReadSideEffect[0] : &:r2311_18, ~m2301_3 +# 2311| m2311_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_13 +# 2311| m2311_24(unknown) = Chi : total:m2311_21, partial:m2311_23 #-----| Goto -> Block 7 # 2311| Block 7 @@ -17673,11 +17681,19 @@ ir.cpp: # 2430| r2430_78(glval>) = CopyValue : r2430_74 #-----| Goto (back edge) -> Block 10 -# 2432| Block 12 -# 2432| v2432_1(void) = NoOp : -# 2410| v2410_5(void) = ReturnVoid : -# 2410| v2410_6(void) = AliasedUse : ~m2430_61 -# 2410| v2410_7(void) = ExitFunction : +#-----| Block 12 +#-----| r0_18(glval>) = CopyValue : r2430_27 +#-----| r0_19(glval) = FunctionAddress[~vector] : +#-----| v0_20(void) = Call[~vector] : func:r0_19, this:r0_18 +#-----| m0_21(unknown) = ^CallSideEffect : ~m2430_63 +#-----| m0_22(unknown) = Chi : total:m2430_63, partial:m0_21 +#-----| v0_23(void) = ^IndirectReadSideEffect[-1] : &:r0_18, ~m0_22 +#-----| m0_24(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_18 +#-----| m0_25(unknown) = Chi : total:m0_22, partial:m0_24 +# 2432| v2432_1(void) = NoOp : +# 2410| v2410_5(void) = ReturnVoid : +# 2410| v2410_6(void) = AliasedUse : ~m0_22 +# 2410| v2410_7(void) = ExitFunction : # 2410| Block 13 # 2410| v2410_8(void) = Unreached : diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 71796c4c39e..b2ea13181a1 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -15353,25 +15353,31 @@ ir.cpp: # 2307| r2307_71(glval>) = CopyValue : r2307_62 #-----| Goto (back edge) -> Block 4 -# 2311| Block 6 -# 2311| r2311_1(glval) = VariableAddress[s] : -# 2311| mu2311_2(String) = Uninitialized[s] : &:r2311_1 -# 2311| r2311_3(glval) = FunctionAddress[String] : -# 2311| r2311_4(glval) = StringConstant["hello"] : -# 2311| r2311_5(char *) = Convert : r2311_4 -# 2311| v2311_6(void) = Call[String] : func:r2311_3, this:r2311_1, 0:r2311_5 -# 2311| mu2311_7(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_8(void) = ^BufferReadSideEffect[0] : &:r2311_5, ~m? -# 2311| mu2311_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 -# 2311| r2311_10(glval) = VariableAddress[s2] : -# 2311| mu2311_11(String) = Uninitialized[s2] : &:r2311_10 -# 2311| r2311_12(glval) = FunctionAddress[String] : -# 2311| r2311_13(glval) = StringConstant["world"] : -# 2311| r2311_14(char *) = Convert : r2311_13 -# 2311| v2311_15(void) = Call[String] : func:r2311_12, this:r2311_10, 0:r2311_14 -# 2311| mu2311_16(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_17(void) = ^BufferReadSideEffect[0] : &:r2311_14, ~m? -# 2311| mu2311_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_10 +#-----| Block 6 +#-----| r0_17(glval>) = CopyValue : r2307_2 +#-----| r0_18(glval) = FunctionAddress[~vector] : +#-----| v0_19(void) = Call[~vector] : func:r0_18, this:r0_17 +#-----| mu0_20(unknown) = ^CallSideEffect : ~m? +#-----| v0_21(void) = ^IndirectReadSideEffect[-1] : &:r0_17, ~m? +#-----| mu0_22(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_17 +# 2311| r2311_1(glval) = VariableAddress[s] : +# 2311| mu2311_2(String) = Uninitialized[s] : &:r2311_1 +# 2311| r2311_3(glval) = FunctionAddress[String] : +# 2311| r2311_4(glval) = StringConstant["hello"] : +# 2311| r2311_5(char *) = Convert : r2311_4 +# 2311| v2311_6(void) = Call[String] : func:r2311_3, this:r2311_1, 0:r2311_5 +# 2311| mu2311_7(unknown) = ^CallSideEffect : ~m? +# 2311| v2311_8(void) = ^BufferReadSideEffect[0] : &:r2311_5, ~m? +# 2311| mu2311_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 +# 2311| r2311_10(glval) = VariableAddress[s2] : +# 2311| mu2311_11(String) = Uninitialized[s2] : &:r2311_10 +# 2311| r2311_12(glval) = FunctionAddress[String] : +# 2311| r2311_13(glval) = StringConstant["world"] : +# 2311| r2311_14(char *) = Convert : r2311_13 +# 2311| v2311_15(void) = Call[String] : func:r2311_12, this:r2311_10, 0:r2311_14 +# 2311| mu2311_16(unknown) = ^CallSideEffect : ~m? +# 2311| v2311_17(void) = ^BufferReadSideEffect[0] : &:r2311_14, ~m? +# 2311| mu2311_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_10 #-----| Goto -> Block 7 # 2311| Block 7 @@ -16082,11 +16088,17 @@ ir.cpp: # 2430| r2430_63(glval>) = CopyValue : r2430_60 #-----| Goto (back edge) -> Block 11 -# 2432| Block 13 -# 2432| v2432_1(void) = NoOp : -# 2410| v2410_4(void) = ReturnVoid : -# 2410| v2410_5(void) = AliasedUse : ~m? -# 2410| v2410_6(void) = ExitFunction : +#-----| Block 13 +#-----| r0_17(glval>) = CopyValue : r2430_21 +#-----| r0_18(glval) = FunctionAddress[~vector] : +#-----| v0_19(void) = Call[~vector] : func:r0_18, this:r0_17 +#-----| mu0_20(unknown) = ^CallSideEffect : ~m? +#-----| v0_21(void) = ^IndirectReadSideEffect[-1] : &:r0_17, ~m? +#-----| mu0_22(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_17 +# 2432| v2432_1(void) = NoOp : +# 2410| v2410_4(void) = ReturnVoid : +# 2410| v2410_5(void) = AliasedUse : ~m? +# 2410| v2410_6(void) = ExitFunction : # 2434| void param_with_destructor_by_value(ClassWithDestructor) # 2434| Block 0 From 9f27eb3eda992d7f74b56bea19f29099eda93184 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 7 May 2024 12:44:28 +0200 Subject: [PATCH 085/118] Bazel: make `git_lfs_probe.py` compatible with python 3.8 --- misc/bazel/internal/git_lfs_probe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/bazel/internal/git_lfs_probe.py b/misc/bazel/internal/git_lfs_probe.py index f0a4dfd4117..018725c82da 100755 --- a/misc/bazel/internal/git_lfs_probe.py +++ b/misc/bazel/internal/git_lfs_probe.py @@ -18,14 +18,15 @@ from urllib.parse import urlparse import re import base64 from dataclasses import dataclass +from typing import Dict @dataclass class Endpoint: href: str - headers: dict[str, str] + headers: Dict[str, str] - def update_headers(self, d: dict[str, str]): + def update_headers(self, d: Dict[str, str]): self.headers.update((k.capitalize(), v) for k, v in d.items()) From 61fb89721ad4736a66d81575179edf06432a2861 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 7 May 2024 12:19:06 +0100 Subject: [PATCH 086/118] C++: Add 'cpp/uninitialized-local' FP. --- .../semmle/tests/UninitializedLocal.expected | 2 ++ .../CWE/CWE-457/semmle/tests/test.cpp | 23 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected index d27b2c996b3..94d01d0e6c1 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected @@ -13,6 +13,7 @@ nodes | test.cpp:458:6:458:6 | definition of x | semmle.label | definition of x | | test.cpp:464:6:464:6 | definition of x | semmle.label | definition of x | | test.cpp:471:6:471:6 | definition of x | semmle.label | definition of x | +| test.cpp:557:15:557:15 | definition of r | semmle.label | definition of r | #select | test.cpp:12:6:12:8 | foo | test.cpp:11:6:11:8 | definition of foo | test.cpp:11:6:11:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:11:6:11:8 | foo | foo | | test.cpp:113:6:113:8 | foo | test.cpp:111:6:111:8 | definition of foo | test.cpp:111:6:111:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:111:6:111:8 | foo | foo | @@ -27,3 +28,4 @@ nodes | test.cpp:460:7:460:7 | x | test.cpp:458:6:458:6 | definition of x | test.cpp:458:6:458:6 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:458:6:458:6 | x | x | | test.cpp:467:2:467:2 | x | test.cpp:464:6:464:6 | definition of x | test.cpp:464:6:464:6 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:464:6:464:6 | x | x | | test.cpp:474:7:474:7 | x | test.cpp:471:6:471:6 | definition of x | test.cpp:471:6:471:6 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:471:6:471:6 | x | x | +| test.cpp:567:7:567:7 | r | test.cpp:557:15:557:15 | definition of r | test.cpp:557:15:557:15 | definition of r | The variable $@ may not be initialized at this access. | test.cpp:557:15:557:15 | r | r | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/test.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/test.cpp index e3489cee4cc..4f56ab1259a 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/test.cpp +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/test.cpp @@ -1,6 +1,6 @@ // Semmle test cases for rule CWE-457. -void use(int data); +void use(...); void test1() { int foo = 1; @@ -544,4 +544,25 @@ class StaticMethodClass{ int static_method_false_positive(){ StaticMethodClass *t; int i = t->get(); // GOOD: the `get` method is static and this is equivalent to StaticMethodClass::get() +} + +struct LinkedList +{ + LinkedList* next; +}; + +bool getBool(); + +void test45() { + LinkedList *r, *s, **rP = &r; + + while(getBool()) + { + s = new LinkedList; + *rP = s; + rP = &s->next; + } + + *rP = NULL; + use(r); // GOOD [FALSE POSITIVE] } \ No newline at end of file From 8e95395382db40ce700ef582998bff933167be9d Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 7 May 2024 12:55:42 +0100 Subject: [PATCH 087/118] C++: Accept more test changes. --- .../CWE/CWE-457/semmle/tests/LoopConditionsConst.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/LoopConditionsConst.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/LoopConditionsConst.expected index 01dbbaa2e65..07ca32b1718 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/LoopConditionsConst.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/LoopConditionsConst.expected @@ -22,3 +22,4 @@ | test.cpp:416:2:418:2 | for(...;...;...) ... | test.cpp:416:18:416:23 | ... < ... | 1 | i | { ... } | i | return ... | | test.cpp:424:2:425:2 | for(...;...;...) ... | test.cpp:424:18:424:23 | ... < ... | 1 | i | { ... } | i | return ... | | test.cpp:433:2:434:2 | for(...;...;...) ... | test.cpp:433:18:433:22 | 0 | 0 | | { ... } | 0 | return ... | +| test.cpp:559:3:564:3 | while (...) ... | test.cpp:559:9:559:15 | call to getBool | | call to getBool | { ... } | call to getBool | ExprStmt | From c529988b43165520cc861dcc44ec0bab0c21ccbe Mon Sep 17 00:00:00 2001 From: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Date: Tue, 7 May 2024 13:09:08 +0100 Subject: [PATCH 088/118] Update README.md Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a0fad907f9..99433b8ca49 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This open source repository contains the standard CodeQL libraries and queries t ## How do I learn CodeQL and run queries? -There is [extensive documentation](https://codeql.github.com/docs/) on getting started with writing CodeQL using the [CodeQL extension for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/) and the [CodeQL CLI](https://docs.github.com/en/code-security/codeql-cli). +There is extensive documentation about the [CodeQL language](https://codeql.github.com/docs/), writing CodeQL using the [CodeQL extension for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/) and using the [CodeQL CLI](https://docs.github.com/en/code-security/codeql-cli). ## Contributing From c11fac81fd5dcc9b14ff42adff823f58ce3f2e83 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 7 May 2024 13:55:42 +0100 Subject: [PATCH 089/118] Make summaryThroughStepValue include param outputs This matches summaryThroughStepTaint. --- .../dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll index 89a2a23d53b..78950806f7d 100644 --- a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll @@ -1286,10 +1286,8 @@ module Make< * be useful to include in the exposed local data-flow/taint-tracking relations. */ predicate summaryThroughStepValue(ArgNode arg, Node out, SummarizedCallable sc) { - exists(ReturnKind rk, SummaryNode ret, DataFlowCall call | - summaryLocalStep(summaryArgParam(call, arg, sc), ret, true, _) and - summaryReturnNode(ret, pragma[only_bind_into](rk)) and - out = getAnOutNode(call, pragma[only_bind_into](rk)) + exists(SummaryNode ret | + summaryLocalStep(summaryArgParamRetOut(arg, ret, out, sc), ret, true, _) ) } From aab43afd8129d64db21507ea04970a9e38900e62 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 7 May 2024 15:36:48 +0100 Subject: [PATCH 090/118] Swift: accept test changes --- .../ql/test/library-tests/dataflow/dataflow/LocalFlow.expected | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected b/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected index 5a1e142d945..4456b1a4ac2 100644 --- a/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected +++ b/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected @@ -794,8 +794,10 @@ | test.swift:680:10:680:11 | &... | test.swift:681:15:681:15 | x | | test.swift:680:11:680:11 | [post] x | test.swift:680:10:680:11 | &... | | test.swift:680:11:680:11 | x | test.swift:680:10:680:11 | &... | +| test.swift:680:11:680:11 | x | test.swift:680:15:680:15 | [post] y | | test.swift:680:14:680:15 | &... | test.swift:682:15:682:15 | y | | test.swift:680:15:680:15 | [post] y | test.swift:680:14:680:15 | &... | +| test.swift:680:15:680:15 | y | test.swift:680:11:680:11 | [post] x | | test.swift:680:15:680:15 | y | test.swift:680:14:680:15 | &... | | test.swift:686:9:686:9 | SSA def(arr1) | test.swift:687:15:687:15 | arr1 | | test.swift:686:9:686:9 | arr1 | test.swift:686:9:686:9 | SSA def(arr1) | From dd95a2ababa2a76c69332fc4cc7d630ba6ef66bd Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 7 May 2024 16:35:11 +0100 Subject: [PATCH 091/118] C++: Move qhelp. --- cpp/ql/src/Critical/DoubleFree.qhelp | 2 +- cpp/ql/src/Critical/{DoubleFree.cpp => DoubleFreeBad.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename cpp/ql/src/Critical/{DoubleFree.cpp => DoubleFreeBad.cpp} (100%) diff --git a/cpp/ql/src/Critical/DoubleFree.qhelp b/cpp/ql/src/Critical/DoubleFree.qhelp index 0b38858eae4..3e086de98dd 100644 --- a/cpp/ql/src/Critical/DoubleFree.qhelp +++ b/cpp/ql/src/Critical/DoubleFree.qhelp @@ -20,7 +20,7 @@ most deallocation functions will perform a null-pointer check before attempting

    - + diff --git a/cpp/ql/src/Critical/DoubleFree.cpp b/cpp/ql/src/Critical/DoubleFreeBad.cpp similarity index 100% rename from cpp/ql/src/Critical/DoubleFree.cpp rename to cpp/ql/src/Critical/DoubleFreeBad.cpp From 575b66a05414398c411918572611b8ba33480926 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 7 May 2024 16:49:37 +0100 Subject: [PATCH 092/118] C++: Clarify the recommendation and example. --- cpp/ql/src/Critical/DoubleFree.qhelp | 18 ++++++++++++++---- cpp/ql/src/Critical/DoubleFreeGood.cpp | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 cpp/ql/src/Critical/DoubleFreeGood.cpp diff --git a/cpp/ql/src/Critical/DoubleFree.qhelp b/cpp/ql/src/Critical/DoubleFree.qhelp index 3e086de98dd..08beb13f49a 100644 --- a/cpp/ql/src/Critical/DoubleFree.qhelp +++ b/cpp/ql/src/Critical/DoubleFree.qhelp @@ -14,13 +14,23 @@ the program, or security vulnerabilities, by allowing an attacker to overwrite a

    -Ensure that all execution paths deallocate the allocated memory at most once. If possible, reassign -the pointer to a null value after deallocating it. This will prevent double-free vulnerabilities since -most deallocation functions will perform a null-pointer check before attempting to deallocate the memory. +Ensure that all execution paths deallocate the allocated memory at most once. In complex cases it may +help to reassign a pointer to a null value after deallocating it. This will prevent double-free vulnerabilities +since most deallocation functions will perform a null-pointer check before attempting to deallocate memory.

    - + +

    +In the following example, buff is allocated and then freed twice: +

    + +

    +Reviewing the code above, the issue can be fixed by simply deleting the additonal call to +free(buff). Another buffer new_buffer is allocated, but we can see the intent was +not to free new_buffer as this pointer is returned by the function. +

    +
    diff --git a/cpp/ql/src/Critical/DoubleFreeGood.cpp b/cpp/ql/src/Critical/DoubleFreeGood.cpp new file mode 100644 index 00000000000..024c7aea493 --- /dev/null +++ b/cpp/ql/src/Critical/DoubleFreeGood.cpp @@ -0,0 +1,7 @@ +int* f() { + int *buff = malloc(SIZE*sizeof(int)); + do_stuff(buff); + free(buff); // GOOD: buff is only freed once. + int *new_buffer = malloc(SIZE*sizeof(int)); + return new_buffer; +} From 336c7de643012a9fce5088ff5624267099a46739 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Tue, 7 May 2024 22:58:49 +0200 Subject: [PATCH 093/118] updates based on review --- cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp | 2 +- .../src/Security/CWE/CWE-022/examples/TaintedPathFolder.c | 6 ++++-- .../Security/CWE/CWE-022/examples/TaintedPathNormalize.c | 6 +----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp b/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp index 3b89b4a763e..4d6238ac335 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp +++ b/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp @@ -62,7 +62,7 @@ is still contained within that directory. OWASP:
    Path Traversal. -
  • Rails: ActiveStorage::Filename#sanitized.
  • +
  • Linux man pages: realpath(3).
  • diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c index 1461616f5dc..e1dc3dafcd7 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c @@ -5,22 +5,24 @@ int main(int argc, char** argv) { char *userAndFile = argv[2]; char baseDir[PATH_MAX] = "/home/user/public/"; char fullPath[PATH_MAX]; - char resolvedPath[PATH_MAX]; // Attempt to concatenate the base directory and the user-supplied path snprintf(fullPath, sizeof(fullPath), "%s%s", baseDir, userAndFile); // Resolve the absolute path, normalizing any ".." or "." - if (realpath(fullPath, resolvedPath) == NULL) { + char *resolvedPath = realpath(fullPath, NULL); + if (resolvedPath == NULL) { perror("Error resolving path"); return 1; } // Check if the resolved path starts with the base directory if (strncmp(baseDir, resolvedPath, strlen(baseDir)) != 0) { + free(resolvedPath); return 1; } // GOOD: Path is within the intended directory FILE *file = fopen(resolvedPath, "wb+"); + free(resolvedPath); } \ No newline at end of file diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c index f46e6d30a41..d891155a8e2 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c @@ -10,9 +10,5 @@ int main(int argc, char** argv) { return 1; } - char fileBuffer[FILENAME_MAX] = "/home/user/files/"; - // Ensure buffer overflow is prevented - strncat(fileBuffer, userAndFile, FILENAME_MAX - strlen(fileBuffer) - 1); - // GOOD: We know that the filename is safe and stays within the public folder - FILE *file = fopen(fileBuffer, "wb+"); + // use `userAndFile` as a safe filename } \ No newline at end of file From 61580da14d608f4a26a2ed19e25eefcafd3aea4d Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 7 May 2024 21:21:25 +0200 Subject: [PATCH 094/118] C++: Update test results after extractor changes --- .../library-tests/ir/ir/PrintAST.expected | 24 ++--- .../library-tests/ir/ir/aliased_ir.expected | 92 +++++++++---------- .../test/library-tests/ir/ir/raw_ir.expected | 72 +++++++-------- 3 files changed, 94 insertions(+), 94 deletions(-) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index eb1b3eeb2a2..ea5b9fec825 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -20678,12 +20678,12 @@ ir.cpp: # 2309| getQualifier(): [VariableAccess] s2 # 2309| Type = [Struct] String # 2309| ValueCategory = lvalue -#-----| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -#-----| Type = [VoidType] void -#-----| ValueCategory = prvalue -#-----| getQualifier(): [ReuseExpr] reuse of temporary object -#-----| Type = [ClassTemplateInstantiation,Struct] vector -#-----| ValueCategory = xvalue +# 2307| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2307| Type = [VoidType] void +# 2307| ValueCategory = prvalue +# 2307| getQualifier(): [ReuseExpr] reuse of temporary object +# 2307| Type = [ClassTemplateInstantiation,Struct] vector +# 2307| ValueCategory = xvalue # 2307| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) # 2307| Type = [ClassTemplateInstantiation,Struct] iterator # 2307| ValueCategory = lvalue @@ -22208,12 +22208,12 @@ ir.cpp: # 2431| Conversion = [IntegralConversion] integral conversion # 2431| Type = [IntType] int # 2431| ValueCategory = prvalue -#-----| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -#-----| Type = [VoidType] void -#-----| ValueCategory = prvalue -#-----| getQualifier(): [ReuseExpr] reuse of temporary object -#-----| Type = [ClassTemplateInstantiation,Struct] vector -#-----| ValueCategory = xvalue +# 2430| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2430| Type = [VoidType] void +# 2430| ValueCategory = prvalue +# 2430| getQualifier(): [ReuseExpr] reuse of temporary object +# 2430| Type = [ClassTemplateInstantiation,Struct] vector +# 2430| ValueCategory = xvalue # 2430| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) # 2430| Type = [ClassTemplateInstantiation,Struct] iterator # 2430| ValueCategory = lvalue diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index 862e921dde9..1fe18e4f92a 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -16810,39 +16810,39 @@ ir.cpp: # 2307| r2307_90(glval>) = CopyValue : r2307_78 #-----| Goto (back edge) -> Block 4 -#-----| Block 6 -#-----| r0_18(glval>) = CopyValue : r2307_2 -#-----| r0_19(glval) = FunctionAddress[~vector] : -#-----| v0_20(void) = Call[~vector] : func:r0_19, this:r0_18 -#-----| m0_21(unknown) = ^CallSideEffect : ~m2307_57 -#-----| m0_22(unknown) = Chi : total:m2307_57, partial:m0_21 -#-----| v0_23(void) = ^IndirectReadSideEffect[-1] : &:r0_18, ~m0_22 -#-----| m0_24(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_18 -#-----| m0_25(unknown) = Chi : total:m0_22, partial:m0_24 -# 2311| r2311_1(glval) = VariableAddress[s] : -# 2311| m2311_2(String) = Uninitialized[s] : &:r2311_1 -# 2311| m2311_3(unknown) = Chi : total:m0_25, partial:m2311_2 -# 2311| r2311_4(glval) = FunctionAddress[String] : -# 2311| r2311_5(glval) = StringConstant["hello"] : -# 2311| r2311_6(char *) = Convert : r2311_5 -# 2311| v2311_7(void) = Call[String] : func:r2311_4, this:r2311_1, 0:r2311_6 -# 2311| m2311_8(unknown) = ^CallSideEffect : ~m2311_3 -# 2311| m2311_9(unknown) = Chi : total:m2311_3, partial:m2311_8 -# 2311| v2311_10(void) = ^BufferReadSideEffect[0] : &:r2311_6, ~m2301_3 -# 2311| m2311_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 -# 2311| m2311_12(unknown) = Chi : total:m2311_9, partial:m2311_11 -# 2311| r2311_13(glval) = VariableAddress[s2] : -# 2311| m2311_14(String) = Uninitialized[s2] : &:r2311_13 -# 2311| m2311_15(unknown) = Chi : total:m2311_12, partial:m2311_14 -# 2311| r2311_16(glval) = FunctionAddress[String] : -# 2311| r2311_17(glval) = StringConstant["world"] : -# 2311| r2311_18(char *) = Convert : r2311_17 -# 2311| v2311_19(void) = Call[String] : func:r2311_16, this:r2311_13, 0:r2311_18 -# 2311| m2311_20(unknown) = ^CallSideEffect : ~m2311_15 -# 2311| m2311_21(unknown) = Chi : total:m2311_15, partial:m2311_20 -# 2311| v2311_22(void) = ^BufferReadSideEffect[0] : &:r2311_18, ~m2301_3 -# 2311| m2311_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_13 -# 2311| m2311_24(unknown) = Chi : total:m2311_21, partial:m2311_23 +# 2307| Block 6 +# 2307| r2307_91(glval>) = CopyValue : r2307_2 +# 2307| r2307_92(glval) = FunctionAddress[~vector] : +# 2307| v2307_93(void) = Call[~vector] : func:r2307_92, this:r2307_91 +# 2307| m2307_94(unknown) = ^CallSideEffect : ~m2307_57 +# 2307| m2307_95(unknown) = Chi : total:m2307_57, partial:m2307_94 +# 2307| v2307_96(void) = ^IndirectReadSideEffect[-1] : &:r2307_91, ~m2307_95 +# 2307| m2307_97(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2307_91 +# 2307| m2307_98(unknown) = Chi : total:m2307_95, partial:m2307_97 +# 2311| r2311_1(glval) = VariableAddress[s] : +# 2311| m2311_2(String) = Uninitialized[s] : &:r2311_1 +# 2311| m2311_3(unknown) = Chi : total:m2307_98, partial:m2311_2 +# 2311| r2311_4(glval) = FunctionAddress[String] : +# 2311| r2311_5(glval) = StringConstant["hello"] : +# 2311| r2311_6(char *) = Convert : r2311_5 +# 2311| v2311_7(void) = Call[String] : func:r2311_4, this:r2311_1, 0:r2311_6 +# 2311| m2311_8(unknown) = ^CallSideEffect : ~m2311_3 +# 2311| m2311_9(unknown) = Chi : total:m2311_3, partial:m2311_8 +# 2311| v2311_10(void) = ^BufferReadSideEffect[0] : &:r2311_6, ~m2301_3 +# 2311| m2311_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 +# 2311| m2311_12(unknown) = Chi : total:m2311_9, partial:m2311_11 +# 2311| r2311_13(glval) = VariableAddress[s2] : +# 2311| m2311_14(String) = Uninitialized[s2] : &:r2311_13 +# 2311| m2311_15(unknown) = Chi : total:m2311_12, partial:m2311_14 +# 2311| r2311_16(glval) = FunctionAddress[String] : +# 2311| r2311_17(glval) = StringConstant["world"] : +# 2311| r2311_18(char *) = Convert : r2311_17 +# 2311| v2311_19(void) = Call[String] : func:r2311_16, this:r2311_13, 0:r2311_18 +# 2311| m2311_20(unknown) = ^CallSideEffect : ~m2311_15 +# 2311| m2311_21(unknown) = Chi : total:m2311_15, partial:m2311_20 +# 2311| v2311_22(void) = ^BufferReadSideEffect[0] : &:r2311_18, ~m2301_3 +# 2311| m2311_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_13 +# 2311| m2311_24(unknown) = Chi : total:m2311_21, partial:m2311_23 #-----| Goto -> Block 7 # 2311| Block 7 @@ -17681,19 +17681,19 @@ ir.cpp: # 2430| r2430_78(glval>) = CopyValue : r2430_74 #-----| Goto (back edge) -> Block 10 -#-----| Block 12 -#-----| r0_18(glval>) = CopyValue : r2430_27 -#-----| r0_19(glval) = FunctionAddress[~vector] : -#-----| v0_20(void) = Call[~vector] : func:r0_19, this:r0_18 -#-----| m0_21(unknown) = ^CallSideEffect : ~m2430_63 -#-----| m0_22(unknown) = Chi : total:m2430_63, partial:m0_21 -#-----| v0_23(void) = ^IndirectReadSideEffect[-1] : &:r0_18, ~m0_22 -#-----| m0_24(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_18 -#-----| m0_25(unknown) = Chi : total:m0_22, partial:m0_24 -# 2432| v2432_1(void) = NoOp : -# 2410| v2410_5(void) = ReturnVoid : -# 2410| v2410_6(void) = AliasedUse : ~m0_22 -# 2410| v2410_7(void) = ExitFunction : +# 2430| Block 12 +# 2430| r2430_79(glval>) = CopyValue : r2430_27 +# 2430| r2430_80(glval) = FunctionAddress[~vector] : +# 2430| v2430_81(void) = Call[~vector] : func:r2430_80, this:r2430_79 +# 2430| m2430_82(unknown) = ^CallSideEffect : ~m2430_63 +# 2430| m2430_83(unknown) = Chi : total:m2430_63, partial:m2430_82 +# 2430| v2430_84(void) = ^IndirectReadSideEffect[-1] : &:r2430_79, ~m2430_83 +# 2430| m2430_85(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2430_79 +# 2430| m2430_86(unknown) = Chi : total:m2430_83, partial:m2430_85 +# 2432| v2432_1(void) = NoOp : +# 2410| v2410_5(void) = ReturnVoid : +# 2410| v2410_6(void) = AliasedUse : ~m2430_83 +# 2410| v2410_7(void) = ExitFunction : # 2410| Block 13 # 2410| v2410_8(void) = Unreached : diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 498b845dd8d..404d48758b8 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -15353,31 +15353,31 @@ ir.cpp: # 2307| r2307_71(glval>) = CopyValue : r2307_62 #-----| Goto (back edge) -> Block 4 -#-----| Block 6 -#-----| r0_17(glval>) = CopyValue : r2307_2 -#-----| r0_18(glval) = FunctionAddress[~vector] : -#-----| v0_19(void) = Call[~vector] : func:r0_18, this:r0_17 -#-----| mu0_20(unknown) = ^CallSideEffect : ~m? -#-----| v0_21(void) = ^IndirectReadSideEffect[-1] : &:r0_17, ~m? -#-----| mu0_22(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_17 -# 2311| r2311_1(glval) = VariableAddress[s] : -# 2311| mu2311_2(String) = Uninitialized[s] : &:r2311_1 -# 2311| r2311_3(glval) = FunctionAddress[String] : -# 2311| r2311_4(glval) = StringConstant["hello"] : -# 2311| r2311_5(char *) = Convert : r2311_4 -# 2311| v2311_6(void) = Call[String] : func:r2311_3, this:r2311_1, 0:r2311_5 -# 2311| mu2311_7(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_8(void) = ^BufferReadSideEffect[0] : &:r2311_5, ~m? -# 2311| mu2311_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 -# 2311| r2311_10(glval) = VariableAddress[s2] : -# 2311| mu2311_11(String) = Uninitialized[s2] : &:r2311_10 -# 2311| r2311_12(glval) = FunctionAddress[String] : -# 2311| r2311_13(glval) = StringConstant["world"] : -# 2311| r2311_14(char *) = Convert : r2311_13 -# 2311| v2311_15(void) = Call[String] : func:r2311_12, this:r2311_10, 0:r2311_14 -# 2311| mu2311_16(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_17(void) = ^BufferReadSideEffect[0] : &:r2311_14, ~m? -# 2311| mu2311_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_10 +# 2307| Block 6 +# 2307| r2307_72(glval>) = CopyValue : r2307_2 +# 2307| r2307_73(glval) = FunctionAddress[~vector] : +# 2307| v2307_74(void) = Call[~vector] : func:r2307_73, this:r2307_72 +# 2307| mu2307_75(unknown) = ^CallSideEffect : ~m? +# 2307| v2307_76(void) = ^IndirectReadSideEffect[-1] : &:r2307_72, ~m? +# 2307| mu2307_77(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2307_72 +# 2311| r2311_1(glval) = VariableAddress[s] : +# 2311| mu2311_2(String) = Uninitialized[s] : &:r2311_1 +# 2311| r2311_3(glval) = FunctionAddress[String] : +# 2311| r2311_4(glval) = StringConstant["hello"] : +# 2311| r2311_5(char *) = Convert : r2311_4 +# 2311| v2311_6(void) = Call[String] : func:r2311_3, this:r2311_1, 0:r2311_5 +# 2311| mu2311_7(unknown) = ^CallSideEffect : ~m? +# 2311| v2311_8(void) = ^BufferReadSideEffect[0] : &:r2311_5, ~m? +# 2311| mu2311_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 +# 2311| r2311_10(glval) = VariableAddress[s2] : +# 2311| mu2311_11(String) = Uninitialized[s2] : &:r2311_10 +# 2311| r2311_12(glval) = FunctionAddress[String] : +# 2311| r2311_13(glval) = StringConstant["world"] : +# 2311| r2311_14(char *) = Convert : r2311_13 +# 2311| v2311_15(void) = Call[String] : func:r2311_12, this:r2311_10, 0:r2311_14 +# 2311| mu2311_16(unknown) = ^CallSideEffect : ~m? +# 2311| v2311_17(void) = ^BufferReadSideEffect[0] : &:r2311_14, ~m? +# 2311| mu2311_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_10 #-----| Goto -> Block 7 # 2311| Block 7 @@ -16088,17 +16088,17 @@ ir.cpp: # 2430| r2430_63(glval>) = CopyValue : r2430_60 #-----| Goto (back edge) -> Block 11 -#-----| Block 13 -#-----| r0_17(glval>) = CopyValue : r2430_21 -#-----| r0_18(glval) = FunctionAddress[~vector] : -#-----| v0_19(void) = Call[~vector] : func:r0_18, this:r0_17 -#-----| mu0_20(unknown) = ^CallSideEffect : ~m? -#-----| v0_21(void) = ^IndirectReadSideEffect[-1] : &:r0_17, ~m? -#-----| mu0_22(vector) = ^IndirectMayWriteSideEffect[-1] : &:r0_17 -# 2432| v2432_1(void) = NoOp : -# 2410| v2410_4(void) = ReturnVoid : -# 2410| v2410_5(void) = AliasedUse : ~m? -# 2410| v2410_6(void) = ExitFunction : +# 2430| Block 13 +# 2430| r2430_64(glval>) = CopyValue : r2430_21 +# 2430| r2430_65(glval) = FunctionAddress[~vector] : +# 2430| v2430_66(void) = Call[~vector] : func:r2430_65, this:r2430_64 +# 2430| mu2430_67(unknown) = ^CallSideEffect : ~m? +# 2430| v2430_68(void) = ^IndirectReadSideEffect[-1] : &:r2430_64, ~m? +# 2430| mu2430_69(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2430_64 +# 2432| v2432_1(void) = NoOp : +# 2410| v2410_4(void) = ReturnVoid : +# 2410| v2410_5(void) = AliasedUse : ~m? +# 2410| v2410_6(void) = ExitFunction : # 2434| void param_with_destructor_by_value(ClassWithDestructor) # 2434| Block 0 From 65645821be8f5bc3dc76d6ba2916869a871f1808 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 8 May 2024 10:00:48 +0100 Subject: [PATCH 095/118] C++: Remove the 'BaseSourceVariableInstruction' column as it's functionally determined by the address column. --- .../cpp/ir/dataflow/internal/SsaInternals.qll | 92 ++++++++----------- 1 file changed, 37 insertions(+), 55 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll index e1512366c70..30511ba1285 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll @@ -105,8 +105,8 @@ predicate hasRawIndirectInstruction(Instruction instr, int indirectionIndex) { cached private newtype TDefImpl = TDefAddressImpl(BaseIRVariable v) or - TDirectDefImpl(BaseSourceVariableInstruction base, Operand address, int indirectionIndex) { - isDef(_, _, address, base, _, indirectionIndex) + TDirectDefImpl(Operand address, int indirectionIndex) { + isDef(_, _, address, _, _, indirectionIndex) } or TGlobalDefImpl(GlobalLikeVariable v, IRFunction f, int indirectionIndex) { // Represents the initial "definition" of a global variable when entering @@ -116,8 +116,8 @@ private newtype TDefImpl = cached private newtype TUseImpl = - TDirectUseImpl(BaseSourceVariableInstruction base, Operand operand, int indirectionIndex) { - isUse(_, operand, base, _, indirectionIndex) and + TDirectUseImpl(Operand operand, int indirectionIndex) { + isUse(_, operand, _, _, indirectionIndex) and not isDef(true, _, operand, _, _, _) } or TGlobalUse(GlobalLikeVariable v, IRFunction f, int indirectionIndex) { @@ -211,19 +211,11 @@ abstract class DefImpl extends TDefImpl { */ abstract int getIndirection(); - /** - * Gets the instruction that computes the base of this definition or use. - * This is always a `VariableAddressInstruction` or an `CallInstruction`. - */ - abstract BaseSourceVariableInstruction getBase(); - /** * Gets the base source variable (i.e., the variable without * any indirection) of this definition or use. */ - final BaseSourceVariable getBaseSourceVariable() { - this.getBase().getBaseSourceVariable() = result - } + abstract BaseSourceVariable getBaseSourceVariable(); /** Gets the variable that is defined or used. */ SourceVariable getSourceVariable() { @@ -283,19 +275,11 @@ abstract class UseImpl extends TUseImpl { /** Gets the indirection index of this use. */ final int getIndirectionIndex() { result = indirectionIndex } - /** - * Gets the instruction that computes the base of this definition or use. - * This is always a `VariableAddressInstruction` or an `CallInstruction`. - */ - abstract BaseSourceVariableInstruction getBase(); - /** * Gets the base source variable (i.e., the variable without * any indirection) of this definition or use. */ - final BaseSourceVariable getBaseSourceVariable() { - this.getBase().getBaseSourceVariable() = result - } + abstract BaseSourceVariable getBaseSourceVariable(); /** Gets the variable that is defined or used. */ SourceVariable getSourceVariable() { @@ -377,14 +361,13 @@ private class DefAddressImpl extends DefImpl, TDefAddressImpl { result.getIndirection() = 0 } - final override BaseSourceVariableInstruction getBase() { none() } + final override BaseSourceVariable getBaseSourceVariable() { result = v } } private class DirectDef extends DefImpl, TDirectDefImpl { Operand address; - BaseSourceVariableInstruction base; - DirectDef() { this = TDirectDefImpl(base, address, indirectionIndex) } + DirectDef() { this = TDirectDefImpl(address, indirectionIndex) } override Cpp::Location getLocation() { result = this.getAddressOperand().getUse().getLocation() } @@ -396,30 +379,36 @@ private class DirectDef extends DefImpl, TDirectDefImpl { override Operand getAddressOperand() { result = address } - override BaseSourceVariableInstruction getBase() { result = base } + private BaseSourceVariableInstruction getBase() { + isDef(_, _, address, result, _, indirectionIndex) + } - override int getIndirection() { isDef(_, _, address, base, result, indirectionIndex) } + override BaseSourceVariable getBaseSourceVariable() { + result = this.getBase().getBaseSourceVariable() + } - override Node0Impl getValue() { isDef(_, result, address, base, _, _) } + override int getIndirection() { isDef(_, _, address, _, result, indirectionIndex) } - override predicate isCertain() { isDef(true, _, address, base, _, indirectionIndex) } + override Node0Impl getValue() { isDef(_, result, address, _, _, _) } + + override predicate isCertain() { isDef(true, _, address, _, _, indirectionIndex) } } private class DirectUseImpl extends UseImpl, TDirectUseImpl { Operand operand; - BaseSourceVariableInstruction base; - DirectUseImpl() { this = TDirectUseImpl(base, operand, indirectionIndex) } + DirectUseImpl() { this = TDirectUseImpl(operand, indirectionIndex) } override string toString() { result = "Use of " + this.getSourceVariable() } final override predicate hasIndexInBlock(IRBlock block, int index) { // See the comment in `ssa0`'s `OperandBasedUse` for an explanation of this // predicate's implementation. - if base.getAst() = any(Cpp::PostfixCrementOperation c).getOperand() + if this.getBase().getAst() = any(Cpp::PostfixCrementOperation c).getOperand() then - exists(Operand op, int indirection | + exists(Operand op, int indirection, Instruction base | indirection = this.getIndirection() and + base = this.getBase() and op = min(Operand cand, int i | isUse(_, cand, base, indirection, indirectionIndex) and @@ -432,15 +421,19 @@ private class DirectUseImpl extends UseImpl, TDirectUseImpl { else operand.getUse() = block.getInstruction(index) } - final override BaseSourceVariableInstruction getBase() { result = base } + private BaseSourceVariableInstruction getBase() { isUse(_, operand, result, _, indirectionIndex) } + + override BaseSourceVariable getBaseSourceVariable() { + result = this.getBase().getBaseSourceVariable() + } final Operand getOperand() { result = operand } final override Cpp::Location getLocation() { result = operand.getLocation() } - override int getIndirection() { isUse(_, operand, base, result, indirectionIndex) } + override int getIndirection() { isUse(_, operand, _, result, indirectionIndex) } - override predicate isCertain() { isUse(true, operand, base, _, indirectionIndex) } + override predicate isCertain() { isUse(true, operand, _, _, indirectionIndex) } override Node getNode() { nodeHasOperand(result, operand, indirectionIndex) } } @@ -499,13 +492,7 @@ class FinalParameterUse extends UseImpl, TFinalParameterUse { result instanceof UnknownDefaultLocation } - override BaseSourceVariableInstruction getBase() { - exists(InitializeParameterInstruction init | - init.getParameter() = p and - // This is always a `VariableAddressInstruction` - result = init.getAnOperand().getDef() - ) - } + override BaseIRVariable getBaseSourceVariable() { result.getIRVariable().getAst() = p } } /** @@ -591,8 +578,8 @@ class GlobalUse extends UseImpl, TGlobalUse { ) } - override SourceVariable getSourceVariable() { - sourceVariableIsGlobal(result, global, f, this.getIndirection()) + override BaseSourceVariable getBaseSourceVariable() { + baseSourceVariableIsGlobal(result, global, f) } final override Cpp::Location getLocation() { result = f.getLocation() } @@ -609,8 +596,6 @@ class GlobalUse extends UseImpl, TGlobalUse { Type getUnderlyingType() { result = global.getUnderlyingType() } override predicate isCertain() { any() } - - override BaseSourceVariableInstruction getBase() { none() } } /** @@ -640,8 +625,8 @@ class GlobalDefImpl extends DefImpl, TGlobalDefImpl { } /** Gets the global variable associated with this definition. */ - override SourceVariable getSourceVariable() { - sourceVariableIsGlobal(result, global, f, this.getIndirection()) + override BaseSourceVariable getBaseSourceVariable() { + baseSourceVariableIsGlobal(result, global, f) } override int getIndirection() { result = indirectionIndex } @@ -664,8 +649,6 @@ class GlobalDefImpl extends DefImpl, TGlobalDefImpl { override string toString() { result = "Def of " + this.getSourceVariable() } override Location getLocation() { result = f.getLocation() } - - override BaseSourceVariableInstruction getBase() { none() } } /** @@ -978,11 +961,10 @@ predicate fromPhiNode(SsaPhiNode nodeFrom, Node nodeTo) { ) } -private predicate sourceVariableIsGlobal( - SourceVariable sv, GlobalLikeVariable global, IRFunction func, int indirectionIndex +private predicate baseSourceVariableIsGlobal( + BaseIRVariable base, GlobalLikeVariable global, IRFunction func ) { - exists(IRVariable irVar, BaseIRVariable base | - sourceVariableHasBaseAndIndex(sv, base, indirectionIndex) and + exists(IRVariable irVar | irVar = base.getIRVariable() and irVar.getEnclosingIRFunction() = func and global = irVar.getAst() and From 2dcb55cc42e1cce375dd336a99df92130dc36fa0 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 11:38:50 +0200 Subject: [PATCH 096/118] C++: Add `bool` operator to IR test --- .../library-tests/ir/ir/PrintAST.expected | 6034 +++++++++-------- .../library-tests/ir/ir/aliased_ir.expected | 5084 +++++++------- cpp/ql/test/library-tests/ir/ir/ir.cpp | 15 + .../test/library-tests/ir/ir/raw_ir.expected | 4138 +++++------ 4 files changed, 7644 insertions(+), 7627 deletions(-) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index ea5b9fec825..0d6ab9c6a4e 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -19311,193 +19311,195 @@ ir.cpp: # 2193| getQualifier(): [ThisExpr] this # 2193| Type = [PointerType] ClassWithDestructor * # 2193| ValueCategory = prvalue(load) -# 2196| [GlobalVariable] bool initialization_with_destructor_bool -# 2196| getInitializer(): [Initializer] initializer for initialization_with_destructor_bool -# 2196| getExpr(): [Literal] 1 -# 2196| Type = [BoolType] bool -# 2196| Value = [Literal] 1 -# 2196| ValueCategory = prvalue -# 2198| [TopLevelFunction] void initialization_with_destructor(bool, char) -# 2198| : -# 2198| getParameter(0): [Parameter] b -# 2198| Type = [BoolType] bool -# 2198| getParameter(1): [Parameter] c -# 2198| Type = [PlainCharType] char -# 2198| getEntryPoint(): [BlockStmt] { ... } -# 2199| getStmt(0): [IfStmt] if (...) ... -# 2199| getInitialization(): [DeclStmt] declaration -# 2199| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2199| Type = [Class] ClassWithDestructor -# 2199| getVariable().getInitializer(): [Initializer] initializer for x -# 2199| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2199| Type = [VoidType] void -# 2199| ValueCategory = prvalue -# 2199| getCondition(): [VariableAccess] b -# 2199| Type = [BoolType] bool -# 2199| ValueCategory = prvalue(load) -# 2200| getThen(): [ExprStmt] ExprStmt -# 2200| getExpr(): [FunctionCall] call to set_x -# 2200| Type = [VoidType] void -# 2200| ValueCategory = prvalue -# 2200| getQualifier(): [VariableAccess] x -# 2200| Type = [Class] ClassWithDestructor -# 2200| ValueCategory = lvalue -# 2200| getArgument(0): [CharLiteral] 97 -# 2200| Type = [PlainCharType] char -# 2200| Value = [CharLiteral] 97 -# 2200| ValueCategory = prvalue -# 2200| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2200| Type = [VoidType] void -# 2200| ValueCategory = prvalue -# 2200| getQualifier(): [VariableAccess] x +# 2194| [ConstMemberFunction,ConversionOperator] bool ClassWithDestructor::operator bool() const +# 2194| : +# 2197| [GlobalVariable] bool initialization_with_destructor_bool +# 2197| getInitializer(): [Initializer] initializer for initialization_with_destructor_bool +# 2197| getExpr(): [Literal] 1 +# 2197| Type = [BoolType] bool +# 2197| Value = [Literal] 1 +# 2197| ValueCategory = prvalue +# 2199| [TopLevelFunction] void initialization_with_destructor(bool, char) +# 2199| : +# 2199| getParameter(0): [Parameter] b +# 2199| Type = [BoolType] bool +# 2199| getParameter(1): [Parameter] c +# 2199| Type = [PlainCharType] char +# 2199| getEntryPoint(): [BlockStmt] { ... } +# 2200| getStmt(0): [IfStmt] if (...) ... +# 2200| getInitialization(): [DeclStmt] declaration +# 2200| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x # 2200| Type = [Class] ClassWithDestructor -# 2200| ValueCategory = lvalue -# 2202| getStmt(1): [ConstexprIfStmt] if constexpr (...) ... -# 2202| getInitialization(): [DeclStmt] declaration -# 2202| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2202| Type = [Class] ClassWithDestructor -# 2202| getVariable().getInitializer(): [Initializer] initializer for x -# 2202| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2202| Type = [VoidType] void -# 2202| ValueCategory = prvalue -# 2202| getCondition(): [VariableAccess] initialization_with_destructor_bool -# 2202| Type = [BoolType] bool -# 2202| Value = [VariableAccess] 1 -# 2202| ValueCategory = prvalue(load) -# 2203| getThen(): [ExprStmt] ExprStmt -# 2203| getExpr(): [FunctionCall] call to set_x -# 2203| Type = [VoidType] void -# 2203| ValueCategory = prvalue -# 2203| getQualifier(): [VariableAccess] x -# 2203| Type = [Class] ClassWithDestructor -# 2203| ValueCategory = lvalue -# 2203| getArgument(0): [CharLiteral] 97 -# 2203| Type = [PlainCharType] char -# 2203| Value = [CharLiteral] 97 -# 2203| ValueCategory = prvalue -# 2203| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2203| Type = [VoidType] void -# 2203| ValueCategory = prvalue -# 2203| getQualifier(): [VariableAccess] x +# 2200| getVariable().getInitializer(): [Initializer] initializer for x +# 2200| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2200| Type = [VoidType] void +# 2200| ValueCategory = prvalue +# 2200| getCondition(): [VariableAccess] b +# 2200| Type = [BoolType] bool +# 2200| ValueCategory = prvalue(load) +# 2201| getThen(): [ExprStmt] ExprStmt +# 2201| getExpr(): [FunctionCall] call to set_x +# 2201| Type = [VoidType] void +# 2201| ValueCategory = prvalue +# 2201| getQualifier(): [VariableAccess] x +# 2201| Type = [Class] ClassWithDestructor +# 2201| ValueCategory = lvalue +# 2201| getArgument(0): [CharLiteral] 97 +# 2201| Type = [PlainCharType] char +# 2201| Value = [CharLiteral] 97 +# 2201| ValueCategory = prvalue +# 2201| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2201| Type = [VoidType] void +# 2201| ValueCategory = prvalue +# 2201| getQualifier(): [VariableAccess] x +# 2201| Type = [Class] ClassWithDestructor +# 2201| ValueCategory = lvalue +# 2203| getStmt(1): [ConstexprIfStmt] if constexpr (...) ... +# 2203| getInitialization(): [DeclStmt] declaration +# 2203| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x # 2203| Type = [Class] ClassWithDestructor -# 2203| ValueCategory = lvalue -# 2205| getStmt(2): [SwitchStmt] switch (...) ... -# 2205| getInitialization(): [DeclStmt] declaration -# 2205| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2205| Type = [Class] ClassWithDestructor -# 2205| getVariable().getInitializer(): [Initializer] initializer for x -# 2205| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2205| Type = [VoidType] void -# 2205| ValueCategory = prvalue -# 2205| getExpr(): [VariableAccess] c -# 2205| Type = [PlainCharType] char -# 2205| ValueCategory = prvalue(load) -# 2205| getStmt(): [BlockStmt] { ... } -# 2206| getStmt(0): [SwitchCase] case ...: -# 2206| getExpr(): [CharLiteral] 97 -# 2206| Type = [PlainCharType] char -# 2206| Value = [CharLiteral] 97 -# 2206| ValueCategory = prvalue -# 2206| getExpr().getFullyConverted(): [CStyleCast] (int)... -# 2206| Conversion = [IntegralConversion] integral conversion -# 2206| Type = [IntType] int -# 2206| Value = [CStyleCast] 97 -# 2206| ValueCategory = prvalue -# 2207| getStmt(1): [ExprStmt] ExprStmt -# 2207| getExpr(): [FunctionCall] call to set_x -# 2207| Type = [VoidType] void +# 2203| getVariable().getInitializer(): [Initializer] initializer for x +# 2203| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2203| Type = [VoidType] void +# 2203| ValueCategory = prvalue +# 2203| getCondition(): [VariableAccess] initialization_with_destructor_bool +# 2203| Type = [BoolType] bool +# 2203| Value = [VariableAccess] 1 +# 2203| ValueCategory = prvalue(load) +# 2204| getThen(): [ExprStmt] ExprStmt +# 2204| getExpr(): [FunctionCall] call to set_x +# 2204| Type = [VoidType] void +# 2204| ValueCategory = prvalue +# 2204| getQualifier(): [VariableAccess] x +# 2204| Type = [Class] ClassWithDestructor +# 2204| ValueCategory = lvalue +# 2204| getArgument(0): [CharLiteral] 97 +# 2204| Type = [PlainCharType] char +# 2204| Value = [CharLiteral] 97 +# 2204| ValueCategory = prvalue +# 2204| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2204| Type = [VoidType] void +# 2204| ValueCategory = prvalue +# 2204| getQualifier(): [VariableAccess] x +# 2204| Type = [Class] ClassWithDestructor +# 2204| ValueCategory = lvalue +# 2206| getStmt(2): [SwitchStmt] switch (...) ... +# 2206| getInitialization(): [DeclStmt] declaration +# 2206| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2206| Type = [Class] ClassWithDestructor +# 2206| getVariable().getInitializer(): [Initializer] initializer for x +# 2206| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2206| Type = [VoidType] void +# 2206| ValueCategory = prvalue +# 2206| getExpr(): [VariableAccess] c +# 2206| Type = [PlainCharType] char +# 2206| ValueCategory = prvalue(load) +# 2206| getStmt(): [BlockStmt] { ... } +# 2207| getStmt(0): [SwitchCase] case ...: +# 2207| getExpr(): [CharLiteral] 97 +# 2207| Type = [PlainCharType] char +# 2207| Value = [CharLiteral] 97 # 2207| ValueCategory = prvalue -# 2207| getQualifier(): [VariableAccess] x -# 2207| Type = [Class] ClassWithDestructor -# 2207| ValueCategory = lvalue -# 2207| getArgument(0): [CharLiteral] 97 -# 2207| Type = [PlainCharType] char -# 2207| Value = [CharLiteral] 97 -# 2207| ValueCategory = prvalue -# 2208| getStmt(2): [BreakStmt] break; -# 2212| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2212| Type = [VoidType] void -# 2212| ValueCategory = prvalue -# 2212| getQualifier(): [VariableAccess] x -# 2212| Type = [Class] ClassWithDestructor -# 2212| ValueCategory = lvalue -# 2209| getStmt(3): [SwitchCase] default: -# 2210| getStmt(4): [ExprStmt] ExprStmt -# 2210| getExpr(): [FunctionCall] call to set_x -# 2210| Type = [VoidType] void -# 2210| ValueCategory = prvalue -# 2210| getQualifier(): [VariableAccess] x -# 2210| Type = [Class] ClassWithDestructor -# 2210| ValueCategory = lvalue -# 2210| getArgument(0): [CharLiteral] 98 -# 2210| Type = [PlainCharType] char -# 2210| Value = [CharLiteral] 98 -# 2210| ValueCategory = prvalue -# 2211| getStmt(5): [BreakStmt] break; -# 2212| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2212| Type = [VoidType] void -# 2212| ValueCategory = prvalue -# 2212| getQualifier(): [VariableAccess] x -# 2212| Type = [Class] ClassWithDestructor -# 2212| ValueCategory = lvalue -# 2212| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2212| Type = [VoidType] void -# 2212| ValueCategory = prvalue -# 2212| getQualifier(): [VariableAccess] x -# 2212| Type = [Class] ClassWithDestructor -# 2212| ValueCategory = lvalue -# 2205| getExpr().getFullyConverted(): [CStyleCast] (int)... -# 2205| Conversion = [IntegralConversion] integral conversion -# 2205| Type = [IntType] int -# 2205| ValueCategory = prvalue -# 2212| getStmt(3): [LabelStmt] label ...: -# 2214| getStmt(4): [DeclStmt] declaration -# 2214| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2214| Type = [Class] ClassWithDestructor -# 2214| getVariable().getInitializer(): [Initializer] initializer for x -# 2214| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2214| Type = [VoidType] void -# 2214| ValueCategory = prvalue -# 2215| getStmt(5): [RangeBasedForStmt] for(...:...) ... -# 2215| getInitialization(): [DeclStmt] declaration -# 2215| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys -# 2215| Type = [ClassTemplateInstantiation,Struct] vector -# 2215| getVariable().getInitializer(): [Initializer] initializer for ys -# 2215| getExpr(): [ConstructorCall] call to vector -# 2215| Type = [VoidType] void -# 2215| ValueCategory = prvalue -# 2215| getArgument(0): [VariableAccess] x -# 2215| Type = [Class] ClassWithDestructor -# 2215| ValueCategory = prvalue(load) -# 2215| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2215| Type = [VoidType] void -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [ReuseExpr] reuse of temporary object -# 2215| Type = [Class] ClassWithDestructor -# 2215| ValueCategory = xvalue -# 2215| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2215| Type = [Class] ClassWithDestructor -# 2215| ValueCategory = lvalue -# 2215| getChild(1): [DeclStmt] declaration -# 2215| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) -# 2215| Type = [LValueReferenceType] vector & +# 2207| getExpr().getFullyConverted(): [CStyleCast] (int)... +# 2207| Conversion = [IntegralConversion] integral conversion +# 2207| Type = [IntType] int +# 2207| Value = [CStyleCast] 97 +# 2207| ValueCategory = prvalue +# 2208| getStmt(1): [ExprStmt] ExprStmt +# 2208| getExpr(): [FunctionCall] call to set_x +# 2208| Type = [VoidType] void +# 2208| ValueCategory = prvalue +# 2208| getQualifier(): [VariableAccess] x +# 2208| Type = [Class] ClassWithDestructor +# 2208| ValueCategory = lvalue +# 2208| getArgument(0): [CharLiteral] 97 +# 2208| Type = [PlainCharType] char +# 2208| Value = [CharLiteral] 97 +# 2208| ValueCategory = prvalue +# 2209| getStmt(2): [BreakStmt] break; +# 2213| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2213| Type = [VoidType] void +# 2213| ValueCategory = prvalue +# 2213| getQualifier(): [VariableAccess] x +# 2213| Type = [Class] ClassWithDestructor +# 2213| ValueCategory = lvalue +# 2210| getStmt(3): [SwitchCase] default: +# 2211| getStmt(4): [ExprStmt] ExprStmt +# 2211| getExpr(): [FunctionCall] call to set_x +# 2211| Type = [VoidType] void +# 2211| ValueCategory = prvalue +# 2211| getQualifier(): [VariableAccess] x +# 2211| Type = [Class] ClassWithDestructor +# 2211| ValueCategory = lvalue +# 2211| getArgument(0): [CharLiteral] 98 +# 2211| Type = [PlainCharType] char +# 2211| Value = [CharLiteral] 98 +# 2211| ValueCategory = prvalue +# 2212| getStmt(5): [BreakStmt] break; +# 2213| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2213| Type = [VoidType] void +# 2213| ValueCategory = prvalue +# 2213| getQualifier(): [VariableAccess] x +# 2213| Type = [Class] ClassWithDestructor +# 2213| ValueCategory = lvalue +# 2213| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2213| Type = [VoidType] void +# 2213| ValueCategory = prvalue +# 2213| getQualifier(): [VariableAccess] x +# 2213| Type = [Class] ClassWithDestructor +# 2213| ValueCategory = lvalue +# 2206| getExpr().getFullyConverted(): [CStyleCast] (int)... +# 2206| Conversion = [IntegralConversion] integral conversion +# 2206| Type = [IntType] int +# 2206| ValueCategory = prvalue +# 2213| getStmt(3): [LabelStmt] label ...: +# 2215| getStmt(4): [DeclStmt] declaration +# 2215| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2215| Type = [Class] ClassWithDestructor +# 2215| getVariable().getInitializer(): [Initializer] initializer for x +# 2215| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2215| Type = [VoidType] void +# 2215| ValueCategory = prvalue +# 2216| getStmt(5): [RangeBasedForStmt] for(...:...) ... +# 2216| getInitialization(): [DeclStmt] declaration +# 2216| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys +# 2216| Type = [ClassTemplateInstantiation,Struct] vector +# 2216| getVariable().getInitializer(): [Initializer] initializer for ys +# 2216| getExpr(): [ConstructorCall] call to vector +# 2216| Type = [VoidType] void +# 2216| ValueCategory = prvalue +# 2216| getArgument(0): [VariableAccess] x +# 2216| Type = [Class] ClassWithDestructor +# 2216| ValueCategory = prvalue(load) +# 2216| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2216| Type = [VoidType] void +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [ReuseExpr] reuse of temporary object +# 2216| Type = [Class] ClassWithDestructor +# 2216| ValueCategory = xvalue +# 2216| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2216| Type = [Class] ClassWithDestructor +# 2216| ValueCategory = lvalue +# 2216| getChild(1): [DeclStmt] declaration +# 2216| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) +# 2216| Type = [LValueReferenceType] vector & #-----| getVariable().getInitializer(): [Initializer] initializer for (__range) -# 2215| getExpr(): [VariableAccess] ys -# 2215| Type = [ClassTemplateInstantiation,Struct] vector -# 2215| ValueCategory = lvalue -# 2215| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2215| Type = [LValueReferenceType] vector & -# 2215| ValueCategory = prvalue -# 2215| getBeginEndDeclaration(): [DeclStmt] declaration -# 2215| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| getExpr(): [VariableAccess] ys +# 2216| Type = [ClassTemplateInstantiation,Struct] vector +# 2216| ValueCategory = lvalue +# 2216| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2216| Type = [LValueReferenceType] vector & +# 2216| ValueCategory = prvalue +# 2216| getBeginEndDeclaration(): [DeclStmt] declaration +# 2216| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__begin) -# 2215| getExpr(): [FunctionCall] call to begin -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] (__range) -# 2215| Type = [LValueReferenceType] vector & -# 2215| ValueCategory = prvalue(load) +# 2216| getExpr(): [FunctionCall] call to begin +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [VariableAccess] (__range) +# 2216| Type = [LValueReferenceType] vector & +# 2216| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19505,15 +19507,15 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2215| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__end) -# 2215| getExpr(): [FunctionCall] call to end -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] (__range) -# 2215| Type = [LValueReferenceType] vector & -# 2215| ValueCategory = prvalue(load) +# 2216| getExpr(): [FunctionCall] call to end +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [VariableAccess] (__range) +# 2216| Type = [LValueReferenceType] vector & +# 2216| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19521,18 +19523,18 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2215| getCondition(): [FunctionCall] call to operator!= -# 2215| Type = [BoolType] bool -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] (__begin) -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2215| ValueCategory = lvalue -# 2215| getArgument(0): [ConstructorCall] call to iterator -# 2215| Type = [VoidType] void -# 2215| ValueCategory = prvalue -# 2215| getArgument(0): [VariableAccess] (__end) -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2215| ValueCategory = lvalue +# 2216| getCondition(): [FunctionCall] call to operator!= +# 2216| Type = [BoolType] bool +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [VariableAccess] (__begin) +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| ValueCategory = lvalue +# 2216| getArgument(0): [ConstructorCall] call to iterator +# 2216| Type = [VoidType] void +# 2216| ValueCategory = prvalue +# 2216| getArgument(0): [VariableAccess] (__end) +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| ValueCategory = lvalue #-----| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) #-----| Type = [LValueReferenceType] const iterator & #-----| ValueCategory = prvalue @@ -19547,95 +19549,95 @@ ir.cpp: #-----| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object #-----| Type = [ClassTemplateInstantiation,Struct] iterator #-----| ValueCategory = lvalue -# 2215| getUpdate(): [FunctionCall] call to operator++ -# 2215| Type = [LValueReferenceType] iterator & -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] (__begin) -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2215| ValueCategory = lvalue -# 2215| getChild(5): [DeclStmt] declaration -# 2215| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2215| Type = [Class] ClassWithDestructor -# 2215| getVariable().getInitializer(): [Initializer] initializer for y -# 2215| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* -# 2215| Type = [LValueReferenceType] ClassWithDestructor & -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] (__begin) -# 2215| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2215| ValueCategory = lvalue +# 2216| getUpdate(): [FunctionCall] call to operator++ +# 2216| Type = [LValueReferenceType] iterator & +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [VariableAccess] (__begin) +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| ValueCategory = lvalue +# 2216| getChild(5): [DeclStmt] declaration +# 2216| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2216| Type = [Class] ClassWithDestructor +# 2216| getVariable().getInitializer(): [Initializer] initializer for y +# 2216| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* +# 2216| Type = [LValueReferenceType] ClassWithDestructor & +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [VariableAccess] (__begin) +# 2216| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2216| ValueCategory = lvalue #-----| getQualifier().getFullyConverted(): [CStyleCast] (const iterator)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const iterator #-----| ValueCategory = lvalue -# 2215| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2215| Type = [Class] ClassWithDestructor -# 2215| ValueCategory = prvalue(load) -# 2216| getStmt(): [ExprStmt] ExprStmt -# 2216| getExpr(): [FunctionCall] call to set_x +# 2216| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2216| Type = [Class] ClassWithDestructor +# 2216| ValueCategory = prvalue(load) +# 2217| getStmt(): [ExprStmt] ExprStmt +# 2217| getExpr(): [FunctionCall] call to set_x +# 2217| Type = [VoidType] void +# 2217| ValueCategory = prvalue +# 2217| getQualifier(): [VariableAccess] y +# 2217| Type = [Class] ClassWithDestructor +# 2217| ValueCategory = lvalue +# 2217| getArgument(0): [CharLiteral] 97 +# 2217| Type = [PlainCharType] char +# 2217| Value = [CharLiteral] 97 +# 2217| ValueCategory = prvalue +# 2216| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2216| Type = [VoidType] void +# 2216| ValueCategory = prvalue +# 2216| getQualifier(): [VariableAccess] ys +# 2216| Type = [ClassTemplateInstantiation,Struct] vector +# 2216| ValueCategory = lvalue +# 2216| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2216| Type = [ClassTemplateInstantiation,Struct] iterator +# 2216| ValueCategory = lvalue +# 2216| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor # 2216| Type = [VoidType] void # 2216| ValueCategory = prvalue # 2216| getQualifier(): [VariableAccess] y # 2216| Type = [Class] ClassWithDestructor # 2216| ValueCategory = lvalue -# 2216| getArgument(0): [CharLiteral] 97 -# 2216| Type = [PlainCharType] char -# 2216| Value = [CharLiteral] 97 -# 2216| ValueCategory = prvalue -# 2215| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2215| Type = [VoidType] void -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] ys -# 2215| Type = [ClassTemplateInstantiation,Struct] vector -# 2215| ValueCategory = lvalue -# 2215| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2215| Type = [ClassTemplateInstantiation,Struct] iterator -# 2215| ValueCategory = lvalue -# 2215| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2215| Type = [VoidType] void -# 2215| ValueCategory = prvalue -# 2215| getQualifier(): [VariableAccess] y -# 2215| Type = [Class] ClassWithDestructor -# 2215| ValueCategory = lvalue -# 2218| getStmt(6): [RangeBasedForStmt] for(...:...) ... -# 2218| getInitialization(): [DeclStmt] declaration -# 2218| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys -# 2218| Type = [ClassTemplateInstantiation,Struct] vector -# 2218| getVariable().getInitializer(): [Initializer] initializer for ys -# 2218| getExpr(): [ConstructorCall] call to vector -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getArgument(0): [VariableAccess] x -# 2218| Type = [Class] ClassWithDestructor -# 2218| ValueCategory = prvalue(load) -# 2218| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [ReuseExpr] reuse of temporary object -# 2218| Type = [Class] ClassWithDestructor -# 2218| ValueCategory = xvalue -# 2218| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2218| Type = [Class] ClassWithDestructor -# 2218| ValueCategory = lvalue -# 2218| getChild(1): [DeclStmt] declaration -# 2218| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) -# 2218| Type = [LValueReferenceType] vector & +# 2219| getStmt(6): [RangeBasedForStmt] for(...:...) ... +# 2219| getInitialization(): [DeclStmt] declaration +# 2219| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys +# 2219| Type = [ClassTemplateInstantiation,Struct] vector +# 2219| getVariable().getInitializer(): [Initializer] initializer for ys +# 2219| getExpr(): [ConstructorCall] call to vector +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getArgument(0): [VariableAccess] x +# 2219| Type = [Class] ClassWithDestructor +# 2219| ValueCategory = prvalue(load) +# 2219| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [ReuseExpr] reuse of temporary object +# 2219| Type = [Class] ClassWithDestructor +# 2219| ValueCategory = xvalue +# 2219| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2219| Type = [Class] ClassWithDestructor +# 2219| ValueCategory = lvalue +# 2219| getChild(1): [DeclStmt] declaration +# 2219| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) +# 2219| Type = [LValueReferenceType] vector & #-----| getVariable().getInitializer(): [Initializer] initializer for (__range) -# 2218| getExpr(): [VariableAccess] ys -# 2218| Type = [ClassTemplateInstantiation,Struct] vector -# 2218| ValueCategory = lvalue -# 2218| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2218| Type = [LValueReferenceType] vector & -# 2218| ValueCategory = prvalue -# 2218| getBeginEndDeclaration(): [DeclStmt] declaration -# 2218| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| getExpr(): [VariableAccess] ys +# 2219| Type = [ClassTemplateInstantiation,Struct] vector +# 2219| ValueCategory = lvalue +# 2219| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2219| Type = [LValueReferenceType] vector & +# 2219| ValueCategory = prvalue +# 2219| getBeginEndDeclaration(): [DeclStmt] declaration +# 2219| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__begin) -# 2218| getExpr(): [FunctionCall] call to begin -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] (__range) -# 2218| Type = [LValueReferenceType] vector & -# 2218| ValueCategory = prvalue(load) +# 2219| getExpr(): [FunctionCall] call to begin +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] (__range) +# 2219| Type = [LValueReferenceType] vector & +# 2219| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19643,15 +19645,15 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2218| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__end) -# 2218| getExpr(): [FunctionCall] call to end -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] (__range) -# 2218| Type = [LValueReferenceType] vector & -# 2218| ValueCategory = prvalue(load) +# 2219| getExpr(): [FunctionCall] call to end +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] (__range) +# 2219| Type = [LValueReferenceType] vector & +# 2219| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19659,18 +19661,18 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2218| getCondition(): [FunctionCall] call to operator!= -# 2218| Type = [BoolType] bool -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] (__begin) -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2218| ValueCategory = lvalue -# 2218| getArgument(0): [ConstructorCall] call to iterator -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getArgument(0): [VariableAccess] (__end) -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2218| ValueCategory = lvalue +# 2219| getCondition(): [FunctionCall] call to operator!= +# 2219| Type = [BoolType] bool +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] (__begin) +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| ValueCategory = lvalue +# 2219| getArgument(0): [ConstructorCall] call to iterator +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getArgument(0): [VariableAccess] (__end) +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| ValueCategory = lvalue #-----| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) #-----| Type = [LValueReferenceType] const iterator & #-----| ValueCategory = prvalue @@ -19685,130 +19687,130 @@ ir.cpp: #-----| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object #-----| Type = [ClassTemplateInstantiation,Struct] iterator #-----| ValueCategory = lvalue -# 2218| getUpdate(): [FunctionCall] call to operator++ -# 2218| Type = [LValueReferenceType] iterator & -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] (__begin) -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2218| ValueCategory = lvalue -# 2218| getChild(5): [DeclStmt] declaration -# 2218| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2218| Type = [Class] ClassWithDestructor -# 2218| getVariable().getInitializer(): [Initializer] initializer for y -# 2218| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* -# 2218| Type = [LValueReferenceType] ClassWithDestructor & -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] (__begin) -# 2218| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2218| ValueCategory = lvalue +# 2219| getUpdate(): [FunctionCall] call to operator++ +# 2219| Type = [LValueReferenceType] iterator & +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] (__begin) +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| ValueCategory = lvalue +# 2219| getChild(5): [DeclStmt] declaration +# 2219| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2219| Type = [Class] ClassWithDestructor +# 2219| getVariable().getInitializer(): [Initializer] initializer for y +# 2219| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* +# 2219| Type = [LValueReferenceType] ClassWithDestructor & +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] (__begin) +# 2219| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2219| ValueCategory = lvalue #-----| getQualifier().getFullyConverted(): [CStyleCast] (const iterator)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const iterator #-----| ValueCategory = lvalue -# 2218| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2218| Type = [Class] ClassWithDestructor -# 2218| ValueCategory = prvalue(load) -# 2218| getStmt(): [BlockStmt] { ... } -# 2219| getStmt(0): [ExprStmt] ExprStmt -# 2219| getExpr(): [FunctionCall] call to set_x -# 2219| Type = [VoidType] void -# 2219| ValueCategory = prvalue -# 2219| getQualifier(): [VariableAccess] y +# 2219| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) # 2219| Type = [Class] ClassWithDestructor -# 2219| ValueCategory = lvalue -# 2219| getArgument(0): [CharLiteral] 97 -# 2219| Type = [PlainCharType] char -# 2219| Value = [CharLiteral] 97 -# 2219| ValueCategory = prvalue -# 2220| getStmt(1): [IfStmt] if (...) ... -# 2220| getCondition(): [EQExpr] ... == ... -# 2220| Type = [BoolType] bool +# 2219| ValueCategory = prvalue(load) +# 2219| getStmt(): [BlockStmt] { ... } +# 2220| getStmt(0): [ExprStmt] ExprStmt +# 2220| getExpr(): [FunctionCall] call to set_x +# 2220| Type = [VoidType] void # 2220| ValueCategory = prvalue -# 2220| getLeftOperand(): [FunctionCall] call to get_x +# 2220| getQualifier(): [VariableAccess] y +# 2220| Type = [Class] ClassWithDestructor +# 2220| ValueCategory = lvalue +# 2220| getArgument(0): [CharLiteral] 97 # 2220| Type = [PlainCharType] char +# 2220| Value = [CharLiteral] 97 # 2220| ValueCategory = prvalue -# 2220| getQualifier(): [VariableAccess] y -# 2220| Type = [Class] ClassWithDestructor -# 2220| ValueCategory = lvalue -# 2220| getRightOperand(): [CharLiteral] 98 -# 2220| Type = [PlainCharType] char -# 2220| Value = [CharLiteral] 98 -# 2220| ValueCategory = prvalue -# 2220| getLeftOperand().getFullyConverted(): [CStyleCast] (int)... -# 2220| Conversion = [IntegralConversion] integral conversion -# 2220| Type = [IntType] int -# 2220| ValueCategory = prvalue -# 2220| getRightOperand().getFullyConverted(): [CStyleCast] (int)... -# 2220| Conversion = [IntegralConversion] integral conversion -# 2220| Type = [IntType] int -# 2220| Value = [CStyleCast] 98 -# 2220| ValueCategory = prvalue -# 2221| getThen(): [ReturnStmt] return ... -# 2218| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] y -# 2218| Type = [Class] ClassWithDestructor -# 2218| ValueCategory = lvalue -# 2218| getImplicitDestructorCall(1): [DestructorCall] call to ~vector -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] ys -# 2218| Type = [ClassTemplateInstantiation,Struct] vector -# 2218| ValueCategory = lvalue -# 2233| getImplicitDestructorCall(2): [DestructorCall] call to ~ClassWithDestructor -# 2233| Type = [VoidType] void -# 2233| ValueCategory = prvalue -# 2233| getQualifier(): [VariableAccess] x -# 2233| Type = [Class] ClassWithDestructor -# 2233| ValueCategory = lvalue -# 2218| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] ys -# 2218| Type = [ClassTemplateInstantiation,Struct] vector -# 2218| ValueCategory = lvalue -# 2218| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2218| Type = [ClassTemplateInstantiation,Struct] iterator -# 2218| ValueCategory = lvalue -# 2218| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2218| Type = [VoidType] void -# 2218| ValueCategory = prvalue -# 2218| getQualifier(): [VariableAccess] y -# 2218| Type = [Class] ClassWithDestructor -# 2218| ValueCategory = lvalue -# 2224| getStmt(7): [RangeBasedForStmt] for(...:...) ... -# 2224| getInitialization(): [DeclStmt] declaration -# 2224| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys -# 2224| Type = [ClassTemplateInstantiation,Struct] vector -# 2224| getVariable().getInitializer(): [Initializer] initializer for ys -# 2224| getExpr(): [ConstructorCall] call to vector -# 2224| Type = [VoidType] void -# 2224| ValueCategory = prvalue -# 2224| getArgument(0): [Literal] 1 -# 2224| Type = [IntType] int -# 2224| Value = [Literal] 1 -# 2224| ValueCategory = prvalue -# 2224| getChild(1): [DeclStmt] declaration -# 2224| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) -# 2224| Type = [LValueReferenceType] vector & +# 2221| getStmt(1): [IfStmt] if (...) ... +# 2221| getCondition(): [EQExpr] ... == ... +# 2221| Type = [BoolType] bool +# 2221| ValueCategory = prvalue +# 2221| getLeftOperand(): [FunctionCall] call to get_x +# 2221| Type = [PlainCharType] char +# 2221| ValueCategory = prvalue +# 2221| getQualifier(): [VariableAccess] y +# 2221| Type = [Class] ClassWithDestructor +# 2221| ValueCategory = lvalue +# 2221| getRightOperand(): [CharLiteral] 98 +# 2221| Type = [PlainCharType] char +# 2221| Value = [CharLiteral] 98 +# 2221| ValueCategory = prvalue +# 2221| getLeftOperand().getFullyConverted(): [CStyleCast] (int)... +# 2221| Conversion = [IntegralConversion] integral conversion +# 2221| Type = [IntType] int +# 2221| ValueCategory = prvalue +# 2221| getRightOperand().getFullyConverted(): [CStyleCast] (int)... +# 2221| Conversion = [IntegralConversion] integral conversion +# 2221| Type = [IntType] int +# 2221| Value = [CStyleCast] 98 +# 2221| ValueCategory = prvalue +# 2222| getThen(): [ReturnStmt] return ... +# 2219| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] y +# 2219| Type = [Class] ClassWithDestructor +# 2219| ValueCategory = lvalue +# 2219| getImplicitDestructorCall(1): [DestructorCall] call to ~vector +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] ys +# 2219| Type = [ClassTemplateInstantiation,Struct] vector +# 2219| ValueCategory = lvalue +# 2234| getImplicitDestructorCall(2): [DestructorCall] call to ~ClassWithDestructor +# 2234| Type = [VoidType] void +# 2234| ValueCategory = prvalue +# 2234| getQualifier(): [VariableAccess] x +# 2234| Type = [Class] ClassWithDestructor +# 2234| ValueCategory = lvalue +# 2219| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] ys +# 2219| Type = [ClassTemplateInstantiation,Struct] vector +# 2219| ValueCategory = lvalue +# 2219| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2219| Type = [ClassTemplateInstantiation,Struct] iterator +# 2219| ValueCategory = lvalue +# 2219| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2219| Type = [VoidType] void +# 2219| ValueCategory = prvalue +# 2219| getQualifier(): [VariableAccess] y +# 2219| Type = [Class] ClassWithDestructor +# 2219| ValueCategory = lvalue +# 2225| getStmt(7): [RangeBasedForStmt] for(...:...) ... +# 2225| getInitialization(): [DeclStmt] declaration +# 2225| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys +# 2225| Type = [ClassTemplateInstantiation,Struct] vector +# 2225| getVariable().getInitializer(): [Initializer] initializer for ys +# 2225| getExpr(): [ConstructorCall] call to vector +# 2225| Type = [VoidType] void +# 2225| ValueCategory = prvalue +# 2225| getArgument(0): [Literal] 1 +# 2225| Type = [IntType] int +# 2225| Value = [Literal] 1 +# 2225| ValueCategory = prvalue +# 2225| getChild(1): [DeclStmt] declaration +# 2225| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) +# 2225| Type = [LValueReferenceType] vector & #-----| getVariable().getInitializer(): [Initializer] initializer for (__range) -# 2224| getExpr(): [VariableAccess] ys -# 2224| Type = [ClassTemplateInstantiation,Struct] vector -# 2224| ValueCategory = lvalue -# 2224| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2224| Type = [LValueReferenceType] vector & -# 2224| ValueCategory = prvalue -# 2224| getBeginEndDeclaration(): [DeclStmt] declaration -# 2224| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| getExpr(): [VariableAccess] ys +# 2225| Type = [ClassTemplateInstantiation,Struct] vector +# 2225| ValueCategory = lvalue +# 2225| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2225| Type = [LValueReferenceType] vector & +# 2225| ValueCategory = prvalue +# 2225| getBeginEndDeclaration(): [DeclStmt] declaration +# 2225| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__begin) -# 2224| getExpr(): [FunctionCall] call to begin -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] (__range) -# 2224| Type = [LValueReferenceType] vector & -# 2224| ValueCategory = prvalue(load) +# 2225| getExpr(): [FunctionCall] call to begin +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| ValueCategory = prvalue +# 2225| getQualifier(): [VariableAccess] (__range) +# 2225| Type = [LValueReferenceType] vector & +# 2225| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19816,15 +19818,15 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2224| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__end) -# 2224| getExpr(): [FunctionCall] call to end -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] (__range) -# 2224| Type = [LValueReferenceType] vector & -# 2224| ValueCategory = prvalue(load) +# 2225| getExpr(): [FunctionCall] call to end +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| ValueCategory = prvalue +# 2225| getQualifier(): [VariableAccess] (__range) +# 2225| Type = [LValueReferenceType] vector & +# 2225| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19832,18 +19834,18 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2224| getCondition(): [FunctionCall] call to operator!= -# 2224| Type = [BoolType] bool -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] (__begin) -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2224| ValueCategory = lvalue -# 2224| getArgument(0): [ConstructorCall] call to iterator -# 2224| Type = [VoidType] void -# 2224| ValueCategory = prvalue -# 2224| getArgument(0): [VariableAccess] (__end) -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2224| ValueCategory = lvalue +# 2225| getCondition(): [FunctionCall] call to operator!= +# 2225| Type = [BoolType] bool +# 2225| ValueCategory = prvalue +# 2225| getQualifier(): [VariableAccess] (__begin) +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| ValueCategory = lvalue +# 2225| getArgument(0): [ConstructorCall] call to iterator +# 2225| Type = [VoidType] void +# 2225| ValueCategory = prvalue +# 2225| getArgument(0): [VariableAccess] (__end) +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| ValueCategory = lvalue #-----| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) #-----| Type = [LValueReferenceType] const iterator & #-----| ValueCategory = prvalue @@ -19858,103 +19860,103 @@ ir.cpp: #-----| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object #-----| Type = [ClassTemplateInstantiation,Struct] iterator #-----| ValueCategory = lvalue -# 2224| getUpdate(): [FunctionCall] call to operator++ -# 2224| Type = [LValueReferenceType] iterator & -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] (__begin) -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2224| ValueCategory = lvalue -# 2224| getChild(5): [DeclStmt] declaration -# 2224| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2224| Type = [IntType] int -# 2224| getVariable().getInitializer(): [Initializer] initializer for y -# 2224| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* -# 2224| Type = [LValueReferenceType] int & -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] (__begin) -# 2224| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2224| ValueCategory = lvalue +# 2225| getUpdate(): [FunctionCall] call to operator++ +# 2225| Type = [LValueReferenceType] iterator & +# 2225| ValueCategory = prvalue +# 2225| getQualifier(): [VariableAccess] (__begin) +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| ValueCategory = lvalue +# 2225| getChild(5): [DeclStmt] declaration +# 2225| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2225| Type = [IntType] int +# 2225| getVariable().getInitializer(): [Initializer] initializer for y +# 2225| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* +# 2225| Type = [LValueReferenceType] int & +# 2225| ValueCategory = prvalue +# 2225| getQualifier(): [VariableAccess] (__begin) +# 2225| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2225| ValueCategory = lvalue #-----| getQualifier().getFullyConverted(): [CStyleCast] (const iterator)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const iterator #-----| ValueCategory = lvalue -# 2224| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2224| Type = [IntType] int -# 2224| ValueCategory = prvalue(load) -# 2224| getStmt(): [BlockStmt] { ... } -# 2225| getStmt(0): [IfStmt] if (...) ... -# 2225| getCondition(): [EQExpr] ... == ... -# 2225| Type = [BoolType] bool -# 2225| ValueCategory = prvalue -# 2225| getLeftOperand(): [VariableAccess] y +# 2225| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) # 2225| Type = [IntType] int # 2225| ValueCategory = prvalue(load) -# 2225| getRightOperand(): [Literal] 1 -# 2225| Type = [IntType] int -# 2225| Value = [Literal] 1 +# 2225| getStmt(): [BlockStmt] { ... } +# 2226| getStmt(0): [IfStmt] if (...) ... +# 2226| getCondition(): [EQExpr] ... == ... +# 2226| Type = [BoolType] bool +# 2226| ValueCategory = prvalue +# 2226| getLeftOperand(): [VariableAccess] y +# 2226| Type = [IntType] int +# 2226| ValueCategory = prvalue(load) +# 2226| getRightOperand(): [Literal] 1 +# 2226| Type = [IntType] int +# 2226| Value = [Literal] 1 +# 2226| ValueCategory = prvalue +# 2227| getThen(): [ReturnStmt] return ... +# 2225| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2225| Type = [VoidType] void # 2225| ValueCategory = prvalue -# 2226| getThen(): [ReturnStmt] return ... -# 2224| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2224| Type = [VoidType] void -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] ys -# 2224| Type = [ClassTemplateInstantiation,Struct] vector -# 2224| ValueCategory = lvalue -# 2233| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor -# 2233| Type = [VoidType] void -# 2233| ValueCategory = prvalue -# 2233| getQualifier(): [VariableAccess] x -# 2233| Type = [Class] ClassWithDestructor -# 2233| ValueCategory = lvalue -# 2224| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2224| Type = [VoidType] void -# 2224| ValueCategory = prvalue -# 2224| getQualifier(): [VariableAccess] ys -# 2224| Type = [ClassTemplateInstantiation,Struct] vector -# 2224| ValueCategory = lvalue -# 2224| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2224| Type = [ClassTemplateInstantiation,Struct] iterator -# 2224| ValueCategory = lvalue -# 2229| getStmt(8): [RangeBasedForStmt] for(...:...) ... -# 2229| getInitialization(): [DeclStmt] declaration -# 2229| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys -# 2229| Type = [ClassTemplateInstantiation,Struct] vector -# 2229| getVariable().getInitializer(): [Initializer] initializer for ys -# 2229| getExpr(): [ConstructorCall] call to vector -# 2229| Type = [VoidType] void -# 2229| ValueCategory = prvalue -# 2229| getArgument(0): [VariableAccess] x -# 2229| Type = [Class] ClassWithDestructor -# 2229| ValueCategory = prvalue(load) -# 2229| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2229| Type = [VoidType] void -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [ReuseExpr] reuse of temporary object -# 2229| Type = [Class] ClassWithDestructor -# 2229| ValueCategory = xvalue -# 2229| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2229| Type = [Class] ClassWithDestructor -# 2229| ValueCategory = lvalue -# 2229| getChild(1): [DeclStmt] declaration -# 2229| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) -# 2229| Type = [LValueReferenceType] vector & +# 2225| getQualifier(): [VariableAccess] ys +# 2225| Type = [ClassTemplateInstantiation,Struct] vector +# 2225| ValueCategory = lvalue +# 2234| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor +# 2234| Type = [VoidType] void +# 2234| ValueCategory = prvalue +# 2234| getQualifier(): [VariableAccess] x +# 2234| Type = [Class] ClassWithDestructor +# 2234| ValueCategory = lvalue +# 2225| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2225| Type = [VoidType] void +# 2225| ValueCategory = prvalue +# 2225| getQualifier(): [VariableAccess] ys +# 2225| Type = [ClassTemplateInstantiation,Struct] vector +# 2225| ValueCategory = lvalue +# 2225| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2225| Type = [ClassTemplateInstantiation,Struct] iterator +# 2225| ValueCategory = lvalue +# 2230| getStmt(8): [RangeBasedForStmt] for(...:...) ... +# 2230| getInitialization(): [DeclStmt] declaration +# 2230| getDeclarationEntry(0): [VariableDeclarationEntry] definition of ys +# 2230| Type = [ClassTemplateInstantiation,Struct] vector +# 2230| getVariable().getInitializer(): [Initializer] initializer for ys +# 2230| getExpr(): [ConstructorCall] call to vector +# 2230| Type = [VoidType] void +# 2230| ValueCategory = prvalue +# 2230| getArgument(0): [VariableAccess] x +# 2230| Type = [Class] ClassWithDestructor +# 2230| ValueCategory = prvalue(load) +# 2230| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2230| Type = [VoidType] void +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [ReuseExpr] reuse of temporary object +# 2230| Type = [Class] ClassWithDestructor +# 2230| ValueCategory = xvalue +# 2230| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2230| Type = [Class] ClassWithDestructor +# 2230| ValueCategory = lvalue +# 2230| getChild(1): [DeclStmt] declaration +# 2230| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) +# 2230| Type = [LValueReferenceType] vector & #-----| getVariable().getInitializer(): [Initializer] initializer for (__range) -# 2229| getExpr(): [VariableAccess] ys -# 2229| Type = [ClassTemplateInstantiation,Struct] vector -# 2229| ValueCategory = lvalue -# 2229| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2229| Type = [LValueReferenceType] vector & -# 2229| ValueCategory = prvalue -# 2229| getBeginEndDeclaration(): [DeclStmt] declaration -# 2229| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| getExpr(): [VariableAccess] ys +# 2230| Type = [ClassTemplateInstantiation,Struct] vector +# 2230| ValueCategory = lvalue +# 2230| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2230| Type = [LValueReferenceType] vector & +# 2230| ValueCategory = prvalue +# 2230| getBeginEndDeclaration(): [DeclStmt] declaration +# 2230| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__begin) -# 2229| getExpr(): [FunctionCall] call to begin -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] (__range) -# 2229| Type = [LValueReferenceType] vector & -# 2229| ValueCategory = prvalue(load) +# 2230| getExpr(): [FunctionCall] call to begin +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] (__range) +# 2230| Type = [LValueReferenceType] vector & +# 2230| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19962,15 +19964,15 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2229| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__end) -# 2229| getExpr(): [FunctionCall] call to end -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] (__range) -# 2229| Type = [LValueReferenceType] vector & -# 2229| ValueCategory = prvalue(load) +# 2230| getExpr(): [FunctionCall] call to end +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] (__range) +# 2230| Type = [LValueReferenceType] vector & +# 2230| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -19978,18 +19980,18 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2229| getCondition(): [FunctionCall] call to operator!= -# 2229| Type = [BoolType] bool -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] (__begin) -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2229| ValueCategory = lvalue -# 2229| getArgument(0): [ConstructorCall] call to iterator -# 2229| Type = [VoidType] void -# 2229| ValueCategory = prvalue -# 2229| getArgument(0): [VariableAccess] (__end) -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2229| ValueCategory = lvalue +# 2230| getCondition(): [FunctionCall] call to operator!= +# 2230| Type = [BoolType] bool +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] (__begin) +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| ValueCategory = lvalue +# 2230| getArgument(0): [ConstructorCall] call to iterator +# 2230| Type = [VoidType] void +# 2230| ValueCategory = prvalue +# 2230| getArgument(0): [VariableAccess] (__end) +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| ValueCategory = lvalue #-----| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) #-----| Type = [LValueReferenceType] const iterator & #-----| ValueCategory = prvalue @@ -20004,584 +20006,584 @@ ir.cpp: #-----| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object #-----| Type = [ClassTemplateInstantiation,Struct] iterator #-----| ValueCategory = lvalue -# 2229| getUpdate(): [FunctionCall] call to operator++ -# 2229| Type = [LValueReferenceType] iterator & -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] (__begin) -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2229| ValueCategory = lvalue -# 2229| getChild(5): [DeclStmt] declaration -# 2229| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2229| Type = [Class] ClassWithDestructor -# 2229| getVariable().getInitializer(): [Initializer] initializer for y -# 2229| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* -# 2229| Type = [LValueReferenceType] ClassWithDestructor & -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] (__begin) -# 2229| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2229| ValueCategory = lvalue +# 2230| getUpdate(): [FunctionCall] call to operator++ +# 2230| Type = [LValueReferenceType] iterator & +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] (__begin) +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| ValueCategory = lvalue +# 2230| getChild(5): [DeclStmt] declaration +# 2230| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2230| Type = [Class] ClassWithDestructor +# 2230| getVariable().getInitializer(): [Initializer] initializer for y +# 2230| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* +# 2230| Type = [LValueReferenceType] ClassWithDestructor & +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] (__begin) +# 2230| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2230| ValueCategory = lvalue #-----| getQualifier().getFullyConverted(): [CStyleCast] (const iterator)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const iterator #-----| ValueCategory = lvalue -# 2229| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2229| Type = [Class] ClassWithDestructor -# 2229| ValueCategory = prvalue(load) -# 2229| getStmt(): [BlockStmt] { ... } -# 2230| getStmt(0): [DeclStmt] declaration -# 2230| getDeclarationEntry(0): [VariableDeclarationEntry] definition of z1 -# 2230| Type = [Class] ClassWithDestructor -# 2230| getVariable().getInitializer(): [Initializer] initializer for z1 -# 2230| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2230| Type = [VoidType] void -# 2230| ValueCategory = prvalue -# 2231| getStmt(1): [DeclStmt] declaration -# 2231| getDeclarationEntry(0): [VariableDeclarationEntry] definition of z2 +# 2230| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2230| Type = [Class] ClassWithDestructor +# 2230| ValueCategory = prvalue(load) +# 2230| getStmt(): [BlockStmt] { ... } +# 2231| getStmt(0): [DeclStmt] declaration +# 2231| getDeclarationEntry(0): [VariableDeclarationEntry] definition of z1 # 2231| Type = [Class] ClassWithDestructor -# 2231| getVariable().getInitializer(): [Initializer] initializer for z2 +# 2231| getVariable().getInitializer(): [Initializer] initializer for z1 # 2231| getExpr(): [ConstructorCall] call to ClassWithDestructor # 2231| Type = [VoidType] void # 2231| ValueCategory = prvalue -# 2232| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2232| Type = [VoidType] void -# 2232| ValueCategory = prvalue -# 2232| getQualifier(): [VariableAccess] z2 +# 2232| getStmt(1): [DeclStmt] declaration +# 2232| getDeclarationEntry(0): [VariableDeclarationEntry] definition of z2 # 2232| Type = [Class] ClassWithDestructor -# 2232| ValueCategory = lvalue -# 2232| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor -# 2232| Type = [VoidType] void -# 2232| ValueCategory = prvalue -# 2232| getQualifier(): [VariableAccess] z1 -# 2232| Type = [Class] ClassWithDestructor -# 2232| ValueCategory = lvalue -# 2229| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2229| Type = [VoidType] void -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] ys -# 2229| Type = [ClassTemplateInstantiation,Struct] vector -# 2229| ValueCategory = lvalue -# 2229| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2229| Type = [ClassTemplateInstantiation,Struct] iterator -# 2229| ValueCategory = lvalue -# 2229| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2229| Type = [VoidType] void -# 2229| ValueCategory = prvalue -# 2229| getQualifier(): [VariableAccess] y -# 2229| Type = [Class] ClassWithDestructor -# 2229| ValueCategory = lvalue -# 2233| getStmt(9): [ReturnStmt] return ... -# 2233| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2233| Type = [VoidType] void -# 2233| ValueCategory = prvalue -# 2233| getQualifier(): [VariableAccess] x -# 2233| Type = [Class] ClassWithDestructor -# 2233| ValueCategory = lvalue -# 2235| [TopLevelFunction] void static_variable_with_destructor_1() -# 2235| : -# 2235| getEntryPoint(): [BlockStmt] { ... } -# 2236| getStmt(0): [DeclStmt] declaration -# 2236| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a -# 2236| Type = [Class] ClassWithDestructor -# 2236| getVariable().getInitializer(): [Initializer] initializer for a -# 2236| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2236| Type = [VoidType] void -# 2236| ValueCategory = prvalue -# 2237| getStmt(1): [DeclStmt] declaration -# 2237| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b +# 2232| getVariable().getInitializer(): [Initializer] initializer for z2 +# 2232| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2232| Type = [VoidType] void +# 2232| ValueCategory = prvalue +# 2233| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2233| Type = [VoidType] void +# 2233| ValueCategory = prvalue +# 2233| getQualifier(): [VariableAccess] z2 +# 2233| Type = [Class] ClassWithDestructor +# 2233| ValueCategory = lvalue +# 2233| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor +# 2233| Type = [VoidType] void +# 2233| ValueCategory = prvalue +# 2233| getQualifier(): [VariableAccess] z1 +# 2233| Type = [Class] ClassWithDestructor +# 2233| ValueCategory = lvalue +# 2230| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2230| Type = [VoidType] void +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] ys +# 2230| Type = [ClassTemplateInstantiation,Struct] vector +# 2230| ValueCategory = lvalue +# 2230| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2230| Type = [ClassTemplateInstantiation,Struct] iterator +# 2230| ValueCategory = lvalue +# 2230| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2230| Type = [VoidType] void +# 2230| ValueCategory = prvalue +# 2230| getQualifier(): [VariableAccess] y +# 2230| Type = [Class] ClassWithDestructor +# 2230| ValueCategory = lvalue +# 2234| getStmt(9): [ReturnStmt] return ... +# 2234| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2234| Type = [VoidType] void +# 2234| ValueCategory = prvalue +# 2234| getQualifier(): [VariableAccess] x +# 2234| Type = [Class] ClassWithDestructor +# 2234| ValueCategory = lvalue +# 2236| [TopLevelFunction] void static_variable_with_destructor_1() +# 2236| : +# 2236| getEntryPoint(): [BlockStmt] { ... } +# 2237| getStmt(0): [DeclStmt] declaration +# 2237| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a # 2237| Type = [Class] ClassWithDestructor +# 2237| getVariable().getInitializer(): [Initializer] initializer for a +# 2237| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2237| Type = [VoidType] void +# 2237| ValueCategory = prvalue +# 2238| getStmt(1): [DeclStmt] declaration +# 2238| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b +# 2238| Type = [Class] ClassWithDestructor #-----| getVariable().getInitializer(): [Initializer] initializer for b #-----| getExpr(): [ConstructorCall] call to ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue -# 2238| getStmt(2): [ReturnStmt] return ... -# 2238| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2238| Type = [VoidType] void -# 2238| ValueCategory = prvalue -# 2238| getQualifier(): [VariableAccess] a -# 2238| Type = [Class] ClassWithDestructor -# 2238| ValueCategory = lvalue -# 2240| [TopLevelFunction] void static_variable_with_destructor_2() -# 2240| : -# 2240| getEntryPoint(): [BlockStmt] { ... } -# 2241| getStmt(0): [DeclStmt] declaration -# 2241| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a -# 2241| Type = [Class] ClassWithDestructor +# 2239| getStmt(2): [ReturnStmt] return ... +# 2239| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2239| Type = [VoidType] void +# 2239| ValueCategory = prvalue +# 2239| getQualifier(): [VariableAccess] a +# 2239| Type = [Class] ClassWithDestructor +# 2239| ValueCategory = lvalue +# 2241| [TopLevelFunction] void static_variable_with_destructor_2() +# 2241| : +# 2241| getEntryPoint(): [BlockStmt] { ... } +# 2242| getStmt(0): [DeclStmt] declaration +# 2242| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a +# 2242| Type = [Class] ClassWithDestructor #-----| getVariable().getInitializer(): [Initializer] initializer for a #-----| getExpr(): [ConstructorCall] call to ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue -# 2242| getStmt(1): [DeclStmt] declaration -# 2242| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b -# 2242| Type = [Class] ClassWithDestructor -# 2242| getVariable().getInitializer(): [Initializer] initializer for b -# 2242| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2242| Type = [VoidType] void -# 2242| ValueCategory = prvalue -# 2243| getStmt(2): [ReturnStmt] return ... -# 2243| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2243| Type = [VoidType] void -# 2243| ValueCategory = prvalue -# 2243| getQualifier(): [VariableAccess] b -# 2243| Type = [Class] ClassWithDestructor -# 2243| ValueCategory = lvalue -# 2245| [TopLevelFunction] void static_variable_with_destructor_3() -# 2245| : -# 2245| getEntryPoint(): [BlockStmt] { ... } -# 2246| getStmt(0): [DeclStmt] declaration -# 2246| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a -# 2246| Type = [Class] ClassWithDestructor -# 2246| getVariable().getInitializer(): [Initializer] initializer for a -# 2246| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2246| Type = [VoidType] void -# 2246| ValueCategory = prvalue -# 2247| getStmt(1): [DeclStmt] declaration -# 2247| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b +# 2243| getStmt(1): [DeclStmt] declaration +# 2243| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b +# 2243| Type = [Class] ClassWithDestructor +# 2243| getVariable().getInitializer(): [Initializer] initializer for b +# 2243| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2243| Type = [VoidType] void +# 2243| ValueCategory = prvalue +# 2244| getStmt(2): [ReturnStmt] return ... +# 2244| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2244| Type = [VoidType] void +# 2244| ValueCategory = prvalue +# 2244| getQualifier(): [VariableAccess] b +# 2244| Type = [Class] ClassWithDestructor +# 2244| ValueCategory = lvalue +# 2246| [TopLevelFunction] void static_variable_with_destructor_3() +# 2246| : +# 2246| getEntryPoint(): [BlockStmt] { ... } +# 2247| getStmt(0): [DeclStmt] declaration +# 2247| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a # 2247| Type = [Class] ClassWithDestructor -# 2247| getVariable().getInitializer(): [Initializer] initializer for b +# 2247| getVariable().getInitializer(): [Initializer] initializer for a # 2247| getExpr(): [ConstructorCall] call to ClassWithDestructor # 2247| Type = [VoidType] void # 2247| ValueCategory = prvalue -# 2248| getStmt(2): [DeclStmt] declaration -# 2248| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c +# 2248| getStmt(1): [DeclStmt] declaration +# 2248| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b # 2248| Type = [Class] ClassWithDestructor +# 2248| getVariable().getInitializer(): [Initializer] initializer for b +# 2248| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2248| Type = [VoidType] void +# 2248| ValueCategory = prvalue +# 2249| getStmt(2): [DeclStmt] declaration +# 2249| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c +# 2249| Type = [Class] ClassWithDestructor #-----| getVariable().getInitializer(): [Initializer] initializer for c #-----| getExpr(): [ConstructorCall] call to ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue -# 2249| getStmt(3): [ReturnStmt] return ... -# 2249| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2249| Type = [VoidType] void -# 2249| ValueCategory = prvalue -# 2249| getQualifier(): [VariableAccess] b -# 2249| Type = [Class] ClassWithDestructor -# 2249| ValueCategory = lvalue -# 2249| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor -# 2249| Type = [VoidType] void -# 2249| ValueCategory = prvalue -# 2249| getQualifier(): [VariableAccess] a -# 2249| Type = [Class] ClassWithDestructor -# 2249| ValueCategory = lvalue -# 2251| [GlobalVariable] ClassWithDestructor global_class_with_destructor -# 2251| getInitializer(): [Initializer] initializer for global_class_with_destructor -# 2251| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2251| Type = [VoidType] void -# 2251| ValueCategory = prvalue -# 2255| [FunctionTemplateInstantiation,TopLevelFunction] ClassWithDestructor& vacuous_destructor_call::get(ClassWithDestructor&) -# 2255| : -# 2255| getParameter(0): [Parameter] t -# 2255| Type = [LValueReferenceType] ClassWithDestructor & -# 2255| getEntryPoint(): [BlockStmt] { ... } -# 2255| getStmt(0): [ReturnStmt] return ... -# 2255| getExpr(): [VariableAccess] t -# 2255| Type = [LValueReferenceType] ClassWithDestructor & -# 2255| ValueCategory = prvalue(load) -# 2255| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2255| Type = [LValueReferenceType] ClassWithDestructor & -# 2255| ValueCategory = prvalue -# 2255| getExpr(): [ReferenceDereferenceExpr] (reference dereference) -# 2255| Type = [Class] ClassWithDestructor -# 2255| ValueCategory = lvalue -# 2255| [TemplateFunction,TopLevelFunction] T& vacuous_destructor_call::get(T&) -# 2255| : -# 2255| getParameter(0): [Parameter] t -# 2255| Type = [LValueReferenceType] T & -# 2255| getEntryPoint(): [BlockStmt] { ... } -# 2255| getStmt(0): [ReturnStmt] return ... -# 2255| getExpr(): [VariableAccess] t -# 2255| Type = [LValueReferenceType] T & -# 2255| ValueCategory = prvalue(load) -# 2255| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2255| Type = [TemplateParameter] T -# 2255| ValueCategory = lvalue -# 2255| [FunctionTemplateInstantiation,TopLevelFunction] int& vacuous_destructor_call::get(int&) -# 2255| : -# 2255| getParameter(0): [Parameter] t -# 2255| Type = [LValueReferenceType] int & -# 2255| getEntryPoint(): [BlockStmt] { ... } -# 2255| getStmt(0): [ReturnStmt] return ... -# 2255| getExpr(): [VariableAccess] t -# 2255| Type = [LValueReferenceType] int & -# 2255| ValueCategory = prvalue(load) -# 2255| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2255| Type = [LValueReferenceType] int & -# 2255| ValueCategory = prvalue -# 2255| getExpr(): [ReferenceDereferenceExpr] (reference dereference) -# 2255| Type = [IntType] int -# 2255| ValueCategory = lvalue -# 2258| [FunctionTemplateInstantiation,TopLevelFunction] void vacuous_destructor_call::call_destructor(ClassWithDestructor&) -# 2258| : -# 2258| getParameter(0): [Parameter] t -# 2258| Type = [LValueReferenceType] ClassWithDestructor & -# 2258| getEntryPoint(): [BlockStmt] { ... } -# 2259| getStmt(0): [ExprStmt] ExprStmt -# 2259| getExpr(): [DestructorCall] call to ~ClassWithDestructor -# 2259| Type = [VoidType] void -# 2259| ValueCategory = prvalue -# 2259| getQualifier(): [FunctionCall] call to get -# 2259| Type = [LValueReferenceType] ClassWithDestructor & -# 2259| ValueCategory = prvalue -# 2259| getArgument(0): [VariableAccess] t -# 2259| Type = [LValueReferenceType] ClassWithDestructor & -# 2259| ValueCategory = prvalue(load) -# 2259| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) -# 2259| Type = [LValueReferenceType] ClassWithDestructor & -# 2259| ValueCategory = prvalue -# 2259| getExpr(): [ReferenceDereferenceExpr] (reference dereference) -# 2259| Type = [Class] ClassWithDestructor -# 2259| ValueCategory = lvalue -# 2259| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2259| Type = [Class] ClassWithDestructor -# 2259| ValueCategory = lvalue -# 2260| getStmt(1): [ReturnStmt] return ... -# 2258| [TemplateFunction,TopLevelFunction] void vacuous_destructor_call::call_destructor(T&) -# 2258| : -# 2258| getParameter(0): [Parameter] t -# 2258| Type = [LValueReferenceType] T & -# 2258| getEntryPoint(): [BlockStmt] { ... } -# 2259| getStmt(0): [ExprStmt] ExprStmt -# 2259| getExpr(): [ExprCall] call to expression -# 2259| Type = [UnknownType] unknown -# 2259| ValueCategory = prvalue -# 2259| getExpr(): [Literal] Unknown literal -# 2259| Type = [UnknownType] unknown -# 2259| ValueCategory = prvalue -# 2259| getChild(-1): [ExprCall] call to expression -# 2259| Type = [UnknownType] unknown -# 2259| ValueCategory = prvalue -# 2259| getExpr(): [Literal] Unknown literal -# 2259| Type = [UnknownType] unknown -# 2259| ValueCategory = prvalue -# 2259| getArgument(0): [VariableAccess] t -# 2259| Type = [LValueReferenceType] T & -# 2259| ValueCategory = prvalue(load) -# 2259| getArgument(0).getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2259| Type = [TemplateParameter] T -# 2259| ValueCategory = lvalue -# 2260| getStmt(1): [ReturnStmt] return ... -# 2258| [FunctionTemplateInstantiation,TopLevelFunction] void vacuous_destructor_call::call_destructor(int&) -# 2258| : -# 2258| getParameter(0): [Parameter] t -# 2258| Type = [LValueReferenceType] int & -# 2258| getEntryPoint(): [BlockStmt] { ... } -# 2259| getStmt(0): [ExprStmt] ExprStmt -# 2259| getExpr(): [VacuousDestructorCall] (vacuous destructor call) -# 2259| Type = [VoidType] void -# 2259| ValueCategory = prvalue -# 2259| getChild(0): [FunctionCall] call to get -# 2259| Type = [LValueReferenceType] int & -# 2259| ValueCategory = prvalue -# 2259| getArgument(0): [VariableAccess] t -# 2259| Type = [LValueReferenceType] int & -# 2259| ValueCategory = prvalue(load) -# 2259| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) -# 2259| Type = [LValueReferenceType] int & -# 2259| ValueCategory = prvalue -# 2259| getExpr(): [ReferenceDereferenceExpr] (reference dereference) -# 2259| Type = [IntType] int -# 2259| ValueCategory = lvalue -# 2259| getChild(0).getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2259| Type = [IntType] int -# 2259| ValueCategory = lvalue -# 2260| getStmt(1): [ReturnStmt] return ... -# 2262| [TopLevelFunction] void vacuous_destructor_call::non_vacuous_destructor_call() -# 2262| : -# 2262| getEntryPoint(): [BlockStmt] { ... } -# 2263| getStmt(0): [DeclStmt] declaration -# 2263| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c -# 2263| Type = [Class] ClassWithDestructor -# 2263| getVariable().getInitializer(): [Initializer] initializer for c -# 2263| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2263| Type = [VoidType] void -# 2263| ValueCategory = prvalue -# 2264| getStmt(1): [ExprStmt] ExprStmt -# 2264| getExpr(): [FunctionCall] call to call_destructor -# 2264| Type = [VoidType] void -# 2264| ValueCategory = prvalue -# 2264| getArgument(0): [VariableAccess] c -# 2264| Type = [Class] ClassWithDestructor -# 2264| ValueCategory = lvalue -# 2264| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) -# 2264| Type = [LValueReferenceType] ClassWithDestructor & -# 2264| ValueCategory = prvalue -# 2265| getStmt(2): [ReturnStmt] return ... -# 2265| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2250| getStmt(3): [ReturnStmt] return ... +# 2250| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2250| Type = [VoidType] void +# 2250| ValueCategory = prvalue +# 2250| getQualifier(): [VariableAccess] b +# 2250| Type = [Class] ClassWithDestructor +# 2250| ValueCategory = lvalue +# 2250| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor +# 2250| Type = [VoidType] void +# 2250| ValueCategory = prvalue +# 2250| getQualifier(): [VariableAccess] a +# 2250| Type = [Class] ClassWithDestructor +# 2250| ValueCategory = lvalue +# 2252| [GlobalVariable] ClassWithDestructor global_class_with_destructor +# 2252| getInitializer(): [Initializer] initializer for global_class_with_destructor +# 2252| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2252| Type = [VoidType] void +# 2252| ValueCategory = prvalue +# 2256| [FunctionTemplateInstantiation,TopLevelFunction] ClassWithDestructor& vacuous_destructor_call::get(ClassWithDestructor&) +# 2256| : +# 2256| getParameter(0): [Parameter] t +# 2256| Type = [LValueReferenceType] ClassWithDestructor & +# 2256| getEntryPoint(): [BlockStmt] { ... } +# 2256| getStmt(0): [ReturnStmt] return ... +# 2256| getExpr(): [VariableAccess] t +# 2256| Type = [LValueReferenceType] ClassWithDestructor & +# 2256| ValueCategory = prvalue(load) +# 2256| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2256| Type = [LValueReferenceType] ClassWithDestructor & +# 2256| ValueCategory = prvalue +# 2256| getExpr(): [ReferenceDereferenceExpr] (reference dereference) +# 2256| Type = [Class] ClassWithDestructor +# 2256| ValueCategory = lvalue +# 2256| [TemplateFunction,TopLevelFunction] T& vacuous_destructor_call::get(T&) +# 2256| : +# 2256| getParameter(0): [Parameter] t +# 2256| Type = [LValueReferenceType] T & +# 2256| getEntryPoint(): [BlockStmt] { ... } +# 2256| getStmt(0): [ReturnStmt] return ... +# 2256| getExpr(): [VariableAccess] t +# 2256| Type = [LValueReferenceType] T & +# 2256| ValueCategory = prvalue(load) +# 2256| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2256| Type = [TemplateParameter] T +# 2256| ValueCategory = lvalue +# 2256| [FunctionTemplateInstantiation,TopLevelFunction] int& vacuous_destructor_call::get(int&) +# 2256| : +# 2256| getParameter(0): [Parameter] t +# 2256| Type = [LValueReferenceType] int & +# 2256| getEntryPoint(): [BlockStmt] { ... } +# 2256| getStmt(0): [ReturnStmt] return ... +# 2256| getExpr(): [VariableAccess] t +# 2256| Type = [LValueReferenceType] int & +# 2256| ValueCategory = prvalue(load) +# 2256| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2256| Type = [LValueReferenceType] int & +# 2256| ValueCategory = prvalue +# 2256| getExpr(): [ReferenceDereferenceExpr] (reference dereference) +# 2256| Type = [IntType] int +# 2256| ValueCategory = lvalue +# 2259| [FunctionTemplateInstantiation,TopLevelFunction] void vacuous_destructor_call::call_destructor(ClassWithDestructor&) +# 2259| : +# 2259| getParameter(0): [Parameter] t +# 2259| Type = [LValueReferenceType] ClassWithDestructor & +# 2259| getEntryPoint(): [BlockStmt] { ... } +# 2260| getStmt(0): [ExprStmt] ExprStmt +# 2260| getExpr(): [DestructorCall] call to ~ClassWithDestructor +# 2260| Type = [VoidType] void +# 2260| ValueCategory = prvalue +# 2260| getQualifier(): [FunctionCall] call to get +# 2260| Type = [LValueReferenceType] ClassWithDestructor & +# 2260| ValueCategory = prvalue +# 2260| getArgument(0): [VariableAccess] t +# 2260| Type = [LValueReferenceType] ClassWithDestructor & +# 2260| ValueCategory = prvalue(load) +# 2260| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) +# 2260| Type = [LValueReferenceType] ClassWithDestructor & +# 2260| ValueCategory = prvalue +# 2260| getExpr(): [ReferenceDereferenceExpr] (reference dereference) +# 2260| Type = [Class] ClassWithDestructor +# 2260| ValueCategory = lvalue +# 2260| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2260| Type = [Class] ClassWithDestructor +# 2260| ValueCategory = lvalue +# 2261| getStmt(1): [ReturnStmt] return ... +# 2259| [TemplateFunction,TopLevelFunction] void vacuous_destructor_call::call_destructor(T&) +# 2259| : +# 2259| getParameter(0): [Parameter] t +# 2259| Type = [LValueReferenceType] T & +# 2259| getEntryPoint(): [BlockStmt] { ... } +# 2260| getStmt(0): [ExprStmt] ExprStmt +# 2260| getExpr(): [ExprCall] call to expression +# 2260| Type = [UnknownType] unknown +# 2260| ValueCategory = prvalue +# 2260| getExpr(): [Literal] Unknown literal +# 2260| Type = [UnknownType] unknown +# 2260| ValueCategory = prvalue +# 2260| getChild(-1): [ExprCall] call to expression +# 2260| Type = [UnknownType] unknown +# 2260| ValueCategory = prvalue +# 2260| getExpr(): [Literal] Unknown literal +# 2260| Type = [UnknownType] unknown +# 2260| ValueCategory = prvalue +# 2260| getArgument(0): [VariableAccess] t +# 2260| Type = [LValueReferenceType] T & +# 2260| ValueCategory = prvalue(load) +# 2260| getArgument(0).getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2260| Type = [TemplateParameter] T +# 2260| ValueCategory = lvalue +# 2261| getStmt(1): [ReturnStmt] return ... +# 2259| [FunctionTemplateInstantiation,TopLevelFunction] void vacuous_destructor_call::call_destructor(int&) +# 2259| : +# 2259| getParameter(0): [Parameter] t +# 2259| Type = [LValueReferenceType] int & +# 2259| getEntryPoint(): [BlockStmt] { ... } +# 2260| getStmt(0): [ExprStmt] ExprStmt +# 2260| getExpr(): [VacuousDestructorCall] (vacuous destructor call) +# 2260| Type = [VoidType] void +# 2260| ValueCategory = prvalue +# 2260| getChild(0): [FunctionCall] call to get +# 2260| Type = [LValueReferenceType] int & +# 2260| ValueCategory = prvalue +# 2260| getArgument(0): [VariableAccess] t +# 2260| Type = [LValueReferenceType] int & +# 2260| ValueCategory = prvalue(load) +# 2260| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) +# 2260| Type = [LValueReferenceType] int & +# 2260| ValueCategory = prvalue +# 2260| getExpr(): [ReferenceDereferenceExpr] (reference dereference) +# 2260| Type = [IntType] int +# 2260| ValueCategory = lvalue +# 2260| getChild(0).getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2260| Type = [IntType] int +# 2260| ValueCategory = lvalue +# 2261| getStmt(1): [ReturnStmt] return ... +# 2263| [TopLevelFunction] void vacuous_destructor_call::non_vacuous_destructor_call() +# 2263| : +# 2263| getEntryPoint(): [BlockStmt] { ... } +# 2264| getStmt(0): [DeclStmt] declaration +# 2264| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c +# 2264| Type = [Class] ClassWithDestructor +# 2264| getVariable().getInitializer(): [Initializer] initializer for c +# 2264| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2264| Type = [VoidType] void +# 2264| ValueCategory = prvalue +# 2265| getStmt(1): [ExprStmt] ExprStmt +# 2265| getExpr(): [FunctionCall] call to call_destructor # 2265| Type = [VoidType] void # 2265| ValueCategory = prvalue -# 2265| getQualifier(): [VariableAccess] c +# 2265| getArgument(0): [VariableAccess] c # 2265| Type = [Class] ClassWithDestructor # 2265| ValueCategory = lvalue -# 2267| [TopLevelFunction] void vacuous_destructor_call::vacuous_destructor_call() -# 2267| : -# 2267| getEntryPoint(): [BlockStmt] { ... } -# 2268| getStmt(0): [DeclStmt] declaration -# 2268| getDeclarationEntry(0): [VariableDeclarationEntry] definition of i -# 2268| Type = [IntType] int -# 2269| getStmt(1): [ExprStmt] ExprStmt -# 2269| getExpr(): [FunctionCall] call to call_destructor -# 2269| Type = [VoidType] void -# 2269| ValueCategory = prvalue -# 2269| getArgument(0): [VariableAccess] i -# 2269| Type = [IntType] int -# 2269| ValueCategory = lvalue -# 2269| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) -# 2269| Type = [LValueReferenceType] int & -# 2269| ValueCategory = prvalue -# 2270| getStmt(2): [ReturnStmt] return ... -# 2273| [TopLevelFunction] void TryCatchDestructors(bool) -# 2273| : -# 2273| getParameter(0): [Parameter] b -# 2273| Type = [BoolType] bool -# 2273| getEntryPoint(): [BlockStmt] { ... } -# 2274| getStmt(0): [TryStmt] try { ... } -# 2274| getStmt(): [BlockStmt] { ... } -# 2275| getStmt(0): [DeclStmt] declaration -# 2275| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2275| Type = [Struct] String -# 2275| getVariable().getInitializer(): [Initializer] initializer for s -# 2275| getExpr(): [ConstructorCall] call to String -# 2275| Type = [VoidType] void -# 2275| ValueCategory = prvalue -# 2276| getStmt(1): [IfStmt] if (...) ... -# 2276| getCondition(): [VariableAccess] b -# 2276| Type = [BoolType] bool -# 2276| ValueCategory = prvalue(load) -# 2276| getThen(): [BlockStmt] { ... } -# 2277| getStmt(0): [ExprStmt] ExprStmt -# 2277| getExpr(): [ThrowExpr] throw ... -# 2277| Type = [PointerType] const char * -# 2277| ValueCategory = prvalue -# 2277| getExpr(): string literal -# 2277| Type = [ArrayType] const char[15] -# 2277| Value = [StringLiteral] "string literal" -# 2277| ValueCategory = lvalue -# 2280| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2280| Type = [VoidType] void -# 2280| ValueCategory = prvalue -# 2280| getQualifier(): [VariableAccess] s -# 2280| Type = [Struct] String -# 2280| ValueCategory = lvalue -# 2277| getExpr().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion -# 2277| Type = [PointerType] const char * -# 2277| ValueCategory = prvalue -# 2279| getStmt(2): [DeclStmt] declaration -# 2279| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 -# 2279| Type = [Struct] String -# 2279| getVariable().getInitializer(): [Initializer] initializer for s2 -# 2279| getExpr(): [ConstructorCall] call to String -# 2279| Type = [VoidType] void -# 2279| ValueCategory = prvalue -# 2280| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2280| Type = [VoidType] void -# 2280| ValueCategory = prvalue -# 2280| getQualifier(): [VariableAccess] s2 +# 2265| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) +# 2265| Type = [LValueReferenceType] ClassWithDestructor & +# 2265| ValueCategory = prvalue +# 2266| getStmt(2): [ReturnStmt] return ... +# 2266| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2266| Type = [VoidType] void +# 2266| ValueCategory = prvalue +# 2266| getQualifier(): [VariableAccess] c +# 2266| Type = [Class] ClassWithDestructor +# 2266| ValueCategory = lvalue +# 2268| [TopLevelFunction] void vacuous_destructor_call::vacuous_destructor_call() +# 2268| : +# 2268| getEntryPoint(): [BlockStmt] { ... } +# 2269| getStmt(0): [DeclStmt] declaration +# 2269| getDeclarationEntry(0): [VariableDeclarationEntry] definition of i +# 2269| Type = [IntType] int +# 2270| getStmt(1): [ExprStmt] ExprStmt +# 2270| getExpr(): [FunctionCall] call to call_destructor +# 2270| Type = [VoidType] void +# 2270| ValueCategory = prvalue +# 2270| getArgument(0): [VariableAccess] i +# 2270| Type = [IntType] int +# 2270| ValueCategory = lvalue +# 2270| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) +# 2270| Type = [LValueReferenceType] int & +# 2270| ValueCategory = prvalue +# 2271| getStmt(2): [ReturnStmt] return ... +# 2274| [TopLevelFunction] void TryCatchDestructors(bool) +# 2274| : +# 2274| getParameter(0): [Parameter] b +# 2274| Type = [BoolType] bool +# 2274| getEntryPoint(): [BlockStmt] { ... } +# 2275| getStmt(0): [TryStmt] try { ... } +# 2275| getStmt(): [BlockStmt] { ... } +# 2276| getStmt(0): [DeclStmt] declaration +# 2276| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2276| Type = [Struct] String +# 2276| getVariable().getInitializer(): [Initializer] initializer for s +# 2276| getExpr(): [ConstructorCall] call to String +# 2276| Type = [VoidType] void +# 2276| ValueCategory = prvalue +# 2277| getStmt(1): [IfStmt] if (...) ... +# 2277| getCondition(): [VariableAccess] b +# 2277| Type = [BoolType] bool +# 2277| ValueCategory = prvalue(load) +# 2277| getThen(): [BlockStmt] { ... } +# 2278| getStmt(0): [ExprStmt] ExprStmt +# 2278| getExpr(): [ThrowExpr] throw ... +# 2278| Type = [PointerType] const char * +# 2278| ValueCategory = prvalue +# 2278| getExpr(): string literal +# 2278| Type = [ArrayType] const char[15] +# 2278| Value = [StringLiteral] "string literal" +# 2278| ValueCategory = lvalue +# 2281| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2281| Type = [VoidType] void +# 2281| ValueCategory = prvalue +# 2281| getQualifier(): [VariableAccess] s +# 2281| Type = [Struct] String +# 2281| ValueCategory = lvalue +# 2278| getExpr().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion +# 2278| Type = [PointerType] const char * +# 2278| ValueCategory = prvalue +# 2280| getStmt(2): [DeclStmt] declaration +# 2280| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 # 2280| Type = [Struct] String -# 2280| ValueCategory = lvalue -# 2280| getImplicitDestructorCall(1): [DestructorCall] call to ~String -# 2280| Type = [VoidType] void -# 2280| ValueCategory = prvalue -# 2280| getQualifier(): [VariableAccess] s -# 2280| Type = [Struct] String -# 2280| ValueCategory = lvalue -# 2281| getChild(1): [Handler] -# 2281| getBlock(): [CatchBlock] { ... } -# 2282| getStmt(0): [ExprStmt] ExprStmt -# 2282| getExpr(): [ThrowExpr] throw ... -# 2282| Type = [Struct] String -# 2282| ValueCategory = prvalue -# 2282| getExpr(): [ConstructorCall] call to String -# 2282| Type = [VoidType] void -# 2282| ValueCategory = prvalue -# 2282| getArgument(0): [VariableAccess] s -# 2282| Type = [PointerType] const char * -# 2282| ValueCategory = prvalue(load) -# 2284| getChild(2): [Handler] -# 2284| getBlock(): [CatchBlock] { ... } -# 2286| getChild(3): [Handler] -# 2286| getBlock(): [CatchAnyBlock] { ... } -# 2287| getStmt(0): [ExprStmt] ExprStmt -# 2287| getExpr(): [ReThrowExpr] re-throw exception -# 2287| Type = [VoidType] void -# 2287| ValueCategory = prvalue -# 2289| getStmt(1): [ReturnStmt] return ... -# 2291| [TopLevelFunction] void IfDestructors(bool) -# 2291| : -# 2291| getParameter(0): [Parameter] b -# 2291| Type = [BoolType] bool -# 2291| getEntryPoint(): [BlockStmt] { ... } -# 2292| getStmt(0): [DeclStmt] declaration -# 2292| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s1 -# 2292| Type = [Struct] String -# 2292| getVariable().getInitializer(): [Initializer] initializer for s1 -# 2292| getExpr(): [ConstructorCall] call to String -# 2292| Type = [VoidType] void -# 2292| ValueCategory = prvalue -# 2293| getStmt(1): [IfStmt] if (...) ... -# 2293| getCondition(): [VariableAccess] b -# 2293| Type = [BoolType] bool -# 2293| ValueCategory = prvalue(load) -# 2293| getThen(): [BlockStmt] { ... } -# 2294| getStmt(0): [DeclStmt] declaration -# 2294| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 -# 2294| Type = [Struct] String -# 2294| getVariable().getInitializer(): [Initializer] initializer for s2 -# 2294| getExpr(): [ConstructorCall] call to String -# 2294| Type = [VoidType] void -# 2294| ValueCategory = prvalue -# 2295| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2295| Type = [VoidType] void -# 2295| ValueCategory = prvalue -# 2295| getQualifier(): [VariableAccess] s2 +# 2280| getVariable().getInitializer(): [Initializer] initializer for s2 +# 2280| getExpr(): [ConstructorCall] call to String +# 2280| Type = [VoidType] void +# 2280| ValueCategory = prvalue +# 2281| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2281| Type = [VoidType] void +# 2281| ValueCategory = prvalue +# 2281| getQualifier(): [VariableAccess] s2 +# 2281| Type = [Struct] String +# 2281| ValueCategory = lvalue +# 2281| getImplicitDestructorCall(1): [DestructorCall] call to ~String +# 2281| Type = [VoidType] void +# 2281| ValueCategory = prvalue +# 2281| getQualifier(): [VariableAccess] s +# 2281| Type = [Struct] String +# 2281| ValueCategory = lvalue +# 2282| getChild(1): [Handler] +# 2282| getBlock(): [CatchBlock] { ... } +# 2283| getStmt(0): [ExprStmt] ExprStmt +# 2283| getExpr(): [ThrowExpr] throw ... +# 2283| Type = [Struct] String +# 2283| ValueCategory = prvalue +# 2283| getExpr(): [ConstructorCall] call to String +# 2283| Type = [VoidType] void +# 2283| ValueCategory = prvalue +# 2283| getArgument(0): [VariableAccess] s +# 2283| Type = [PointerType] const char * +# 2283| ValueCategory = prvalue(load) +# 2285| getChild(2): [Handler] +# 2285| getBlock(): [CatchBlock] { ... } +# 2287| getChild(3): [Handler] +# 2287| getBlock(): [CatchAnyBlock] { ... } +# 2288| getStmt(0): [ExprStmt] ExprStmt +# 2288| getExpr(): [ReThrowExpr] re-throw exception +# 2288| Type = [VoidType] void +# 2288| ValueCategory = prvalue +# 2290| getStmt(1): [ReturnStmt] return ... +# 2292| [TopLevelFunction] void IfDestructors(bool) +# 2292| : +# 2292| getParameter(0): [Parameter] b +# 2292| Type = [BoolType] bool +# 2292| getEntryPoint(): [BlockStmt] { ... } +# 2293| getStmt(0): [DeclStmt] declaration +# 2293| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s1 +# 2293| Type = [Struct] String +# 2293| getVariable().getInitializer(): [Initializer] initializer for s1 +# 2293| getExpr(): [ConstructorCall] call to String +# 2293| Type = [VoidType] void +# 2293| ValueCategory = prvalue +# 2294| getStmt(1): [IfStmt] if (...) ... +# 2294| getCondition(): [VariableAccess] b +# 2294| Type = [BoolType] bool +# 2294| ValueCategory = prvalue(load) +# 2294| getThen(): [BlockStmt] { ... } +# 2295| getStmt(0): [DeclStmt] declaration +# 2295| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 # 2295| Type = [Struct] String -# 2295| ValueCategory = lvalue -# 2295| getElse(): [BlockStmt] { ... } -# 2296| getStmt(0): [DeclStmt] declaration -# 2296| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s3 +# 2295| getVariable().getInitializer(): [Initializer] initializer for s2 +# 2295| getExpr(): [ConstructorCall] call to String +# 2295| Type = [VoidType] void +# 2295| ValueCategory = prvalue +# 2296| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2296| Type = [VoidType] void +# 2296| ValueCategory = prvalue +# 2296| getQualifier(): [VariableAccess] s2 # 2296| Type = [Struct] String -# 2296| getVariable().getInitializer(): [Initializer] initializer for s3 -# 2296| getExpr(): [ConstructorCall] call to String -# 2296| Type = [VoidType] void -# 2296| ValueCategory = prvalue -# 2297| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2297| Type = [VoidType] void -# 2297| ValueCategory = prvalue -# 2297| getQualifier(): [VariableAccess] s3 +# 2296| ValueCategory = lvalue +# 2296| getElse(): [BlockStmt] { ... } +# 2297| getStmt(0): [DeclStmt] declaration +# 2297| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s3 # 2297| Type = [Struct] String -# 2297| ValueCategory = lvalue -# 2298| getStmt(2): [DeclStmt] declaration -# 2298| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s4 -# 2298| Type = [Struct] String -# 2298| getVariable().getInitializer(): [Initializer] initializer for s4 -# 2298| getExpr(): [ConstructorCall] call to String -# 2298| Type = [VoidType] void -# 2298| ValueCategory = prvalue -# 2299| getStmt(3): [ReturnStmt] return ... -# 2299| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2299| Type = [VoidType] void -# 2299| ValueCategory = prvalue -# 2299| getQualifier(): [VariableAccess] s4 -# 2299| Type = [Struct] String -# 2299| ValueCategory = lvalue -# 2299| getImplicitDestructorCall(1): [DestructorCall] call to ~String -# 2299| Type = [VoidType] void -# 2299| ValueCategory = prvalue -# 2299| getQualifier(): [VariableAccess] s1 -# 2299| Type = [Struct] String -# 2299| ValueCategory = lvalue -# 2301| [TopLevelFunction] void ForDestructors() -# 2301| : -# 2301| getEntryPoint(): [BlockStmt] { ... } -# 2302| getStmt(0): [DeclStmt] declaration -# 2302| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c -# 2302| Type = [PlainCharType] char -# 2302| getVariable().getInitializer(): [Initializer] initializer for c -# 2302| getExpr(): [CharLiteral] 97 -# 2302| Type = [PlainCharType] char -# 2302| Value = [CharLiteral] 97 -# 2302| ValueCategory = prvalue -# 2303| getStmt(1): [ForStmt] for(...;...;...) ... -# 2303| getInitialization(): [DeclStmt] declaration -# 2303| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2303| Type = [Struct] String -# 2303| getVariable().getInitializer(): [Initializer] initializer for s -# 2303| getExpr(): [ConstructorCall] call to String -# 2303| Type = [VoidType] void -# 2303| ValueCategory = prvalue -# 2303| getArgument(0): hello -# 2303| Type = [ArrayType] const char[6] -# 2303| Value = [StringLiteral] "hello" -# 2303| ValueCategory = lvalue -# 2303| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion -# 2303| Type = [PointerType] const char * -# 2303| ValueCategory = prvalue -# 2303| getCondition(): [NEExpr] ... != ... -# 2303| Type = [BoolType] bool -# 2303| ValueCategory = prvalue -# 2303| getLeftOperand(): [VariableAccess] c -# 2303| Type = [PlainCharType] char -# 2303| ValueCategory = prvalue(load) -# 2303| getRightOperand(): [Literal] 0 -# 2303| Type = [IntType] int -# 2303| Value = [Literal] 0 -# 2303| ValueCategory = prvalue -# 2303| getLeftOperand().getFullyConverted(): [CStyleCast] (int)... -# 2303| Conversion = [IntegralConversion] integral conversion -# 2303| Type = [IntType] int -# 2303| ValueCategory = prvalue -# 2303| getUpdate(): [AssignExpr] ... = ... +# 2297| getVariable().getInitializer(): [Initializer] initializer for s3 +# 2297| getExpr(): [ConstructorCall] call to String +# 2297| Type = [VoidType] void +# 2297| ValueCategory = prvalue +# 2298| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2298| Type = [VoidType] void +# 2298| ValueCategory = prvalue +# 2298| getQualifier(): [VariableAccess] s3 +# 2298| Type = [Struct] String +# 2298| ValueCategory = lvalue +# 2299| getStmt(2): [DeclStmt] declaration +# 2299| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s4 +# 2299| Type = [Struct] String +# 2299| getVariable().getInitializer(): [Initializer] initializer for s4 +# 2299| getExpr(): [ConstructorCall] call to String +# 2299| Type = [VoidType] void +# 2299| ValueCategory = prvalue +# 2300| getStmt(3): [ReturnStmt] return ... +# 2300| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2300| Type = [VoidType] void +# 2300| ValueCategory = prvalue +# 2300| getQualifier(): [VariableAccess] s4 +# 2300| Type = [Struct] String +# 2300| ValueCategory = lvalue +# 2300| getImplicitDestructorCall(1): [DestructorCall] call to ~String +# 2300| Type = [VoidType] void +# 2300| ValueCategory = prvalue +# 2300| getQualifier(): [VariableAccess] s1 +# 2300| Type = [Struct] String +# 2300| ValueCategory = lvalue +# 2302| [TopLevelFunction] void ForDestructors() +# 2302| : +# 2302| getEntryPoint(): [BlockStmt] { ... } +# 2303| getStmt(0): [DeclStmt] declaration +# 2303| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c # 2303| Type = [PlainCharType] char -# 2303| ValueCategory = lvalue -# 2303| getLValue(): [VariableAccess] c -# 2303| Type = [PlainCharType] char -# 2303| ValueCategory = lvalue -# 2303| getRValue(): [FunctionCall] call to pop_back -# 2303| Type = [PlainCharType] char -# 2303| ValueCategory = prvalue -# 2303| getQualifier(): [VariableAccess] s -# 2303| Type = [Struct] String -# 2303| ValueCategory = lvalue -# 2303| getStmt(): [BlockStmt] { ... } -# 2304| getStmt(0): [DeclStmt] declaration -# 2304| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 -# 2304| Type = [Struct] String -# 2304| getVariable().getInitializer(): [Initializer] initializer for s2 -# 2304| getExpr(): [ConstructorCall] call to String -# 2304| Type = [VoidType] void +# 2303| getVariable().getInitializer(): [Initializer] initializer for c +# 2303| getExpr(): [CharLiteral] 97 +# 2303| Type = [PlainCharType] char +# 2303| Value = [CharLiteral] 97 +# 2303| ValueCategory = prvalue +# 2304| getStmt(1): [ForStmt] for(...;...;...) ... +# 2304| getInitialization(): [DeclStmt] declaration +# 2304| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2304| Type = [Struct] String +# 2304| getVariable().getInitializer(): [Initializer] initializer for s +# 2304| getExpr(): [ConstructorCall] call to String +# 2304| Type = [VoidType] void +# 2304| ValueCategory = prvalue +# 2304| getArgument(0): hello +# 2304| Type = [ArrayType] const char[6] +# 2304| Value = [StringLiteral] "hello" +# 2304| ValueCategory = lvalue +# 2304| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion +# 2304| Type = [PointerType] const char * # 2304| ValueCategory = prvalue -# 2305| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2305| Type = [VoidType] void -# 2305| ValueCategory = prvalue -# 2305| getQualifier(): [VariableAccess] s2 +# 2304| getCondition(): [NEExpr] ... != ... +# 2304| Type = [BoolType] bool +# 2304| ValueCategory = prvalue +# 2304| getLeftOperand(): [VariableAccess] c +# 2304| Type = [PlainCharType] char +# 2304| ValueCategory = prvalue(load) +# 2304| getRightOperand(): [Literal] 0 +# 2304| Type = [IntType] int +# 2304| Value = [Literal] 0 +# 2304| ValueCategory = prvalue +# 2304| getLeftOperand().getFullyConverted(): [CStyleCast] (int)... +# 2304| Conversion = [IntegralConversion] integral conversion +# 2304| Type = [IntType] int +# 2304| ValueCategory = prvalue +# 2304| getUpdate(): [AssignExpr] ... = ... +# 2304| Type = [PlainCharType] char +# 2304| ValueCategory = lvalue +# 2304| getLValue(): [VariableAccess] c +# 2304| Type = [PlainCharType] char +# 2304| ValueCategory = lvalue +# 2304| getRValue(): [FunctionCall] call to pop_back +# 2304| Type = [PlainCharType] char +# 2304| ValueCategory = prvalue +# 2304| getQualifier(): [VariableAccess] s +# 2304| Type = [Struct] String +# 2304| ValueCategory = lvalue +# 2304| getStmt(): [BlockStmt] { ... } +# 2305| getStmt(0): [DeclStmt] declaration +# 2305| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 # 2305| Type = [Struct] String -# 2305| ValueCategory = lvalue -# 2303| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2303| Type = [VoidType] void -# 2303| ValueCategory = prvalue -# 2303| getQualifier(): [VariableAccess] s -# 2303| Type = [Struct] String -# 2303| ValueCategory = lvalue -# 2307| getStmt(2): [RangeBasedForStmt] for(...:...) ... -# 2307| getChild(1): [DeclStmt] declaration -# 2307| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) -# 2307| Type = [RValueReferenceType] vector && +# 2305| getVariable().getInitializer(): [Initializer] initializer for s2 +# 2305| getExpr(): [ConstructorCall] call to String +# 2305| Type = [VoidType] void +# 2305| ValueCategory = prvalue +# 2306| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2306| Type = [VoidType] void +# 2306| ValueCategory = prvalue +# 2306| getQualifier(): [VariableAccess] s2 +# 2306| Type = [Struct] String +# 2306| ValueCategory = lvalue +# 2304| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2304| Type = [VoidType] void +# 2304| ValueCategory = prvalue +# 2304| getQualifier(): [VariableAccess] s +# 2304| Type = [Struct] String +# 2304| ValueCategory = lvalue +# 2308| getStmt(2): [RangeBasedForStmt] for(...:...) ... +# 2308| getChild(1): [DeclStmt] declaration +# 2308| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) +# 2308| Type = [RValueReferenceType] vector && #-----| getVariable().getInitializer(): [Initializer] initializer for (__range) -# 2307| getExpr(): [ConstructorCall] call to vector -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getArgument(0): [ConstructorCall] call to String -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getArgument(0): hello -# 2307| Type = [ArrayType] const char[6] -# 2307| Value = [StringLiteral] "hello" -# 2307| ValueCategory = lvalue -# 2307| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion -# 2307| Type = [PointerType] const char * -# 2307| ValueCategory = prvalue -# 2307| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2307| Type = [Struct] String -# 2307| ValueCategory = lvalue -# 2307| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2307| Type = [LValueReferenceType] vector & -# 2307| ValueCategory = prvalue -# 2307| getExpr(): [TemporaryObjectExpr] temporary object -# 2307| Type = [ClassTemplateInstantiation,Struct] vector -# 2307| ValueCategory = xvalue -# 2307| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [ReuseExpr] reuse of temporary object -# 2307| Type = [Struct] String -# 2307| ValueCategory = xvalue -# 2307| getBeginEndDeclaration(): [DeclStmt] declaration -# 2307| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| getExpr(): [ConstructorCall] call to vector +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getArgument(0): [ConstructorCall] call to String +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getArgument(0): hello +# 2308| Type = [ArrayType] const char[6] +# 2308| Value = [StringLiteral] "hello" +# 2308| ValueCategory = lvalue +# 2308| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion +# 2308| Type = [PointerType] const char * +# 2308| ValueCategory = prvalue +# 2308| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2308| Type = [Struct] String +# 2308| ValueCategory = lvalue +# 2308| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2308| Type = [LValueReferenceType] vector & +# 2308| ValueCategory = prvalue +# 2308| getExpr(): [TemporaryObjectExpr] temporary object +# 2308| Type = [ClassTemplateInstantiation,Struct] vector +# 2308| ValueCategory = xvalue +# 2308| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [ReuseExpr] reuse of temporary object +# 2308| Type = [Struct] String +# 2308| ValueCategory = xvalue +# 2308| getBeginEndDeclaration(): [DeclStmt] declaration +# 2308| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__begin) -# 2307| getExpr(): [FunctionCall] call to begin -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [VariableAccess] (__range) -# 2307| Type = [RValueReferenceType] vector && -# 2307| ValueCategory = prvalue(load) +# 2308| getExpr(): [FunctionCall] call to begin +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [VariableAccess] (__range) +# 2308| Type = [RValueReferenceType] vector && +# 2308| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -20589,15 +20591,15 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2307| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__end) -# 2307| getExpr(): [FunctionCall] call to end -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [VariableAccess] (__range) -# 2307| Type = [RValueReferenceType] vector && -# 2307| ValueCategory = prvalue(load) +# 2308| getExpr(): [FunctionCall] call to end +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [VariableAccess] (__range) +# 2308| Type = [RValueReferenceType] vector && +# 2308| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -20605,18 +20607,18 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2307| getCondition(): [FunctionCall] call to operator!= -# 2307| Type = [BoolType] bool -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [VariableAccess] (__begin) -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2307| ValueCategory = lvalue -# 2307| getArgument(0): [ConstructorCall] call to iterator -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getArgument(0): [VariableAccess] (__end) -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2307| ValueCategory = lvalue +# 2308| getCondition(): [FunctionCall] call to operator!= +# 2308| Type = [BoolType] bool +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [VariableAccess] (__begin) +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| ValueCategory = lvalue +# 2308| getArgument(0): [ConstructorCall] call to iterator +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getArgument(0): [VariableAccess] (__end) +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| ValueCategory = lvalue #-----| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) #-----| Type = [LValueReferenceType] const iterator & #-----| ValueCategory = prvalue @@ -20631,1497 +20633,1497 @@ ir.cpp: #-----| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object #-----| Type = [ClassTemplateInstantiation,Struct] iterator #-----| ValueCategory = lvalue -# 2307| getUpdate(): [FunctionCall] call to operator++ -# 2307| Type = [LValueReferenceType] iterator & -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [VariableAccess] (__begin) -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2307| ValueCategory = lvalue -# 2307| getChild(5): [DeclStmt] declaration -# 2307| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2307| Type = [Struct] String -# 2307| getVariable().getInitializer(): [Initializer] initializer for s -# 2307| getExpr(): [ConstructorCall] call to String -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getArgument(0): [OverloadedPointerDereferenceExpr] call to operator* -# 2307| Type = [LValueReferenceType] String & -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [VariableAccess] (__begin) -# 2307| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2307| ValueCategory = lvalue +# 2308| getUpdate(): [FunctionCall] call to operator++ +# 2308| Type = [LValueReferenceType] iterator & +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [VariableAccess] (__begin) +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| ValueCategory = lvalue +# 2308| getChild(5): [DeclStmt] declaration +# 2308| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2308| Type = [Struct] String +# 2308| getVariable().getInitializer(): [Initializer] initializer for s +# 2308| getExpr(): [ConstructorCall] call to String +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getArgument(0): [OverloadedPointerDereferenceExpr] call to operator* +# 2308| Type = [LValueReferenceType] String & +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [VariableAccess] (__begin) +# 2308| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2308| ValueCategory = lvalue #-----| getQualifier().getFullyConverted(): [CStyleCast] (const iterator)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const iterator #-----| ValueCategory = lvalue -# 2307| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) -# 2307| Type = [LValueReferenceType] const String & -# 2307| ValueCategory = prvalue -# 2307| getExpr(): [CStyleCast] (const String)... -# 2307| Conversion = [GlvalueConversion] glvalue conversion -# 2307| Type = [SpecifiedType] const String -# 2307| ValueCategory = lvalue -# 2307| getExpr(): [ReferenceDereferenceExpr] (reference dereference) -# 2307| Type = [Struct] String -# 2307| ValueCategory = lvalue -# 2307| getStmt(): [BlockStmt] { ... } -# 2308| getStmt(0): [DeclStmt] declaration -# 2308| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 -# 2308| Type = [Struct] String -# 2308| getVariable().getInitializer(): [Initializer] initializer for s2 -# 2308| getExpr(): [ConstructorCall] call to String -# 2308| Type = [VoidType] void +# 2308| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) +# 2308| Type = [LValueReferenceType] const String & # 2308| ValueCategory = prvalue -# 2309| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2309| Type = [VoidType] void -# 2309| ValueCategory = prvalue -# 2309| getQualifier(): [VariableAccess] s2 +# 2308| getExpr(): [CStyleCast] (const String)... +# 2308| Conversion = [GlvalueConversion] glvalue conversion +# 2308| Type = [SpecifiedType] const String +# 2308| ValueCategory = lvalue +# 2308| getExpr(): [ReferenceDereferenceExpr] (reference dereference) +# 2308| Type = [Struct] String +# 2308| ValueCategory = lvalue +# 2308| getStmt(): [BlockStmt] { ... } +# 2309| getStmt(0): [DeclStmt] declaration +# 2309| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 # 2309| Type = [Struct] String -# 2309| ValueCategory = lvalue -# 2307| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [ReuseExpr] reuse of temporary object -# 2307| Type = [ClassTemplateInstantiation,Struct] vector -# 2307| ValueCategory = xvalue -# 2307| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2307| Type = [ClassTemplateInstantiation,Struct] iterator -# 2307| ValueCategory = lvalue -# 2307| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2307| Type = [VoidType] void -# 2307| ValueCategory = prvalue -# 2307| getQualifier(): [VariableAccess] s -# 2307| Type = [Struct] String -# 2307| ValueCategory = lvalue -# 2311| getStmt(3): [ForStmt] for(...;...;...) ... -# 2311| getInitialization(): [DeclStmt] declaration -# 2311| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2311| Type = [Struct] String -# 2311| getVariable().getInitializer(): [Initializer] initializer for s -# 2311| getExpr(): [ConstructorCall] call to String -# 2311| Type = [VoidType] void -# 2311| ValueCategory = prvalue -# 2311| getArgument(0): hello -# 2311| Type = [ArrayType] const char[6] -# 2311| Value = [StringLiteral] "hello" -# 2311| ValueCategory = lvalue -# 2311| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion -# 2311| Type = [PointerType] const char * -# 2311| ValueCategory = prvalue -# 2311| getDeclarationEntry(1): [VariableDeclarationEntry] definition of s2 -# 2311| Type = [Struct] String -# 2311| getVariable().getInitializer(): [Initializer] initializer for s2 -# 2311| getExpr(): [ConstructorCall] call to String -# 2311| Type = [VoidType] void -# 2311| ValueCategory = prvalue -# 2311| getArgument(0): world -# 2311| Type = [ArrayType] const char[6] -# 2311| Value = [StringLiteral] "world" -# 2311| ValueCategory = lvalue -# 2311| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion -# 2311| Type = [PointerType] const char * -# 2311| ValueCategory = prvalue -# 2311| getCondition(): [NEExpr] ... != ... -# 2311| Type = [BoolType] bool -# 2311| ValueCategory = prvalue -# 2311| getLeftOperand(): [VariableAccess] c -# 2311| Type = [PlainCharType] char -# 2311| ValueCategory = prvalue(load) -# 2311| getRightOperand(): [Literal] 0 -# 2311| Type = [IntType] int -# 2311| Value = [Literal] 0 -# 2311| ValueCategory = prvalue -# 2311| getLeftOperand().getFullyConverted(): [CStyleCast] (int)... -# 2311| Conversion = [IntegralConversion] integral conversion -# 2311| Type = [IntType] int -# 2311| ValueCategory = prvalue -# 2311| getUpdate(): [AssignExpr] ... = ... -# 2311| Type = [PlainCharType] char -# 2311| ValueCategory = lvalue -# 2311| getLValue(): [VariableAccess] c -# 2311| Type = [PlainCharType] char -# 2311| ValueCategory = lvalue -# 2311| getRValue(): [FunctionCall] call to pop_back -# 2311| Type = [PlainCharType] char -# 2311| ValueCategory = prvalue -# 2311| getQualifier(): [VariableAccess] s -# 2311| Type = [Struct] String -# 2311| ValueCategory = lvalue -# 2311| getStmt(): [BlockStmt] { ... } -# 2312| getStmt(0): [ExprStmt] ExprStmt -# 2312| getExpr(): [AssignExpr] ... = ... -# 2312| Type = [PlainCharType] char +# 2309| getVariable().getInitializer(): [Initializer] initializer for s2 +# 2309| getExpr(): [ConstructorCall] call to String +# 2309| Type = [VoidType] void +# 2309| ValueCategory = prvalue +# 2310| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2310| Type = [VoidType] void +# 2310| ValueCategory = prvalue +# 2310| getQualifier(): [VariableAccess] s2 +# 2310| Type = [Struct] String +# 2310| ValueCategory = lvalue +# 2308| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [ReuseExpr] reuse of temporary object +# 2308| Type = [ClassTemplateInstantiation,Struct] vector +# 2308| ValueCategory = xvalue +# 2308| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2308| Type = [ClassTemplateInstantiation,Struct] iterator +# 2308| ValueCategory = lvalue +# 2308| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2308| Type = [VoidType] void +# 2308| ValueCategory = prvalue +# 2308| getQualifier(): [VariableAccess] s +# 2308| Type = [Struct] String +# 2308| ValueCategory = lvalue +# 2312| getStmt(3): [ForStmt] for(...;...;...) ... +# 2312| getInitialization(): [DeclStmt] declaration +# 2312| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2312| Type = [Struct] String +# 2312| getVariable().getInitializer(): [Initializer] initializer for s +# 2312| getExpr(): [ConstructorCall] call to String +# 2312| Type = [VoidType] void +# 2312| ValueCategory = prvalue +# 2312| getArgument(0): hello +# 2312| Type = [ArrayType] const char[6] +# 2312| Value = [StringLiteral] "hello" +# 2312| ValueCategory = lvalue +# 2312| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion +# 2312| Type = [PointerType] const char * +# 2312| ValueCategory = prvalue +# 2312| getDeclarationEntry(1): [VariableDeclarationEntry] definition of s2 +# 2312| Type = [Struct] String +# 2312| getVariable().getInitializer(): [Initializer] initializer for s2 +# 2312| getExpr(): [ConstructorCall] call to String +# 2312| Type = [VoidType] void +# 2312| ValueCategory = prvalue +# 2312| getArgument(0): world +# 2312| Type = [ArrayType] const char[6] +# 2312| Value = [StringLiteral] "world" +# 2312| ValueCategory = lvalue +# 2312| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion +# 2312| Type = [PointerType] const char * +# 2312| ValueCategory = prvalue +# 2312| getCondition(): [NEExpr] ... != ... +# 2312| Type = [BoolType] bool +# 2312| ValueCategory = prvalue +# 2312| getLeftOperand(): [VariableAccess] c +# 2312| Type = [PlainCharType] char +# 2312| ValueCategory = prvalue(load) +# 2312| getRightOperand(): [Literal] 0 +# 2312| Type = [IntType] int +# 2312| Value = [Literal] 0 +# 2312| ValueCategory = prvalue +# 2312| getLeftOperand().getFullyConverted(): [CStyleCast] (int)... +# 2312| Conversion = [IntegralConversion] integral conversion +# 2312| Type = [IntType] int +# 2312| ValueCategory = prvalue +# 2312| getUpdate(): [AssignExpr] ... = ... +# 2312| Type = [PlainCharType] char +# 2312| ValueCategory = lvalue +# 2312| getLValue(): [VariableAccess] c +# 2312| Type = [PlainCharType] char +# 2312| ValueCategory = lvalue +# 2312| getRValue(): [FunctionCall] call to pop_back +# 2312| Type = [PlainCharType] char +# 2312| ValueCategory = prvalue +# 2312| getQualifier(): [VariableAccess] s +# 2312| Type = [Struct] String # 2312| ValueCategory = lvalue -# 2312| getLValue(): [VariableAccess] c -# 2312| Type = [PlainCharType] char -# 2312| ValueCategory = lvalue -# 2312| getRValue(): [Literal] 0 -# 2312| Type = [IntType] int -# 2312| Value = [Literal] 0 -# 2312| ValueCategory = prvalue -# 2312| getRValue().getFullyConverted(): [CStyleCast] (char)... -# 2312| Conversion = [IntegralConversion] integral conversion -# 2312| Type = [PlainCharType] char -# 2312| Value = [CStyleCast] 0 -# 2312| ValueCategory = prvalue -# 2311| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2311| Type = [VoidType] void -# 2311| ValueCategory = prvalue -# 2311| getQualifier(): [VariableAccess] s2 -# 2311| Type = [Struct] String -# 2311| ValueCategory = lvalue -# 2311| getImplicitDestructorCall(1): [DestructorCall] call to ~String -# 2311| Type = [VoidType] void -# 2311| ValueCategory = prvalue -# 2311| getQualifier(): [VariableAccess] s -# 2311| Type = [Struct] String -# 2311| ValueCategory = lvalue -# 2314| getStmt(4): [ReturnStmt] return ... -# 2316| [TopLevelFunction] void IfDestructors2(bool) -# 2316| : -# 2316| getParameter(0): [Parameter] b -# 2316| Type = [BoolType] bool -# 2316| getEntryPoint(): [BlockStmt] { ... } -# 2317| getStmt(0): [IfStmt] if (...) ... -# 2317| getInitialization(): [DeclStmt] declaration -# 2317| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2317| Type = [Struct] String -# 2317| getVariable().getInitializer(): [Initializer] initializer for s -# 2317| getExpr(): [ConstructorCall] call to String -# 2317| Type = [VoidType] void -# 2317| ValueCategory = prvalue -# 2317| getArgument(0): hello -# 2317| Type = [ArrayType] const char[6] -# 2317| Value = [StringLiteral] "hello" -# 2317| ValueCategory = lvalue -# 2317| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion -# 2317| Type = [PointerType] const char * -# 2317| ValueCategory = prvalue -# 2317| getCondition(): [VariableAccess] b -# 2317| Type = [BoolType] bool -# 2317| ValueCategory = prvalue(load) -# 2317| getThen(): [BlockStmt] { ... } -# 2318| getStmt(0): [DeclStmt] declaration -# 2318| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2318| Type = [IntType] int -# 2318| getVariable().getInitializer(): [Initializer] initializer for x -# 2318| getExpr(): [Literal] 0 -# 2318| Type = [IntType] int -# 2318| Value = [Literal] 0 +# 2312| getStmt(): [BlockStmt] { ... } +# 2313| getStmt(0): [ExprStmt] ExprStmt +# 2313| getExpr(): [AssignExpr] ... = ... +# 2313| Type = [PlainCharType] char +# 2313| ValueCategory = lvalue +# 2313| getLValue(): [VariableAccess] c +# 2313| Type = [PlainCharType] char +# 2313| ValueCategory = lvalue +# 2313| getRValue(): [Literal] 0 +# 2313| Type = [IntType] int +# 2313| Value = [Literal] 0 +# 2313| ValueCategory = prvalue +# 2313| getRValue().getFullyConverted(): [CStyleCast] (char)... +# 2313| Conversion = [IntegralConversion] integral conversion +# 2313| Type = [PlainCharType] char +# 2313| Value = [CStyleCast] 0 +# 2313| ValueCategory = prvalue +# 2312| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2312| Type = [VoidType] void +# 2312| ValueCategory = prvalue +# 2312| getQualifier(): [VariableAccess] s2 +# 2312| Type = [Struct] String +# 2312| ValueCategory = lvalue +# 2312| getImplicitDestructorCall(1): [DestructorCall] call to ~String +# 2312| Type = [VoidType] void +# 2312| ValueCategory = prvalue +# 2312| getQualifier(): [VariableAccess] s +# 2312| Type = [Struct] String +# 2312| ValueCategory = lvalue +# 2315| getStmt(4): [ReturnStmt] return ... +# 2317| [TopLevelFunction] void IfDestructors2(bool) +# 2317| : +# 2317| getParameter(0): [Parameter] b +# 2317| Type = [BoolType] bool +# 2317| getEntryPoint(): [BlockStmt] { ... } +# 2318| getStmt(0): [IfStmt] if (...) ... +# 2318| getInitialization(): [DeclStmt] declaration +# 2318| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2318| Type = [Struct] String +# 2318| getVariable().getInitializer(): [Initializer] initializer for s +# 2318| getExpr(): [ConstructorCall] call to String +# 2318| Type = [VoidType] void +# 2318| ValueCategory = prvalue +# 2318| getArgument(0): hello +# 2318| Type = [ArrayType] const char[6] +# 2318| Value = [StringLiteral] "hello" +# 2318| ValueCategory = lvalue +# 2318| getArgument(0).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion +# 2318| Type = [PointerType] const char * # 2318| ValueCategory = prvalue -# 2319| getElse(): [BlockStmt] { ... } -# 2320| getStmt(0): [DeclStmt] declaration -# 2320| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2320| Type = [IntType] int -# 2320| getVariable().getInitializer(): [Initializer] initializer for y -# 2320| getExpr(): [Literal] 0 -# 2320| Type = [IntType] int -# 2320| Value = [Literal] 0 -# 2320| ValueCategory = prvalue -# 2321| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2321| Type = [VoidType] void -# 2321| ValueCategory = prvalue -# 2321| getQualifier(): [VariableAccess] s -# 2321| Type = [Struct] String -# 2321| ValueCategory = lvalue -# 2322| getStmt(1): [ReturnStmt] return ... -# 2324| [CopyAssignmentOperator] Bool& Bool::operator=(Bool const&) -# 2324| : +# 2318| getCondition(): [VariableAccess] b +# 2318| Type = [BoolType] bool +# 2318| ValueCategory = prvalue(load) +# 2318| getThen(): [BlockStmt] { ... } +# 2319| getStmt(0): [DeclStmt] declaration +# 2319| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2319| Type = [IntType] int +# 2319| getVariable().getInitializer(): [Initializer] initializer for x +# 2319| getExpr(): [Literal] 0 +# 2319| Type = [IntType] int +# 2319| Value = [Literal] 0 +# 2319| ValueCategory = prvalue +# 2320| getElse(): [BlockStmt] { ... } +# 2321| getStmt(0): [DeclStmt] declaration +# 2321| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2321| Type = [IntType] int +# 2321| getVariable().getInitializer(): [Initializer] initializer for y +# 2321| getExpr(): [Literal] 0 +# 2321| Type = [IntType] int +# 2321| Value = [Literal] 0 +# 2321| ValueCategory = prvalue +# 2322| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2322| Type = [VoidType] void +# 2322| ValueCategory = prvalue +# 2322| getQualifier(): [VariableAccess] s +# 2322| Type = [Struct] String +# 2322| ValueCategory = lvalue +# 2323| getStmt(1): [ReturnStmt] return ... +# 2325| [CopyAssignmentOperator] Bool& Bool::operator=(Bool const&) +# 2325| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [LValueReferenceType] const Bool & -# 2324| [CopyConstructor] void Bool::Bool(Bool const&) -# 2324| : +# 2325| [CopyConstructor] void Bool::Bool(Bool const&) +# 2325| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [LValueReferenceType] const Bool & -# 2326| [Constructor] void Bool::Bool(bool) -# 2326| : -# 2326| getParameter(0): [Parameter] b_ -# 2326| Type = [BoolType] bool -# 2327| [ConversionOperator] bool Bool::operator bool() +# 2327| [Constructor] void Bool::Bool(bool) # 2327| : -# 2328| [Destructor] void Bool::~Bool() +# 2327| getParameter(0): [Parameter] b_ +# 2327| Type = [BoolType] bool +# 2328| [ConversionOperator] bool Bool::operator bool() # 2328| : -# 2331| [TopLevelFunction] void IfDestructors3(bool) -# 2331| : -# 2331| getParameter(0): [Parameter] b -# 2331| Type = [BoolType] bool -# 2331| getEntryPoint(): [BlockStmt] { ... } -# 2332| getStmt(0): [IfStmt] if (...) ... -# 2332| getCondition(): [ConditionDeclExpr] (condition decl) -# 2332| Type = [BoolType] bool -# 2332| ValueCategory = prvalue -# 2332| getChild(0): [FunctionCall] call to operator bool -# 2332| Type = [BoolType] bool -# 2332| ValueCategory = prvalue -# 2332| getQualifier(): [VariableAccess] B -# 2332| Type = [Class] Bool -# 2332| ValueCategory = prvalue(load) -# 2332| getInitializingExpr(): [ConstructorCall] call to Bool -# 2332| Type = [VoidType] void -# 2332| ValueCategory = prvalue -# 2332| getArgument(0): [VariableAccess] b -# 2332| Type = [BoolType] bool -# 2332| ValueCategory = prvalue(load) -# 2332| getThen(): [BlockStmt] { ... } -# 2333| getStmt(0): [DeclStmt] declaration -# 2333| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s1 -# 2333| Type = [Struct] String -# 2333| getVariable().getInitializer(): [Initializer] initializer for s1 -# 2333| getExpr(): [ConstructorCall] call to String -# 2333| Type = [VoidType] void -# 2333| ValueCategory = prvalue -# 2334| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2334| Type = [VoidType] void -# 2334| ValueCategory = prvalue -# 2334| getQualifier(): [VariableAccess] s1 +# 2329| [Destructor] void Bool::~Bool() +# 2329| : +# 2332| [TopLevelFunction] void IfDestructors3(bool) +# 2332| : +# 2332| getParameter(0): [Parameter] b +# 2332| Type = [BoolType] bool +# 2332| getEntryPoint(): [BlockStmt] { ... } +# 2333| getStmt(0): [IfStmt] if (...) ... +# 2333| getCondition(): [ConditionDeclExpr] (condition decl) +# 2333| Type = [BoolType] bool +# 2333| ValueCategory = prvalue +# 2333| getChild(0): [FunctionCall] call to operator bool +# 2333| Type = [BoolType] bool +# 2333| ValueCategory = prvalue +# 2333| getQualifier(): [VariableAccess] B +# 2333| Type = [Class] Bool +# 2333| ValueCategory = prvalue(load) +# 2333| getInitializingExpr(): [ConstructorCall] call to Bool +# 2333| Type = [VoidType] void +# 2333| ValueCategory = prvalue +# 2333| getArgument(0): [VariableAccess] b +# 2333| Type = [BoolType] bool +# 2333| ValueCategory = prvalue(load) +# 2333| getThen(): [BlockStmt] { ... } +# 2334| getStmt(0): [DeclStmt] declaration +# 2334| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s1 # 2334| Type = [Struct] String -# 2334| ValueCategory = lvalue -# 2334| getElse(): [BlockStmt] { ... } -# 2335| getStmt(0): [DeclStmt] declaration -# 2335| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 +# 2334| getVariable().getInitializer(): [Initializer] initializer for s1 +# 2334| getExpr(): [ConstructorCall] call to String +# 2334| Type = [VoidType] void +# 2334| ValueCategory = prvalue +# 2335| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2335| Type = [VoidType] void +# 2335| ValueCategory = prvalue +# 2335| getQualifier(): [VariableAccess] s1 # 2335| Type = [Struct] String -# 2335| getVariable().getInitializer(): [Initializer] initializer for s2 -# 2335| getExpr(): [ConstructorCall] call to String -# 2335| Type = [VoidType] void -# 2335| ValueCategory = prvalue -# 2336| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2336| Type = [VoidType] void -# 2336| ValueCategory = prvalue -# 2336| getQualifier(): [VariableAccess] s2 +# 2335| ValueCategory = lvalue +# 2335| getElse(): [BlockStmt] { ... } +# 2336| getStmt(0): [DeclStmt] declaration +# 2336| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s2 # 2336| Type = [Struct] String -# 2336| ValueCategory = lvalue -# 2336| getImplicitDestructorCall(0): [DestructorCall] call to ~Bool -# 2336| Type = [VoidType] void -# 2336| ValueCategory = prvalue -# 2336| getQualifier(): [VariableAccess] B -# 2336| Type = [Class] Bool -# 2336| ValueCategory = lvalue -# 2337| getStmt(1): [ReturnStmt] return ... -# 2339| [TopLevelFunction] void WhileLoopDestructors(bool) -# 2339| : -# 2339| getParameter(0): [Parameter] b -# 2339| Type = [BoolType] bool -# 2339| getEntryPoint(): [BlockStmt] { ... } -# 2340| getStmt(0): [BlockStmt] { ... } -# 2341| getStmt(0): [DeclStmt] declaration -# 2341| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2341| Type = [Struct] String -# 2341| getVariable().getInitializer(): [Initializer] initializer for s -# 2341| getExpr(): [ConstructorCall] call to String -# 2341| Type = [VoidType] void -# 2341| ValueCategory = prvalue -# 2342| getStmt(1): [WhileStmt] while (...) ... -# 2342| getCondition(): [VariableAccess] b -# 2342| Type = [BoolType] bool -# 2342| ValueCategory = prvalue(load) -# 2342| getStmt(): [BlockStmt] { ... } -# 2343| getStmt(0): [ExprStmt] ExprStmt -# 2343| getExpr(): [AssignExpr] ... = ... -# 2343| Type = [BoolType] bool -# 2343| ValueCategory = lvalue -# 2343| getLValue(): [VariableAccess] b -# 2343| Type = [BoolType] bool -# 2343| ValueCategory = lvalue -# 2343| getRValue(): [Literal] 0 -# 2343| Type = [BoolType] bool -# 2343| Value = [Literal] 0 -# 2343| ValueCategory = prvalue -# 2345| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2345| Type = [VoidType] void -# 2345| ValueCategory = prvalue -# 2345| getQualifier(): [VariableAccess] s -# 2345| Type = [Struct] String -# 2345| ValueCategory = lvalue -# 2347| getStmt(1): [BlockStmt] { ... } -# 2348| getStmt(0): [WhileStmt] while (...) ... -# 2348| getCondition(): [ConditionDeclExpr] (condition decl) -# 2348| Type = [BoolType] bool -# 2348| ValueCategory = prvalue -# 2348| getChild(0): [FunctionCall] call to operator bool -# 2348| Type = [BoolType] bool -# 2348| ValueCategory = prvalue -# 2348| getQualifier(): [VariableAccess] B -# 2348| Type = [Class] Bool -# 2348| ValueCategory = prvalue(load) -# 2348| getInitializingExpr(): [ConstructorCall] call to Bool -# 2348| Type = [VoidType] void -# 2348| ValueCategory = prvalue -# 2348| getArgument(0): [VariableAccess] b -# 2348| Type = [BoolType] bool -# 2348| ValueCategory = prvalue(load) -# 2348| getStmt(): [BlockStmt] { ... } -# 2349| getStmt(0): [ExprStmt] ExprStmt -# 2349| getExpr(): [AssignExpr] ... = ... +# 2336| getVariable().getInitializer(): [Initializer] initializer for s2 +# 2336| getExpr(): [ConstructorCall] call to String +# 2336| Type = [VoidType] void +# 2336| ValueCategory = prvalue +# 2337| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2337| Type = [VoidType] void +# 2337| ValueCategory = prvalue +# 2337| getQualifier(): [VariableAccess] s2 +# 2337| Type = [Struct] String +# 2337| ValueCategory = lvalue +# 2337| getImplicitDestructorCall(0): [DestructorCall] call to ~Bool +# 2337| Type = [VoidType] void +# 2337| ValueCategory = prvalue +# 2337| getQualifier(): [VariableAccess] B +# 2337| Type = [Class] Bool +# 2337| ValueCategory = lvalue +# 2338| getStmt(1): [ReturnStmt] return ... +# 2340| [TopLevelFunction] void WhileLoopDestructors(bool) +# 2340| : +# 2340| getParameter(0): [Parameter] b +# 2340| Type = [BoolType] bool +# 2340| getEntryPoint(): [BlockStmt] { ... } +# 2341| getStmt(0): [BlockStmt] { ... } +# 2342| getStmt(0): [DeclStmt] declaration +# 2342| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2342| Type = [Struct] String +# 2342| getVariable().getInitializer(): [Initializer] initializer for s +# 2342| getExpr(): [ConstructorCall] call to String +# 2342| Type = [VoidType] void +# 2342| ValueCategory = prvalue +# 2343| getStmt(1): [WhileStmt] while (...) ... +# 2343| getCondition(): [VariableAccess] b +# 2343| Type = [BoolType] bool +# 2343| ValueCategory = prvalue(load) +# 2343| getStmt(): [BlockStmt] { ... } +# 2344| getStmt(0): [ExprStmt] ExprStmt +# 2344| getExpr(): [AssignExpr] ... = ... +# 2344| Type = [BoolType] bool +# 2344| ValueCategory = lvalue +# 2344| getLValue(): [VariableAccess] b +# 2344| Type = [BoolType] bool +# 2344| ValueCategory = lvalue +# 2344| getRValue(): [Literal] 0 +# 2344| Type = [BoolType] bool +# 2344| Value = [Literal] 0 +# 2344| ValueCategory = prvalue +# 2346| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2346| Type = [VoidType] void +# 2346| ValueCategory = prvalue +# 2346| getQualifier(): [VariableAccess] s +# 2346| Type = [Struct] String +# 2346| ValueCategory = lvalue +# 2348| getStmt(1): [BlockStmt] { ... } +# 2349| getStmt(0): [WhileStmt] while (...) ... +# 2349| getCondition(): [ConditionDeclExpr] (condition decl) +# 2349| Type = [BoolType] bool +# 2349| ValueCategory = prvalue +# 2349| getChild(0): [FunctionCall] call to operator bool +# 2349| Type = [BoolType] bool +# 2349| ValueCategory = prvalue +# 2349| getQualifier(): [VariableAccess] B +# 2349| Type = [Class] Bool +# 2349| ValueCategory = prvalue(load) +# 2349| getInitializingExpr(): [ConstructorCall] call to Bool +# 2349| Type = [VoidType] void +# 2349| ValueCategory = prvalue +# 2349| getArgument(0): [VariableAccess] b # 2349| Type = [BoolType] bool -# 2349| ValueCategory = lvalue -# 2349| getLValue(): [VariableAccess] b -# 2349| Type = [BoolType] bool -# 2349| ValueCategory = lvalue -# 2349| getRValue(): [Literal] 0 -# 2349| Type = [BoolType] bool -# 2349| Value = [Literal] 0 -# 2349| ValueCategory = prvalue -# 2350| getImplicitDestructorCall(0): [DestructorCall] call to ~Bool -# 2350| Type = [VoidType] void -# 2350| ValueCategory = prvalue -# 2350| getQualifier(): [VariableAccess] B -# 2350| Type = [Class] Bool +# 2349| ValueCategory = prvalue(load) +# 2349| getStmt(): [BlockStmt] { ... } +# 2350| getStmt(0): [ExprStmt] ExprStmt +# 2350| getExpr(): [AssignExpr] ... = ... +# 2350| Type = [BoolType] bool # 2350| ValueCategory = lvalue -# 2350| getImplicitDestructorCall(0): [DestructorCall] call to ~Bool -# 2350| Type = [VoidType] void -# 2350| ValueCategory = prvalue -# 2350| getQualifier(): [VariableAccess] B -# 2350| Type = [Class] Bool -# 2350| ValueCategory = lvalue -# 2352| getStmt(2): [ReturnStmt] return ... -# 2354| [TopLevelFunction] void VoidFunc() -# 2354| : -# 2354| getEntryPoint(): [BlockStmt] { ... } -# 2354| getStmt(0): [ReturnStmt] return ... -# 2356| [TopLevelFunction] void IfReturnDestructors(bool) -# 2356| : -# 2356| getParameter(0): [Parameter] b -# 2356| Type = [BoolType] bool -# 2356| getEntryPoint(): [BlockStmt] { ... } -# 2357| getStmt(0): [DeclStmt] declaration -# 2357| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2357| Type = [Struct] String -# 2357| getVariable().getInitializer(): [Initializer] initializer for s -# 2357| getExpr(): [ConstructorCall] call to String -# 2357| Type = [VoidType] void -# 2357| ValueCategory = prvalue -# 2358| getStmt(1): [IfStmt] if (...) ... -# 2358| getCondition(): [VariableAccess] b -# 2358| Type = [BoolType] bool -# 2358| ValueCategory = prvalue(load) -# 2358| getThen(): [BlockStmt] { ... } -# 2359| getStmt(0): [ReturnStmt] return ... -# 2365| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2365| Type = [VoidType] void -# 2365| ValueCategory = prvalue -# 2365| getQualifier(): [VariableAccess] s -# 2365| Type = [Struct] String -# 2365| ValueCategory = lvalue -# 2361| getStmt(2): [IfStmt] if (...) ... -# 2361| getCondition(): [VariableAccess] b -# 2361| Type = [BoolType] bool -# 2361| ValueCategory = prvalue(load) -# 2361| getThen(): [BlockStmt] { ... } -# 2362| getStmt(0): [ReturnStmt] return ... -# 2362| getExpr(): [FunctionCall] call to VoidFunc -# 2362| Type = [VoidType] void -# 2362| ValueCategory = prvalue -# 2365| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2365| Type = [VoidType] void -# 2365| ValueCategory = prvalue -# 2365| getQualifier(): [VariableAccess] s -# 2365| Type = [Struct] String -# 2365| ValueCategory = lvalue -# 2364| getStmt(3): [ExprStmt] ExprStmt -# 2364| getExpr(): [VariableAccess] s -# 2364| Type = [Struct] String -# 2364| ValueCategory = lvalue -# 2365| getStmt(4): [ReturnStmt] return ... -# 2365| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2365| Type = [VoidType] void -# 2365| ValueCategory = prvalue -# 2365| getQualifier(): [VariableAccess] s -# 2365| Type = [Struct] String -# 2365| ValueCategory = lvalue -# 2367| [TopLevelFunction] int IfReturnDestructors3(bool) -# 2367| : -# 2367| getParameter(0): [Parameter] b -# 2367| Type = [BoolType] bool -# 2367| getEntryPoint(): [BlockStmt] { ... } -# 2368| getStmt(0): [DeclStmt] declaration -# 2368| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2368| Type = [Struct] String -# 2368| getVariable().getInitializer(): [Initializer] initializer for s -# 2368| getExpr(): [ConstructorCall] call to String -# 2368| Type = [VoidType] void -# 2368| ValueCategory = prvalue -# 2369| getStmt(1): [IfStmt] if (...) ... -# 2369| getCondition(): [VariableAccess] b -# 2369| Type = [BoolType] bool -# 2369| ValueCategory = prvalue(load) -# 2369| getThen(): [BlockStmt] { ... } -# 2370| getStmt(0): [ReturnStmt] return ... -# 2370| getExpr(): [Literal] 1 -# 2370| Type = [IntType] int -# 2370| Value = [Literal] 1 -# 2370| ValueCategory = prvalue -# 2373| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2373| Type = [VoidType] void -# 2373| ValueCategory = prvalue -# 2373| getQualifier(): [VariableAccess] s -# 2373| Type = [Struct] String -# 2373| ValueCategory = lvalue -# 2372| getStmt(2): [ReturnStmt] return ... -# 2372| getExpr(): [Literal] 0 -# 2372| Type = [IntType] int -# 2372| Value = [Literal] 0 -# 2372| ValueCategory = prvalue -# 2373| getImplicitDestructorCall(0): [DestructorCall] call to ~String -# 2373| Type = [VoidType] void +# 2350| getLValue(): [VariableAccess] b +# 2350| Type = [BoolType] bool +# 2350| ValueCategory = lvalue +# 2350| getRValue(): [Literal] 0 +# 2350| Type = [BoolType] bool +# 2350| Value = [Literal] 0 +# 2350| ValueCategory = prvalue +# 2351| getImplicitDestructorCall(0): [DestructorCall] call to ~Bool +# 2351| Type = [VoidType] void +# 2351| ValueCategory = prvalue +# 2351| getQualifier(): [VariableAccess] B +# 2351| Type = [Class] Bool +# 2351| ValueCategory = lvalue +# 2351| getImplicitDestructorCall(0): [DestructorCall] call to ~Bool +# 2351| Type = [VoidType] void +# 2351| ValueCategory = prvalue +# 2351| getQualifier(): [VariableAccess] B +# 2351| Type = [Class] Bool +# 2351| ValueCategory = lvalue +# 2353| getStmt(2): [ReturnStmt] return ... +# 2355| [TopLevelFunction] void VoidFunc() +# 2355| : +# 2355| getEntryPoint(): [BlockStmt] { ... } +# 2355| getStmt(0): [ReturnStmt] return ... +# 2357| [TopLevelFunction] void IfReturnDestructors(bool) +# 2357| : +# 2357| getParameter(0): [Parameter] b +# 2357| Type = [BoolType] bool +# 2357| getEntryPoint(): [BlockStmt] { ... } +# 2358| getStmt(0): [DeclStmt] declaration +# 2358| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2358| Type = [Struct] String +# 2358| getVariable().getInitializer(): [Initializer] initializer for s +# 2358| getExpr(): [ConstructorCall] call to String +# 2358| Type = [VoidType] void +# 2358| ValueCategory = prvalue +# 2359| getStmt(1): [IfStmt] if (...) ... +# 2359| getCondition(): [VariableAccess] b +# 2359| Type = [BoolType] bool +# 2359| ValueCategory = prvalue(load) +# 2359| getThen(): [BlockStmt] { ... } +# 2360| getStmt(0): [ReturnStmt] return ... +# 2366| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2366| Type = [VoidType] void +# 2366| ValueCategory = prvalue +# 2366| getQualifier(): [VariableAccess] s +# 2366| Type = [Struct] String +# 2366| ValueCategory = lvalue +# 2362| getStmt(2): [IfStmt] if (...) ... +# 2362| getCondition(): [VariableAccess] b +# 2362| Type = [BoolType] bool +# 2362| ValueCategory = prvalue(load) +# 2362| getThen(): [BlockStmt] { ... } +# 2363| getStmt(0): [ReturnStmt] return ... +# 2363| getExpr(): [FunctionCall] call to VoidFunc +# 2363| Type = [VoidType] void +# 2363| ValueCategory = prvalue +# 2366| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2366| Type = [VoidType] void +# 2366| ValueCategory = prvalue +# 2366| getQualifier(): [VariableAccess] s +# 2366| Type = [Struct] String +# 2366| ValueCategory = lvalue +# 2365| getStmt(3): [ExprStmt] ExprStmt +# 2365| getExpr(): [VariableAccess] s +# 2365| Type = [Struct] String +# 2365| ValueCategory = lvalue +# 2366| getStmt(4): [ReturnStmt] return ... +# 2366| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2366| Type = [VoidType] void +# 2366| ValueCategory = prvalue +# 2366| getQualifier(): [VariableAccess] s +# 2366| Type = [Struct] String +# 2366| ValueCategory = lvalue +# 2368| [TopLevelFunction] int IfReturnDestructors3(bool) +# 2368| : +# 2368| getParameter(0): [Parameter] b +# 2368| Type = [BoolType] bool +# 2368| getEntryPoint(): [BlockStmt] { ... } +# 2369| getStmt(0): [DeclStmt] declaration +# 2369| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2369| Type = [Struct] String +# 2369| getVariable().getInitializer(): [Initializer] initializer for s +# 2369| getExpr(): [ConstructorCall] call to String +# 2369| Type = [VoidType] void +# 2369| ValueCategory = prvalue +# 2370| getStmt(1): [IfStmt] if (...) ... +# 2370| getCondition(): [VariableAccess] b +# 2370| Type = [BoolType] bool +# 2370| ValueCategory = prvalue(load) +# 2370| getThen(): [BlockStmt] { ... } +# 2371| getStmt(0): [ReturnStmt] return ... +# 2371| getExpr(): [Literal] 1 +# 2371| Type = [IntType] int +# 2371| Value = [Literal] 1 +# 2371| ValueCategory = prvalue +# 2374| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2374| Type = [VoidType] void +# 2374| ValueCategory = prvalue +# 2374| getQualifier(): [VariableAccess] s +# 2374| Type = [Struct] String +# 2374| ValueCategory = lvalue +# 2373| getStmt(2): [ReturnStmt] return ... +# 2373| getExpr(): [Literal] 0 +# 2373| Type = [IntType] int +# 2373| Value = [Literal] 0 # 2373| ValueCategory = prvalue -# 2373| getQualifier(): [VariableAccess] s -# 2373| Type = [Struct] String -# 2373| ValueCategory = lvalue -# 2375| [TopLevelFunction] void VoidReturnDestructors() -# 2375| : -# 2375| getEntryPoint(): [BlockStmt] { ... } -# 2376| getStmt(0): [DeclStmt] declaration -# 2376| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s -# 2376| Type = [Struct] String -# 2376| getVariable().getInitializer(): [Initializer] initializer for s -# 2376| getExpr(): [ConstructorCall] call to String -# 2376| Type = [VoidType] void -# 2376| ValueCategory = prvalue -# 2377| getStmt(1): [ReturnStmt] return ... -# 2377| getExpr(): [FunctionCall] call to VoidFunc -# 2377| Type = [VoidType] void -# 2377| ValueCategory = prvalue -# 2378| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2374| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2374| Type = [VoidType] void +# 2374| ValueCategory = prvalue +# 2374| getQualifier(): [VariableAccess] s +# 2374| Type = [Struct] String +# 2374| ValueCategory = lvalue +# 2376| [TopLevelFunction] void VoidReturnDestructors() +# 2376| : +# 2376| getEntryPoint(): [BlockStmt] { ... } +# 2377| getStmt(0): [DeclStmt] declaration +# 2377| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s +# 2377| Type = [Struct] String +# 2377| getVariable().getInitializer(): [Initializer] initializer for s +# 2377| getExpr(): [ConstructorCall] call to String +# 2377| Type = [VoidType] void +# 2377| ValueCategory = prvalue +# 2378| getStmt(1): [ReturnStmt] return ... +# 2378| getExpr(): [FunctionCall] call to VoidFunc # 2378| Type = [VoidType] void # 2378| ValueCategory = prvalue -# 2378| getQualifier(): [VariableAccess] s -# 2378| Type = [Struct] String -# 2378| ValueCategory = lvalue -# 2381| [CopyAssignmentOperator] return_routine_type::HasVoidToIntFunc& return_routine_type::HasVoidToIntFunc::operator=(return_routine_type::HasVoidToIntFunc const&) -# 2381| : +# 2379| getImplicitDestructorCall(0): [DestructorCall] call to ~String +# 2379| Type = [VoidType] void +# 2379| ValueCategory = prvalue +# 2379| getQualifier(): [VariableAccess] s +# 2379| Type = [Struct] String +# 2379| ValueCategory = lvalue +# 2382| [CopyAssignmentOperator] return_routine_type::HasVoidToIntFunc& return_routine_type::HasVoidToIntFunc::operator=(return_routine_type::HasVoidToIntFunc const&) +# 2382| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [LValueReferenceType] const HasVoidToIntFunc & -# 2381| [MoveAssignmentOperator] return_routine_type::HasVoidToIntFunc& return_routine_type::HasVoidToIntFunc::operator=(return_routine_type::HasVoidToIntFunc&&) -# 2381| : +# 2382| [MoveAssignmentOperator] return_routine_type::HasVoidToIntFunc& return_routine_type::HasVoidToIntFunc::operator=(return_routine_type::HasVoidToIntFunc&&) +# 2382| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [RValueReferenceType] HasVoidToIntFunc && -# 2383| [MemberFunction] void return_routine_type::HasVoidToIntFunc::VoidToInt(int) -# 2383| : -# 2383| getParameter(0): [Parameter] (unnamed parameter 0) -# 2383| Type = [IntType] int -# 2388| [TopLevelFunction] return_routine_type::VoidToIntMemberFunc return_routine_type::GetVoidToIntFunc() -# 2388| : -# 2389| getEntryPoint(): [BlockStmt] { ... } -# 2390| getStmt(0): [ReturnStmt] return ... -# 2390| getExpr(): [FunctionAccess] VoidToInt -# 2390| Type = [RoutineType] ..()(..) -# 2390| ValueCategory = prvalue -# 2395| [TopLevelFunction] int small_operation_should_not_be_constant_folded() -# 2395| : -# 2395| getEntryPoint(): [BlockStmt] { ... } -# 2396| getStmt(0): [ReturnStmt] return ... -# 2396| getExpr(): [BitwiseXorExpr] ... ^ ... -# 2396| Type = [IntType] int -# 2396| Value = [BitwiseXorExpr] 3 -# 2396| ValueCategory = prvalue -# 2396| getLeftOperand(): [Literal] 1 -# 2396| Type = [IntType] int -# 2396| Value = [Literal] 1 -# 2396| ValueCategory = prvalue -# 2396| getRightOperand(): [Literal] 2 -# 2396| Type = [IntType] int -# 2396| Value = [Literal] 2 -# 2396| ValueCategory = prvalue -# 2406| [TopLevelFunction] int large_operation_should_be_constant_folded() -# 2406| : -# 2406| getEntryPoint(): [BlockStmt] { ... } -# 2407| getStmt(0): [ReturnStmt] return ... -# 2407| getExpr(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [BitwiseXorExpr] ... ^ ... -# 2407| Type = [IntType] int -# 2407| Value = [BitwiseXorExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand(): [Literal] 1 -# 2407| Type = [IntType] int -# 2407| Value = [Literal] 1 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2407| getExpr().getFullyConverted(): [ParenthesisExpr] (...) -# 2407| Type = [IntType] int -# 2407| Value = [ParenthesisExpr] 0 -# 2407| ValueCategory = prvalue -# 2410| [TopLevelFunction] void initialization_with_temp_destructor() -# 2410| : -# 2410| getEntryPoint(): [BlockStmt] { ... } -# 2411| getStmt(0): [IfStmt] if (...) ... -# 2411| getCondition(): [ConditionDeclExpr] (condition decl) -# 2411| Type = [BoolType] bool -# 2411| ValueCategory = prvalue -# 2411| getVariableAccess(): [VariableAccess] x -# 2411| Type = [PlainCharType] char -# 2411| ValueCategory = prvalue(load) -# 2411| getInitializingExpr(): [FunctionCall] call to get_x -# 2411| Type = [PlainCharType] char -# 2411| ValueCategory = prvalue -# 2411| getQualifier(): [ConstructorCall] call to ClassWithDestructor -# 2411| Type = [VoidType] void -# 2411| ValueCategory = prvalue -# 2411| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2411| Type = [VoidType] void -# 2411| ValueCategory = prvalue -# 2411| getQualifier(): [ReuseExpr] reuse of temporary object -# 2411| Type = [Class] ClassWithDestructor -# 2411| ValueCategory = xvalue -# 2411| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2411| Type = [Class] ClassWithDestructor -# 2411| ValueCategory = prvalue(load) -# 2411| getVariableAccess().getFullyConverted(): [CStyleCast] (bool)... -# 2411| Conversion = [BoolConversion] conversion to bool -# 2411| Type = [BoolType] bool -# 2411| ValueCategory = prvalue -# 2412| getThen(): [ExprStmt] ExprStmt -# 2412| getExpr(): [PostfixIncrExpr] ... ++ +# 2384| [MemberFunction] void return_routine_type::HasVoidToIntFunc::VoidToInt(int) +# 2384| : +# 2384| getParameter(0): [Parameter] (unnamed parameter 0) +# 2384| Type = [IntType] int +# 2389| [TopLevelFunction] return_routine_type::VoidToIntMemberFunc return_routine_type::GetVoidToIntFunc() +# 2389| : +# 2390| getEntryPoint(): [BlockStmt] { ... } +# 2391| getStmt(0): [ReturnStmt] return ... +# 2391| getExpr(): [FunctionAccess] VoidToInt +# 2391| Type = [RoutineType] ..()(..) +# 2391| ValueCategory = prvalue +# 2396| [TopLevelFunction] int small_operation_should_not_be_constant_folded() +# 2396| : +# 2396| getEntryPoint(): [BlockStmt] { ... } +# 2397| getStmt(0): [ReturnStmt] return ... +# 2397| getExpr(): [BitwiseXorExpr] ... ^ ... +# 2397| Type = [IntType] int +# 2397| Value = [BitwiseXorExpr] 3 +# 2397| ValueCategory = prvalue +# 2397| getLeftOperand(): [Literal] 1 +# 2397| Type = [IntType] int +# 2397| Value = [Literal] 1 +# 2397| ValueCategory = prvalue +# 2397| getRightOperand(): [Literal] 2 +# 2397| Type = [IntType] int +# 2397| Value = [Literal] 2 +# 2397| ValueCategory = prvalue +# 2407| [TopLevelFunction] int large_operation_should_be_constant_folded() +# 2407| : +# 2407| getEntryPoint(): [BlockStmt] { ... } +# 2408| getStmt(0): [ReturnStmt] return ... +# 2408| getExpr(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [BitwiseXorExpr] ... ^ ... +# 2408| Type = [IntType] int +# 2408| Value = [BitwiseXorExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand(): [Literal] 1 +# 2408| Type = [IntType] int +# 2408| Value = [Literal] 1 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getLeftOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getRightOperand().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2408| getExpr().getFullyConverted(): [ParenthesisExpr] (...) +# 2408| Type = [IntType] int +# 2408| Value = [ParenthesisExpr] 0 +# 2408| ValueCategory = prvalue +# 2411| [TopLevelFunction] void initialization_with_temp_destructor() +# 2411| : +# 2411| getEntryPoint(): [BlockStmt] { ... } +# 2412| getStmt(0): [IfStmt] if (...) ... +# 2412| getCondition(): [ConditionDeclExpr] (condition decl) +# 2412| Type = [BoolType] bool +# 2412| ValueCategory = prvalue +# 2412| getVariableAccess(): [VariableAccess] x +# 2412| Type = [PlainCharType] char +# 2412| ValueCategory = prvalue(load) +# 2412| getInitializingExpr(): [FunctionCall] call to get_x # 2412| Type = [PlainCharType] char # 2412| ValueCategory = prvalue -# 2412| getOperand(): [VariableAccess] x -# 2412| Type = [PlainCharType] char -# 2412| ValueCategory = lvalue -# 2414| getStmt(1): [IfStmt] if (...) ... -# 2414| getInitialization(): [DeclStmt] declaration -# 2414| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2414| Type = [PlainCharType] char -# 2414| getVariable().getInitializer(): [Initializer] initializer for x -# 2414| getExpr(): [FunctionCall] call to get_x -# 2414| Type = [PlainCharType] char -# 2414| ValueCategory = prvalue -# 2414| getQualifier(): [ConstructorCall] call to ClassWithDestructor -# 2414| Type = [VoidType] void -# 2414| ValueCategory = prvalue -# 2414| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2414| Type = [VoidType] void -# 2414| ValueCategory = prvalue -# 2414| getQualifier(): [ReuseExpr] reuse of temporary object -# 2414| Type = [Class] ClassWithDestructor -# 2414| ValueCategory = xvalue -# 2414| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2414| Type = [Class] ClassWithDestructor -# 2414| ValueCategory = prvalue(load) -# 2414| getCondition(): [VariableAccess] x -# 2414| Type = [PlainCharType] char -# 2414| ValueCategory = prvalue(load) -# 2415| getThen(): [ExprStmt] ExprStmt -# 2415| getExpr(): [PostfixIncrExpr] ... ++ +# 2412| getQualifier(): [ConstructorCall] call to ClassWithDestructor +# 2412| Type = [VoidType] void +# 2412| ValueCategory = prvalue +# 2412| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2412| Type = [VoidType] void +# 2412| ValueCategory = prvalue +# 2412| getQualifier(): [ReuseExpr] reuse of temporary object +# 2412| Type = [Class] ClassWithDestructor +# 2412| ValueCategory = xvalue +# 2412| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2412| Type = [Class] ClassWithDestructor +# 2412| ValueCategory = prvalue(load) +# 2412| getVariableAccess().getFullyConverted(): [CStyleCast] (bool)... +# 2412| Conversion = [BoolConversion] conversion to bool +# 2412| Type = [BoolType] bool +# 2412| ValueCategory = prvalue +# 2413| getThen(): [ExprStmt] ExprStmt +# 2413| getExpr(): [PostfixIncrExpr] ... ++ +# 2413| Type = [PlainCharType] char +# 2413| ValueCategory = prvalue +# 2413| getOperand(): [VariableAccess] x +# 2413| Type = [PlainCharType] char +# 2413| ValueCategory = lvalue +# 2415| getStmt(1): [IfStmt] if (...) ... +# 2415| getInitialization(): [DeclStmt] declaration +# 2415| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x # 2415| Type = [PlainCharType] char -# 2415| ValueCategory = prvalue -# 2415| getOperand(): [VariableAccess] x -# 2415| Type = [PlainCharType] char -# 2415| ValueCategory = lvalue -# 2414| getCondition().getFullyConverted(): [CStyleCast] (bool)... -# 2414| Conversion = [BoolConversion] conversion to bool -# 2414| Type = [BoolType] bool -# 2414| ValueCategory = prvalue -# 2417| getStmt(2): [ConstexprIfStmt] if constexpr (...) ... -# 2417| getInitialization(): [DeclStmt] declaration -# 2417| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2417| Type = [PlainCharType] char -# 2417| getVariable().getInitializer(): [Initializer] initializer for x -# 2417| getExpr(): [FunctionCall] call to get_x -# 2417| Type = [PlainCharType] char -# 2417| ValueCategory = prvalue -# 2417| getQualifier(): [ConstructorCall] call to ClassWithDestructor -# 2417| Type = [VoidType] void -# 2417| ValueCategory = prvalue -# 2417| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2417| Type = [VoidType] void -# 2417| ValueCategory = prvalue -# 2417| getQualifier(): [ReuseExpr] reuse of temporary object -# 2417| Type = [Class] ClassWithDestructor -# 2417| ValueCategory = xvalue -# 2417| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2417| Type = [Class] ClassWithDestructor -# 2417| ValueCategory = prvalue(load) -# 2417| getCondition(): [VariableAccess] initialization_with_destructor_bool -# 2417| Type = [BoolType] bool -# 2417| Value = [VariableAccess] 1 -# 2417| ValueCategory = prvalue(load) -# 2418| getThen(): [ExprStmt] ExprStmt -# 2418| getExpr(): [PostfixIncrExpr] ... ++ +# 2415| getVariable().getInitializer(): [Initializer] initializer for x +# 2415| getExpr(): [FunctionCall] call to get_x +# 2415| Type = [PlainCharType] char +# 2415| ValueCategory = prvalue +# 2415| getQualifier(): [ConstructorCall] call to ClassWithDestructor +# 2415| Type = [VoidType] void +# 2415| ValueCategory = prvalue +# 2415| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2415| Type = [VoidType] void +# 2415| ValueCategory = prvalue +# 2415| getQualifier(): [ReuseExpr] reuse of temporary object +# 2415| Type = [Class] ClassWithDestructor +# 2415| ValueCategory = xvalue +# 2415| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2415| Type = [Class] ClassWithDestructor +# 2415| ValueCategory = prvalue(load) +# 2415| getCondition(): [VariableAccess] x +# 2415| Type = [PlainCharType] char +# 2415| ValueCategory = prvalue(load) +# 2416| getThen(): [ExprStmt] ExprStmt +# 2416| getExpr(): [PostfixIncrExpr] ... ++ +# 2416| Type = [PlainCharType] char +# 2416| ValueCategory = prvalue +# 2416| getOperand(): [VariableAccess] x +# 2416| Type = [PlainCharType] char +# 2416| ValueCategory = lvalue +# 2415| getCondition().getFullyConverted(): [CStyleCast] (bool)... +# 2415| Conversion = [BoolConversion] conversion to bool +# 2415| Type = [BoolType] bool +# 2415| ValueCategory = prvalue +# 2418| getStmt(2): [ConstexprIfStmt] if constexpr (...) ... +# 2418| getInitialization(): [DeclStmt] declaration +# 2418| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x # 2418| Type = [PlainCharType] char -# 2418| ValueCategory = prvalue -# 2418| getOperand(): [VariableAccess] x -# 2418| Type = [PlainCharType] char -# 2418| ValueCategory = lvalue -# 2420| getStmt(3): [SwitchStmt] switch (...) ... -# 2420| getExpr(): [ConditionDeclExpr] (condition decl) -# 2420| Type = [IntType] int -# 2420| ValueCategory = prvalue -# 2420| getVariableAccess(): [VariableAccess] x -# 2420| Type = [PlainCharType] char -# 2420| ValueCategory = prvalue(load) -# 2420| getInitializingExpr(): [FunctionCall] call to get_x -# 2420| Type = [PlainCharType] char -# 2420| ValueCategory = prvalue -# 2420| getQualifier(): [ConstructorCall] call to ClassWithDestructor -# 2420| Type = [VoidType] void -# 2420| ValueCategory = prvalue -# 2420| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2420| Type = [VoidType] void -# 2420| ValueCategory = prvalue -# 2420| getQualifier(): [ReuseExpr] reuse of temporary object -# 2420| Type = [Class] ClassWithDestructor -# 2420| ValueCategory = xvalue -# 2420| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2420| Type = [Class] ClassWithDestructor -# 2420| ValueCategory = prvalue(load) -# 2420| getVariableAccess().getFullyConverted(): [CStyleCast] (int)... -# 2420| Conversion = [IntegralConversion] integral conversion -# 2420| Type = [IntType] int -# 2420| ValueCategory = prvalue -# 2420| getStmt(): [BlockStmt] { ... } -# 2421| getStmt(0): [SwitchCase] case ...: -# 2421| getExpr(): [CharLiteral] 97 -# 2421| Type = [PlainCharType] char -# 2421| Value = [CharLiteral] 97 +# 2418| getVariable().getInitializer(): [Initializer] initializer for x +# 2418| getExpr(): [FunctionCall] call to get_x +# 2418| Type = [PlainCharType] char +# 2418| ValueCategory = prvalue +# 2418| getQualifier(): [ConstructorCall] call to ClassWithDestructor +# 2418| Type = [VoidType] void +# 2418| ValueCategory = prvalue +# 2418| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2418| Type = [VoidType] void +# 2418| ValueCategory = prvalue +# 2418| getQualifier(): [ReuseExpr] reuse of temporary object +# 2418| Type = [Class] ClassWithDestructor +# 2418| ValueCategory = xvalue +# 2418| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2418| Type = [Class] ClassWithDestructor +# 2418| ValueCategory = prvalue(load) +# 2418| getCondition(): [VariableAccess] initialization_with_destructor_bool +# 2418| Type = [BoolType] bool +# 2418| Value = [VariableAccess] 1 +# 2418| ValueCategory = prvalue(load) +# 2419| getThen(): [ExprStmt] ExprStmt +# 2419| getExpr(): [PostfixIncrExpr] ... ++ +# 2419| Type = [PlainCharType] char +# 2419| ValueCategory = prvalue +# 2419| getOperand(): [VariableAccess] x +# 2419| Type = [PlainCharType] char +# 2419| ValueCategory = lvalue +# 2421| getStmt(3): [SwitchStmt] switch (...) ... +# 2421| getExpr(): [ConditionDeclExpr] (condition decl) +# 2421| Type = [IntType] int +# 2421| ValueCategory = prvalue +# 2421| getVariableAccess(): [VariableAccess] x +# 2421| Type = [PlainCharType] char +# 2421| ValueCategory = prvalue(load) +# 2421| getInitializingExpr(): [FunctionCall] call to get_x +# 2421| Type = [PlainCharType] char +# 2421| ValueCategory = prvalue +# 2421| getQualifier(): [ConstructorCall] call to ClassWithDestructor +# 2421| Type = [VoidType] void # 2421| ValueCategory = prvalue -# 2421| getExpr().getFullyConverted(): [CStyleCast] (int)... -# 2421| Conversion = [IntegralConversion] integral conversion -# 2421| Type = [IntType] int -# 2421| Value = [CStyleCast] 97 +# 2421| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2421| Type = [VoidType] void # 2421| ValueCategory = prvalue -# 2422| getStmt(1): [ExprStmt] ExprStmt -# 2422| getExpr(): [PostfixIncrExpr] ... ++ +# 2421| getQualifier(): [ReuseExpr] reuse of temporary object +# 2421| Type = [Class] ClassWithDestructor +# 2421| ValueCategory = xvalue +# 2421| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2421| Type = [Class] ClassWithDestructor +# 2421| ValueCategory = prvalue(load) +# 2421| getVariableAccess().getFullyConverted(): [CStyleCast] (int)... +# 2421| Conversion = [IntegralConversion] integral conversion +# 2421| Type = [IntType] int +# 2421| ValueCategory = prvalue +# 2421| getStmt(): [BlockStmt] { ... } +# 2422| getStmt(0): [SwitchCase] case ...: +# 2422| getExpr(): [CharLiteral] 97 # 2422| Type = [PlainCharType] char +# 2422| Value = [CharLiteral] 97 # 2422| ValueCategory = prvalue -# 2422| getOperand(): [VariableAccess] x -# 2422| Type = [PlainCharType] char -# 2422| ValueCategory = lvalue -# 2425| getStmt(4): [SwitchStmt] switch (...) ... -# 2425| getInitialization(): [DeclStmt] declaration -# 2425| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2425| Type = [PlainCharType] char -# 2425| getVariable().getInitializer(): [Initializer] initializer for x -# 2425| getExpr(): [FunctionCall] call to get_x -# 2425| Type = [PlainCharType] char -# 2425| ValueCategory = prvalue -# 2425| getQualifier(): [ConstructorCall] call to ClassWithDestructor -# 2425| Type = [VoidType] void -# 2425| ValueCategory = prvalue -# 2425| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2425| Type = [VoidType] void -# 2425| ValueCategory = prvalue -# 2425| getQualifier(): [ReuseExpr] reuse of temporary object -# 2425| Type = [Class] ClassWithDestructor -# 2425| ValueCategory = xvalue -# 2425| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2425| Type = [Class] ClassWithDestructor -# 2425| ValueCategory = prvalue(load) -# 2425| getExpr(): [VariableAccess] x -# 2425| Type = [PlainCharType] char -# 2425| ValueCategory = prvalue(load) -# 2425| getStmt(): [BlockStmt] { ... } -# 2426| getStmt(0): [SwitchCase] case ...: -# 2426| getExpr(): [CharLiteral] 97 -# 2426| Type = [PlainCharType] char -# 2426| Value = [CharLiteral] 97 -# 2426| ValueCategory = prvalue -# 2426| getExpr().getFullyConverted(): [CStyleCast] (int)... -# 2426| Conversion = [IntegralConversion] integral conversion -# 2426| Type = [IntType] int -# 2426| Value = [CStyleCast] 97 -# 2426| ValueCategory = prvalue -# 2427| getStmt(1): [ExprStmt] ExprStmt -# 2427| getExpr(): [PostfixIncrExpr] ... ++ +# 2422| getExpr().getFullyConverted(): [CStyleCast] (int)... +# 2422| Conversion = [IntegralConversion] integral conversion +# 2422| Type = [IntType] int +# 2422| Value = [CStyleCast] 97 +# 2422| ValueCategory = prvalue +# 2423| getStmt(1): [ExprStmt] ExprStmt +# 2423| getExpr(): [PostfixIncrExpr] ... ++ +# 2423| Type = [PlainCharType] char +# 2423| ValueCategory = prvalue +# 2423| getOperand(): [VariableAccess] x +# 2423| Type = [PlainCharType] char +# 2423| ValueCategory = lvalue +# 2426| getStmt(4): [SwitchStmt] switch (...) ... +# 2426| getInitialization(): [DeclStmt] declaration +# 2426| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2426| Type = [PlainCharType] char +# 2426| getVariable().getInitializer(): [Initializer] initializer for x +# 2426| getExpr(): [FunctionCall] call to get_x +# 2426| Type = [PlainCharType] char +# 2426| ValueCategory = prvalue +# 2426| getQualifier(): [ConstructorCall] call to ClassWithDestructor +# 2426| Type = [VoidType] void +# 2426| ValueCategory = prvalue +# 2426| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2426| Type = [VoidType] void +# 2426| ValueCategory = prvalue +# 2426| getQualifier(): [ReuseExpr] reuse of temporary object +# 2426| Type = [Class] ClassWithDestructor +# 2426| ValueCategory = xvalue +# 2426| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2426| Type = [Class] ClassWithDestructor +# 2426| ValueCategory = prvalue(load) +# 2426| getExpr(): [VariableAccess] x +# 2426| Type = [PlainCharType] char +# 2426| ValueCategory = prvalue(load) +# 2426| getStmt(): [BlockStmt] { ... } +# 2427| getStmt(0): [SwitchCase] case ...: +# 2427| getExpr(): [CharLiteral] 97 # 2427| Type = [PlainCharType] char +# 2427| Value = [CharLiteral] 97 # 2427| ValueCategory = prvalue -# 2427| getOperand(): [VariableAccess] x -# 2427| Type = [PlainCharType] char -# 2427| ValueCategory = lvalue -# 2425| getExpr().getFullyConverted(): [CStyleCast] (int)... -# 2425| Conversion = [IntegralConversion] integral conversion -# 2425| Type = [IntType] int -# 2425| ValueCategory = prvalue -# 2430| getStmt(5): [RangeBasedForStmt] for(...:...) ... -# 2430| getInitialization(): [DeclStmt] declaration -# 2430| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2430| Type = [PlainCharType] char -# 2430| getVariable().getInitializer(): [Initializer] initializer for x -# 2430| getExpr(): [FunctionCall] call to get_x -# 2430| Type = [PlainCharType] char -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [ConstructorCall] call to ClassWithDestructor -# 2430| Type = [VoidType] void -# 2430| ValueCategory = prvalue -# 2430| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2430| Type = [VoidType] void -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [ReuseExpr] reuse of temporary object -# 2430| Type = [Class] ClassWithDestructor -# 2430| ValueCategory = xvalue -# 2430| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2430| Type = [Class] ClassWithDestructor -# 2430| ValueCategory = prvalue(load) -# 2430| getChild(1): [DeclStmt] declaration -# 2430| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) -# 2430| Type = [RValueReferenceType] vector && +# 2427| getExpr().getFullyConverted(): [CStyleCast] (int)... +# 2427| Conversion = [IntegralConversion] integral conversion +# 2427| Type = [IntType] int +# 2427| Value = [CStyleCast] 97 +# 2427| ValueCategory = prvalue +# 2428| getStmt(1): [ExprStmt] ExprStmt +# 2428| getExpr(): [PostfixIncrExpr] ... ++ +# 2428| Type = [PlainCharType] char +# 2428| ValueCategory = prvalue +# 2428| getOperand(): [VariableAccess] x +# 2428| Type = [PlainCharType] char +# 2428| ValueCategory = lvalue +# 2426| getExpr().getFullyConverted(): [CStyleCast] (int)... +# 2426| Conversion = [IntegralConversion] integral conversion +# 2426| Type = [IntType] int +# 2426| ValueCategory = prvalue +# 2431| getStmt(5): [RangeBasedForStmt] for(...:...) ... +# 2431| getInitialization(): [DeclStmt] declaration +# 2431| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2431| Type = [PlainCharType] char +# 2431| getVariable().getInitializer(): [Initializer] initializer for x +# 2431| getExpr(): [FunctionCall] call to get_x +# 2431| Type = [PlainCharType] char +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [ConstructorCall] call to ClassWithDestructor +# 2431| Type = [VoidType] void +# 2431| ValueCategory = prvalue +# 2431| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2431| Type = [VoidType] void +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [ReuseExpr] reuse of temporary object +# 2431| Type = [Class] ClassWithDestructor +# 2431| ValueCategory = xvalue +# 2431| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2431| Type = [Class] ClassWithDestructor +# 2431| ValueCategory = prvalue(load) +# 2431| getChild(1): [DeclStmt] declaration +# 2431| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__range) +# 2431| Type = [RValueReferenceType] vector && #-----| getVariable().getInitializer(): [Initializer] initializer for (__range) -# 2430| getExpr(): [ConstructorCall] call to vector -# 2430| Type = [VoidType] void -# 2430| ValueCategory = prvalue -# 2430| getArgument(0): [VariableAccess] x -# 2430| Type = [PlainCharType] char -# 2430| ValueCategory = prvalue(load) -# 2430| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) -# 2430| Type = [LValueReferenceType] vector & -# 2430| ValueCategory = prvalue -# 2430| getExpr(): [TemporaryObjectExpr] temporary object -# 2430| Type = [ClassTemplateInstantiation,Struct] vector -# 2430| ValueCategory = xvalue -# 2430| getBeginEndDeclaration(): [DeclStmt] declaration -# 2430| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| getExpr(): [ConstructorCall] call to vector +# 2431| Type = [VoidType] void +# 2431| ValueCategory = prvalue +# 2431| getArgument(0): [VariableAccess] x +# 2431| Type = [PlainCharType] char +# 2431| ValueCategory = prvalue(load) +# 2431| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2431| Type = [LValueReferenceType] vector & +# 2431| ValueCategory = prvalue +# 2431| getExpr(): [TemporaryObjectExpr] temporary object +# 2431| Type = [ClassTemplateInstantiation,Struct] vector +# 2431| ValueCategory = xvalue +# 2431| getBeginEndDeclaration(): [DeclStmt] declaration +# 2431| getDeclarationEntry(0): [VariableDeclarationEntry] declaration of (__begin) +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__begin) -# 2430| getExpr(): [FunctionCall] call to begin -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [VariableAccess] (__range) -# 2430| Type = [RValueReferenceType] vector && -# 2430| ValueCategory = prvalue(load) +# 2431| getExpr(): [FunctionCall] call to begin +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [VariableAccess] (__range) +# 2431| Type = [RValueReferenceType] vector && +# 2431| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -22129,15 +22131,15 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2430| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| getDeclarationEntry(1): [VariableDeclarationEntry] declaration of (__end) +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator #-----| getVariable().getInitializer(): [Initializer] initializer for (__end) -# 2430| getExpr(): [FunctionCall] call to end -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [VariableAccess] (__range) -# 2430| Type = [RValueReferenceType] vector && -# 2430| ValueCategory = prvalue(load) +# 2431| getExpr(): [FunctionCall] call to end +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [VariableAccess] (__range) +# 2431| Type = [RValueReferenceType] vector && +# 2431| ValueCategory = prvalue(load) #-----| getQualifier().getFullyConverted(): [CStyleCast] (const vector)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const vector @@ -22145,18 +22147,18 @@ ir.cpp: #-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference) #-----| Type = [ClassTemplateInstantiation,Struct] vector #-----| ValueCategory = lvalue -# 2430| getCondition(): [FunctionCall] call to operator!= -# 2430| Type = [BoolType] bool -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [VariableAccess] (__begin) -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2430| ValueCategory = lvalue -# 2430| getArgument(0): [ConstructorCall] call to iterator -# 2430| Type = [VoidType] void -# 2430| ValueCategory = prvalue -# 2430| getArgument(0): [VariableAccess] (__end) -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2430| ValueCategory = lvalue +# 2431| getCondition(): [FunctionCall] call to operator!= +# 2431| Type = [BoolType] bool +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [VariableAccess] (__begin) +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| ValueCategory = lvalue +# 2431| getArgument(0): [ConstructorCall] call to iterator +# 2431| Type = [VoidType] void +# 2431| ValueCategory = prvalue +# 2431| getArgument(0): [VariableAccess] (__end) +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| ValueCategory = lvalue #-----| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to) #-----| Type = [LValueReferenceType] const iterator & #-----| ValueCategory = prvalue @@ -22171,491 +22173,491 @@ ir.cpp: #-----| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object #-----| Type = [ClassTemplateInstantiation,Struct] iterator #-----| ValueCategory = lvalue -# 2430| getUpdate(): [FunctionCall] call to operator++ -# 2430| Type = [LValueReferenceType] iterator & -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [VariableAccess] (__begin) -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2430| ValueCategory = lvalue -# 2430| getChild(5): [DeclStmt] declaration -# 2430| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2430| Type = [PlainCharType] char -# 2430| getVariable().getInitializer(): [Initializer] initializer for y -# 2430| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* -# 2430| Type = [LValueReferenceType] char & -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [VariableAccess] (__begin) -# 2430| Type = [NestedTypedefType,UsingAliasTypedefType] iterator -# 2430| ValueCategory = lvalue +# 2431| getUpdate(): [FunctionCall] call to operator++ +# 2431| Type = [LValueReferenceType] iterator & +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [VariableAccess] (__begin) +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| ValueCategory = lvalue +# 2431| getChild(5): [DeclStmt] declaration +# 2431| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2431| Type = [PlainCharType] char +# 2431| getVariable().getInitializer(): [Initializer] initializer for y +# 2431| getExpr(): [OverloadedPointerDereferenceExpr] call to operator* +# 2431| Type = [LValueReferenceType] char & +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [VariableAccess] (__begin) +# 2431| Type = [NestedTypedefType,UsingAliasTypedefType] iterator +# 2431| ValueCategory = lvalue #-----| getQualifier().getFullyConverted(): [CStyleCast] (const iterator)... #-----| Conversion = [GlvalueConversion] glvalue conversion #-----| Type = [SpecifiedType] const iterator #-----| ValueCategory = lvalue -# 2430| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2430| Type = [PlainCharType] char -# 2430| ValueCategory = prvalue(load) -# 2431| getStmt(): [ExprStmt] ExprStmt -# 2431| getExpr(): [AssignAddExpr] ... += ... -# 2431| Type = [PlainCharType] char -# 2431| ValueCategory = lvalue -# 2431| getLValue(): [VariableAccess] y -# 2431| Type = [PlainCharType] char -# 2431| ValueCategory = lvalue -# 2431| getRValue(): [VariableAccess] x -# 2431| Type = [PlainCharType] char -# 2431| ValueCategory = prvalue(load) -# 2431| getRValue().getFullyConverted(): [CStyleCast] (int)... -# 2431| Conversion = [IntegralConversion] integral conversion -# 2431| Type = [IntType] int -# 2431| ValueCategory = prvalue -# 2430| getImplicitDestructorCall(0): [DestructorCall] call to ~vector -# 2430| Type = [VoidType] void -# 2430| ValueCategory = prvalue -# 2430| getQualifier(): [ReuseExpr] reuse of temporary object -# 2430| Type = [ClassTemplateInstantiation,Struct] vector -# 2430| ValueCategory = xvalue -# 2430| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) -# 2430| Type = [ClassTemplateInstantiation,Struct] iterator -# 2430| ValueCategory = lvalue -# 2432| getStmt(6): [ReturnStmt] return ... -# 2434| [TopLevelFunction] void param_with_destructor_by_value(ClassWithDestructor) -# 2434| : -# 2434| getParameter(0): [Parameter] c -# 2434| Type = [Class] ClassWithDestructor -# 2434| getEntryPoint(): [BlockStmt] { ... } -# 2436| getStmt(0): [ReturnStmt] return ... -# 2438| [TopLevelFunction] void param_with_destructor_by_pointer(ClassWithDestructor*) -# 2438| : -# 2438| getParameter(0): [Parameter] c -# 2438| Type = [PointerType] ClassWithDestructor * -# 2438| getEntryPoint(): [BlockStmt] { ... } -# 2440| getStmt(0): [ReturnStmt] return ... -# 2442| [TopLevelFunction] void param_with_destructor_by_ref(ClassWithDestructor&) -# 2442| : -# 2442| getParameter(0): [Parameter] c -# 2442| Type = [LValueReferenceType] ClassWithDestructor & -# 2442| getEntryPoint(): [BlockStmt] { ... } -# 2444| getStmt(0): [ReturnStmt] return ... -# 2446| [TopLevelFunction] void param_with_destructor_by_rref(ClassWithDestructor&&) -# 2446| : -# 2446| getParameter(0): [Parameter] c -# 2446| Type = [RValueReferenceType] ClassWithDestructor && -# 2446| getEntryPoint(): [BlockStmt] { ... } -# 2448| getStmt(0): [ReturnStmt] return ... -# 2450| [TopLevelFunction] void rethrow_with_destruction(int) -# 2450| : -# 2450| getParameter(0): [Parameter] x -# 2450| Type = [IntType] int -# 2450| getEntryPoint(): [BlockStmt] { ... } -# 2451| getStmt(0): [DeclStmt] declaration -# 2451| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c -# 2451| Type = [Class] ClassWithDestructor -# 2451| getVariable().getInitializer(): [Initializer] initializer for c -# 2451| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2451| Type = [VoidType] void -# 2451| ValueCategory = prvalue -# 2452| getStmt(1): [ExprStmt] ExprStmt -# 2452| getExpr(): [ReThrowExpr] re-throw exception -# 2452| Type = [VoidType] void -# 2452| ValueCategory = prvalue -# 2453| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2453| Type = [VoidType] void -# 2453| ValueCategory = prvalue -# 2453| getQualifier(): [VariableAccess] c -# 2453| Type = [Class] ClassWithDestructor -# 2453| ValueCategory = lvalue -# 2455| [CopyAssignmentOperator] ByValueConstructor& ByValueConstructor::operator=(ByValueConstructor const&) -# 2455| : -#-----| getParameter(0): [Parameter] (unnamed parameter 0) -#-----| Type = [LValueReferenceType] const ByValueConstructor & -# 2455| [MoveAssignmentOperator] ByValueConstructor& ByValueConstructor::operator=(ByValueConstructor&&) -# 2455| : -#-----| getParameter(0): [Parameter] (unnamed parameter 0) -#-----| Type = [RValueReferenceType] ByValueConstructor && -# 2455| [CopyConstructor] void ByValueConstructor::ByValueConstructor(ByValueConstructor const&) -# 2455| : -#-----| getParameter(0): [Parameter] (unnamed parameter 0) -#-----| Type = [LValueReferenceType] const ByValueConstructor & -# 2455| [MoveConstructor] void ByValueConstructor::ByValueConstructor(ByValueConstructor&&) -# 2455| : -#-----| getParameter(0): [Parameter] (unnamed parameter 0) -#-----| Type = [RValueReferenceType] ByValueConstructor && -# 2456| [Constructor] void ByValueConstructor::ByValueConstructor(ClassWithDestructor) +# 2431| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2431| Type = [PlainCharType] char +# 2431| ValueCategory = prvalue(load) +# 2432| getStmt(): [ExprStmt] ExprStmt +# 2432| getExpr(): [AssignAddExpr] ... += ... +# 2432| Type = [PlainCharType] char +# 2432| ValueCategory = lvalue +# 2432| getLValue(): [VariableAccess] y +# 2432| Type = [PlainCharType] char +# 2432| ValueCategory = lvalue +# 2432| getRValue(): [VariableAccess] x +# 2432| Type = [PlainCharType] char +# 2432| ValueCategory = prvalue(load) +# 2432| getRValue().getFullyConverted(): [CStyleCast] (int)... +# 2432| Conversion = [IntegralConversion] integral conversion +# 2432| Type = [IntType] int +# 2432| ValueCategory = prvalue +# 2431| getImplicitDestructorCall(0): [DestructorCall] call to ~vector +# 2431| Type = [VoidType] void +# 2431| ValueCategory = prvalue +# 2431| getQualifier(): [ReuseExpr] reuse of temporary object +# 2431| Type = [ClassTemplateInstantiation,Struct] vector +# 2431| ValueCategory = xvalue +# 2431| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2431| Type = [ClassTemplateInstantiation,Struct] iterator +# 2431| ValueCategory = lvalue +# 2433| getStmt(6): [ReturnStmt] return ... +# 2435| [TopLevelFunction] void param_with_destructor_by_value(ClassWithDestructor) +# 2435| : +# 2435| getParameter(0): [Parameter] c +# 2435| Type = [Class] ClassWithDestructor +# 2435| getEntryPoint(): [BlockStmt] { ... } +# 2437| getStmt(0): [ReturnStmt] return ... +# 2439| [TopLevelFunction] void param_with_destructor_by_pointer(ClassWithDestructor*) +# 2439| : +# 2439| getParameter(0): [Parameter] c +# 2439| Type = [PointerType] ClassWithDestructor * +# 2439| getEntryPoint(): [BlockStmt] { ... } +# 2441| getStmt(0): [ReturnStmt] return ... +# 2443| [TopLevelFunction] void param_with_destructor_by_ref(ClassWithDestructor&) +# 2443| : +# 2443| getParameter(0): [Parameter] c +# 2443| Type = [LValueReferenceType] ClassWithDestructor & +# 2443| getEntryPoint(): [BlockStmt] { ... } +# 2445| getStmt(0): [ReturnStmt] return ... +# 2447| [TopLevelFunction] void param_with_destructor_by_rref(ClassWithDestructor&&) +# 2447| : +# 2447| getParameter(0): [Parameter] c +# 2447| Type = [RValueReferenceType] ClassWithDestructor && +# 2447| getEntryPoint(): [BlockStmt] { ... } +# 2449| getStmt(0): [ReturnStmt] return ... +# 2451| [TopLevelFunction] void rethrow_with_destruction(int) +# 2451| : +# 2451| getParameter(0): [Parameter] x +# 2451| Type = [IntType] int +# 2451| getEntryPoint(): [BlockStmt] { ... } +# 2452| getStmt(0): [DeclStmt] declaration +# 2452| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c +# 2452| Type = [Class] ClassWithDestructor +# 2452| getVariable().getInitializer(): [Initializer] initializer for c +# 2452| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2452| Type = [VoidType] void +# 2452| ValueCategory = prvalue +# 2453| getStmt(1): [ExprStmt] ExprStmt +# 2453| getExpr(): [ReThrowExpr] re-throw exception +# 2453| Type = [VoidType] void +# 2453| ValueCategory = prvalue +# 2454| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2454| Type = [VoidType] void +# 2454| ValueCategory = prvalue +# 2454| getQualifier(): [VariableAccess] c +# 2454| Type = [Class] ClassWithDestructor +# 2454| ValueCategory = lvalue +# 2456| [CopyAssignmentOperator] ByValueConstructor& ByValueConstructor::operator=(ByValueConstructor const&) # 2456| : -# 2456| getParameter(0): [Parameter] (unnamed parameter 0) -# 2456| Type = [Class] ClassWithDestructor -# 2459| [TopLevelFunction] void new_with_destructor(ClassWithDestructor) -# 2459| : -# 2459| getParameter(0): [Parameter] a -# 2459| Type = [Class] ClassWithDestructor -# 2460| getEntryPoint(): [BlockStmt] { ... } -# 2461| getStmt(0): [DeclStmt] declaration -# 2461| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b -# 2461| Type = [PointerType] ByValueConstructor * -# 2461| getVariable().getInitializer(): [Initializer] initializer for b -# 2461| getExpr(): [NewExpr] new -# 2461| Type = [PointerType] ByValueConstructor * -# 2461| ValueCategory = prvalue -# 2461| getInitializer(): [ConstructorCall] call to ByValueConstructor -# 2461| Type = [VoidType] void -# 2461| ValueCategory = prvalue -# 2461| getArgument(0): [VariableAccess] a -# 2461| Type = [Class] ClassWithDestructor -# 2461| ValueCategory = prvalue(load) -# 2461| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object -# 2461| Type = [Class] ClassWithDestructor -# 2461| ValueCategory = lvalue -# 2461| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2461| Type = [VoidType] void -# 2461| ValueCategory = prvalue -# 2461| getQualifier(): [ReuseExpr] reuse of temporary object -# 2461| Type = [Class] ClassWithDestructor -# 2461| ValueCategory = xvalue -# 2462| getStmt(1): [ReturnStmt] return ... -# 2465| [CopyAssignmentOperator] rvalue_conversion_with_destructor::A& rvalue_conversion_with_destructor::A::operator=(rvalue_conversion_with_destructor::A const&) -# 2465| : +#-----| getParameter(0): [Parameter] (unnamed parameter 0) +#-----| Type = [LValueReferenceType] const ByValueConstructor & +# 2456| [MoveAssignmentOperator] ByValueConstructor& ByValueConstructor::operator=(ByValueConstructor&&) +# 2456| : +#-----| getParameter(0): [Parameter] (unnamed parameter 0) +#-----| Type = [RValueReferenceType] ByValueConstructor && +# 2456| [CopyConstructor] void ByValueConstructor::ByValueConstructor(ByValueConstructor const&) +# 2456| : +#-----| getParameter(0): [Parameter] (unnamed parameter 0) +#-----| Type = [LValueReferenceType] const ByValueConstructor & +# 2456| [MoveConstructor] void ByValueConstructor::ByValueConstructor(ByValueConstructor&&) +# 2456| : +#-----| getParameter(0): [Parameter] (unnamed parameter 0) +#-----| Type = [RValueReferenceType] ByValueConstructor && +# 2457| [Constructor] void ByValueConstructor::ByValueConstructor(ClassWithDestructor) +# 2457| : +# 2457| getParameter(0): [Parameter] (unnamed parameter 0) +# 2457| Type = [Class] ClassWithDestructor +# 2460| [TopLevelFunction] void new_with_destructor(ClassWithDestructor) +# 2460| : +# 2460| getParameter(0): [Parameter] a +# 2460| Type = [Class] ClassWithDestructor +# 2461| getEntryPoint(): [BlockStmt] { ... } +# 2462| getStmt(0): [DeclStmt] declaration +# 2462| getDeclarationEntry(0): [VariableDeclarationEntry] definition of b +# 2462| Type = [PointerType] ByValueConstructor * +# 2462| getVariable().getInitializer(): [Initializer] initializer for b +# 2462| getExpr(): [NewExpr] new +# 2462| Type = [PointerType] ByValueConstructor * +# 2462| ValueCategory = prvalue +# 2462| getInitializer(): [ConstructorCall] call to ByValueConstructor +# 2462| Type = [VoidType] void +# 2462| ValueCategory = prvalue +# 2462| getArgument(0): [VariableAccess] a +# 2462| Type = [Class] ClassWithDestructor +# 2462| ValueCategory = prvalue(load) +# 2462| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object +# 2462| Type = [Class] ClassWithDestructor +# 2462| ValueCategory = lvalue +# 2462| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2462| Type = [VoidType] void +# 2462| ValueCategory = prvalue +# 2462| getQualifier(): [ReuseExpr] reuse of temporary object +# 2462| Type = [Class] ClassWithDestructor +# 2462| ValueCategory = xvalue +# 2463| getStmt(1): [ReturnStmt] return ... +# 2466| [CopyAssignmentOperator] rvalue_conversion_with_destructor::A& rvalue_conversion_with_destructor::A::operator=(rvalue_conversion_with_destructor::A const&) +# 2466| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [LValueReferenceType] const A & -# 2465| [MoveAssignmentOperator] rvalue_conversion_with_destructor::A& rvalue_conversion_with_destructor::A::operator=(rvalue_conversion_with_destructor::A&&) -# 2465| : +# 2466| [MoveAssignmentOperator] rvalue_conversion_with_destructor::A& rvalue_conversion_with_destructor::A::operator=(rvalue_conversion_with_destructor::A&&) +# 2466| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [RValueReferenceType] A && -# 2469| [CopyAssignmentOperator] rvalue_conversion_with_destructor::B& rvalue_conversion_with_destructor::B::operator=(rvalue_conversion_with_destructor::B const&) -# 2469| : +# 2470| [CopyAssignmentOperator] rvalue_conversion_with_destructor::B& rvalue_conversion_with_destructor::B::operator=(rvalue_conversion_with_destructor::B const&) +# 2470| : #-----| getParameter(0): [Parameter] (unnamed parameter 0) #-----| Type = [LValueReferenceType] const B & -# 2469| [Constructor] void rvalue_conversion_with_destructor::B::B() -# 2469| : -# 2471| [Destructor] void rvalue_conversion_with_destructor::B::~B() -# 2471| : -# 2473| [ConstMemberFunction] rvalue_conversion_with_destructor::A* rvalue_conversion_with_destructor::B::operator->() const -# 2473| : -# 2476| [TopLevelFunction] rvalue_conversion_with_destructor::B rvalue_conversion_with_destructor::get() -# 2476| : -# 2478| [TopLevelFunction] void rvalue_conversion_with_destructor::test() -# 2478| : -# 2479| getEntryPoint(): [BlockStmt] { ... } -# 2480| getStmt(0): [DeclStmt] declaration -# 2480| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a -# 2480| Type = [IntType] unsigned int -# 2480| getVariable().getInitializer(): [Initializer] initializer for a -# 2480| getExpr(): [PointerFieldAccess] a -# 2480| Type = [IntType] unsigned int -# 2480| ValueCategory = prvalue(load) -# 2480| getQualifier(): [FunctionCall] call to operator-> -# 2480| Type = [PointerType] A * -# 2480| ValueCategory = prvalue -# 2480| getQualifier(): [FunctionCall] call to get -# 2480| Type = [Struct] B -# 2480| ValueCategory = prvalue -# 2480| getQualifier().getFullyConverted(): [CStyleCast] (const B)... -# 2480| Conversion = [PrvalueAdjustmentConversion] prvalue adjustment conversion -# 2480| Type = [SpecifiedType] const B -# 2480| ValueCategory = prvalue -# 2480| getExpr(): [TemporaryObjectExpr] temporary object -# 2480| Type = [Struct] B -# 2480| ValueCategory = prvalue(load) -# 2480| getImplicitDestructorCall(0): [DestructorCall] call to ~B -# 2480| Type = [VoidType] void -# 2480| ValueCategory = prvalue -# 2480| getQualifier(): [ReuseExpr] reuse of temporary object -# 2480| Type = [Struct] B -# 2480| ValueCategory = xvalue -# 2481| getStmt(1): [ReturnStmt] return ... -# 2484| [TopLevelFunction] void destructor_without_block(bool) -# 2484| : -# 2484| getParameter(0): [Parameter] b -# 2484| Type = [BoolType] bool -# 2485| getEntryPoint(): [BlockStmt] { ... } -# 2486| getStmt(0): [IfStmt] if (...) ... -# 2486| getCondition(): [VariableAccess] b -# 2486| Type = [BoolType] bool -# 2486| ValueCategory = prvalue(load) -# 2487| getThen(): [DeclStmt] declaration -# 2487| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c -# 2487| Type = [Class] ClassWithDestructor -# 2487| getVariable().getInitializer(): [Initializer] initializer for c -# 2487| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2487| Type = [VoidType] void -# 2487| ValueCategory = prvalue +# 2470| [Constructor] void rvalue_conversion_with_destructor::B::B() +# 2470| : +# 2472| [Destructor] void rvalue_conversion_with_destructor::B::~B() +# 2472| : +# 2474| [ConstMemberFunction] rvalue_conversion_with_destructor::A* rvalue_conversion_with_destructor::B::operator->() const +# 2474| : +# 2477| [TopLevelFunction] rvalue_conversion_with_destructor::B rvalue_conversion_with_destructor::get() +# 2477| : +# 2479| [TopLevelFunction] void rvalue_conversion_with_destructor::test() +# 2479| : +# 2480| getEntryPoint(): [BlockStmt] { ... } +# 2481| getStmt(0): [DeclStmt] declaration +# 2481| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a +# 2481| Type = [IntType] unsigned int +# 2481| getVariable().getInitializer(): [Initializer] initializer for a +# 2481| getExpr(): [PointerFieldAccess] a +# 2481| Type = [IntType] unsigned int +# 2481| ValueCategory = prvalue(load) +# 2481| getQualifier(): [FunctionCall] call to operator-> +# 2481| Type = [PointerType] A * +# 2481| ValueCategory = prvalue +# 2481| getQualifier(): [FunctionCall] call to get +# 2481| Type = [Struct] B +# 2481| ValueCategory = prvalue +# 2481| getQualifier().getFullyConverted(): [CStyleCast] (const B)... +# 2481| Conversion = [PrvalueAdjustmentConversion] prvalue adjustment conversion +# 2481| Type = [SpecifiedType] const B +# 2481| ValueCategory = prvalue +# 2481| getExpr(): [TemporaryObjectExpr] temporary object +# 2481| Type = [Struct] B +# 2481| ValueCategory = prvalue(load) +# 2481| getImplicitDestructorCall(0): [DestructorCall] call to ~B +# 2481| Type = [VoidType] void +# 2481| ValueCategory = prvalue +# 2481| getQualifier(): [ReuseExpr] reuse of temporary object +# 2481| Type = [Struct] B +# 2481| ValueCategory = xvalue +# 2482| getStmt(1): [ReturnStmt] return ... +# 2485| [TopLevelFunction] void destructor_without_block(bool) +# 2485| : +# 2485| getParameter(0): [Parameter] b +# 2485| Type = [BoolType] bool +# 2486| getEntryPoint(): [BlockStmt] { ... } +# 2487| getStmt(0): [IfStmt] if (...) ... +# 2487| getCondition(): [VariableAccess] b +# 2487| Type = [BoolType] bool +# 2487| ValueCategory = prvalue(load) +# 2488| getThen(): [DeclStmt] declaration +# 2488| getDeclarationEntry(0): [VariableDeclarationEntry] definition of c +# 2488| Type = [Class] ClassWithDestructor +# 2488| getVariable().getInitializer(): [Initializer] initializer for c +# 2488| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2488| Type = [VoidType] void +# 2488| ValueCategory = prvalue #-----| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue #-----| getQualifier(): [VariableAccess] c #-----| Type = [Class] ClassWithDestructor #-----| ValueCategory = lvalue -# 2489| getStmt(1): [IfStmt] if (...) ... -# 2489| getCondition(): [VariableAccess] b -# 2489| Type = [BoolType] bool -# 2489| ValueCategory = prvalue(load) -# 2490| getThen(): [DeclStmt] declaration -# 2490| getDeclarationEntry(0): [VariableDeclarationEntry] definition of d -# 2490| Type = [Class] ClassWithDestructor -# 2490| getVariable().getInitializer(): [Initializer] initializer for d -# 2490| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2490| Type = [VoidType] void -# 2490| ValueCategory = prvalue +# 2490| getStmt(1): [IfStmt] if (...) ... +# 2490| getCondition(): [VariableAccess] b +# 2490| Type = [BoolType] bool +# 2490| ValueCategory = prvalue(load) +# 2491| getThen(): [DeclStmt] declaration +# 2491| getDeclarationEntry(0): [VariableDeclarationEntry] definition of d +# 2491| Type = [Class] ClassWithDestructor +# 2491| getVariable().getInitializer(): [Initializer] initializer for d +# 2491| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2491| Type = [VoidType] void +# 2491| ValueCategory = prvalue #-----| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue #-----| getQualifier(): [VariableAccess] d #-----| Type = [Class] ClassWithDestructor #-----| ValueCategory = lvalue -# 2492| getElse(): [DeclStmt] declaration -# 2492| getDeclarationEntry(0): [VariableDeclarationEntry] definition of e -# 2492| Type = [Class] ClassWithDestructor -# 2492| getVariable().getInitializer(): [Initializer] initializer for e -# 2492| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2492| Type = [VoidType] void -# 2492| ValueCategory = prvalue +# 2493| getElse(): [DeclStmt] declaration +# 2493| getDeclarationEntry(0): [VariableDeclarationEntry] definition of e +# 2493| Type = [Class] ClassWithDestructor +# 2493| getVariable().getInitializer(): [Initializer] initializer for e +# 2493| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2493| Type = [VoidType] void +# 2493| ValueCategory = prvalue #-----| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue #-----| getQualifier(): [VariableAccess] e #-----| Type = [Class] ClassWithDestructor #-----| ValueCategory = lvalue -# 2494| getStmt(2): [WhileStmt] while (...) ... -# 2494| getCondition(): [VariableAccess] b -# 2494| Type = [BoolType] bool -# 2494| ValueCategory = prvalue(load) -# 2495| getStmt(): [DeclStmt] declaration -# 2495| getDeclarationEntry(0): [VariableDeclarationEntry] definition of f -# 2495| Type = [Class] ClassWithDestructor -# 2495| getVariable().getInitializer(): [Initializer] initializer for f -# 2495| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2495| Type = [VoidType] void -# 2495| ValueCategory = prvalue +# 2495| getStmt(2): [WhileStmt] while (...) ... +# 2495| getCondition(): [VariableAccess] b +# 2495| Type = [BoolType] bool +# 2495| ValueCategory = prvalue(load) +# 2496| getStmt(): [DeclStmt] declaration +# 2496| getDeclarationEntry(0): [VariableDeclarationEntry] definition of f +# 2496| Type = [Class] ClassWithDestructor +# 2496| getVariable().getInitializer(): [Initializer] initializer for f +# 2496| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2496| Type = [VoidType] void +# 2496| ValueCategory = prvalue #-----| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue #-----| getQualifier(): [VariableAccess] f #-----| Type = [Class] ClassWithDestructor #-----| ValueCategory = lvalue -# 2497| getStmt(3): [ForStmt] for(...;...;...) ... -# 2497| getInitialization(): [DeclStmt] declaration -# 2497| getDeclarationEntry(0): [VariableDeclarationEntry] definition of i -# 2497| Type = [IntType] int -# 2497| getVariable().getInitializer(): [Initializer] initializer for i -# 2497| getExpr(): [Literal] 0 -# 2497| Type = [IntType] int -# 2497| Value = [Literal] 0 -# 2497| ValueCategory = prvalue -# 2497| getCondition(): [LTExpr] ... < ... -# 2497| Type = [BoolType] bool -# 2497| ValueCategory = prvalue -# 2497| getLesserOperand(): [VariableAccess] i -# 2497| Type = [IntType] int -# 2497| ValueCategory = prvalue(load) -# 2497| getGreaterOperand(): [Literal] 42 -# 2497| Type = [IntType] int -# 2497| Value = [Literal] 42 -# 2497| ValueCategory = prvalue -# 2497| getUpdate(): [PrefixIncrExpr] ++ ... -# 2497| Type = [IntType] int -# 2497| ValueCategory = lvalue -# 2497| getOperand(): [VariableAccess] i -# 2497| Type = [IntType] int -# 2497| ValueCategory = lvalue -# 2498| getStmt(): [DeclStmt] declaration -# 2498| getDeclarationEntry(0): [VariableDeclarationEntry] definition of g -# 2498| Type = [Class] ClassWithDestructor -# 2498| getVariable().getInitializer(): [Initializer] initializer for g -# 2498| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2498| Type = [VoidType] void +# 2498| getStmt(3): [ForStmt] for(...;...;...) ... +# 2498| getInitialization(): [DeclStmt] declaration +# 2498| getDeclarationEntry(0): [VariableDeclarationEntry] definition of i +# 2498| Type = [IntType] int +# 2498| getVariable().getInitializer(): [Initializer] initializer for i +# 2498| getExpr(): [Literal] 0 +# 2498| Type = [IntType] int +# 2498| Value = [Literal] 0 # 2498| ValueCategory = prvalue +# 2498| getCondition(): [LTExpr] ... < ... +# 2498| Type = [BoolType] bool +# 2498| ValueCategory = prvalue +# 2498| getLesserOperand(): [VariableAccess] i +# 2498| Type = [IntType] int +# 2498| ValueCategory = prvalue(load) +# 2498| getGreaterOperand(): [Literal] 42 +# 2498| Type = [IntType] int +# 2498| Value = [Literal] 42 +# 2498| ValueCategory = prvalue +# 2498| getUpdate(): [PrefixIncrExpr] ++ ... +# 2498| Type = [IntType] int +# 2498| ValueCategory = lvalue +# 2498| getOperand(): [VariableAccess] i +# 2498| Type = [IntType] int +# 2498| ValueCategory = lvalue +# 2499| getStmt(): [DeclStmt] declaration +# 2499| getDeclarationEntry(0): [VariableDeclarationEntry] definition of g +# 2499| Type = [Class] ClassWithDestructor +# 2499| getVariable().getInitializer(): [Initializer] initializer for g +# 2499| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2499| Type = [VoidType] void +# 2499| ValueCategory = prvalue #-----| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor #-----| Type = [VoidType] void #-----| ValueCategory = prvalue #-----| getQualifier(): [VariableAccess] g #-----| Type = [Class] ClassWithDestructor #-----| ValueCategory = lvalue -# 2499| getStmt(4): [ReturnStmt] return ... -# 2501| [TopLevelFunction] void destruction_in_switch_1(int) -# 2501| : -# 2501| getParameter(0): [Parameter] c -# 2501| Type = [IntType] int -# 2501| getEntryPoint(): [BlockStmt] { ... } -# 2502| getStmt(0): [SwitchStmt] switch (...) ... -# 2502| getExpr(): [VariableAccess] c -# 2502| Type = [IntType] int -# 2502| ValueCategory = prvalue(load) -# 2502| getStmt(): [BlockStmt] { ... } -# 2503| getStmt(0): [SwitchCase] case ...: -# 2503| getExpr(): [Literal] 0 -# 2503| Type = [IntType] int -# 2503| Value = [Literal] 0 -# 2503| ValueCategory = prvalue -# 2503| getStmt(1): [BlockStmt] { ... } -# 2504| getStmt(0): [DeclStmt] declaration -# 2504| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2504| Type = [Class] ClassWithDestructor -# 2504| getVariable().getInitializer(): [Initializer] initializer for x -# 2504| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2504| Type = [VoidType] void -# 2504| ValueCategory = prvalue -# 2505| getStmt(1): [BreakStmt] break; -# 2506| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2506| Type = [VoidType] void -# 2506| ValueCategory = prvalue -# 2506| getQualifier(): [VariableAccess] x -# 2506| Type = [Class] ClassWithDestructor -# 2506| ValueCategory = lvalue -# 2506| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2506| Type = [VoidType] void -# 2506| ValueCategory = prvalue -# 2506| getQualifier(): [VariableAccess] x -# 2506| Type = [Class] ClassWithDestructor -# 2506| ValueCategory = lvalue -# 2507| getStmt(1): [LabelStmt] label ...: -# 2508| getStmt(2): [ReturnStmt] return ... -# 2510| [TopLevelFunction] void destruction_in_switch_2(int) -# 2510| : -# 2510| getParameter(0): [Parameter] c -# 2510| Type = [IntType] int -# 2510| getEntryPoint(): [BlockStmt] { ... } -# 2511| getStmt(0): [SwitchStmt] switch (...) ... -# 2511| getInitialization(): [DeclStmt] declaration -# 2511| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2511| Type = [Class] ClassWithDestructor -# 2511| getVariable().getInitializer(): [Initializer] initializer for y -# 2511| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2511| Type = [VoidType] void -# 2511| ValueCategory = prvalue -# 2511| getExpr(): [VariableAccess] c -# 2511| Type = [IntType] int -# 2511| ValueCategory = prvalue(load) -# 2511| getStmt(): [BlockStmt] { ... } -# 2512| getStmt(0): [SwitchCase] case ...: -# 2512| getExpr(): [Literal] 0 -# 2512| Type = [IntType] int -# 2512| Value = [Literal] 0 -# 2512| ValueCategory = prvalue -# 2512| getStmt(1): [BlockStmt] { ... } -# 2513| getStmt(0): [BreakStmt] break; -# 2518| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2518| Type = [VoidType] void -# 2518| ValueCategory = prvalue -# 2518| getQualifier(): [VariableAccess] y -# 2518| Type = [Class] ClassWithDestructor -# 2518| ValueCategory = lvalue -# 2515| getStmt(2): [SwitchCase] default: -# 2515| getStmt(3): [BlockStmt] { ... } -# 2516| getStmt(0): [BreakStmt] break; -# 2518| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2518| Type = [VoidType] void -# 2518| ValueCategory = prvalue -# 2518| getQualifier(): [VariableAccess] y -# 2518| Type = [Class] ClassWithDestructor -# 2518| ValueCategory = lvalue -# 2518| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2518| Type = [VoidType] void -# 2518| ValueCategory = prvalue -# 2518| getQualifier(): [VariableAccess] y -# 2518| Type = [Class] ClassWithDestructor -# 2518| ValueCategory = lvalue -# 2518| getStmt(1): [LabelStmt] label ...: -# 2519| getStmt(2): [ReturnStmt] return ... -# 2521| [TopLevelFunction] void destruction_in_switch_3(int) -# 2521| : -# 2521| getParameter(0): [Parameter] c -# 2521| Type = [IntType] int -# 2521| getEntryPoint(): [BlockStmt] { ... } -# 2522| getStmt(0): [SwitchStmt] switch (...) ... -# 2522| getInitialization(): [DeclStmt] declaration -# 2522| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y -# 2522| Type = [Class] ClassWithDestructor -# 2522| getVariable().getInitializer(): [Initializer] initializer for y -# 2522| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2522| Type = [VoidType] void -# 2522| ValueCategory = prvalue -# 2522| getExpr(): [VariableAccess] c -# 2522| Type = [IntType] int -# 2522| ValueCategory = prvalue(load) -# 2522| getStmt(): [BlockStmt] { ... } -# 2523| getStmt(0): [SwitchCase] case ...: -# 2523| getExpr(): [Literal] 0 -# 2523| Type = [IntType] int -# 2523| Value = [Literal] 0 -# 2523| ValueCategory = prvalue -# 2523| getStmt(1): [BlockStmt] { ... } -# 2524| getStmt(0): [DeclStmt] declaration -# 2524| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2524| Type = [Class] ClassWithDestructor -# 2524| getVariable().getInitializer(): [Initializer] initializer for x -# 2524| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2524| Type = [VoidType] void -# 2524| ValueCategory = prvalue -# 2525| getStmt(1): [BreakStmt] break; -# 2526| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2526| Type = [VoidType] void -# 2526| ValueCategory = prvalue -# 2526| getQualifier(): [VariableAccess] x -# 2526| Type = [Class] ClassWithDestructor -# 2526| ValueCategory = lvalue -# 2530| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor -# 2530| Type = [VoidType] void -# 2530| ValueCategory = prvalue -# 2530| getQualifier(): [VariableAccess] y -# 2530| Type = [Class] ClassWithDestructor -# 2530| ValueCategory = lvalue -# 2526| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2526| Type = [VoidType] void -# 2526| ValueCategory = prvalue -# 2526| getQualifier(): [VariableAccess] x -# 2526| Type = [Class] ClassWithDestructor -# 2526| ValueCategory = lvalue -# 2527| getStmt(2): [SwitchCase] default: -# 2527| getStmt(3): [BlockStmt] { ... } -# 2528| getStmt(0): [BreakStmt] break; -# 2530| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2530| Type = [VoidType] void -# 2530| ValueCategory = prvalue -# 2530| getQualifier(): [VariableAccess] y -# 2530| Type = [Class] ClassWithDestructor -# 2530| ValueCategory = lvalue -# 2530| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2530| Type = [VoidType] void -# 2530| ValueCategory = prvalue -# 2530| getQualifier(): [VariableAccess] y -# 2530| Type = [Class] ClassWithDestructor -# 2530| ValueCategory = lvalue -# 2530| getStmt(1): [LabelStmt] label ...: -# 2531| getStmt(2): [ReturnStmt] return ... -# 2533| [TopLevelFunction] void destructor_possibly_not_handled() -# 2533| : -# 2533| getEntryPoint(): [BlockStmt] { ... } -# 2534| getStmt(0): [DeclStmt] declaration -# 2534| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x -# 2534| Type = [Class] ClassWithDestructor -# 2534| getVariable().getInitializer(): [Initializer] initializer for x -# 2534| getExpr(): [ConstructorCall] call to ClassWithDestructor -# 2534| Type = [VoidType] void -# 2534| ValueCategory = prvalue -# 2535| getStmt(1): [TryStmt] try { ... } -# 2535| getStmt(): [BlockStmt] { ... } -# 2536| getStmt(0): [ExprStmt] ExprStmt -# 2536| getExpr(): [ThrowExpr] throw ... -# 2536| Type = [IntType] int -# 2536| ValueCategory = prvalue -# 2536| getExpr(): [Literal] 42 -# 2536| Type = [IntType] int -# 2536| Value = [Literal] 42 -# 2536| ValueCategory = prvalue -# 2538| getChild(1): [Handler] -# 2538| getBlock(): [CatchBlock] { ... } -# 2540| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2540| Type = [VoidType] void -# 2540| ValueCategory = prvalue -# 2540| getQualifier(): [VariableAccess] x -# 2540| Type = [Class] ClassWithDestructor -# 2540| ValueCategory = lvalue -# 2540| getStmt(2): [ReturnStmt] return ... -# 2540| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor -# 2540| Type = [VoidType] void -# 2540| ValueCategory = prvalue -# 2540| getQualifier(): [VariableAccess] x -# 2540| Type = [Class] ClassWithDestructor -# 2540| ValueCategory = lvalue +# 2500| getStmt(4): [ReturnStmt] return ... +# 2502| [TopLevelFunction] void destruction_in_switch_1(int) +# 2502| : +# 2502| getParameter(0): [Parameter] c +# 2502| Type = [IntType] int +# 2502| getEntryPoint(): [BlockStmt] { ... } +# 2503| getStmt(0): [SwitchStmt] switch (...) ... +# 2503| getExpr(): [VariableAccess] c +# 2503| Type = [IntType] int +# 2503| ValueCategory = prvalue(load) +# 2503| getStmt(): [BlockStmt] { ... } +# 2504| getStmt(0): [SwitchCase] case ...: +# 2504| getExpr(): [Literal] 0 +# 2504| Type = [IntType] int +# 2504| Value = [Literal] 0 +# 2504| ValueCategory = prvalue +# 2504| getStmt(1): [BlockStmt] { ... } +# 2505| getStmt(0): [DeclStmt] declaration +# 2505| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2505| Type = [Class] ClassWithDestructor +# 2505| getVariable().getInitializer(): [Initializer] initializer for x +# 2505| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2505| Type = [VoidType] void +# 2505| ValueCategory = prvalue +# 2506| getStmt(1): [BreakStmt] break; +# 2507| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2507| Type = [VoidType] void +# 2507| ValueCategory = prvalue +# 2507| getQualifier(): [VariableAccess] x +# 2507| Type = [Class] ClassWithDestructor +# 2507| ValueCategory = lvalue +# 2507| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2507| Type = [VoidType] void +# 2507| ValueCategory = prvalue +# 2507| getQualifier(): [VariableAccess] x +# 2507| Type = [Class] ClassWithDestructor +# 2507| ValueCategory = lvalue +# 2508| getStmt(1): [LabelStmt] label ...: +# 2509| getStmt(2): [ReturnStmt] return ... +# 2511| [TopLevelFunction] void destruction_in_switch_2(int) +# 2511| : +# 2511| getParameter(0): [Parameter] c +# 2511| Type = [IntType] int +# 2511| getEntryPoint(): [BlockStmt] { ... } +# 2512| getStmt(0): [SwitchStmt] switch (...) ... +# 2512| getInitialization(): [DeclStmt] declaration +# 2512| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2512| Type = [Class] ClassWithDestructor +# 2512| getVariable().getInitializer(): [Initializer] initializer for y +# 2512| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2512| Type = [VoidType] void +# 2512| ValueCategory = prvalue +# 2512| getExpr(): [VariableAccess] c +# 2512| Type = [IntType] int +# 2512| ValueCategory = prvalue(load) +# 2512| getStmt(): [BlockStmt] { ... } +# 2513| getStmt(0): [SwitchCase] case ...: +# 2513| getExpr(): [Literal] 0 +# 2513| Type = [IntType] int +# 2513| Value = [Literal] 0 +# 2513| ValueCategory = prvalue +# 2513| getStmt(1): [BlockStmt] { ... } +# 2514| getStmt(0): [BreakStmt] break; +# 2519| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2519| Type = [VoidType] void +# 2519| ValueCategory = prvalue +# 2519| getQualifier(): [VariableAccess] y +# 2519| Type = [Class] ClassWithDestructor +# 2519| ValueCategory = lvalue +# 2516| getStmt(2): [SwitchCase] default: +# 2516| getStmt(3): [BlockStmt] { ... } +# 2517| getStmt(0): [BreakStmt] break; +# 2519| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2519| Type = [VoidType] void +# 2519| ValueCategory = prvalue +# 2519| getQualifier(): [VariableAccess] y +# 2519| Type = [Class] ClassWithDestructor +# 2519| ValueCategory = lvalue +# 2519| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2519| Type = [VoidType] void +# 2519| ValueCategory = prvalue +# 2519| getQualifier(): [VariableAccess] y +# 2519| Type = [Class] ClassWithDestructor +# 2519| ValueCategory = lvalue +# 2519| getStmt(1): [LabelStmt] label ...: +# 2520| getStmt(2): [ReturnStmt] return ... +# 2522| [TopLevelFunction] void destruction_in_switch_3(int) +# 2522| : +# 2522| getParameter(0): [Parameter] c +# 2522| Type = [IntType] int +# 2522| getEntryPoint(): [BlockStmt] { ... } +# 2523| getStmt(0): [SwitchStmt] switch (...) ... +# 2523| getInitialization(): [DeclStmt] declaration +# 2523| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y +# 2523| Type = [Class] ClassWithDestructor +# 2523| getVariable().getInitializer(): [Initializer] initializer for y +# 2523| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2523| Type = [VoidType] void +# 2523| ValueCategory = prvalue +# 2523| getExpr(): [VariableAccess] c +# 2523| Type = [IntType] int +# 2523| ValueCategory = prvalue(load) +# 2523| getStmt(): [BlockStmt] { ... } +# 2524| getStmt(0): [SwitchCase] case ...: +# 2524| getExpr(): [Literal] 0 +# 2524| Type = [IntType] int +# 2524| Value = [Literal] 0 +# 2524| ValueCategory = prvalue +# 2524| getStmt(1): [BlockStmt] { ... } +# 2525| getStmt(0): [DeclStmt] declaration +# 2525| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2525| Type = [Class] ClassWithDestructor +# 2525| getVariable().getInitializer(): [Initializer] initializer for x +# 2525| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2525| Type = [VoidType] void +# 2525| ValueCategory = prvalue +# 2526| getStmt(1): [BreakStmt] break; +# 2527| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2527| Type = [VoidType] void +# 2527| ValueCategory = prvalue +# 2527| getQualifier(): [VariableAccess] x +# 2527| Type = [Class] ClassWithDestructor +# 2527| ValueCategory = lvalue +# 2531| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor +# 2531| Type = [VoidType] void +# 2531| ValueCategory = prvalue +# 2531| getQualifier(): [VariableAccess] y +# 2531| Type = [Class] ClassWithDestructor +# 2531| ValueCategory = lvalue +# 2527| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2527| Type = [VoidType] void +# 2527| ValueCategory = prvalue +# 2527| getQualifier(): [VariableAccess] x +# 2527| Type = [Class] ClassWithDestructor +# 2527| ValueCategory = lvalue +# 2528| getStmt(2): [SwitchCase] default: +# 2528| getStmt(3): [BlockStmt] { ... } +# 2529| getStmt(0): [BreakStmt] break; +# 2531| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2531| Type = [VoidType] void +# 2531| ValueCategory = prvalue +# 2531| getQualifier(): [VariableAccess] y +# 2531| Type = [Class] ClassWithDestructor +# 2531| ValueCategory = lvalue +# 2531| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2531| Type = [VoidType] void +# 2531| ValueCategory = prvalue +# 2531| getQualifier(): [VariableAccess] y +# 2531| Type = [Class] ClassWithDestructor +# 2531| ValueCategory = lvalue +# 2531| getStmt(1): [LabelStmt] label ...: +# 2532| getStmt(2): [ReturnStmt] return ... +# 2534| [TopLevelFunction] void destructor_possibly_not_handled() +# 2534| : +# 2534| getEntryPoint(): [BlockStmt] { ... } +# 2535| getStmt(0): [DeclStmt] declaration +# 2535| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x +# 2535| Type = [Class] ClassWithDestructor +# 2535| getVariable().getInitializer(): [Initializer] initializer for x +# 2535| getExpr(): [ConstructorCall] call to ClassWithDestructor +# 2535| Type = [VoidType] void +# 2535| ValueCategory = prvalue +# 2536| getStmt(1): [TryStmt] try { ... } +# 2536| getStmt(): [BlockStmt] { ... } +# 2537| getStmt(0): [ExprStmt] ExprStmt +# 2537| getExpr(): [ThrowExpr] throw ... +# 2537| Type = [IntType] int +# 2537| ValueCategory = prvalue +# 2537| getExpr(): [Literal] 42 +# 2537| Type = [IntType] int +# 2537| Value = [Literal] 42 +# 2537| ValueCategory = prvalue +# 2539| getChild(1): [Handler] +# 2539| getBlock(): [CatchBlock] { ... } +# 2541| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2541| Type = [VoidType] void +# 2541| ValueCategory = prvalue +# 2541| getQualifier(): [VariableAccess] x +# 2541| Type = [Class] ClassWithDestructor +# 2541| ValueCategory = lvalue +# 2541| getStmt(2): [ReturnStmt] return ... +# 2541| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2541| Type = [VoidType] void +# 2541| ValueCategory = prvalue +# 2541| getQualifier(): [VariableAccess] x +# 2541| Type = [Class] ClassWithDestructor +# 2541| ValueCategory = lvalue perf-regression.cpp: # 4| [CopyAssignmentOperator] Big& Big::operator=(Big const&) # 4| : diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index 1fe18e4f92a..2fc610f6d12 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -15335,2920 +15335,2920 @@ ir.cpp: # 2193| v2193_19(void) = AliasedUse : m2193_3 # 2193| v2193_20(void) = ExitFunction : -# 2196| bool initialization_with_destructor_bool -# 2196| Block 0 -# 2196| v2196_1(void) = EnterFunction : -# 2196| m2196_2(unknown) = AliasedDefinition : -# 2196| r2196_3(glval) = VariableAddress[initialization_with_destructor_bool] : -# 2196| r2196_4(bool) = Constant[1] : -# 2196| m2196_5(bool) = Store[initialization_with_destructor_bool] : &:r2196_3, r2196_4 -# 2196| m2196_6(unknown) = Chi : total:m2196_2, partial:m2196_5 -# 2196| v2196_7(void) = ReturnVoid : -# 2196| v2196_8(void) = AliasedUse : ~m2196_6 -# 2196| v2196_9(void) = ExitFunction : +# 2197| bool initialization_with_destructor_bool +# 2197| Block 0 +# 2197| v2197_1(void) = EnterFunction : +# 2197| m2197_2(unknown) = AliasedDefinition : +# 2197| r2197_3(glval) = VariableAddress[initialization_with_destructor_bool] : +# 2197| r2197_4(bool) = Constant[1] : +# 2197| m2197_5(bool) = Store[initialization_with_destructor_bool] : &:r2197_3, r2197_4 +# 2197| m2197_6(unknown) = Chi : total:m2197_2, partial:m2197_5 +# 2197| v2197_7(void) = ReturnVoid : +# 2197| v2197_8(void) = AliasedUse : ~m2197_6 +# 2197| v2197_9(void) = ExitFunction : -# 2198| void initialization_with_destructor(bool, char) -# 2198| Block 0 -# 2198| v2198_1(void) = EnterFunction : -# 2198| m2198_2(unknown) = AliasedDefinition : -# 2198| m2198_3(unknown) = InitializeNonLocal : -# 2198| m2198_4(unknown) = Chi : total:m2198_2, partial:m2198_3 -# 2198| r2198_5(glval) = VariableAddress[b] : -# 2198| m2198_6(bool) = InitializeParameter[b] : &:r2198_5 -# 2198| r2198_7(glval) = VariableAddress[c] : -# 2198| m2198_8(char) = InitializeParameter[c] : &:r2198_7 -# 2199| r2199_1(glval) = VariableAddress[x] : -# 2199| m2199_2(ClassWithDestructor) = Uninitialized[x] : &:r2199_1 -# 2199| r2199_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2199| v2199_4(void) = Call[ClassWithDestructor] : func:r2199_3, this:r2199_1 -# 2199| m2199_5(unknown) = ^CallSideEffect : ~m2198_4 -# 2199| m2199_6(unknown) = Chi : total:m2198_4, partial:m2199_5 -# 2199| m2199_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2199_1 -# 2199| m2199_8(ClassWithDestructor) = Chi : total:m2199_2, partial:m2199_7 -# 2199| r2199_9(glval) = VariableAddress[b] : -# 2199| r2199_10(bool) = Load[b] : &:r2199_9, m2198_6 -# 2199| v2199_11(void) = ConditionalBranch : r2199_10 +# 2199| void initialization_with_destructor(bool, char) +# 2199| Block 0 +# 2199| v2199_1(void) = EnterFunction : +# 2199| m2199_2(unknown) = AliasedDefinition : +# 2199| m2199_3(unknown) = InitializeNonLocal : +# 2199| m2199_4(unknown) = Chi : total:m2199_2, partial:m2199_3 +# 2199| r2199_5(glval) = VariableAddress[b] : +# 2199| m2199_6(bool) = InitializeParameter[b] : &:r2199_5 +# 2199| r2199_7(glval) = VariableAddress[c] : +# 2199| m2199_8(char) = InitializeParameter[c] : &:r2199_7 +# 2200| r2200_1(glval) = VariableAddress[x] : +# 2200| m2200_2(ClassWithDestructor) = Uninitialized[x] : &:r2200_1 +# 2200| r2200_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2200| v2200_4(void) = Call[ClassWithDestructor] : func:r2200_3, this:r2200_1 +# 2200| m2200_5(unknown) = ^CallSideEffect : ~m2199_4 +# 2200| m2200_6(unknown) = Chi : total:m2199_4, partial:m2200_5 +# 2200| m2200_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2200_1 +# 2200| m2200_8(ClassWithDestructor) = Chi : total:m2200_2, partial:m2200_7 +# 2200| r2200_9(glval) = VariableAddress[b] : +# 2200| r2200_10(bool) = Load[b] : &:r2200_9, m2199_6 +# 2200| v2200_11(void) = ConditionalBranch : r2200_10 #-----| False -> Block 3 #-----| True -> Block 2 -# 2198| Block 1 -# 2198| m2198_9(unknown) = Phi : from 14:~m2233_5, from 19:~m2233_13, from 23:~m2233_22 -# 2198| v2198_10(void) = ReturnVoid : -# 2198| v2198_11(void) = AliasedUse : ~m2198_9 -# 2198| v2198_12(void) = ExitFunction : +# 2199| Block 1 +# 2199| m2199_9(unknown) = Phi : from 14:~m2234_5, from 19:~m2234_13, from 23:~m2234_22 +# 2199| v2199_10(void) = ReturnVoid : +# 2199| v2199_11(void) = AliasedUse : ~m2199_9 +# 2199| v2199_12(void) = ExitFunction : -# 2200| Block 2 -# 2200| r2200_1(glval) = VariableAddress[x] : -# 2200| r2200_2(glval) = FunctionAddress[set_x] : -# 2200| r2200_3(char) = Constant[97] : -# 2200| v2200_4(void) = Call[set_x] : func:r2200_2, this:r2200_1, 0:r2200_3 -# 2200| m2200_5(unknown) = ^CallSideEffect : ~m2199_6 -# 2200| m2200_6(unknown) = Chi : total:m2199_6, partial:m2200_5 -# 2200| v2200_7(void) = ^IndirectReadSideEffect[-1] : &:r2200_1, m2199_8 -# 2200| m2200_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2200_1 -# 2200| m2200_9(ClassWithDestructor) = Chi : total:m2199_8, partial:m2200_8 -# 2200| r2200_10(glval) = VariableAddress[x] : -# 2200| r2200_11(glval) = FunctionAddress[~ClassWithDestructor] : -# 2200| v2200_12(void) = Call[~ClassWithDestructor] : func:r2200_11, this:r2200_10 -# 2200| m2200_13(unknown) = ^CallSideEffect : ~m2200_6 -# 2200| m2200_14(unknown) = Chi : total:m2200_6, partial:m2200_13 -# 2200| v2200_15(void) = ^IndirectReadSideEffect[-1] : &:r2200_10, m2200_9 -# 2200| m2200_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2200_10 -# 2200| m2200_17(ClassWithDestructor) = Chi : total:m2200_9, partial:m2200_16 +# 2201| Block 2 +# 2201| r2201_1(glval) = VariableAddress[x] : +# 2201| r2201_2(glval) = FunctionAddress[set_x] : +# 2201| r2201_3(char) = Constant[97] : +# 2201| v2201_4(void) = Call[set_x] : func:r2201_2, this:r2201_1, 0:r2201_3 +# 2201| m2201_5(unknown) = ^CallSideEffect : ~m2200_6 +# 2201| m2201_6(unknown) = Chi : total:m2200_6, partial:m2201_5 +# 2201| v2201_7(void) = ^IndirectReadSideEffect[-1] : &:r2201_1, m2200_8 +# 2201| m2201_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_1 +# 2201| m2201_9(ClassWithDestructor) = Chi : total:m2200_8, partial:m2201_8 +# 2201| r2201_10(glval) = VariableAddress[x] : +# 2201| r2201_11(glval) = FunctionAddress[~ClassWithDestructor] : +# 2201| v2201_12(void) = Call[~ClassWithDestructor] : func:r2201_11, this:r2201_10 +# 2201| m2201_13(unknown) = ^CallSideEffect : ~m2201_6 +# 2201| m2201_14(unknown) = Chi : total:m2201_6, partial:m2201_13 +# 2201| v2201_15(void) = ^IndirectReadSideEffect[-1] : &:r2201_10, m2201_9 +# 2201| m2201_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_10 +# 2201| m2201_17(ClassWithDestructor) = Chi : total:m2201_9, partial:m2201_16 #-----| Goto -> Block 3 -# 2202| Block 3 -# 2202| m2202_1(unknown) = Phi : from 0:~m2199_6, from 2:~m2200_14 -# 2202| r2202_2(glval) = VariableAddress[x] : -# 2202| m2202_3(ClassWithDestructor) = Uninitialized[x] : &:r2202_2 -# 2202| r2202_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2202| v2202_5(void) = Call[ClassWithDestructor] : func:r2202_4, this:r2202_2 -# 2202| m2202_6(unknown) = ^CallSideEffect : ~m2202_1 -# 2202| m2202_7(unknown) = Chi : total:m2202_1, partial:m2202_6 -# 2202| m2202_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2202_2 -# 2202| m2202_9(ClassWithDestructor) = Chi : total:m2202_3, partial:m2202_8 -# 2202| r2202_10(bool) = Constant[1] : -# 2202| v2202_11(void) = ConditionalBranch : r2202_10 +# 2203| Block 3 +# 2203| m2203_1(unknown) = Phi : from 0:~m2200_6, from 2:~m2201_14 +# 2203| r2203_2(glval) = VariableAddress[x] : +# 2203| m2203_3(ClassWithDestructor) = Uninitialized[x] : &:r2203_2 +# 2203| r2203_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2203| v2203_5(void) = Call[ClassWithDestructor] : func:r2203_4, this:r2203_2 +# 2203| m2203_6(unknown) = ^CallSideEffect : ~m2203_1 +# 2203| m2203_7(unknown) = Chi : total:m2203_1, partial:m2203_6 +# 2203| m2203_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_2 +# 2203| m2203_9(ClassWithDestructor) = Chi : total:m2203_3, partial:m2203_8 +# 2203| r2203_10(bool) = Constant[1] : +# 2203| v2203_11(void) = ConditionalBranch : r2203_10 #-----| False -> Block 24 #-----| True -> Block 4 -# 2203| Block 4 -# 2203| r2203_1(glval) = VariableAddress[x] : -# 2203| r2203_2(glval) = FunctionAddress[set_x] : -# 2203| r2203_3(char) = Constant[97] : -# 2203| v2203_4(void) = Call[set_x] : func:r2203_2, this:r2203_1, 0:r2203_3 -# 2203| m2203_5(unknown) = ^CallSideEffect : ~m2202_7 -# 2203| m2203_6(unknown) = Chi : total:m2202_7, partial:m2203_5 -# 2203| v2203_7(void) = ^IndirectReadSideEffect[-1] : &:r2203_1, m2202_9 -# 2203| m2203_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 -# 2203| m2203_9(ClassWithDestructor) = Chi : total:m2202_9, partial:m2203_8 -# 2205| r2205_1(glval) = VariableAddress[x] : -# 2205| m2205_2(ClassWithDestructor) = Uninitialized[x] : &:r2205_1 -# 2205| r2205_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2205| v2205_4(void) = Call[ClassWithDestructor] : func:r2205_3, this:r2205_1 -# 2205| m2205_5(unknown) = ^CallSideEffect : ~m2203_6 -# 2205| m2205_6(unknown) = Chi : total:m2203_6, partial:m2205_5 -# 2205| m2205_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2205_1 -# 2205| m2205_8(ClassWithDestructor) = Chi : total:m2205_2, partial:m2205_7 -# 2205| r2205_9(glval) = VariableAddress[c] : -# 2205| r2205_10(char) = Load[c] : &:r2205_9, m2198_8 -# 2205| r2205_11(int) = Convert : r2205_10 -# 2205| v2205_12(void) = Switch : r2205_11 +# 2204| Block 4 +# 2204| r2204_1(glval) = VariableAddress[x] : +# 2204| r2204_2(glval) = FunctionAddress[set_x] : +# 2204| r2204_3(char) = Constant[97] : +# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 +# 2204| m2204_5(unknown) = ^CallSideEffect : ~m2203_7 +# 2204| m2204_6(unknown) = Chi : total:m2203_7, partial:m2204_5 +# 2204| v2204_7(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, m2203_9 +# 2204| m2204_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 +# 2204| m2204_9(ClassWithDestructor) = Chi : total:m2203_9, partial:m2204_8 +# 2206| r2206_1(glval) = VariableAddress[x] : +# 2206| m2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 +# 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2206| v2206_4(void) = Call[ClassWithDestructor] : func:r2206_3, this:r2206_1 +# 2206| m2206_5(unknown) = ^CallSideEffect : ~m2204_6 +# 2206| m2206_6(unknown) = Chi : total:m2204_6, partial:m2206_5 +# 2206| m2206_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2206_1 +# 2206| m2206_8(ClassWithDestructor) = Chi : total:m2206_2, partial:m2206_7 +# 2206| r2206_9(glval) = VariableAddress[c] : +# 2206| r2206_10(char) = Load[c] : &:r2206_9, m2199_8 +# 2206| r2206_11(int) = Convert : r2206_10 +# 2206| v2206_12(void) = Switch : r2206_11 #-----| Case[97] -> Block 5 #-----| Default -> Block 6 -# 2206| Block 5 -# 2206| v2206_1(void) = NoOp : -# 2207| r2207_1(glval) = VariableAddress[x] : -# 2207| r2207_2(glval) = FunctionAddress[set_x] : -# 2207| r2207_3(char) = Constant[97] : -# 2207| v2207_4(void) = Call[set_x] : func:r2207_2, this:r2207_1, 0:r2207_3 -# 2207| m2207_5(unknown) = ^CallSideEffect : ~m2205_6 -# 2207| m2207_6(unknown) = Chi : total:m2205_6, partial:m2207_5 -# 2207| v2207_7(void) = ^IndirectReadSideEffect[-1] : &:r2207_1, m2205_8 -# 2207| m2207_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2207_1 -# 2207| m2207_9(ClassWithDestructor) = Chi : total:m2205_8, partial:m2207_8 -# 2212| r2212_1(glval) = VariableAddress[x] : -# 2212| r2212_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2212| v2212_3(void) = Call[~ClassWithDestructor] : func:r2212_2, this:r2212_1 -# 2212| m2212_4(unknown) = ^CallSideEffect : ~m2207_6 -# 2212| m2212_5(unknown) = Chi : total:m2207_6, partial:m2212_4 -# 2212| v2212_6(void) = ^IndirectReadSideEffect[-1] : &:r2212_1, m2207_9 -# 2212| m2212_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2212_1 -# 2212| m2212_8(ClassWithDestructor) = Chi : total:m2207_9, partial:m2212_7 -# 2208| v2208_1(void) = NoOp : -#-----| Goto -> Block 7 - -# 2209| Block 6 +# 2207| Block 5 +# 2207| v2207_1(void) = NoOp : +# 2208| r2208_1(glval) = VariableAddress[x] : +# 2208| r2208_2(glval) = FunctionAddress[set_x] : +# 2208| r2208_3(char) = Constant[97] : +# 2208| v2208_4(void) = Call[set_x] : func:r2208_2, this:r2208_1, 0:r2208_3 +# 2208| m2208_5(unknown) = ^CallSideEffect : ~m2206_6 +# 2208| m2208_6(unknown) = Chi : total:m2206_6, partial:m2208_5 +# 2208| v2208_7(void) = ^IndirectReadSideEffect[-1] : &:r2208_1, m2206_8 +# 2208| m2208_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2208_1 +# 2208| m2208_9(ClassWithDestructor) = Chi : total:m2206_8, partial:m2208_8 +# 2213| r2213_1(glval) = VariableAddress[x] : +# 2213| r2213_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2213| v2213_3(void) = Call[~ClassWithDestructor] : func:r2213_2, this:r2213_1 +# 2213| m2213_4(unknown) = ^CallSideEffect : ~m2208_6 +# 2213| m2213_5(unknown) = Chi : total:m2208_6, partial:m2213_4 +# 2213| v2213_6(void) = ^IndirectReadSideEffect[-1] : &:r2213_1, m2208_9 +# 2213| m2213_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_1 +# 2213| m2213_8(ClassWithDestructor) = Chi : total:m2208_9, partial:m2213_7 # 2209| v2209_1(void) = NoOp : -# 2210| r2210_1(glval) = VariableAddress[x] : -# 2210| r2210_2(glval) = FunctionAddress[set_x] : -# 2210| r2210_3(char) = Constant[98] : -# 2210| v2210_4(void) = Call[set_x] : func:r2210_2, this:r2210_1, 0:r2210_3 -# 2210| m2210_5(unknown) = ^CallSideEffect : ~m2205_6 -# 2210| m2210_6(unknown) = Chi : total:m2205_6, partial:m2210_5 -# 2210| v2210_7(void) = ^IndirectReadSideEffect[-1] : &:r2210_1, m2205_8 -# 2210| m2210_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2210_1 -# 2210| m2210_9(ClassWithDestructor) = Chi : total:m2205_8, partial:m2210_8 -# 2212| r2212_9(glval) = VariableAddress[x] : -# 2212| r2212_10(glval) = FunctionAddress[~ClassWithDestructor] : -# 2212| v2212_11(void) = Call[~ClassWithDestructor] : func:r2212_10, this:r2212_9 -# 2212| m2212_12(unknown) = ^CallSideEffect : ~m2210_6 -# 2212| m2212_13(unknown) = Chi : total:m2210_6, partial:m2212_12 -# 2212| v2212_14(void) = ^IndirectReadSideEffect[-1] : &:r2212_9, m2210_9 -# 2212| m2212_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2212_9 -# 2212| m2212_16(ClassWithDestructor) = Chi : total:m2210_9, partial:m2212_15 -# 2211| v2211_1(void) = NoOp : #-----| Goto -> Block 7 -# 2212| Block 7 -# 2212| m2212_17(unknown) = Phi : from 5:~m2212_5, from 6:~m2212_13 -# 2212| v2212_18(void) = NoOp : -# 2214| r2214_1(glval) = VariableAddress[x] : -# 2214| m2214_2(ClassWithDestructor) = Uninitialized[x] : &:r2214_1 -# 2214| r2214_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2214| v2214_4(void) = Call[ClassWithDestructor] : func:r2214_3, this:r2214_1 -# 2214| m2214_5(unknown) = ^CallSideEffect : ~m2212_17 -# 2214| m2214_6(unknown) = Chi : total:m2212_17, partial:m2214_5 -# 2214| m2214_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2214_1 -# 2214| m2214_8(ClassWithDestructor) = Chi : total:m2214_2, partial:m2214_7 -# 2215| r2215_1(glval>) = VariableAddress[ys] : -# 2215| m2215_2(vector) = Uninitialized[ys] : &:r2215_1 -# 2215| m2215_3(unknown) = Chi : total:m2214_6, partial:m2215_2 -# 2215| r2215_4(glval) = FunctionAddress[vector] : -# 2215| r2215_5(glval) = VariableAddress[#temp2215:45] : -# 2215| r2215_6(glval) = VariableAddress[x] : -# 2215| r2215_7(ClassWithDestructor) = Load[x] : &:r2215_6, m2214_8 -# 2215| m2215_8(ClassWithDestructor) = Store[#temp2215:45] : &:r2215_5, r2215_7 -# 2215| r2215_9(ClassWithDestructor) = Load[#temp2215:45] : &:r2215_5, m2215_8 -# 2215| v2215_10(void) = Call[vector] : func:r2215_4, this:r2215_1, 0:r2215_9 -# 2215| m2215_11(unknown) = ^CallSideEffect : ~m2215_3 -# 2215| m2215_12(unknown) = Chi : total:m2215_3, partial:m2215_11 -# 2215| m2215_13(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2215_1 -# 2215| m2215_14(unknown) = Chi : total:m2215_12, partial:m2215_13 -# 2215| r2215_15(glval) = CopyValue : r2215_5 -# 2215| r2215_16(glval) = FunctionAddress[~ClassWithDestructor] : -# 2215| v2215_17(void) = Call[~ClassWithDestructor] : func:r2215_16, this:r2215_15 -# 2215| m2215_18(unknown) = ^CallSideEffect : ~m2215_14 -# 2215| m2215_19(unknown) = Chi : total:m2215_14, partial:m2215_18 -# 2215| v2215_20(void) = ^IndirectReadSideEffect[-1] : &:r2215_15, m2215_8 -# 2215| m2215_21(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2215_15 -# 2215| m2215_22(ClassWithDestructor) = Chi : total:m2215_8, partial:m2215_21 -# 2215| r2215_23(glval &>) = VariableAddress[(__range)] : -# 2215| r2215_24(glval>) = VariableAddress[ys] : -# 2215| r2215_25(vector &) = CopyValue : r2215_24 -# 2215| m2215_26(vector &) = Store[(__range)] : &:r2215_23, r2215_25 -# 2215| r2215_27(glval>) = VariableAddress[(__begin)] : -# 2215| r2215_28(glval &>) = VariableAddress[(__range)] : -# 2215| r2215_29(vector &) = Load[(__range)] : &:r2215_28, m2215_26 -#-----| r0_1(glval>) = CopyValue : r2215_29 +# 2210| Block 6 +# 2210| v2210_1(void) = NoOp : +# 2211| r2211_1(glval) = VariableAddress[x] : +# 2211| r2211_2(glval) = FunctionAddress[set_x] : +# 2211| r2211_3(char) = Constant[98] : +# 2211| v2211_4(void) = Call[set_x] : func:r2211_2, this:r2211_1, 0:r2211_3 +# 2211| m2211_5(unknown) = ^CallSideEffect : ~m2206_6 +# 2211| m2211_6(unknown) = Chi : total:m2206_6, partial:m2211_5 +# 2211| v2211_7(void) = ^IndirectReadSideEffect[-1] : &:r2211_1, m2206_8 +# 2211| m2211_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2211_1 +# 2211| m2211_9(ClassWithDestructor) = Chi : total:m2206_8, partial:m2211_8 +# 2213| r2213_9(glval) = VariableAddress[x] : +# 2213| r2213_10(glval) = FunctionAddress[~ClassWithDestructor] : +# 2213| v2213_11(void) = Call[~ClassWithDestructor] : func:r2213_10, this:r2213_9 +# 2213| m2213_12(unknown) = ^CallSideEffect : ~m2211_6 +# 2213| m2213_13(unknown) = Chi : total:m2211_6, partial:m2213_12 +# 2213| v2213_14(void) = ^IndirectReadSideEffect[-1] : &:r2213_9, m2211_9 +# 2213| m2213_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_9 +# 2213| m2213_16(ClassWithDestructor) = Chi : total:m2211_9, partial:m2213_15 +# 2212| v2212_1(void) = NoOp : +#-----| Goto -> Block 7 + +# 2213| Block 7 +# 2213| m2213_17(unknown) = Phi : from 5:~m2213_5, from 6:~m2213_13 +# 2213| v2213_18(void) = NoOp : +# 2215| r2215_1(glval) = VariableAddress[x] : +# 2215| m2215_2(ClassWithDestructor) = Uninitialized[x] : &:r2215_1 +# 2215| r2215_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2215| v2215_4(void) = Call[ClassWithDestructor] : func:r2215_3, this:r2215_1 +# 2215| m2215_5(unknown) = ^CallSideEffect : ~m2213_17 +# 2215| m2215_6(unknown) = Chi : total:m2213_17, partial:m2215_5 +# 2215| m2215_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2215_1 +# 2215| m2215_8(ClassWithDestructor) = Chi : total:m2215_2, partial:m2215_7 +# 2216| r2216_1(glval>) = VariableAddress[ys] : +# 2216| m2216_2(vector) = Uninitialized[ys] : &:r2216_1 +# 2216| m2216_3(unknown) = Chi : total:m2215_6, partial:m2216_2 +# 2216| r2216_4(glval) = FunctionAddress[vector] : +# 2216| r2216_5(glval) = VariableAddress[#temp2216:45] : +# 2216| r2216_6(glval) = VariableAddress[x] : +# 2216| r2216_7(ClassWithDestructor) = Load[x] : &:r2216_6, m2215_8 +# 2216| m2216_8(ClassWithDestructor) = Store[#temp2216:45] : &:r2216_5, r2216_7 +# 2216| r2216_9(ClassWithDestructor) = Load[#temp2216:45] : &:r2216_5, m2216_8 +# 2216| v2216_10(void) = Call[vector] : func:r2216_4, this:r2216_1, 0:r2216_9 +# 2216| m2216_11(unknown) = ^CallSideEffect : ~m2216_3 +# 2216| m2216_12(unknown) = Chi : total:m2216_3, partial:m2216_11 +# 2216| m2216_13(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2216_1 +# 2216| m2216_14(unknown) = Chi : total:m2216_12, partial:m2216_13 +# 2216| r2216_15(glval) = CopyValue : r2216_5 +# 2216| r2216_16(glval) = FunctionAddress[~ClassWithDestructor] : +# 2216| v2216_17(void) = Call[~ClassWithDestructor] : func:r2216_16, this:r2216_15 +# 2216| m2216_18(unknown) = ^CallSideEffect : ~m2216_14 +# 2216| m2216_19(unknown) = Chi : total:m2216_14, partial:m2216_18 +# 2216| v2216_20(void) = ^IndirectReadSideEffect[-1] : &:r2216_15, m2216_8 +# 2216| m2216_21(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_15 +# 2216| m2216_22(ClassWithDestructor) = Chi : total:m2216_8, partial:m2216_21 +# 2216| r2216_23(glval &>) = VariableAddress[(__range)] : +# 2216| r2216_24(glval>) = VariableAddress[ys] : +# 2216| r2216_25(vector &) = CopyValue : r2216_24 +# 2216| m2216_26(vector &) = Store[(__range)] : &:r2216_23, r2216_25 +# 2216| r2216_27(glval>) = VariableAddress[(__begin)] : +# 2216| r2216_28(glval &>) = VariableAddress[(__range)] : +# 2216| r2216_29(vector &) = Load[(__range)] : &:r2216_28, m2216_26 +#-----| r0_1(glval>) = CopyValue : r2216_29 #-----| r0_2(glval>) = Convert : r0_1 -# 2215| r2215_30(glval) = FunctionAddress[begin] : -# 2215| r2215_31(iterator) = Call[begin] : func:r2215_30, this:r0_2 -#-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m2215_19 -# 2215| m2215_32(iterator) = Store[(__begin)] : &:r2215_27, r2215_31 -# 2215| r2215_33(glval>) = VariableAddress[(__end)] : -# 2215| r2215_34(glval &>) = VariableAddress[(__range)] : -# 2215| r2215_35(vector &) = Load[(__range)] : &:r2215_34, m2215_26 -#-----| r0_4(glval>) = CopyValue : r2215_35 +# 2216| r2216_30(glval) = FunctionAddress[begin] : +# 2216| r2216_31(iterator) = Call[begin] : func:r2216_30, this:r0_2 +#-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m2216_19 +# 2216| m2216_32(iterator) = Store[(__begin)] : &:r2216_27, r2216_31 +# 2216| r2216_33(glval>) = VariableAddress[(__end)] : +# 2216| r2216_34(glval &>) = VariableAddress[(__range)] : +# 2216| r2216_35(vector &) = Load[(__range)] : &:r2216_34, m2216_26 +#-----| r0_4(glval>) = CopyValue : r2216_35 #-----| r0_5(glval>) = Convert : r0_4 -# 2215| r2215_36(glval) = FunctionAddress[end] : -# 2215| r2215_37(iterator) = Call[end] : func:r2215_36, this:r0_5 -#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m2215_19 -# 2215| m2215_38(iterator) = Store[(__end)] : &:r2215_33, r2215_37 -# 2215| m2215_39(unknown) = Chi : total:m2215_19, partial:m2215_38 +# 2216| r2216_36(glval) = FunctionAddress[end] : +# 2216| r2216_37(iterator) = Call[end] : func:r2216_36, this:r0_5 +#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m2216_19 +# 2216| m2216_38(iterator) = Store[(__end)] : &:r2216_33, r2216_37 +# 2216| m2216_39(unknown) = Chi : total:m2216_19, partial:m2216_38 #-----| Goto -> Block 8 -# 2215| Block 8 -# 2215| m2215_40(iterator) = Phi : from 7:m2215_32, from 9:m2215_64 -# 2215| m2215_41(unknown) = Phi : from 7:~m2215_39, from 9:~m2215_69 -# 2215| r2215_42(glval>) = VariableAddress[(__begin)] : -#-----| r0_7(glval>) = Convert : r2215_42 -# 2215| r2215_43(glval) = FunctionAddress[operator!=] : +# 2216| Block 8 +# 2216| m2216_40(iterator) = Phi : from 7:m2216_32, from 9:m2216_64 +# 2216| m2216_41(unknown) = Phi : from 7:~m2216_39, from 9:~m2216_69 +# 2216| r2216_42(glval>) = VariableAddress[(__begin)] : +#-----| r0_7(glval>) = Convert : r2216_42 +# 2216| r2216_43(glval) = FunctionAddress[operator!=] : #-----| r0_8(glval>) = VariableAddress[#temp0:0] : #-----| m0_9(iterator) = Uninitialized[#temp0:0] : &:r0_8 -#-----| m0_10(unknown) = Chi : total:m2215_41, partial:m0_9 -# 2215| r2215_44(glval) = FunctionAddress[iterator] : -# 2215| r2215_45(glval>) = VariableAddress[(__end)] : -#-----| r0_11(glval>) = Convert : r2215_45 +#-----| m0_10(unknown) = Chi : total:m2216_41, partial:m0_9 +# 2216| r2216_44(glval) = FunctionAddress[iterator] : +# 2216| r2216_45(glval>) = VariableAddress[(__end)] : +#-----| r0_11(glval>) = Convert : r2216_45 #-----| r0_12(iterator &) = CopyValue : r0_11 -# 2215| v2215_46(void) = Call[iterator] : func:r2215_44, this:r0_8, 0:r0_12 -# 2215| m2215_47(unknown) = ^CallSideEffect : ~m0_10 -# 2215| m2215_48(unknown) = Chi : total:m0_10, partial:m2215_47 -#-----| v0_13(void) = ^BufferReadSideEffect[0] : &:r0_12, ~m2215_48 -# 2215| m2215_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 -# 2215| m2215_50(unknown) = Chi : total:m2215_48, partial:m2215_49 -#-----| r0_14(iterator) = Load[#temp0:0] : &:r0_8, ~m2215_50 -# 2215| r2215_51(bool) = Call[operator!=] : func:r2215_43, this:r0_7, 0:r0_14 -#-----| v0_15(void) = ^IndirectReadSideEffect[-1] : &:r0_7, m2215_40 -# 2215| v2215_52(void) = ConditionalBranch : r2215_51 +# 2216| v2216_46(void) = Call[iterator] : func:r2216_44, this:r0_8, 0:r0_12 +# 2216| m2216_47(unknown) = ^CallSideEffect : ~m0_10 +# 2216| m2216_48(unknown) = Chi : total:m0_10, partial:m2216_47 +#-----| v0_13(void) = ^BufferReadSideEffect[0] : &:r0_12, ~m2216_48 +# 2216| m2216_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 +# 2216| m2216_50(unknown) = Chi : total:m2216_48, partial:m2216_49 +#-----| r0_14(iterator) = Load[#temp0:0] : &:r0_8, ~m2216_50 +# 2216| r2216_51(bool) = Call[operator!=] : func:r2216_43, this:r0_7, 0:r0_14 +#-----| v0_15(void) = ^IndirectReadSideEffect[-1] : &:r0_7, m2216_40 +# 2216| v2216_52(void) = ConditionalBranch : r2216_51 #-----| False -> Block 10 #-----| True -> Block 9 -# 2215| Block 9 -# 2215| r2215_53(glval) = VariableAddress[y] : -# 2215| r2215_54(glval>) = VariableAddress[(__begin)] : -#-----| r0_16(glval>) = Convert : r2215_54 -# 2215| r2215_55(glval) = FunctionAddress[operator*] : -# 2215| r2215_56(ClassWithDestructor &) = Call[operator*] : func:r2215_55, this:r0_16 -#-----| v0_17(void) = ^IndirectReadSideEffect[-1] : &:r0_16, m2215_40 -# 2215| r2215_57(ClassWithDestructor) = Load[?] : &:r2215_56, ~m2215_50 -# 2215| m2215_58(ClassWithDestructor) = Store[y] : &:r2215_53, r2215_57 -# 2216| r2216_1(glval) = VariableAddress[y] : -# 2216| r2216_2(glval) = FunctionAddress[set_x] : -# 2216| r2216_3(char) = Constant[97] : -# 2216| v2216_4(void) = Call[set_x] : func:r2216_2, this:r2216_1, 0:r2216_3 -# 2216| m2216_5(unknown) = ^CallSideEffect : ~m2215_50 -# 2216| m2216_6(unknown) = Chi : total:m2215_50, partial:m2216_5 -# 2216| v2216_7(void) = ^IndirectReadSideEffect[-1] : &:r2216_1, m2215_58 -# 2216| m2216_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_1 -# 2216| m2216_9(ClassWithDestructor) = Chi : total:m2215_58, partial:m2216_8 -# 2215| r2215_59(glval>) = VariableAddress[(__begin)] : -# 2215| r2215_60(glval) = FunctionAddress[operator++] : -# 2215| r2215_61(iterator &) = Call[operator++] : func:r2215_60, this:r2215_59 -# 2215| v2215_62(void) = ^IndirectReadSideEffect[-1] : &:r2215_59, m2215_40 -# 2215| m2215_63(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2215_59 -# 2215| m2215_64(iterator) = Chi : total:m2215_40, partial:m2215_63 -# 2215| r2215_65(glval) = VariableAddress[y] : -# 2215| r2215_66(glval) = FunctionAddress[~ClassWithDestructor] : -# 2215| v2215_67(void) = Call[~ClassWithDestructor] : func:r2215_66, this:r2215_65 -# 2215| m2215_68(unknown) = ^CallSideEffect : ~m2216_6 -# 2215| m2215_69(unknown) = Chi : total:m2216_6, partial:m2215_68 -# 2215| v2215_70(void) = ^IndirectReadSideEffect[-1] : &:r2215_65, m2216_9 -# 2215| m2215_71(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2215_65 -# 2215| m2215_72(ClassWithDestructor) = Chi : total:m2216_9, partial:m2215_71 -# 2215| r2215_73(glval>) = CopyValue : r2215_61 +# 2216| Block 9 +# 2216| r2216_53(glval) = VariableAddress[y] : +# 2216| r2216_54(glval>) = VariableAddress[(__begin)] : +#-----| r0_16(glval>) = Convert : r2216_54 +# 2216| r2216_55(glval) = FunctionAddress[operator*] : +# 2216| r2216_56(ClassWithDestructor &) = Call[operator*] : func:r2216_55, this:r0_16 +#-----| v0_17(void) = ^IndirectReadSideEffect[-1] : &:r0_16, m2216_40 +# 2216| r2216_57(ClassWithDestructor) = Load[?] : &:r2216_56, ~m2216_50 +# 2216| m2216_58(ClassWithDestructor) = Store[y] : &:r2216_53, r2216_57 +# 2217| r2217_1(glval) = VariableAddress[y] : +# 2217| r2217_2(glval) = FunctionAddress[set_x] : +# 2217| r2217_3(char) = Constant[97] : +# 2217| v2217_4(void) = Call[set_x] : func:r2217_2, this:r2217_1, 0:r2217_3 +# 2217| m2217_5(unknown) = ^CallSideEffect : ~m2216_50 +# 2217| m2217_6(unknown) = Chi : total:m2216_50, partial:m2217_5 +# 2217| v2217_7(void) = ^IndirectReadSideEffect[-1] : &:r2217_1, m2216_58 +# 2217| m2217_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2217_1 +# 2217| m2217_9(ClassWithDestructor) = Chi : total:m2216_58, partial:m2217_8 +# 2216| r2216_59(glval>) = VariableAddress[(__begin)] : +# 2216| r2216_60(glval) = FunctionAddress[operator++] : +# 2216| r2216_61(iterator &) = Call[operator++] : func:r2216_60, this:r2216_59 +# 2216| v2216_62(void) = ^IndirectReadSideEffect[-1] : &:r2216_59, m2216_40 +# 2216| m2216_63(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2216_59 +# 2216| m2216_64(iterator) = Chi : total:m2216_40, partial:m2216_63 +# 2216| r2216_65(glval) = VariableAddress[y] : +# 2216| r2216_66(glval) = FunctionAddress[~ClassWithDestructor] : +# 2216| v2216_67(void) = Call[~ClassWithDestructor] : func:r2216_66, this:r2216_65 +# 2216| m2216_68(unknown) = ^CallSideEffect : ~m2217_6 +# 2216| m2216_69(unknown) = Chi : total:m2217_6, partial:m2216_68 +# 2216| v2216_70(void) = ^IndirectReadSideEffect[-1] : &:r2216_65, m2217_9 +# 2216| m2216_71(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_65 +# 2216| m2216_72(ClassWithDestructor) = Chi : total:m2217_9, partial:m2216_71 +# 2216| r2216_73(glval>) = CopyValue : r2216_61 #-----| Goto (back edge) -> Block 8 -# 2215| Block 10 -# 2215| r2215_74(glval>) = VariableAddress[ys] : -# 2215| r2215_75(glval) = FunctionAddress[~vector] : -# 2215| v2215_76(void) = Call[~vector] : func:r2215_75, this:r2215_74 -# 2215| m2215_77(unknown) = ^CallSideEffect : ~m2215_50 -# 2215| m2215_78(unknown) = Chi : total:m2215_50, partial:m2215_77 -# 2215| v2215_79(void) = ^IndirectReadSideEffect[-1] : &:r2215_74, ~m2215_78 -# 2215| m2215_80(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2215_74 -# 2215| m2215_81(unknown) = Chi : total:m2215_78, partial:m2215_80 -# 2218| r2218_1(glval>) = VariableAddress[ys] : -# 2218| m2218_2(vector) = Uninitialized[ys] : &:r2218_1 -# 2218| m2218_3(unknown) = Chi : total:m2215_81, partial:m2218_2 -# 2218| r2218_4(glval) = FunctionAddress[vector] : -# 2218| r2218_5(glval) = VariableAddress[#temp2218:45] : -# 2218| r2218_6(glval) = VariableAddress[x] : -# 2218| r2218_7(ClassWithDestructor) = Load[x] : &:r2218_6, m2214_8 -# 2218| m2218_8(ClassWithDestructor) = Store[#temp2218:45] : &:r2218_5, r2218_7 -# 2218| r2218_9(ClassWithDestructor) = Load[#temp2218:45] : &:r2218_5, m2218_8 -# 2218| v2218_10(void) = Call[vector] : func:r2218_4, this:r2218_1, 0:r2218_9 -# 2218| m2218_11(unknown) = ^CallSideEffect : ~m2218_3 -# 2218| m2218_12(unknown) = Chi : total:m2218_3, partial:m2218_11 -# 2218| m2218_13(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2218_1 -# 2218| m2218_14(unknown) = Chi : total:m2218_12, partial:m2218_13 -# 2218| r2218_15(glval) = CopyValue : r2218_5 -# 2218| r2218_16(glval) = FunctionAddress[~ClassWithDestructor] : -# 2218| v2218_17(void) = Call[~ClassWithDestructor] : func:r2218_16, this:r2218_15 -# 2218| m2218_18(unknown) = ^CallSideEffect : ~m2218_14 -# 2218| m2218_19(unknown) = Chi : total:m2218_14, partial:m2218_18 -# 2218| v2218_20(void) = ^IndirectReadSideEffect[-1] : &:r2218_15, m2218_8 -# 2218| m2218_21(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2218_15 -# 2218| m2218_22(ClassWithDestructor) = Chi : total:m2218_8, partial:m2218_21 -# 2218| r2218_23(glval &>) = VariableAddress[(__range)] : -# 2218| r2218_24(glval>) = VariableAddress[ys] : -# 2218| r2218_25(vector &) = CopyValue : r2218_24 -# 2218| m2218_26(vector &) = Store[(__range)] : &:r2218_23, r2218_25 -# 2218| r2218_27(glval>) = VariableAddress[(__begin)] : -# 2218| r2218_28(glval &>) = VariableAddress[(__range)] : -# 2218| r2218_29(vector &) = Load[(__range)] : &:r2218_28, m2218_26 -#-----| r0_18(glval>) = CopyValue : r2218_29 +# 2216| Block 10 +# 2216| r2216_74(glval>) = VariableAddress[ys] : +# 2216| r2216_75(glval) = FunctionAddress[~vector] : +# 2216| v2216_76(void) = Call[~vector] : func:r2216_75, this:r2216_74 +# 2216| m2216_77(unknown) = ^CallSideEffect : ~m2216_50 +# 2216| m2216_78(unknown) = Chi : total:m2216_50, partial:m2216_77 +# 2216| v2216_79(void) = ^IndirectReadSideEffect[-1] : &:r2216_74, ~m2216_78 +# 2216| m2216_80(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2216_74 +# 2216| m2216_81(unknown) = Chi : total:m2216_78, partial:m2216_80 +# 2219| r2219_1(glval>) = VariableAddress[ys] : +# 2219| m2219_2(vector) = Uninitialized[ys] : &:r2219_1 +# 2219| m2219_3(unknown) = Chi : total:m2216_81, partial:m2219_2 +# 2219| r2219_4(glval) = FunctionAddress[vector] : +# 2219| r2219_5(glval) = VariableAddress[#temp2219:45] : +# 2219| r2219_6(glval) = VariableAddress[x] : +# 2219| r2219_7(ClassWithDestructor) = Load[x] : &:r2219_6, m2215_8 +# 2219| m2219_8(ClassWithDestructor) = Store[#temp2219:45] : &:r2219_5, r2219_7 +# 2219| r2219_9(ClassWithDestructor) = Load[#temp2219:45] : &:r2219_5, m2219_8 +# 2219| v2219_10(void) = Call[vector] : func:r2219_4, this:r2219_1, 0:r2219_9 +# 2219| m2219_11(unknown) = ^CallSideEffect : ~m2219_3 +# 2219| m2219_12(unknown) = Chi : total:m2219_3, partial:m2219_11 +# 2219| m2219_13(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2219_1 +# 2219| m2219_14(unknown) = Chi : total:m2219_12, partial:m2219_13 +# 2219| r2219_15(glval) = CopyValue : r2219_5 +# 2219| r2219_16(glval) = FunctionAddress[~ClassWithDestructor] : +# 2219| v2219_17(void) = Call[~ClassWithDestructor] : func:r2219_16, this:r2219_15 +# 2219| m2219_18(unknown) = ^CallSideEffect : ~m2219_14 +# 2219| m2219_19(unknown) = Chi : total:m2219_14, partial:m2219_18 +# 2219| v2219_20(void) = ^IndirectReadSideEffect[-1] : &:r2219_15, m2219_8 +# 2219| m2219_21(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_15 +# 2219| m2219_22(ClassWithDestructor) = Chi : total:m2219_8, partial:m2219_21 +# 2219| r2219_23(glval &>) = VariableAddress[(__range)] : +# 2219| r2219_24(glval>) = VariableAddress[ys] : +# 2219| r2219_25(vector &) = CopyValue : r2219_24 +# 2219| m2219_26(vector &) = Store[(__range)] : &:r2219_23, r2219_25 +# 2219| r2219_27(glval>) = VariableAddress[(__begin)] : +# 2219| r2219_28(glval &>) = VariableAddress[(__range)] : +# 2219| r2219_29(vector &) = Load[(__range)] : &:r2219_28, m2219_26 +#-----| r0_18(glval>) = CopyValue : r2219_29 #-----| r0_19(glval>) = Convert : r0_18 -# 2218| r2218_30(glval) = FunctionAddress[begin] : -# 2218| r2218_31(iterator) = Call[begin] : func:r2218_30, this:r0_19 -#-----| v0_20(void) = ^IndirectReadSideEffect[-1] : &:r0_19, ~m2218_19 -# 2218| m2218_32(iterator) = Store[(__begin)] : &:r2218_27, r2218_31 -# 2218| r2218_33(glval>) = VariableAddress[(__end)] : -# 2218| r2218_34(glval &>) = VariableAddress[(__range)] : -# 2218| r2218_35(vector &) = Load[(__range)] : &:r2218_34, m2218_26 -#-----| r0_21(glval>) = CopyValue : r2218_35 +# 2219| r2219_30(glval) = FunctionAddress[begin] : +# 2219| r2219_31(iterator) = Call[begin] : func:r2219_30, this:r0_19 +#-----| v0_20(void) = ^IndirectReadSideEffect[-1] : &:r0_19, ~m2219_19 +# 2219| m2219_32(iterator) = Store[(__begin)] : &:r2219_27, r2219_31 +# 2219| r2219_33(glval>) = VariableAddress[(__end)] : +# 2219| r2219_34(glval &>) = VariableAddress[(__range)] : +# 2219| r2219_35(vector &) = Load[(__range)] : &:r2219_34, m2219_26 +#-----| r0_21(glval>) = CopyValue : r2219_35 #-----| r0_22(glval>) = Convert : r0_21 -# 2218| r2218_36(glval) = FunctionAddress[end] : -# 2218| r2218_37(iterator) = Call[end] : func:r2218_36, this:r0_22 -#-----| v0_23(void) = ^IndirectReadSideEffect[-1] : &:r0_22, ~m2218_19 -# 2218| m2218_38(iterator) = Store[(__end)] : &:r2218_33, r2218_37 -# 2218| m2218_39(unknown) = Chi : total:m2218_19, partial:m2218_38 +# 2219| r2219_36(glval) = FunctionAddress[end] : +# 2219| r2219_37(iterator) = Call[end] : func:r2219_36, this:r0_22 +#-----| v0_23(void) = ^IndirectReadSideEffect[-1] : &:r0_22, ~m2219_19 +# 2219| m2219_38(iterator) = Store[(__end)] : &:r2219_33, r2219_37 +# 2219| m2219_39(unknown) = Chi : total:m2219_19, partial:m2219_38 #-----| Goto -> Block 11 -# 2218| Block 11 -# 2218| m2218_40(iterator) = Phi : from 10:m2218_32, from 12:m2218_58 -# 2218| m2218_41(unknown) = Phi : from 10:~m2218_39, from 12:~m2218_63 -# 2218| r2218_42(glval>) = VariableAddress[(__begin)] : -#-----| r0_24(glval>) = Convert : r2218_42 -# 2218| r2218_43(glval) = FunctionAddress[operator!=] : +# 2219| Block 11 +# 2219| m2219_40(iterator) = Phi : from 10:m2219_32, from 12:m2219_58 +# 2219| m2219_41(unknown) = Phi : from 10:~m2219_39, from 12:~m2219_63 +# 2219| r2219_42(glval>) = VariableAddress[(__begin)] : +#-----| r0_24(glval>) = Convert : r2219_42 +# 2219| r2219_43(glval) = FunctionAddress[operator!=] : #-----| r0_25(glval>) = VariableAddress[#temp0:0] : #-----| m0_26(iterator) = Uninitialized[#temp0:0] : &:r0_25 -#-----| m0_27(unknown) = Chi : total:m2218_41, partial:m0_26 -# 2218| r2218_44(glval) = FunctionAddress[iterator] : -# 2218| r2218_45(glval>) = VariableAddress[(__end)] : -#-----| r0_28(glval>) = Convert : r2218_45 +#-----| m0_27(unknown) = Chi : total:m2219_41, partial:m0_26 +# 2219| r2219_44(glval) = FunctionAddress[iterator] : +# 2219| r2219_45(glval>) = VariableAddress[(__end)] : +#-----| r0_28(glval>) = Convert : r2219_45 #-----| r0_29(iterator &) = CopyValue : r0_28 -# 2218| v2218_46(void) = Call[iterator] : func:r2218_44, this:r0_25, 0:r0_29 -# 2218| m2218_47(unknown) = ^CallSideEffect : ~m0_27 -# 2218| m2218_48(unknown) = Chi : total:m0_27, partial:m2218_47 -#-----| v0_30(void) = ^BufferReadSideEffect[0] : &:r0_29, ~m2218_48 -# 2218| m2218_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_25 -# 2218| m2218_50(unknown) = Chi : total:m2218_48, partial:m2218_49 -#-----| r0_31(iterator) = Load[#temp0:0] : &:r0_25, ~m2218_50 -# 2218| r2218_51(bool) = Call[operator!=] : func:r2218_43, this:r0_24, 0:r0_31 -#-----| v0_32(void) = ^IndirectReadSideEffect[-1] : &:r0_24, m2218_40 -# 2218| v2218_52(void) = ConditionalBranch : r2218_51 +# 2219| v2219_46(void) = Call[iterator] : func:r2219_44, this:r0_25, 0:r0_29 +# 2219| m2219_47(unknown) = ^CallSideEffect : ~m0_27 +# 2219| m2219_48(unknown) = Chi : total:m0_27, partial:m2219_47 +#-----| v0_30(void) = ^BufferReadSideEffect[0] : &:r0_29, ~m2219_48 +# 2219| m2219_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_25 +# 2219| m2219_50(unknown) = Chi : total:m2219_48, partial:m2219_49 +#-----| r0_31(iterator) = Load[#temp0:0] : &:r0_25, ~m2219_50 +# 2219| r2219_51(bool) = Call[operator!=] : func:r2219_43, this:r0_24, 0:r0_31 +#-----| v0_32(void) = ^IndirectReadSideEffect[-1] : &:r0_24, m2219_40 +# 2219| v2219_52(void) = ConditionalBranch : r2219_51 #-----| False -> Block 15 #-----| True -> Block 13 -# 2218| Block 12 -# 2218| r2218_53(glval>) = VariableAddress[(__begin)] : -# 2218| r2218_54(glval) = FunctionAddress[operator++] : -# 2218| r2218_55(iterator &) = Call[operator++] : func:r2218_54, this:r2218_53 -# 2218| v2218_56(void) = ^IndirectReadSideEffect[-1] : &:r2218_53, m2218_40 -# 2218| m2218_57(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2218_53 -# 2218| m2218_58(iterator) = Chi : total:m2218_40, partial:m2218_57 -# 2218| r2218_59(glval) = VariableAddress[y] : -# 2218| r2218_60(glval) = FunctionAddress[~ClassWithDestructor] : -# 2218| v2218_61(void) = Call[~ClassWithDestructor] : func:r2218_60, this:r2218_59 -# 2218| m2218_62(unknown) = ^CallSideEffect : ~m2220_5 -# 2218| m2218_63(unknown) = Chi : total:m2220_5, partial:m2218_62 -# 2218| v2218_64(void) = ^IndirectReadSideEffect[-1] : &:r2218_59, m2220_8 -# 2218| m2218_65(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2218_59 -# 2218| m2218_66(ClassWithDestructor) = Chi : total:m2220_8, partial:m2218_65 -# 2218| r2218_67(glval>) = CopyValue : r2218_55 +# 2219| Block 12 +# 2219| r2219_53(glval>) = VariableAddress[(__begin)] : +# 2219| r2219_54(glval) = FunctionAddress[operator++] : +# 2219| r2219_55(iterator &) = Call[operator++] : func:r2219_54, this:r2219_53 +# 2219| v2219_56(void) = ^IndirectReadSideEffect[-1] : &:r2219_53, m2219_40 +# 2219| m2219_57(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2219_53 +# 2219| m2219_58(iterator) = Chi : total:m2219_40, partial:m2219_57 +# 2219| r2219_59(glval) = VariableAddress[y] : +# 2219| r2219_60(glval) = FunctionAddress[~ClassWithDestructor] : +# 2219| v2219_61(void) = Call[~ClassWithDestructor] : func:r2219_60, this:r2219_59 +# 2219| m2219_62(unknown) = ^CallSideEffect : ~m2221_5 +# 2219| m2219_63(unknown) = Chi : total:m2221_5, partial:m2219_62 +# 2219| v2219_64(void) = ^IndirectReadSideEffect[-1] : &:r2219_59, m2221_8 +# 2219| m2219_65(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_59 +# 2219| m2219_66(ClassWithDestructor) = Chi : total:m2221_8, partial:m2219_65 +# 2219| r2219_67(glval>) = CopyValue : r2219_55 #-----| Goto (back edge) -> Block 11 -# 2218| Block 13 -# 2218| r2218_68(glval) = VariableAddress[y] : -# 2218| r2218_69(glval>) = VariableAddress[(__begin)] : -#-----| r0_33(glval>) = Convert : r2218_69 -# 2218| r2218_70(glval) = FunctionAddress[operator*] : -# 2218| r2218_71(ClassWithDestructor &) = Call[operator*] : func:r2218_70, this:r0_33 -#-----| v0_34(void) = ^IndirectReadSideEffect[-1] : &:r0_33, m2218_40 -# 2218| r2218_72(ClassWithDestructor) = Load[?] : &:r2218_71, ~m2218_50 -# 2218| m2218_73(ClassWithDestructor) = Store[y] : &:r2218_68, r2218_72 -# 2219| r2219_1(glval) = VariableAddress[y] : -# 2219| r2219_2(glval) = FunctionAddress[set_x] : -# 2219| r2219_3(char) = Constant[97] : -# 2219| v2219_4(void) = Call[set_x] : func:r2219_2, this:r2219_1, 0:r2219_3 -# 2219| m2219_5(unknown) = ^CallSideEffect : ~m2218_50 -# 2219| m2219_6(unknown) = Chi : total:m2218_50, partial:m2219_5 -# 2219| v2219_7(void) = ^IndirectReadSideEffect[-1] : &:r2219_1, m2218_73 -# 2219| m2219_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_1 -# 2219| m2219_9(ClassWithDestructor) = Chi : total:m2218_73, partial:m2219_8 +# 2219| Block 13 +# 2219| r2219_68(glval) = VariableAddress[y] : +# 2219| r2219_69(glval>) = VariableAddress[(__begin)] : +#-----| r0_33(glval>) = Convert : r2219_69 +# 2219| r2219_70(glval) = FunctionAddress[operator*] : +# 2219| r2219_71(ClassWithDestructor &) = Call[operator*] : func:r2219_70, this:r0_33 +#-----| v0_34(void) = ^IndirectReadSideEffect[-1] : &:r0_33, m2219_40 +# 2219| r2219_72(ClassWithDestructor) = Load[?] : &:r2219_71, ~m2219_50 +# 2219| m2219_73(ClassWithDestructor) = Store[y] : &:r2219_68, r2219_72 # 2220| r2220_1(glval) = VariableAddress[y] : -# 2220| r2220_2(glval) = FunctionAddress[get_x] : -# 2220| r2220_3(char) = Call[get_x] : func:r2220_2, this:r2220_1 -# 2220| m2220_4(unknown) = ^CallSideEffect : ~m2219_6 -# 2220| m2220_5(unknown) = Chi : total:m2219_6, partial:m2220_4 -# 2220| v2220_6(void) = ^IndirectReadSideEffect[-1] : &:r2220_1, m2219_9 -# 2220| m2220_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2220_1 -# 2220| m2220_8(ClassWithDestructor) = Chi : total:m2219_9, partial:m2220_7 -# 2220| r2220_9(int) = Convert : r2220_3 -# 2220| r2220_10(int) = Constant[98] : -# 2220| r2220_11(bool) = CompareEQ : r2220_9, r2220_10 -# 2220| v2220_12(void) = ConditionalBranch : r2220_11 +# 2220| r2220_2(glval) = FunctionAddress[set_x] : +# 2220| r2220_3(char) = Constant[97] : +# 2220| v2220_4(void) = Call[set_x] : func:r2220_2, this:r2220_1, 0:r2220_3 +# 2220| m2220_5(unknown) = ^CallSideEffect : ~m2219_50 +# 2220| m2220_6(unknown) = Chi : total:m2219_50, partial:m2220_5 +# 2220| v2220_7(void) = ^IndirectReadSideEffect[-1] : &:r2220_1, m2219_73 +# 2220| m2220_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2220_1 +# 2220| m2220_9(ClassWithDestructor) = Chi : total:m2219_73, partial:m2220_8 +# 2221| r2221_1(glval) = VariableAddress[y] : +# 2221| r2221_2(glval) = FunctionAddress[get_x] : +# 2221| r2221_3(char) = Call[get_x] : func:r2221_2, this:r2221_1 +# 2221| m2221_4(unknown) = ^CallSideEffect : ~m2220_6 +# 2221| m2221_5(unknown) = Chi : total:m2220_6, partial:m2221_4 +# 2221| v2221_6(void) = ^IndirectReadSideEffect[-1] : &:r2221_1, m2220_9 +# 2221| m2221_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2221_1 +# 2221| m2221_8(ClassWithDestructor) = Chi : total:m2220_9, partial:m2221_7 +# 2221| r2221_9(int) = Convert : r2221_3 +# 2221| r2221_10(int) = Constant[98] : +# 2221| r2221_11(bool) = CompareEQ : r2221_9, r2221_10 +# 2221| v2221_12(void) = ConditionalBranch : r2221_11 #-----| False -> Block 12 #-----| True -> Block 14 -# 2221| Block 14 -# 2221| v2221_1(void) = NoOp : -# 2218| r2218_74(glval) = VariableAddress[y] : -# 2218| r2218_75(glval) = FunctionAddress[~ClassWithDestructor] : -# 2218| v2218_76(void) = Call[~ClassWithDestructor] : func:r2218_75, this:r2218_74 -# 2218| m2218_77(unknown) = ^CallSideEffect : ~m2220_5 -# 2218| m2218_78(unknown) = Chi : total:m2220_5, partial:m2218_77 -# 2218| v2218_79(void) = ^IndirectReadSideEffect[-1] : &:r2218_74, m2220_8 -# 2218| m2218_80(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2218_74 -# 2218| m2218_81(ClassWithDestructor) = Chi : total:m2220_8, partial:m2218_80 -# 2218| r2218_82(glval>) = VariableAddress[ys] : -# 2218| r2218_83(glval) = FunctionAddress[~vector] : -# 2218| v2218_84(void) = Call[~vector] : func:r2218_83, this:r2218_82 -# 2218| m2218_85(unknown) = ^CallSideEffect : ~m2218_78 -# 2218| m2218_86(unknown) = Chi : total:m2218_78, partial:m2218_85 -# 2218| v2218_87(void) = ^IndirectReadSideEffect[-1] : &:r2218_82, ~m2218_86 -# 2218| m2218_88(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2218_82 -# 2218| m2218_89(unknown) = Chi : total:m2218_86, partial:m2218_88 -# 2233| r2233_1(glval) = VariableAddress[x] : -# 2233| r2233_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2233| v2233_3(void) = Call[~ClassWithDestructor] : func:r2233_2, this:r2233_1 -# 2233| m2233_4(unknown) = ^CallSideEffect : ~m2218_89 -# 2233| m2233_5(unknown) = Chi : total:m2218_89, partial:m2233_4 -# 2233| v2233_6(void) = ^IndirectReadSideEffect[-1] : &:r2233_1, m2214_8 -# 2233| m2233_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_1 -# 2233| m2233_8(ClassWithDestructor) = Chi : total:m2214_8, partial:m2233_7 +# 2222| Block 14 +# 2222| v2222_1(void) = NoOp : +# 2219| r2219_74(glval) = VariableAddress[y] : +# 2219| r2219_75(glval) = FunctionAddress[~ClassWithDestructor] : +# 2219| v2219_76(void) = Call[~ClassWithDestructor] : func:r2219_75, this:r2219_74 +# 2219| m2219_77(unknown) = ^CallSideEffect : ~m2221_5 +# 2219| m2219_78(unknown) = Chi : total:m2221_5, partial:m2219_77 +# 2219| v2219_79(void) = ^IndirectReadSideEffect[-1] : &:r2219_74, m2221_8 +# 2219| m2219_80(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_74 +# 2219| m2219_81(ClassWithDestructor) = Chi : total:m2221_8, partial:m2219_80 +# 2219| r2219_82(glval>) = VariableAddress[ys] : +# 2219| r2219_83(glval) = FunctionAddress[~vector] : +# 2219| v2219_84(void) = Call[~vector] : func:r2219_83, this:r2219_82 +# 2219| m2219_85(unknown) = ^CallSideEffect : ~m2219_78 +# 2219| m2219_86(unknown) = Chi : total:m2219_78, partial:m2219_85 +# 2219| v2219_87(void) = ^IndirectReadSideEffect[-1] : &:r2219_82, ~m2219_86 +# 2219| m2219_88(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2219_82 +# 2219| m2219_89(unknown) = Chi : total:m2219_86, partial:m2219_88 +# 2234| r2234_1(glval) = VariableAddress[x] : +# 2234| r2234_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2234| v2234_3(void) = Call[~ClassWithDestructor] : func:r2234_2, this:r2234_1 +# 2234| m2234_4(unknown) = ^CallSideEffect : ~m2219_89 +# 2234| m2234_5(unknown) = Chi : total:m2219_89, partial:m2234_4 +# 2234| v2234_6(void) = ^IndirectReadSideEffect[-1] : &:r2234_1, m2215_8 +# 2234| m2234_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_1 +# 2234| m2234_8(ClassWithDestructor) = Chi : total:m2215_8, partial:m2234_7 #-----| Goto -> Block 1 -# 2218| Block 15 -# 2218| r2218_90(glval>) = VariableAddress[ys] : -# 2218| r2218_91(glval) = FunctionAddress[~vector] : -# 2218| v2218_92(void) = Call[~vector] : func:r2218_91, this:r2218_90 -# 2218| m2218_93(unknown) = ^CallSideEffect : ~m2218_50 -# 2218| m2218_94(unknown) = Chi : total:m2218_50, partial:m2218_93 -# 2218| v2218_95(void) = ^IndirectReadSideEffect[-1] : &:r2218_90, ~m2218_94 -# 2218| m2218_96(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2218_90 -# 2218| m2218_97(unknown) = Chi : total:m2218_94, partial:m2218_96 -# 2224| r2224_1(glval>) = VariableAddress[ys] : -# 2224| m2224_2(vector) = Uninitialized[ys] : &:r2224_1 -# 2224| m2224_3(unknown) = Chi : total:m2218_97, partial:m2224_2 -# 2224| r2224_4(glval) = FunctionAddress[vector] : -# 2224| r2224_5(int) = Constant[1] : -# 2224| v2224_6(void) = Call[vector] : func:r2224_4, this:r2224_1, 0:r2224_5 -# 2224| m2224_7(unknown) = ^CallSideEffect : ~m2224_3 -# 2224| m2224_8(unknown) = Chi : total:m2224_3, partial:m2224_7 -# 2224| m2224_9(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2224_1 -# 2224| m2224_10(unknown) = Chi : total:m2224_8, partial:m2224_9 -# 2224| r2224_11(glval &>) = VariableAddress[(__range)] : -# 2224| r2224_12(glval>) = VariableAddress[ys] : -# 2224| r2224_13(vector &) = CopyValue : r2224_12 -# 2224| m2224_14(vector &) = Store[(__range)] : &:r2224_11, r2224_13 -# 2224| r2224_15(glval>) = VariableAddress[(__begin)] : -# 2224| r2224_16(glval &>) = VariableAddress[(__range)] : -# 2224| r2224_17(vector &) = Load[(__range)] : &:r2224_16, m2224_14 -#-----| r0_35(glval>) = CopyValue : r2224_17 +# 2219| Block 15 +# 2219| r2219_90(glval>) = VariableAddress[ys] : +# 2219| r2219_91(glval) = FunctionAddress[~vector] : +# 2219| v2219_92(void) = Call[~vector] : func:r2219_91, this:r2219_90 +# 2219| m2219_93(unknown) = ^CallSideEffect : ~m2219_50 +# 2219| m2219_94(unknown) = Chi : total:m2219_50, partial:m2219_93 +# 2219| v2219_95(void) = ^IndirectReadSideEffect[-1] : &:r2219_90, ~m2219_94 +# 2219| m2219_96(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2219_90 +# 2219| m2219_97(unknown) = Chi : total:m2219_94, partial:m2219_96 +# 2225| r2225_1(glval>) = VariableAddress[ys] : +# 2225| m2225_2(vector) = Uninitialized[ys] : &:r2225_1 +# 2225| m2225_3(unknown) = Chi : total:m2219_97, partial:m2225_2 +# 2225| r2225_4(glval) = FunctionAddress[vector] : +# 2225| r2225_5(int) = Constant[1] : +# 2225| v2225_6(void) = Call[vector] : func:r2225_4, this:r2225_1, 0:r2225_5 +# 2225| m2225_7(unknown) = ^CallSideEffect : ~m2225_3 +# 2225| m2225_8(unknown) = Chi : total:m2225_3, partial:m2225_7 +# 2225| m2225_9(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2225_1 +# 2225| m2225_10(unknown) = Chi : total:m2225_8, partial:m2225_9 +# 2225| r2225_11(glval &>) = VariableAddress[(__range)] : +# 2225| r2225_12(glval>) = VariableAddress[ys] : +# 2225| r2225_13(vector &) = CopyValue : r2225_12 +# 2225| m2225_14(vector &) = Store[(__range)] : &:r2225_11, r2225_13 +# 2225| r2225_15(glval>) = VariableAddress[(__begin)] : +# 2225| r2225_16(glval &>) = VariableAddress[(__range)] : +# 2225| r2225_17(vector &) = Load[(__range)] : &:r2225_16, m2225_14 +#-----| r0_35(glval>) = CopyValue : r2225_17 #-----| r0_36(glval>) = Convert : r0_35 -# 2224| r2224_18(glval) = FunctionAddress[begin] : -# 2224| r2224_19(iterator) = Call[begin] : func:r2224_18, this:r0_36 -#-----| v0_37(void) = ^IndirectReadSideEffect[-1] : &:r0_36, ~m2224_10 -# 2224| m2224_20(iterator) = Store[(__begin)] : &:r2224_15, r2224_19 -# 2224| r2224_21(glval>) = VariableAddress[(__end)] : -# 2224| r2224_22(glval &>) = VariableAddress[(__range)] : -# 2224| r2224_23(vector &) = Load[(__range)] : &:r2224_22, m2224_14 -#-----| r0_38(glval>) = CopyValue : r2224_23 +# 2225| r2225_18(glval) = FunctionAddress[begin] : +# 2225| r2225_19(iterator) = Call[begin] : func:r2225_18, this:r0_36 +#-----| v0_37(void) = ^IndirectReadSideEffect[-1] : &:r0_36, ~m2225_10 +# 2225| m2225_20(iterator) = Store[(__begin)] : &:r2225_15, r2225_19 +# 2225| r2225_21(glval>) = VariableAddress[(__end)] : +# 2225| r2225_22(glval &>) = VariableAddress[(__range)] : +# 2225| r2225_23(vector &) = Load[(__range)] : &:r2225_22, m2225_14 +#-----| r0_38(glval>) = CopyValue : r2225_23 #-----| r0_39(glval>) = Convert : r0_38 -# 2224| r2224_24(glval) = FunctionAddress[end] : -# 2224| r2224_25(iterator) = Call[end] : func:r2224_24, this:r0_39 -#-----| v0_40(void) = ^IndirectReadSideEffect[-1] : &:r0_39, ~m2224_10 -# 2224| m2224_26(iterator) = Store[(__end)] : &:r2224_21, r2224_25 -# 2224| m2224_27(unknown) = Chi : total:m2224_10, partial:m2224_26 +# 2225| r2225_24(glval) = FunctionAddress[end] : +# 2225| r2225_25(iterator) = Call[end] : func:r2225_24, this:r0_39 +#-----| v0_40(void) = ^IndirectReadSideEffect[-1] : &:r0_39, ~m2225_10 +# 2225| m2225_26(iterator) = Store[(__end)] : &:r2225_21, r2225_25 +# 2225| m2225_27(unknown) = Chi : total:m2225_10, partial:m2225_26 #-----| Goto -> Block 16 -# 2224| Block 16 -# 2224| m2224_28(iterator) = Phi : from 15:m2224_20, from 17:m2224_46 -# 2224| m2224_29(unknown) = Phi : from 15:~m2224_27, from 17:~m2224_38 -# 2224| r2224_30(glval>) = VariableAddress[(__begin)] : -#-----| r0_41(glval>) = Convert : r2224_30 -# 2224| r2224_31(glval) = FunctionAddress[operator!=] : +# 2225| Block 16 +# 2225| m2225_28(iterator) = Phi : from 15:m2225_20, from 17:m2225_46 +# 2225| m2225_29(unknown) = Phi : from 15:~m2225_27, from 17:~m2225_38 +# 2225| r2225_30(glval>) = VariableAddress[(__begin)] : +#-----| r0_41(glval>) = Convert : r2225_30 +# 2225| r2225_31(glval) = FunctionAddress[operator!=] : #-----| r0_42(glval>) = VariableAddress[#temp0:0] : #-----| m0_43(iterator) = Uninitialized[#temp0:0] : &:r0_42 -#-----| m0_44(unknown) = Chi : total:m2224_29, partial:m0_43 -# 2224| r2224_32(glval) = FunctionAddress[iterator] : -# 2224| r2224_33(glval>) = VariableAddress[(__end)] : -#-----| r0_45(glval>) = Convert : r2224_33 +#-----| m0_44(unknown) = Chi : total:m2225_29, partial:m0_43 +# 2225| r2225_32(glval) = FunctionAddress[iterator] : +# 2225| r2225_33(glval>) = VariableAddress[(__end)] : +#-----| r0_45(glval>) = Convert : r2225_33 #-----| r0_46(iterator &) = CopyValue : r0_45 -# 2224| v2224_34(void) = Call[iterator] : func:r2224_32, this:r0_42, 0:r0_46 -# 2224| m2224_35(unknown) = ^CallSideEffect : ~m0_44 -# 2224| m2224_36(unknown) = Chi : total:m0_44, partial:m2224_35 -#-----| v0_47(void) = ^BufferReadSideEffect[0] : &:r0_46, ~m2224_36 -# 2224| m2224_37(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_42 -# 2224| m2224_38(unknown) = Chi : total:m2224_36, partial:m2224_37 -#-----| r0_48(iterator) = Load[#temp0:0] : &:r0_42, ~m2224_38 -# 2224| r2224_39(bool) = Call[operator!=] : func:r2224_31, this:r0_41, 0:r0_48 -#-----| v0_49(void) = ^IndirectReadSideEffect[-1] : &:r0_41, m2224_28 -# 2224| v2224_40(void) = ConditionalBranch : r2224_39 +# 2225| v2225_34(void) = Call[iterator] : func:r2225_32, this:r0_42, 0:r0_46 +# 2225| m2225_35(unknown) = ^CallSideEffect : ~m0_44 +# 2225| m2225_36(unknown) = Chi : total:m0_44, partial:m2225_35 +#-----| v0_47(void) = ^BufferReadSideEffect[0] : &:r0_46, ~m2225_36 +# 2225| m2225_37(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_42 +# 2225| m2225_38(unknown) = Chi : total:m2225_36, partial:m2225_37 +#-----| r0_48(iterator) = Load[#temp0:0] : &:r0_42, ~m2225_38 +# 2225| r2225_39(bool) = Call[operator!=] : func:r2225_31, this:r0_41, 0:r0_48 +#-----| v0_49(void) = ^IndirectReadSideEffect[-1] : &:r0_41, m2225_28 +# 2225| v2225_40(void) = ConditionalBranch : r2225_39 #-----| False -> Block 20 #-----| True -> Block 18 -# 2224| Block 17 -# 2224| r2224_41(glval>) = VariableAddress[(__begin)] : -# 2224| r2224_42(glval) = FunctionAddress[operator++] : -# 2224| r2224_43(iterator &) = Call[operator++] : func:r2224_42, this:r2224_41 -# 2224| v2224_44(void) = ^IndirectReadSideEffect[-1] : &:r2224_41, m2224_28 -# 2224| m2224_45(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2224_41 -# 2224| m2224_46(iterator) = Chi : total:m2224_28, partial:m2224_45 -# 2224| r2224_47(glval>) = CopyValue : r2224_43 +# 2225| Block 17 +# 2225| r2225_41(glval>) = VariableAddress[(__begin)] : +# 2225| r2225_42(glval) = FunctionAddress[operator++] : +# 2225| r2225_43(iterator &) = Call[operator++] : func:r2225_42, this:r2225_41 +# 2225| v2225_44(void) = ^IndirectReadSideEffect[-1] : &:r2225_41, m2225_28 +# 2225| m2225_45(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2225_41 +# 2225| m2225_46(iterator) = Chi : total:m2225_28, partial:m2225_45 +# 2225| r2225_47(glval>) = CopyValue : r2225_43 #-----| Goto (back edge) -> Block 16 -# 2224| Block 18 -# 2224| r2224_48(glval) = VariableAddress[y] : -# 2224| r2224_49(glval>) = VariableAddress[(__begin)] : -#-----| r0_50(glval>) = Convert : r2224_49 -# 2224| r2224_50(glval) = FunctionAddress[operator*] : -# 2224| r2224_51(int &) = Call[operator*] : func:r2224_50, this:r0_50 -#-----| v0_51(void) = ^IndirectReadSideEffect[-1] : &:r0_50, m2224_28 -# 2224| r2224_52(int) = Load[?] : &:r2224_51, ~m2224_38 -# 2224| m2224_53(int) = Store[y] : &:r2224_48, r2224_52 -# 2225| r2225_1(glval) = VariableAddress[y] : -# 2225| r2225_2(int) = Load[y] : &:r2225_1, m2224_53 -# 2225| r2225_3(int) = Constant[1] : -# 2225| r2225_4(bool) = CompareEQ : r2225_2, r2225_3 -# 2225| v2225_5(void) = ConditionalBranch : r2225_4 +# 2225| Block 18 +# 2225| r2225_48(glval) = VariableAddress[y] : +# 2225| r2225_49(glval>) = VariableAddress[(__begin)] : +#-----| r0_50(glval>) = Convert : r2225_49 +# 2225| r2225_50(glval) = FunctionAddress[operator*] : +# 2225| r2225_51(int &) = Call[operator*] : func:r2225_50, this:r0_50 +#-----| v0_51(void) = ^IndirectReadSideEffect[-1] : &:r0_50, m2225_28 +# 2225| r2225_52(int) = Load[?] : &:r2225_51, ~m2225_38 +# 2225| m2225_53(int) = Store[y] : &:r2225_48, r2225_52 +# 2226| r2226_1(glval) = VariableAddress[y] : +# 2226| r2226_2(int) = Load[y] : &:r2226_1, m2225_53 +# 2226| r2226_3(int) = Constant[1] : +# 2226| r2226_4(bool) = CompareEQ : r2226_2, r2226_3 +# 2226| v2226_5(void) = ConditionalBranch : r2226_4 #-----| False -> Block 17 #-----| True -> Block 19 -# 2226| Block 19 -# 2226| v2226_1(void) = NoOp : -# 2224| r2224_54(glval>) = VariableAddress[ys] : -# 2224| r2224_55(glval) = FunctionAddress[~vector] : -# 2224| v2224_56(void) = Call[~vector] : func:r2224_55, this:r2224_54 -# 2224| m2224_57(unknown) = ^CallSideEffect : ~m2224_38 -# 2224| m2224_58(unknown) = Chi : total:m2224_38, partial:m2224_57 -# 2224| v2224_59(void) = ^IndirectReadSideEffect[-1] : &:r2224_54, ~m2224_58 -# 2224| m2224_60(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2224_54 -# 2224| m2224_61(unknown) = Chi : total:m2224_58, partial:m2224_60 -# 2233| r2233_9(glval) = VariableAddress[x] : -# 2233| r2233_10(glval) = FunctionAddress[~ClassWithDestructor] : -# 2233| v2233_11(void) = Call[~ClassWithDestructor] : func:r2233_10, this:r2233_9 -# 2233| m2233_12(unknown) = ^CallSideEffect : ~m2224_61 -# 2233| m2233_13(unknown) = Chi : total:m2224_61, partial:m2233_12 -# 2233| v2233_14(void) = ^IndirectReadSideEffect[-1] : &:r2233_9, m2214_8 -# 2233| m2233_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_9 -# 2233| m2233_16(ClassWithDestructor) = Chi : total:m2214_8, partial:m2233_15 +# 2227| Block 19 +# 2227| v2227_1(void) = NoOp : +# 2225| r2225_54(glval>) = VariableAddress[ys] : +# 2225| r2225_55(glval) = FunctionAddress[~vector] : +# 2225| v2225_56(void) = Call[~vector] : func:r2225_55, this:r2225_54 +# 2225| m2225_57(unknown) = ^CallSideEffect : ~m2225_38 +# 2225| m2225_58(unknown) = Chi : total:m2225_38, partial:m2225_57 +# 2225| v2225_59(void) = ^IndirectReadSideEffect[-1] : &:r2225_54, ~m2225_58 +# 2225| m2225_60(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2225_54 +# 2225| m2225_61(unknown) = Chi : total:m2225_58, partial:m2225_60 +# 2234| r2234_9(glval) = VariableAddress[x] : +# 2234| r2234_10(glval) = FunctionAddress[~ClassWithDestructor] : +# 2234| v2234_11(void) = Call[~ClassWithDestructor] : func:r2234_10, this:r2234_9 +# 2234| m2234_12(unknown) = ^CallSideEffect : ~m2225_61 +# 2234| m2234_13(unknown) = Chi : total:m2225_61, partial:m2234_12 +# 2234| v2234_14(void) = ^IndirectReadSideEffect[-1] : &:r2234_9, m2215_8 +# 2234| m2234_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_9 +# 2234| m2234_16(ClassWithDestructor) = Chi : total:m2215_8, partial:m2234_15 #-----| Goto -> Block 1 -# 2224| Block 20 -# 2224| r2224_62(glval>) = VariableAddress[ys] : -# 2224| r2224_63(glval) = FunctionAddress[~vector] : -# 2224| v2224_64(void) = Call[~vector] : func:r2224_63, this:r2224_62 -# 2224| m2224_65(unknown) = ^CallSideEffect : ~m2224_38 -# 2224| m2224_66(unknown) = Chi : total:m2224_38, partial:m2224_65 -# 2224| v2224_67(void) = ^IndirectReadSideEffect[-1] : &:r2224_62, ~m2224_66 -# 2224| m2224_68(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2224_62 -# 2224| m2224_69(unknown) = Chi : total:m2224_66, partial:m2224_68 -# 2229| r2229_1(glval>) = VariableAddress[ys] : -# 2229| m2229_2(vector) = Uninitialized[ys] : &:r2229_1 -# 2229| m2229_3(unknown) = Chi : total:m2224_69, partial:m2229_2 -# 2229| r2229_4(glval) = FunctionAddress[vector] : -# 2229| r2229_5(glval) = VariableAddress[#temp2229:45] : -# 2229| r2229_6(glval) = VariableAddress[x] : -# 2229| r2229_7(ClassWithDestructor) = Load[x] : &:r2229_6, m2214_8 -# 2229| m2229_8(ClassWithDestructor) = Store[#temp2229:45] : &:r2229_5, r2229_7 -# 2229| r2229_9(ClassWithDestructor) = Load[#temp2229:45] : &:r2229_5, m2229_8 -# 2229| v2229_10(void) = Call[vector] : func:r2229_4, this:r2229_1, 0:r2229_9 -# 2229| m2229_11(unknown) = ^CallSideEffect : ~m2229_3 -# 2229| m2229_12(unknown) = Chi : total:m2229_3, partial:m2229_11 -# 2229| m2229_13(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2229_1 -# 2229| m2229_14(unknown) = Chi : total:m2229_12, partial:m2229_13 -# 2229| r2229_15(glval) = CopyValue : r2229_5 -# 2229| r2229_16(glval) = FunctionAddress[~ClassWithDestructor] : -# 2229| v2229_17(void) = Call[~ClassWithDestructor] : func:r2229_16, this:r2229_15 -# 2229| m2229_18(unknown) = ^CallSideEffect : ~m2229_14 -# 2229| m2229_19(unknown) = Chi : total:m2229_14, partial:m2229_18 -# 2229| v2229_20(void) = ^IndirectReadSideEffect[-1] : &:r2229_15, m2229_8 -# 2229| m2229_21(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2229_15 -# 2229| m2229_22(ClassWithDestructor) = Chi : total:m2229_8, partial:m2229_21 -# 2229| r2229_23(glval &>) = VariableAddress[(__range)] : -# 2229| r2229_24(glval>) = VariableAddress[ys] : -# 2229| r2229_25(vector &) = CopyValue : r2229_24 -# 2229| m2229_26(vector &) = Store[(__range)] : &:r2229_23, r2229_25 -# 2229| r2229_27(glval>) = VariableAddress[(__begin)] : -# 2229| r2229_28(glval &>) = VariableAddress[(__range)] : -# 2229| r2229_29(vector &) = Load[(__range)] : &:r2229_28, m2229_26 -#-----| r0_52(glval>) = CopyValue : r2229_29 +# 2225| Block 20 +# 2225| r2225_62(glval>) = VariableAddress[ys] : +# 2225| r2225_63(glval) = FunctionAddress[~vector] : +# 2225| v2225_64(void) = Call[~vector] : func:r2225_63, this:r2225_62 +# 2225| m2225_65(unknown) = ^CallSideEffect : ~m2225_38 +# 2225| m2225_66(unknown) = Chi : total:m2225_38, partial:m2225_65 +# 2225| v2225_67(void) = ^IndirectReadSideEffect[-1] : &:r2225_62, ~m2225_66 +# 2225| m2225_68(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2225_62 +# 2225| m2225_69(unknown) = Chi : total:m2225_66, partial:m2225_68 +# 2230| r2230_1(glval>) = VariableAddress[ys] : +# 2230| m2230_2(vector) = Uninitialized[ys] : &:r2230_1 +# 2230| m2230_3(unknown) = Chi : total:m2225_69, partial:m2230_2 +# 2230| r2230_4(glval) = FunctionAddress[vector] : +# 2230| r2230_5(glval) = VariableAddress[#temp2230:45] : +# 2230| r2230_6(glval) = VariableAddress[x] : +# 2230| r2230_7(ClassWithDestructor) = Load[x] : &:r2230_6, m2215_8 +# 2230| m2230_8(ClassWithDestructor) = Store[#temp2230:45] : &:r2230_5, r2230_7 +# 2230| r2230_9(ClassWithDestructor) = Load[#temp2230:45] : &:r2230_5, m2230_8 +# 2230| v2230_10(void) = Call[vector] : func:r2230_4, this:r2230_1, 0:r2230_9 +# 2230| m2230_11(unknown) = ^CallSideEffect : ~m2230_3 +# 2230| m2230_12(unknown) = Chi : total:m2230_3, partial:m2230_11 +# 2230| m2230_13(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2230_1 +# 2230| m2230_14(unknown) = Chi : total:m2230_12, partial:m2230_13 +# 2230| r2230_15(glval) = CopyValue : r2230_5 +# 2230| r2230_16(glval) = FunctionAddress[~ClassWithDestructor] : +# 2230| v2230_17(void) = Call[~ClassWithDestructor] : func:r2230_16, this:r2230_15 +# 2230| m2230_18(unknown) = ^CallSideEffect : ~m2230_14 +# 2230| m2230_19(unknown) = Chi : total:m2230_14, partial:m2230_18 +# 2230| v2230_20(void) = ^IndirectReadSideEffect[-1] : &:r2230_15, m2230_8 +# 2230| m2230_21(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_15 +# 2230| m2230_22(ClassWithDestructor) = Chi : total:m2230_8, partial:m2230_21 +# 2230| r2230_23(glval &>) = VariableAddress[(__range)] : +# 2230| r2230_24(glval>) = VariableAddress[ys] : +# 2230| r2230_25(vector &) = CopyValue : r2230_24 +# 2230| m2230_26(vector &) = Store[(__range)] : &:r2230_23, r2230_25 +# 2230| r2230_27(glval>) = VariableAddress[(__begin)] : +# 2230| r2230_28(glval &>) = VariableAddress[(__range)] : +# 2230| r2230_29(vector &) = Load[(__range)] : &:r2230_28, m2230_26 +#-----| r0_52(glval>) = CopyValue : r2230_29 #-----| r0_53(glval>) = Convert : r0_52 -# 2229| r2229_30(glval) = FunctionAddress[begin] : -# 2229| r2229_31(iterator) = Call[begin] : func:r2229_30, this:r0_53 -#-----| v0_54(void) = ^IndirectReadSideEffect[-1] : &:r0_53, ~m2229_19 -# 2229| m2229_32(iterator) = Store[(__begin)] : &:r2229_27, r2229_31 -# 2229| r2229_33(glval>) = VariableAddress[(__end)] : -# 2229| r2229_34(glval &>) = VariableAddress[(__range)] : -# 2229| r2229_35(vector &) = Load[(__range)] : &:r2229_34, m2229_26 -#-----| r0_55(glval>) = CopyValue : r2229_35 +# 2230| r2230_30(glval) = FunctionAddress[begin] : +# 2230| r2230_31(iterator) = Call[begin] : func:r2230_30, this:r0_53 +#-----| v0_54(void) = ^IndirectReadSideEffect[-1] : &:r0_53, ~m2230_19 +# 2230| m2230_32(iterator) = Store[(__begin)] : &:r2230_27, r2230_31 +# 2230| r2230_33(glval>) = VariableAddress[(__end)] : +# 2230| r2230_34(glval &>) = VariableAddress[(__range)] : +# 2230| r2230_35(vector &) = Load[(__range)] : &:r2230_34, m2230_26 +#-----| r0_55(glval>) = CopyValue : r2230_35 #-----| r0_56(glval>) = Convert : r0_55 -# 2229| r2229_36(glval) = FunctionAddress[end] : -# 2229| r2229_37(iterator) = Call[end] : func:r2229_36, this:r0_56 -#-----| v0_57(void) = ^IndirectReadSideEffect[-1] : &:r0_56, ~m2229_19 -# 2229| m2229_38(iterator) = Store[(__end)] : &:r2229_33, r2229_37 -# 2229| m2229_39(unknown) = Chi : total:m2229_19, partial:m2229_38 +# 2230| r2230_36(glval) = FunctionAddress[end] : +# 2230| r2230_37(iterator) = Call[end] : func:r2230_36, this:r0_56 +#-----| v0_57(void) = ^IndirectReadSideEffect[-1] : &:r0_56, ~m2230_19 +# 2230| m2230_38(iterator) = Store[(__end)] : &:r2230_33, r2230_37 +# 2230| m2230_39(unknown) = Chi : total:m2230_19, partial:m2230_38 #-----| Goto -> Block 21 -# 2229| Block 21 -# 2229| m2229_40(iterator) = Phi : from 20:m2229_32, from 22:m2229_64 -# 2229| m2229_41(unknown) = Phi : from 20:~m2229_39, from 22:~m2229_69 -# 2229| r2229_42(glval>) = VariableAddress[(__begin)] : -#-----| r0_58(glval>) = Convert : r2229_42 -# 2229| r2229_43(glval) = FunctionAddress[operator!=] : +# 2230| Block 21 +# 2230| m2230_40(iterator) = Phi : from 20:m2230_32, from 22:m2230_64 +# 2230| m2230_41(unknown) = Phi : from 20:~m2230_39, from 22:~m2230_69 +# 2230| r2230_42(glval>) = VariableAddress[(__begin)] : +#-----| r0_58(glval>) = Convert : r2230_42 +# 2230| r2230_43(glval) = FunctionAddress[operator!=] : #-----| r0_59(glval>) = VariableAddress[#temp0:0] : #-----| m0_60(iterator) = Uninitialized[#temp0:0] : &:r0_59 -#-----| m0_61(unknown) = Chi : total:m2229_41, partial:m0_60 -# 2229| r2229_44(glval) = FunctionAddress[iterator] : -# 2229| r2229_45(glval>) = VariableAddress[(__end)] : -#-----| r0_62(glval>) = Convert : r2229_45 +#-----| m0_61(unknown) = Chi : total:m2230_41, partial:m0_60 +# 2230| r2230_44(glval) = FunctionAddress[iterator] : +# 2230| r2230_45(glval>) = VariableAddress[(__end)] : +#-----| r0_62(glval>) = Convert : r2230_45 #-----| r0_63(iterator &) = CopyValue : r0_62 -# 2229| v2229_46(void) = Call[iterator] : func:r2229_44, this:r0_59, 0:r0_63 -# 2229| m2229_47(unknown) = ^CallSideEffect : ~m0_61 -# 2229| m2229_48(unknown) = Chi : total:m0_61, partial:m2229_47 -#-----| v0_64(void) = ^BufferReadSideEffect[0] : &:r0_63, ~m2229_48 -# 2229| m2229_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_59 -# 2229| m2229_50(unknown) = Chi : total:m2229_48, partial:m2229_49 -#-----| r0_65(iterator) = Load[#temp0:0] : &:r0_59, ~m2229_50 -# 2229| r2229_51(bool) = Call[operator!=] : func:r2229_43, this:r0_58, 0:r0_65 -#-----| v0_66(void) = ^IndirectReadSideEffect[-1] : &:r0_58, m2229_40 -# 2229| v2229_52(void) = ConditionalBranch : r2229_51 +# 2230| v2230_46(void) = Call[iterator] : func:r2230_44, this:r0_59, 0:r0_63 +# 2230| m2230_47(unknown) = ^CallSideEffect : ~m0_61 +# 2230| m2230_48(unknown) = Chi : total:m0_61, partial:m2230_47 +#-----| v0_64(void) = ^BufferReadSideEffect[0] : &:r0_63, ~m2230_48 +# 2230| m2230_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_59 +# 2230| m2230_50(unknown) = Chi : total:m2230_48, partial:m2230_49 +#-----| r0_65(iterator) = Load[#temp0:0] : &:r0_59, ~m2230_50 +# 2230| r2230_51(bool) = Call[operator!=] : func:r2230_43, this:r0_58, 0:r0_65 +#-----| v0_66(void) = ^IndirectReadSideEffect[-1] : &:r0_58, m2230_40 +# 2230| v2230_52(void) = ConditionalBranch : r2230_51 #-----| False -> Block 23 #-----| True -> Block 22 -# 2229| Block 22 -# 2229| r2229_53(glval) = VariableAddress[y] : -# 2229| r2229_54(glval>) = VariableAddress[(__begin)] : -#-----| r0_67(glval>) = Convert : r2229_54 -# 2229| r2229_55(glval) = FunctionAddress[operator*] : -# 2229| r2229_56(ClassWithDestructor &) = Call[operator*] : func:r2229_55, this:r0_67 -#-----| v0_68(void) = ^IndirectReadSideEffect[-1] : &:r0_67, m2229_40 -# 2229| r2229_57(ClassWithDestructor) = Load[?] : &:r2229_56, ~m2229_50 -# 2229| m2229_58(ClassWithDestructor) = Store[y] : &:r2229_53, r2229_57 -# 2230| r2230_1(glval) = VariableAddress[z1] : -# 2230| m2230_2(ClassWithDestructor) = Uninitialized[z1] : &:r2230_1 -# 2230| r2230_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2230| v2230_4(void) = Call[ClassWithDestructor] : func:r2230_3, this:r2230_1 -# 2230| m2230_5(unknown) = ^CallSideEffect : ~m2229_50 -# 2230| m2230_6(unknown) = Chi : total:m2229_50, partial:m2230_5 -# 2230| m2230_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_1 -# 2230| m2230_8(ClassWithDestructor) = Chi : total:m2230_2, partial:m2230_7 -# 2231| r2231_1(glval) = VariableAddress[z2] : -# 2231| m2231_2(ClassWithDestructor) = Uninitialized[z2] : &:r2231_1 +# 2230| Block 22 +# 2230| r2230_53(glval) = VariableAddress[y] : +# 2230| r2230_54(glval>) = VariableAddress[(__begin)] : +#-----| r0_67(glval>) = Convert : r2230_54 +# 2230| r2230_55(glval) = FunctionAddress[operator*] : +# 2230| r2230_56(ClassWithDestructor &) = Call[operator*] : func:r2230_55, this:r0_67 +#-----| v0_68(void) = ^IndirectReadSideEffect[-1] : &:r0_67, m2230_40 +# 2230| r2230_57(ClassWithDestructor) = Load[?] : &:r2230_56, ~m2230_50 +# 2230| m2230_58(ClassWithDestructor) = Store[y] : &:r2230_53, r2230_57 +# 2231| r2231_1(glval) = VariableAddress[z1] : +# 2231| m2231_2(ClassWithDestructor) = Uninitialized[z1] : &:r2231_1 # 2231| r2231_3(glval) = FunctionAddress[ClassWithDestructor] : # 2231| v2231_4(void) = Call[ClassWithDestructor] : func:r2231_3, this:r2231_1 -# 2231| m2231_5(unknown) = ^CallSideEffect : ~m2230_6 -# 2231| m2231_6(unknown) = Chi : total:m2230_6, partial:m2231_5 +# 2231| m2231_5(unknown) = ^CallSideEffect : ~m2230_50 +# 2231| m2231_6(unknown) = Chi : total:m2230_50, partial:m2231_5 # 2231| m2231_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2231_1 # 2231| m2231_8(ClassWithDestructor) = Chi : total:m2231_2, partial:m2231_7 # 2232| r2232_1(glval) = VariableAddress[z2] : -# 2232| r2232_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2232| v2232_3(void) = Call[~ClassWithDestructor] : func:r2232_2, this:r2232_1 -# 2232| m2232_4(unknown) = ^CallSideEffect : ~m2231_6 -# 2232| m2232_5(unknown) = Chi : total:m2231_6, partial:m2232_4 -# 2232| v2232_6(void) = ^IndirectReadSideEffect[-1] : &:r2232_1, m2231_8 +# 2232| m2232_2(ClassWithDestructor) = Uninitialized[z2] : &:r2232_1 +# 2232| r2232_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2232| v2232_4(void) = Call[ClassWithDestructor] : func:r2232_3, this:r2232_1 +# 2232| m2232_5(unknown) = ^CallSideEffect : ~m2231_6 +# 2232| m2232_6(unknown) = Chi : total:m2231_6, partial:m2232_5 # 2232| m2232_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2232_1 -# 2232| m2232_8(ClassWithDestructor) = Chi : total:m2231_8, partial:m2232_7 -# 2232| r2232_9(glval) = VariableAddress[z1] : -# 2232| r2232_10(glval) = FunctionAddress[~ClassWithDestructor] : -# 2232| v2232_11(void) = Call[~ClassWithDestructor] : func:r2232_10, this:r2232_9 -# 2232| m2232_12(unknown) = ^CallSideEffect : ~m2232_5 -# 2232| m2232_13(unknown) = Chi : total:m2232_5, partial:m2232_12 -# 2232| v2232_14(void) = ^IndirectReadSideEffect[-1] : &:r2232_9, m2230_8 -# 2232| m2232_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2232_9 -# 2232| m2232_16(ClassWithDestructor) = Chi : total:m2230_8, partial:m2232_15 -# 2229| r2229_59(glval>) = VariableAddress[(__begin)] : -# 2229| r2229_60(glval) = FunctionAddress[operator++] : -# 2229| r2229_61(iterator &) = Call[operator++] : func:r2229_60, this:r2229_59 -# 2229| v2229_62(void) = ^IndirectReadSideEffect[-1] : &:r2229_59, m2229_40 -# 2229| m2229_63(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2229_59 -# 2229| m2229_64(iterator) = Chi : total:m2229_40, partial:m2229_63 -# 2229| r2229_65(glval) = VariableAddress[y] : -# 2229| r2229_66(glval) = FunctionAddress[~ClassWithDestructor] : -# 2229| v2229_67(void) = Call[~ClassWithDestructor] : func:r2229_66, this:r2229_65 -# 2229| m2229_68(unknown) = ^CallSideEffect : ~m2232_13 -# 2229| m2229_69(unknown) = Chi : total:m2232_13, partial:m2229_68 -# 2229| v2229_70(void) = ^IndirectReadSideEffect[-1] : &:r2229_65, m2229_58 -# 2229| m2229_71(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2229_65 -# 2229| m2229_72(ClassWithDestructor) = Chi : total:m2229_58, partial:m2229_71 -# 2229| r2229_73(glval>) = CopyValue : r2229_61 +# 2232| m2232_8(ClassWithDestructor) = Chi : total:m2232_2, partial:m2232_7 +# 2233| r2233_1(glval) = VariableAddress[z2] : +# 2233| r2233_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2233| v2233_3(void) = Call[~ClassWithDestructor] : func:r2233_2, this:r2233_1 +# 2233| m2233_4(unknown) = ^CallSideEffect : ~m2232_6 +# 2233| m2233_5(unknown) = Chi : total:m2232_6, partial:m2233_4 +# 2233| v2233_6(void) = ^IndirectReadSideEffect[-1] : &:r2233_1, m2232_8 +# 2233| m2233_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_1 +# 2233| m2233_8(ClassWithDestructor) = Chi : total:m2232_8, partial:m2233_7 +# 2233| r2233_9(glval) = VariableAddress[z1] : +# 2233| r2233_10(glval) = FunctionAddress[~ClassWithDestructor] : +# 2233| v2233_11(void) = Call[~ClassWithDestructor] : func:r2233_10, this:r2233_9 +# 2233| m2233_12(unknown) = ^CallSideEffect : ~m2233_5 +# 2233| m2233_13(unknown) = Chi : total:m2233_5, partial:m2233_12 +# 2233| v2233_14(void) = ^IndirectReadSideEffect[-1] : &:r2233_9, m2231_8 +# 2233| m2233_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_9 +# 2233| m2233_16(ClassWithDestructor) = Chi : total:m2231_8, partial:m2233_15 +# 2230| r2230_59(glval>) = VariableAddress[(__begin)] : +# 2230| r2230_60(glval) = FunctionAddress[operator++] : +# 2230| r2230_61(iterator &) = Call[operator++] : func:r2230_60, this:r2230_59 +# 2230| v2230_62(void) = ^IndirectReadSideEffect[-1] : &:r2230_59, m2230_40 +# 2230| m2230_63(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2230_59 +# 2230| m2230_64(iterator) = Chi : total:m2230_40, partial:m2230_63 +# 2230| r2230_65(glval) = VariableAddress[y] : +# 2230| r2230_66(glval) = FunctionAddress[~ClassWithDestructor] : +# 2230| v2230_67(void) = Call[~ClassWithDestructor] : func:r2230_66, this:r2230_65 +# 2230| m2230_68(unknown) = ^CallSideEffect : ~m2233_13 +# 2230| m2230_69(unknown) = Chi : total:m2233_13, partial:m2230_68 +# 2230| v2230_70(void) = ^IndirectReadSideEffect[-1] : &:r2230_65, m2230_58 +# 2230| m2230_71(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_65 +# 2230| m2230_72(ClassWithDestructor) = Chi : total:m2230_58, partial:m2230_71 +# 2230| r2230_73(glval>) = CopyValue : r2230_61 #-----| Goto (back edge) -> Block 21 -# 2229| Block 23 -# 2229| r2229_74(glval>) = VariableAddress[ys] : -# 2229| r2229_75(glval) = FunctionAddress[~vector] : -# 2229| v2229_76(void) = Call[~vector] : func:r2229_75, this:r2229_74 -# 2229| m2229_77(unknown) = ^CallSideEffect : ~m2229_50 -# 2229| m2229_78(unknown) = Chi : total:m2229_50, partial:m2229_77 -# 2229| v2229_79(void) = ^IndirectReadSideEffect[-1] : &:r2229_74, ~m2229_78 -# 2229| m2229_80(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2229_74 -# 2229| m2229_81(unknown) = Chi : total:m2229_78, partial:m2229_80 -# 2233| v2233_17(void) = NoOp : -# 2233| r2233_18(glval) = VariableAddress[x] : -# 2233| r2233_19(glval) = FunctionAddress[~ClassWithDestructor] : -# 2233| v2233_20(void) = Call[~ClassWithDestructor] : func:r2233_19, this:r2233_18 -# 2233| m2233_21(unknown) = ^CallSideEffect : ~m2229_81 -# 2233| m2233_22(unknown) = Chi : total:m2229_81, partial:m2233_21 -# 2233| v2233_23(void) = ^IndirectReadSideEffect[-1] : &:r2233_18, m2214_8 -# 2233| m2233_24(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_18 -# 2233| m2233_25(ClassWithDestructor) = Chi : total:m2214_8, partial:m2233_24 +# 2230| Block 23 +# 2230| r2230_74(glval>) = VariableAddress[ys] : +# 2230| r2230_75(glval) = FunctionAddress[~vector] : +# 2230| v2230_76(void) = Call[~vector] : func:r2230_75, this:r2230_74 +# 2230| m2230_77(unknown) = ^CallSideEffect : ~m2230_50 +# 2230| m2230_78(unknown) = Chi : total:m2230_50, partial:m2230_77 +# 2230| v2230_79(void) = ^IndirectReadSideEffect[-1] : &:r2230_74, ~m2230_78 +# 2230| m2230_80(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2230_74 +# 2230| m2230_81(unknown) = Chi : total:m2230_78, partial:m2230_80 +# 2234| v2234_17(void) = NoOp : +# 2234| r2234_18(glval) = VariableAddress[x] : +# 2234| r2234_19(glval) = FunctionAddress[~ClassWithDestructor] : +# 2234| v2234_20(void) = Call[~ClassWithDestructor] : func:r2234_19, this:r2234_18 +# 2234| m2234_21(unknown) = ^CallSideEffect : ~m2230_81 +# 2234| m2234_22(unknown) = Chi : total:m2230_81, partial:m2234_21 +# 2234| v2234_23(void) = ^IndirectReadSideEffect[-1] : &:r2234_18, m2215_8 +# 2234| m2234_24(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_18 +# 2234| m2234_25(ClassWithDestructor) = Chi : total:m2215_8, partial:m2234_24 #-----| Goto -> Block 1 -# 2198| Block 24 -# 2198| v2198_13(void) = Unreached : +# 2199| Block 24 +# 2199| v2199_13(void) = Unreached : -# 2235| void static_variable_with_destructor_1() -# 2235| Block 0 -# 2235| v2235_1(void) = EnterFunction : -# 2235| m2235_2(unknown) = AliasedDefinition : -# 2235| m2235_3(unknown) = InitializeNonLocal : -# 2235| m2235_4(unknown) = Chi : total:m2235_2, partial:m2235_3 -# 2236| r2236_1(glval) = VariableAddress[a] : -# 2236| m2236_2(ClassWithDestructor) = Uninitialized[a] : &:r2236_1 -# 2236| r2236_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2236| v2236_4(void) = Call[ClassWithDestructor] : func:r2236_3, this:r2236_1 -# 2236| m2236_5(unknown) = ^CallSideEffect : ~m2235_4 -# 2236| m2236_6(unknown) = Chi : total:m2235_4, partial:m2236_5 -# 2236| m2236_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2236_1 -# 2236| m2236_8(ClassWithDestructor) = Chi : total:m2236_2, partial:m2236_7 -# 2237| r2237_1(glval) = VariableAddress[b#init] : -# 2237| r2237_2(bool) = Load[b#init] : &:r2237_1, ~m2236_6 -# 2237| v2237_3(void) = ConditionalBranch : r2237_2 +# 2236| void static_variable_with_destructor_1() +# 2236| Block 0 +# 2236| v2236_1(void) = EnterFunction : +# 2236| m2236_2(unknown) = AliasedDefinition : +# 2236| m2236_3(unknown) = InitializeNonLocal : +# 2236| m2236_4(unknown) = Chi : total:m2236_2, partial:m2236_3 +# 2237| r2237_1(glval) = VariableAddress[a] : +# 2237| m2237_2(ClassWithDestructor) = Uninitialized[a] : &:r2237_1 +# 2237| r2237_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2237| v2237_4(void) = Call[ClassWithDestructor] : func:r2237_3, this:r2237_1 +# 2237| m2237_5(unknown) = ^CallSideEffect : ~m2236_4 +# 2237| m2237_6(unknown) = Chi : total:m2236_4, partial:m2237_5 +# 2237| m2237_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2237_1 +# 2237| m2237_8(ClassWithDestructor) = Chi : total:m2237_2, partial:m2237_7 +# 2238| r2238_1(glval) = VariableAddress[b#init] : +# 2238| r2238_2(bool) = Load[b#init] : &:r2238_1, ~m2237_6 +# 2238| v2238_3(void) = ConditionalBranch : r2238_2 #-----| False -> Block 1 #-----| True -> Block 2 -# 2237| Block 1 -# 2237| r2237_4(glval) = VariableAddress[b] : +# 2238| Block 1 +# 2238| r2238_4(glval) = VariableAddress[b] : #-----| r0_1(glval) = FunctionAddress[ClassWithDestructor] : -#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2237_4 -#-----| m0_3(unknown) = ^CallSideEffect : ~m2236_6 -#-----| m0_4(unknown) = Chi : total:m2236_6, partial:m0_3 -#-----| m0_5(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2237_4 +#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2238_4 +#-----| m0_3(unknown) = ^CallSideEffect : ~m2237_6 +#-----| m0_4(unknown) = Chi : total:m2237_6, partial:m0_3 +#-----| m0_5(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2238_4 #-----| m0_6(unknown) = Chi : total:m0_4, partial:m0_5 -# 2237| r2237_5(bool) = Constant[1] : -# 2237| m2237_6(bool) = Store[b#init] : &:r2237_1, r2237_5 -# 2237| m2237_7(unknown) = Chi : total:m0_6, partial:m2237_6 +# 2238| r2238_5(bool) = Constant[1] : +# 2238| m2238_6(bool) = Store[b#init] : &:r2238_1, r2238_5 +# 2238| m2238_7(unknown) = Chi : total:m0_6, partial:m2238_6 #-----| Goto -> Block 2 -# 2238| Block 2 -# 2238| m2238_1(unknown) = Phi : from 0:~m2236_6, from 1:~m2237_7 -# 2238| v2238_2(void) = NoOp : -# 2238| r2238_3(glval) = VariableAddress[a] : -# 2238| r2238_4(glval) = FunctionAddress[~ClassWithDestructor] : -# 2238| v2238_5(void) = Call[~ClassWithDestructor] : func:r2238_4, this:r2238_3 -# 2238| m2238_6(unknown) = ^CallSideEffect : ~m2238_1 -# 2238| m2238_7(unknown) = Chi : total:m2238_1, partial:m2238_6 -# 2238| v2238_8(void) = ^IndirectReadSideEffect[-1] : &:r2238_3, m2236_8 -# 2238| m2238_9(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2238_3 -# 2238| m2238_10(ClassWithDestructor) = Chi : total:m2236_8, partial:m2238_9 -# 2235| v2235_5(void) = ReturnVoid : -# 2235| v2235_6(void) = AliasedUse : ~m2238_7 -# 2235| v2235_7(void) = ExitFunction : +# 2239| Block 2 +# 2239| m2239_1(unknown) = Phi : from 0:~m2237_6, from 1:~m2238_7 +# 2239| v2239_2(void) = NoOp : +# 2239| r2239_3(glval) = VariableAddress[a] : +# 2239| r2239_4(glval) = FunctionAddress[~ClassWithDestructor] : +# 2239| v2239_5(void) = Call[~ClassWithDestructor] : func:r2239_4, this:r2239_3 +# 2239| m2239_6(unknown) = ^CallSideEffect : ~m2239_1 +# 2239| m2239_7(unknown) = Chi : total:m2239_1, partial:m2239_6 +# 2239| v2239_8(void) = ^IndirectReadSideEffect[-1] : &:r2239_3, m2237_8 +# 2239| m2239_9(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2239_3 +# 2239| m2239_10(ClassWithDestructor) = Chi : total:m2237_8, partial:m2239_9 +# 2236| v2236_5(void) = ReturnVoid : +# 2236| v2236_6(void) = AliasedUse : ~m2239_7 +# 2236| v2236_7(void) = ExitFunction : -# 2240| void static_variable_with_destructor_2() -# 2240| Block 0 -# 2240| v2240_1(void) = EnterFunction : -# 2240| m2240_2(unknown) = AliasedDefinition : -# 2240| m2240_3(unknown) = InitializeNonLocal : -# 2240| m2240_4(unknown) = Chi : total:m2240_2, partial:m2240_3 -# 2241| r2241_1(glval) = VariableAddress[a#init] : -# 2241| r2241_2(bool) = Load[a#init] : &:r2241_1, ~m2240_3 -# 2241| v2241_3(void) = ConditionalBranch : r2241_2 +# 2241| void static_variable_with_destructor_2() +# 2241| Block 0 +# 2241| v2241_1(void) = EnterFunction : +# 2241| m2241_2(unknown) = AliasedDefinition : +# 2241| m2241_3(unknown) = InitializeNonLocal : +# 2241| m2241_4(unknown) = Chi : total:m2241_2, partial:m2241_3 +# 2242| r2242_1(glval) = VariableAddress[a#init] : +# 2242| r2242_2(bool) = Load[a#init] : &:r2242_1, ~m2241_3 +# 2242| v2242_3(void) = ConditionalBranch : r2242_2 #-----| False -> Block 1 #-----| True -> Block 2 -# 2241| Block 1 -# 2241| r2241_4(glval) = VariableAddress[a] : +# 2242| Block 1 +# 2242| r2242_4(glval) = VariableAddress[a] : #-----| r0_1(glval) = FunctionAddress[ClassWithDestructor] : -#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2241_4 -#-----| m0_3(unknown) = ^CallSideEffect : ~m2240_4 -#-----| m0_4(unknown) = Chi : total:m2240_4, partial:m0_3 -#-----| m0_5(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2241_4 +#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2242_4 +#-----| m0_3(unknown) = ^CallSideEffect : ~m2241_4 +#-----| m0_4(unknown) = Chi : total:m2241_4, partial:m0_3 +#-----| m0_5(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2242_4 #-----| m0_6(unknown) = Chi : total:m0_4, partial:m0_5 -# 2241| r2241_5(bool) = Constant[1] : -# 2241| m2241_6(bool) = Store[a#init] : &:r2241_1, r2241_5 -# 2241| m2241_7(unknown) = Chi : total:m0_6, partial:m2241_6 +# 2242| r2242_5(bool) = Constant[1] : +# 2242| m2242_6(bool) = Store[a#init] : &:r2242_1, r2242_5 +# 2242| m2242_7(unknown) = Chi : total:m0_6, partial:m2242_6 #-----| Goto -> Block 2 -# 2242| Block 2 -# 2242| m2242_1(unknown) = Phi : from 0:~m2240_4, from 1:~m2241_7 -# 2242| r2242_2(glval) = VariableAddress[b] : -# 2242| m2242_3(ClassWithDestructor) = Uninitialized[b] : &:r2242_2 -# 2242| r2242_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2242| v2242_5(void) = Call[ClassWithDestructor] : func:r2242_4, this:r2242_2 -# 2242| m2242_6(unknown) = ^CallSideEffect : ~m2242_1 -# 2242| m2242_7(unknown) = Chi : total:m2242_1, partial:m2242_6 -# 2242| m2242_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2242_2 -# 2242| m2242_9(ClassWithDestructor) = Chi : total:m2242_3, partial:m2242_8 -# 2243| v2243_1(void) = NoOp : +# 2243| Block 2 +# 2243| m2243_1(unknown) = Phi : from 0:~m2241_4, from 1:~m2242_7 # 2243| r2243_2(glval) = VariableAddress[b] : -# 2243| r2243_3(glval) = FunctionAddress[~ClassWithDestructor] : -# 2243| v2243_4(void) = Call[~ClassWithDestructor] : func:r2243_3, this:r2243_2 -# 2243| m2243_5(unknown) = ^CallSideEffect : ~m2242_7 -# 2243| m2243_6(unknown) = Chi : total:m2242_7, partial:m2243_5 -# 2243| v2243_7(void) = ^IndirectReadSideEffect[-1] : &:r2243_2, m2242_9 +# 2243| m2243_3(ClassWithDestructor) = Uninitialized[b] : &:r2243_2 +# 2243| r2243_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2243| v2243_5(void) = Call[ClassWithDestructor] : func:r2243_4, this:r2243_2 +# 2243| m2243_6(unknown) = ^CallSideEffect : ~m2243_1 +# 2243| m2243_7(unknown) = Chi : total:m2243_1, partial:m2243_6 # 2243| m2243_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2243_2 -# 2243| m2243_9(ClassWithDestructor) = Chi : total:m2242_9, partial:m2243_8 -# 2240| v2240_5(void) = ReturnVoid : -# 2240| v2240_6(void) = AliasedUse : ~m2243_6 -# 2240| v2240_7(void) = ExitFunction : +# 2243| m2243_9(ClassWithDestructor) = Chi : total:m2243_3, partial:m2243_8 +# 2244| v2244_1(void) = NoOp : +# 2244| r2244_2(glval) = VariableAddress[b] : +# 2244| r2244_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2244| v2244_4(void) = Call[~ClassWithDestructor] : func:r2244_3, this:r2244_2 +# 2244| m2244_5(unknown) = ^CallSideEffect : ~m2243_7 +# 2244| m2244_6(unknown) = Chi : total:m2243_7, partial:m2244_5 +# 2244| v2244_7(void) = ^IndirectReadSideEffect[-1] : &:r2244_2, m2243_9 +# 2244| m2244_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2244_2 +# 2244| m2244_9(ClassWithDestructor) = Chi : total:m2243_9, partial:m2244_8 +# 2241| v2241_5(void) = ReturnVoid : +# 2241| v2241_6(void) = AliasedUse : ~m2244_6 +# 2241| v2241_7(void) = ExitFunction : -# 2245| void static_variable_with_destructor_3() -# 2245| Block 0 -# 2245| v2245_1(void) = EnterFunction : -# 2245| m2245_2(unknown) = AliasedDefinition : -# 2245| m2245_3(unknown) = InitializeNonLocal : -# 2245| m2245_4(unknown) = Chi : total:m2245_2, partial:m2245_3 -# 2246| r2246_1(glval) = VariableAddress[a] : -# 2246| m2246_2(ClassWithDestructor) = Uninitialized[a] : &:r2246_1 -# 2246| r2246_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2246| v2246_4(void) = Call[ClassWithDestructor] : func:r2246_3, this:r2246_1 -# 2246| m2246_5(unknown) = ^CallSideEffect : ~m2245_4 -# 2246| m2246_6(unknown) = Chi : total:m2245_4, partial:m2246_5 -# 2246| m2246_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2246_1 -# 2246| m2246_8(ClassWithDestructor) = Chi : total:m2246_2, partial:m2246_7 -# 2247| r2247_1(glval) = VariableAddress[b] : -# 2247| m2247_2(ClassWithDestructor) = Uninitialized[b] : &:r2247_1 +# 2246| void static_variable_with_destructor_3() +# 2246| Block 0 +# 2246| v2246_1(void) = EnterFunction : +# 2246| m2246_2(unknown) = AliasedDefinition : +# 2246| m2246_3(unknown) = InitializeNonLocal : +# 2246| m2246_4(unknown) = Chi : total:m2246_2, partial:m2246_3 +# 2247| r2247_1(glval) = VariableAddress[a] : +# 2247| m2247_2(ClassWithDestructor) = Uninitialized[a] : &:r2247_1 # 2247| r2247_3(glval) = FunctionAddress[ClassWithDestructor] : # 2247| v2247_4(void) = Call[ClassWithDestructor] : func:r2247_3, this:r2247_1 -# 2247| m2247_5(unknown) = ^CallSideEffect : ~m2246_6 -# 2247| m2247_6(unknown) = Chi : total:m2246_6, partial:m2247_5 +# 2247| m2247_5(unknown) = ^CallSideEffect : ~m2246_4 +# 2247| m2247_6(unknown) = Chi : total:m2246_4, partial:m2247_5 # 2247| m2247_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2247_1 # 2247| m2247_8(ClassWithDestructor) = Chi : total:m2247_2, partial:m2247_7 -# 2248| r2248_1(glval) = VariableAddress[c#init] : -# 2248| r2248_2(bool) = Load[c#init] : &:r2248_1, ~m2247_6 -# 2248| v2248_3(void) = ConditionalBranch : r2248_2 +# 2248| r2248_1(glval) = VariableAddress[b] : +# 2248| m2248_2(ClassWithDestructor) = Uninitialized[b] : &:r2248_1 +# 2248| r2248_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2248| v2248_4(void) = Call[ClassWithDestructor] : func:r2248_3, this:r2248_1 +# 2248| m2248_5(unknown) = ^CallSideEffect : ~m2247_6 +# 2248| m2248_6(unknown) = Chi : total:m2247_6, partial:m2248_5 +# 2248| m2248_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2248_1 +# 2248| m2248_8(ClassWithDestructor) = Chi : total:m2248_2, partial:m2248_7 +# 2249| r2249_1(glval) = VariableAddress[c#init] : +# 2249| r2249_2(bool) = Load[c#init] : &:r2249_1, ~m2248_6 +# 2249| v2249_3(void) = ConditionalBranch : r2249_2 #-----| False -> Block 1 #-----| True -> Block 2 -# 2248| Block 1 -# 2248| r2248_4(glval) = VariableAddress[c] : +# 2249| Block 1 +# 2249| r2249_4(glval) = VariableAddress[c] : #-----| r0_1(glval) = FunctionAddress[ClassWithDestructor] : -#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2248_4 -#-----| m0_3(unknown) = ^CallSideEffect : ~m2247_6 -#-----| m0_4(unknown) = Chi : total:m2247_6, partial:m0_3 -#-----| m0_5(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2248_4 +#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2249_4 +#-----| m0_3(unknown) = ^CallSideEffect : ~m2248_6 +#-----| m0_4(unknown) = Chi : total:m2248_6, partial:m0_3 +#-----| m0_5(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2249_4 #-----| m0_6(unknown) = Chi : total:m0_4, partial:m0_5 -# 2248| r2248_5(bool) = Constant[1] : -# 2248| m2248_6(bool) = Store[c#init] : &:r2248_1, r2248_5 -# 2248| m2248_7(unknown) = Chi : total:m0_6, partial:m2248_6 +# 2249| r2249_5(bool) = Constant[1] : +# 2249| m2249_6(bool) = Store[c#init] : &:r2249_1, r2249_5 +# 2249| m2249_7(unknown) = Chi : total:m0_6, partial:m2249_6 #-----| Goto -> Block 2 -# 2249| Block 2 -# 2249| m2249_1(unknown) = Phi : from 0:~m2247_6, from 1:~m2248_7 -# 2249| v2249_2(void) = NoOp : -# 2249| r2249_3(glval) = VariableAddress[b] : -# 2249| r2249_4(glval) = FunctionAddress[~ClassWithDestructor] : -# 2249| v2249_5(void) = Call[~ClassWithDestructor] : func:r2249_4, this:r2249_3 -# 2249| m2249_6(unknown) = ^CallSideEffect : ~m2249_1 -# 2249| m2249_7(unknown) = Chi : total:m2249_1, partial:m2249_6 -# 2249| v2249_8(void) = ^IndirectReadSideEffect[-1] : &:r2249_3, m2247_8 -# 2249| m2249_9(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2249_3 -# 2249| m2249_10(ClassWithDestructor) = Chi : total:m2247_8, partial:m2249_9 -# 2249| r2249_11(glval) = VariableAddress[a] : -# 2249| r2249_12(glval) = FunctionAddress[~ClassWithDestructor] : -# 2249| v2249_13(void) = Call[~ClassWithDestructor] : func:r2249_12, this:r2249_11 -# 2249| m2249_14(unknown) = ^CallSideEffect : ~m2249_7 -# 2249| m2249_15(unknown) = Chi : total:m2249_7, partial:m2249_14 -# 2249| v2249_16(void) = ^IndirectReadSideEffect[-1] : &:r2249_11, m2246_8 -# 2249| m2249_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2249_11 -# 2249| m2249_18(ClassWithDestructor) = Chi : total:m2246_8, partial:m2249_17 -# 2245| v2245_5(void) = ReturnVoid : -# 2245| v2245_6(void) = AliasedUse : ~m2249_15 -# 2245| v2245_7(void) = ExitFunction : +# 2250| Block 2 +# 2250| m2250_1(unknown) = Phi : from 0:~m2248_6, from 1:~m2249_7 +# 2250| v2250_2(void) = NoOp : +# 2250| r2250_3(glval) = VariableAddress[b] : +# 2250| r2250_4(glval) = FunctionAddress[~ClassWithDestructor] : +# 2250| v2250_5(void) = Call[~ClassWithDestructor] : func:r2250_4, this:r2250_3 +# 2250| m2250_6(unknown) = ^CallSideEffect : ~m2250_1 +# 2250| m2250_7(unknown) = Chi : total:m2250_1, partial:m2250_6 +# 2250| v2250_8(void) = ^IndirectReadSideEffect[-1] : &:r2250_3, m2248_8 +# 2250| m2250_9(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2250_3 +# 2250| m2250_10(ClassWithDestructor) = Chi : total:m2248_8, partial:m2250_9 +# 2250| r2250_11(glval) = VariableAddress[a] : +# 2250| r2250_12(glval) = FunctionAddress[~ClassWithDestructor] : +# 2250| v2250_13(void) = Call[~ClassWithDestructor] : func:r2250_12, this:r2250_11 +# 2250| m2250_14(unknown) = ^CallSideEffect : ~m2250_7 +# 2250| m2250_15(unknown) = Chi : total:m2250_7, partial:m2250_14 +# 2250| v2250_16(void) = ^IndirectReadSideEffect[-1] : &:r2250_11, m2247_8 +# 2250| m2250_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2250_11 +# 2250| m2250_18(ClassWithDestructor) = Chi : total:m2247_8, partial:m2250_17 +# 2246| v2246_5(void) = ReturnVoid : +# 2246| v2246_6(void) = AliasedUse : ~m2250_15 +# 2246| v2246_7(void) = ExitFunction : -# 2251| ClassWithDestructor global_class_with_destructor -# 2251| Block 0 -# 2251| v2251_1(void) = EnterFunction : -# 2251| m2251_2(unknown) = AliasedDefinition : -# 2251| r2251_3(glval) = VariableAddress[global_class_with_destructor] : -# 2251| r2251_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2251| v2251_5(void) = Call[ClassWithDestructor] : func:r2251_4, this:r2251_3 -# 2251| m2251_6(unknown) = ^CallSideEffect : ~m2251_2 -# 2251| m2251_7(unknown) = Chi : total:m2251_2, partial:m2251_6 -# 2251| m2251_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2251_3 -# 2251| m2251_9(unknown) = Chi : total:m2251_7, partial:m2251_8 -# 2251| v2251_10(void) = ReturnVoid : -# 2251| v2251_11(void) = AliasedUse : ~m2251_9 -# 2251| v2251_12(void) = ExitFunction : +# 2252| ClassWithDestructor global_class_with_destructor +# 2252| Block 0 +# 2252| v2252_1(void) = EnterFunction : +# 2252| m2252_2(unknown) = AliasedDefinition : +# 2252| r2252_3(glval) = VariableAddress[global_class_with_destructor] : +# 2252| r2252_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2252| v2252_5(void) = Call[ClassWithDestructor] : func:r2252_4, this:r2252_3 +# 2252| m2252_6(unknown) = ^CallSideEffect : ~m2252_2 +# 2252| m2252_7(unknown) = Chi : total:m2252_2, partial:m2252_6 +# 2252| m2252_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2252_3 +# 2252| m2252_9(unknown) = Chi : total:m2252_7, partial:m2252_8 +# 2252| v2252_10(void) = ReturnVoid : +# 2252| v2252_11(void) = AliasedUse : ~m2252_9 +# 2252| v2252_12(void) = ExitFunction : -# 2255| ClassWithDestructor& vacuous_destructor_call::get(ClassWithDestructor&) -# 2255| Block 0 -# 2255| v2255_1(void) = EnterFunction : -# 2255| m2255_2(unknown) = AliasedDefinition : -# 2255| m2255_3(unknown) = InitializeNonLocal : -# 2255| m2255_4(unknown) = Chi : total:m2255_2, partial:m2255_3 -# 2255| r2255_5(glval) = VariableAddress[t] : -# 2255| m2255_6(ClassWithDestructor &) = InitializeParameter[t] : &:r2255_5 -# 2255| r2255_7(ClassWithDestructor &) = Load[t] : &:r2255_5, m2255_6 -# 2255| m2255_8(unknown) = InitializeIndirection[t] : &:r2255_7 -# 2255| r2255_9(glval) = VariableAddress[#return] : -# 2255| r2255_10(glval) = VariableAddress[t] : -# 2255| r2255_11(ClassWithDestructor &) = Load[t] : &:r2255_10, m2255_6 -# 2255| r2255_12(glval) = CopyValue : r2255_11 -# 2255| r2255_13(ClassWithDestructor &) = CopyValue : r2255_12 -# 2255| m2255_14(ClassWithDestructor &) = Store[#return] : &:r2255_9, r2255_13 -# 2255| v2255_15(void) = ReturnIndirection[t] : &:r2255_7, m2255_8 -# 2255| r2255_16(glval) = VariableAddress[#return] : -# 2255| v2255_17(void) = ReturnValue : &:r2255_16, m2255_14 -# 2255| v2255_18(void) = AliasedUse : m2255_3 -# 2255| v2255_19(void) = ExitFunction : +# 2256| ClassWithDestructor& vacuous_destructor_call::get(ClassWithDestructor&) +# 2256| Block 0 +# 2256| v2256_1(void) = EnterFunction : +# 2256| m2256_2(unknown) = AliasedDefinition : +# 2256| m2256_3(unknown) = InitializeNonLocal : +# 2256| m2256_4(unknown) = Chi : total:m2256_2, partial:m2256_3 +# 2256| r2256_5(glval) = VariableAddress[t] : +# 2256| m2256_6(ClassWithDestructor &) = InitializeParameter[t] : &:r2256_5 +# 2256| r2256_7(ClassWithDestructor &) = Load[t] : &:r2256_5, m2256_6 +# 2256| m2256_8(unknown) = InitializeIndirection[t] : &:r2256_7 +# 2256| r2256_9(glval) = VariableAddress[#return] : +# 2256| r2256_10(glval) = VariableAddress[t] : +# 2256| r2256_11(ClassWithDestructor &) = Load[t] : &:r2256_10, m2256_6 +# 2256| r2256_12(glval) = CopyValue : r2256_11 +# 2256| r2256_13(ClassWithDestructor &) = CopyValue : r2256_12 +# 2256| m2256_14(ClassWithDestructor &) = Store[#return] : &:r2256_9, r2256_13 +# 2256| v2256_15(void) = ReturnIndirection[t] : &:r2256_7, m2256_8 +# 2256| r2256_16(glval) = VariableAddress[#return] : +# 2256| v2256_17(void) = ReturnValue : &:r2256_16, m2256_14 +# 2256| v2256_18(void) = AliasedUse : m2256_3 +# 2256| v2256_19(void) = ExitFunction : -# 2255| int& vacuous_destructor_call::get(int&) -# 2255| Block 0 -# 2255| v2255_1(void) = EnterFunction : -# 2255| m2255_2(unknown) = AliasedDefinition : -# 2255| m2255_3(unknown) = InitializeNonLocal : -# 2255| m2255_4(unknown) = Chi : total:m2255_2, partial:m2255_3 -# 2255| r2255_5(glval) = VariableAddress[t] : -# 2255| m2255_6(int &) = InitializeParameter[t] : &:r2255_5 -# 2255| r2255_7(int &) = Load[t] : &:r2255_5, m2255_6 -# 2255| m2255_8(unknown) = InitializeIndirection[t] : &:r2255_7 -# 2255| r2255_9(glval) = VariableAddress[#return] : -# 2255| r2255_10(glval) = VariableAddress[t] : -# 2255| r2255_11(int &) = Load[t] : &:r2255_10, m2255_6 -# 2255| r2255_12(glval) = CopyValue : r2255_11 -# 2255| r2255_13(int &) = CopyValue : r2255_12 -# 2255| m2255_14(int &) = Store[#return] : &:r2255_9, r2255_13 -# 2255| v2255_15(void) = ReturnIndirection[t] : &:r2255_7, m2255_8 -# 2255| r2255_16(glval) = VariableAddress[#return] : -# 2255| v2255_17(void) = ReturnValue : &:r2255_16, m2255_14 -# 2255| v2255_18(void) = AliasedUse : m2255_3 -# 2255| v2255_19(void) = ExitFunction : +# 2256| int& vacuous_destructor_call::get(int&) +# 2256| Block 0 +# 2256| v2256_1(void) = EnterFunction : +# 2256| m2256_2(unknown) = AliasedDefinition : +# 2256| m2256_3(unknown) = InitializeNonLocal : +# 2256| m2256_4(unknown) = Chi : total:m2256_2, partial:m2256_3 +# 2256| r2256_5(glval) = VariableAddress[t] : +# 2256| m2256_6(int &) = InitializeParameter[t] : &:r2256_5 +# 2256| r2256_7(int &) = Load[t] : &:r2256_5, m2256_6 +# 2256| m2256_8(unknown) = InitializeIndirection[t] : &:r2256_7 +# 2256| r2256_9(glval) = VariableAddress[#return] : +# 2256| r2256_10(glval) = VariableAddress[t] : +# 2256| r2256_11(int &) = Load[t] : &:r2256_10, m2256_6 +# 2256| r2256_12(glval) = CopyValue : r2256_11 +# 2256| r2256_13(int &) = CopyValue : r2256_12 +# 2256| m2256_14(int &) = Store[#return] : &:r2256_9, r2256_13 +# 2256| v2256_15(void) = ReturnIndirection[t] : &:r2256_7, m2256_8 +# 2256| r2256_16(glval) = VariableAddress[#return] : +# 2256| v2256_17(void) = ReturnValue : &:r2256_16, m2256_14 +# 2256| v2256_18(void) = AliasedUse : m2256_3 +# 2256| v2256_19(void) = ExitFunction : -# 2258| void vacuous_destructor_call::call_destructor(ClassWithDestructor&) -# 2258| Block 0 -# 2258| v2258_1(void) = EnterFunction : -# 2258| m2258_2(unknown) = AliasedDefinition : -# 2258| m2258_3(unknown) = InitializeNonLocal : -# 2258| m2258_4(unknown) = Chi : total:m2258_2, partial:m2258_3 -# 2258| r2258_5(glval) = VariableAddress[t] : -# 2258| m2258_6(ClassWithDestructor &) = InitializeParameter[t] : &:r2258_5 -# 2258| r2258_7(ClassWithDestructor &) = Load[t] : &:r2258_5, m2258_6 -# 2258| m2258_8(unknown) = InitializeIndirection[t] : &:r2258_7 -# 2259| r2259_1(glval) = FunctionAddress[get] : -# 2259| r2259_2(glval) = VariableAddress[t] : -# 2259| r2259_3(ClassWithDestructor &) = Load[t] : &:r2259_2, m2258_6 -# 2259| r2259_4(glval) = CopyValue : r2259_3 -# 2259| r2259_5(ClassWithDestructor &) = CopyValue : r2259_4 -# 2259| r2259_6(ClassWithDestructor &) = Call[get] : func:r2259_1, 0:r2259_5 -# 2259| m2259_7(unknown) = ^CallSideEffect : ~m2258_4 -# 2259| m2259_8(unknown) = Chi : total:m2258_4, partial:m2259_7 -# 2259| v2259_9(void) = ^BufferReadSideEffect[0] : &:r2259_5, ~m2258_8 -# 2259| m2259_10(unknown) = ^BufferMayWriteSideEffect[0] : &:r2259_5 -# 2259| m2259_11(unknown) = Chi : total:m2258_8, partial:m2259_10 -# 2259| r2259_12(glval) = CopyValue : r2259_6 -# 2259| r2259_13(glval) = FunctionAddress[~ClassWithDestructor] : -# 2259| v2259_14(void) = Call[~ClassWithDestructor] : func:r2259_13 -# 2259| m2259_15(unknown) = ^CallSideEffect : ~m2259_8 -# 2259| m2259_16(unknown) = Chi : total:m2259_8, partial:m2259_15 -# 2259| v2259_17(void) = ^IndirectReadSideEffect[-1] : &:r2259_12, ~m2259_11 -# 2259| m2259_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2259_12 -# 2259| m2259_19(unknown) = Chi : total:m2259_11, partial:m2259_18 -# 2260| v2260_1(void) = NoOp : -# 2258| v2258_9(void) = ReturnIndirection[t] : &:r2258_7, m2259_19 -# 2258| v2258_10(void) = ReturnVoid : -# 2258| v2258_11(void) = AliasedUse : ~m2259_16 -# 2258| v2258_12(void) = ExitFunction : +# 2259| void vacuous_destructor_call::call_destructor(ClassWithDestructor&) +# 2259| Block 0 +# 2259| v2259_1(void) = EnterFunction : +# 2259| m2259_2(unknown) = AliasedDefinition : +# 2259| m2259_3(unknown) = InitializeNonLocal : +# 2259| m2259_4(unknown) = Chi : total:m2259_2, partial:m2259_3 +# 2259| r2259_5(glval) = VariableAddress[t] : +# 2259| m2259_6(ClassWithDestructor &) = InitializeParameter[t] : &:r2259_5 +# 2259| r2259_7(ClassWithDestructor &) = Load[t] : &:r2259_5, m2259_6 +# 2259| m2259_8(unknown) = InitializeIndirection[t] : &:r2259_7 +# 2260| r2260_1(glval) = FunctionAddress[get] : +# 2260| r2260_2(glval) = VariableAddress[t] : +# 2260| r2260_3(ClassWithDestructor &) = Load[t] : &:r2260_2, m2259_6 +# 2260| r2260_4(glval) = CopyValue : r2260_3 +# 2260| r2260_5(ClassWithDestructor &) = CopyValue : r2260_4 +# 2260| r2260_6(ClassWithDestructor &) = Call[get] : func:r2260_1, 0:r2260_5 +# 2260| m2260_7(unknown) = ^CallSideEffect : ~m2259_4 +# 2260| m2260_8(unknown) = Chi : total:m2259_4, partial:m2260_7 +# 2260| v2260_9(void) = ^BufferReadSideEffect[0] : &:r2260_5, ~m2259_8 +# 2260| m2260_10(unknown) = ^BufferMayWriteSideEffect[0] : &:r2260_5 +# 2260| m2260_11(unknown) = Chi : total:m2259_8, partial:m2260_10 +# 2260| r2260_12(glval) = CopyValue : r2260_6 +# 2260| r2260_13(glval) = FunctionAddress[~ClassWithDestructor] : +# 2260| v2260_14(void) = Call[~ClassWithDestructor] : func:r2260_13 +# 2260| m2260_15(unknown) = ^CallSideEffect : ~m2260_8 +# 2260| m2260_16(unknown) = Chi : total:m2260_8, partial:m2260_15 +# 2260| v2260_17(void) = ^IndirectReadSideEffect[-1] : &:r2260_12, ~m2260_11 +# 2260| m2260_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2260_12 +# 2260| m2260_19(unknown) = Chi : total:m2260_11, partial:m2260_18 +# 2261| v2261_1(void) = NoOp : +# 2259| v2259_9(void) = ReturnIndirection[t] : &:r2259_7, m2260_19 +# 2259| v2259_10(void) = ReturnVoid : +# 2259| v2259_11(void) = AliasedUse : ~m2260_16 +# 2259| v2259_12(void) = ExitFunction : -# 2258| void vacuous_destructor_call::call_destructor(int&) -# 2258| Block 0 -# 2258| v2258_1(void) = EnterFunction : -# 2258| m2258_2(unknown) = AliasedDefinition : -# 2258| m2258_3(unknown) = InitializeNonLocal : -# 2258| m2258_4(unknown) = Chi : total:m2258_2, partial:m2258_3 -# 2258| r2258_5(glval) = VariableAddress[t] : -# 2258| m2258_6(int &) = InitializeParameter[t] : &:r2258_5 -# 2258| r2258_7(int &) = Load[t] : &:r2258_5, m2258_6 -# 2258| m2258_8(unknown) = InitializeIndirection[t] : &:r2258_7 -# 2259| r2259_1(glval) = FunctionAddress[get] : -# 2259| r2259_2(glval) = VariableAddress[t] : -# 2259| r2259_3(int &) = Load[t] : &:r2259_2, m2258_6 -# 2259| r2259_4(glval) = CopyValue : r2259_3 -# 2259| r2259_5(int &) = CopyValue : r2259_4 -# 2259| r2259_6(int &) = Call[get] : func:r2259_1, 0:r2259_5 -# 2259| m2259_7(unknown) = ^CallSideEffect : ~m2258_4 -# 2259| m2259_8(unknown) = Chi : total:m2258_4, partial:m2259_7 -# 2259| v2259_9(void) = ^BufferReadSideEffect[0] : &:r2259_5, ~m2258_8 -# 2259| m2259_10(unknown) = ^BufferMayWriteSideEffect[0] : &:r2259_5 -# 2259| m2259_11(unknown) = Chi : total:m2258_8, partial:m2259_10 -# 2259| r2259_12(glval) = CopyValue : r2259_6 -# 2260| v2260_1(void) = NoOp : -# 2258| v2258_9(void) = ReturnIndirection[t] : &:r2258_7, m2259_11 -# 2258| v2258_10(void) = ReturnVoid : -# 2258| v2258_11(void) = AliasedUse : ~m2259_8 -# 2258| v2258_12(void) = ExitFunction : +# 2259| void vacuous_destructor_call::call_destructor(int&) +# 2259| Block 0 +# 2259| v2259_1(void) = EnterFunction : +# 2259| m2259_2(unknown) = AliasedDefinition : +# 2259| m2259_3(unknown) = InitializeNonLocal : +# 2259| m2259_4(unknown) = Chi : total:m2259_2, partial:m2259_3 +# 2259| r2259_5(glval) = VariableAddress[t] : +# 2259| m2259_6(int &) = InitializeParameter[t] : &:r2259_5 +# 2259| r2259_7(int &) = Load[t] : &:r2259_5, m2259_6 +# 2259| m2259_8(unknown) = InitializeIndirection[t] : &:r2259_7 +# 2260| r2260_1(glval) = FunctionAddress[get] : +# 2260| r2260_2(glval) = VariableAddress[t] : +# 2260| r2260_3(int &) = Load[t] : &:r2260_2, m2259_6 +# 2260| r2260_4(glval) = CopyValue : r2260_3 +# 2260| r2260_5(int &) = CopyValue : r2260_4 +# 2260| r2260_6(int &) = Call[get] : func:r2260_1, 0:r2260_5 +# 2260| m2260_7(unknown) = ^CallSideEffect : ~m2259_4 +# 2260| m2260_8(unknown) = Chi : total:m2259_4, partial:m2260_7 +# 2260| v2260_9(void) = ^BufferReadSideEffect[0] : &:r2260_5, ~m2259_8 +# 2260| m2260_10(unknown) = ^BufferMayWriteSideEffect[0] : &:r2260_5 +# 2260| m2260_11(unknown) = Chi : total:m2259_8, partial:m2260_10 +# 2260| r2260_12(glval) = CopyValue : r2260_6 +# 2261| v2261_1(void) = NoOp : +# 2259| v2259_9(void) = ReturnIndirection[t] : &:r2259_7, m2260_11 +# 2259| v2259_10(void) = ReturnVoid : +# 2259| v2259_11(void) = AliasedUse : ~m2260_8 +# 2259| v2259_12(void) = ExitFunction : -# 2262| void vacuous_destructor_call::non_vacuous_destructor_call() -# 2262| Block 0 -# 2262| v2262_1(void) = EnterFunction : -# 2262| m2262_2(unknown) = AliasedDefinition : -# 2262| m2262_3(unknown) = InitializeNonLocal : -# 2262| m2262_4(unknown) = Chi : total:m2262_2, partial:m2262_3 -# 2263| r2263_1(glval) = VariableAddress[c] : -# 2263| m2263_2(ClassWithDestructor) = Uninitialized[c] : &:r2263_1 -# 2263| r2263_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2263| v2263_4(void) = Call[ClassWithDestructor] : func:r2263_3, this:r2263_1 -# 2263| m2263_5(unknown) = ^CallSideEffect : ~m2262_4 -# 2263| m2263_6(unknown) = Chi : total:m2262_4, partial:m2263_5 -# 2263| m2263_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2263_1 -# 2263| m2263_8(ClassWithDestructor) = Chi : total:m2263_2, partial:m2263_7 -# 2264| r2264_1(glval) = FunctionAddress[call_destructor] : -# 2264| r2264_2(glval) = VariableAddress[c] : -# 2264| r2264_3(ClassWithDestructor &) = CopyValue : r2264_2 -# 2264| v2264_4(void) = Call[call_destructor] : func:r2264_1, 0:r2264_3 -# 2264| m2264_5(unknown) = ^CallSideEffect : ~m2263_6 -# 2264| m2264_6(unknown) = Chi : total:m2263_6, partial:m2264_5 -# 2264| v2264_7(void) = ^BufferReadSideEffect[0] : &:r2264_3, ~m2263_8 -# 2264| m2264_8(unknown) = ^BufferMayWriteSideEffect[0] : &:r2264_3 -# 2264| m2264_9(ClassWithDestructor) = Chi : total:m2263_8, partial:m2264_8 -# 2265| v2265_1(void) = NoOp : +# 2263| void vacuous_destructor_call::non_vacuous_destructor_call() +# 2263| Block 0 +# 2263| v2263_1(void) = EnterFunction : +# 2263| m2263_2(unknown) = AliasedDefinition : +# 2263| m2263_3(unknown) = InitializeNonLocal : +# 2263| m2263_4(unknown) = Chi : total:m2263_2, partial:m2263_3 +# 2264| r2264_1(glval) = VariableAddress[c] : +# 2264| m2264_2(ClassWithDestructor) = Uninitialized[c] : &:r2264_1 +# 2264| r2264_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2264| v2264_4(void) = Call[ClassWithDestructor] : func:r2264_3, this:r2264_1 +# 2264| m2264_5(unknown) = ^CallSideEffect : ~m2263_4 +# 2264| m2264_6(unknown) = Chi : total:m2263_4, partial:m2264_5 +# 2264| m2264_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2264_1 +# 2264| m2264_8(ClassWithDestructor) = Chi : total:m2264_2, partial:m2264_7 +# 2265| r2265_1(glval) = FunctionAddress[call_destructor] : # 2265| r2265_2(glval) = VariableAddress[c] : -# 2265| r2265_3(glval) = FunctionAddress[~ClassWithDestructor] : -# 2265| v2265_4(void) = Call[~ClassWithDestructor] : func:r2265_3, this:r2265_2 +# 2265| r2265_3(ClassWithDestructor &) = CopyValue : r2265_2 +# 2265| v2265_4(void) = Call[call_destructor] : func:r2265_1, 0:r2265_3 # 2265| m2265_5(unknown) = ^CallSideEffect : ~m2264_6 # 2265| m2265_6(unknown) = Chi : total:m2264_6, partial:m2265_5 -# 2265| v2265_7(void) = ^IndirectReadSideEffect[-1] : &:r2265_2, m2264_9 -# 2265| m2265_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2265_2 -# 2265| m2265_9(ClassWithDestructor) = Chi : total:m2264_9, partial:m2265_8 -# 2262| v2262_5(void) = ReturnVoid : -# 2262| v2262_6(void) = AliasedUse : ~m2265_6 -# 2262| v2262_7(void) = ExitFunction : +# 2265| v2265_7(void) = ^BufferReadSideEffect[0] : &:r2265_3, ~m2264_8 +# 2265| m2265_8(unknown) = ^BufferMayWriteSideEffect[0] : &:r2265_3 +# 2265| m2265_9(ClassWithDestructor) = Chi : total:m2264_8, partial:m2265_8 +# 2266| v2266_1(void) = NoOp : +# 2266| r2266_2(glval) = VariableAddress[c] : +# 2266| r2266_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2266| v2266_4(void) = Call[~ClassWithDestructor] : func:r2266_3, this:r2266_2 +# 2266| m2266_5(unknown) = ^CallSideEffect : ~m2265_6 +# 2266| m2266_6(unknown) = Chi : total:m2265_6, partial:m2266_5 +# 2266| v2266_7(void) = ^IndirectReadSideEffect[-1] : &:r2266_2, m2265_9 +# 2266| m2266_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2266_2 +# 2266| m2266_9(ClassWithDestructor) = Chi : total:m2265_9, partial:m2266_8 +# 2263| v2263_5(void) = ReturnVoid : +# 2263| v2263_6(void) = AliasedUse : ~m2266_6 +# 2263| v2263_7(void) = ExitFunction : -# 2267| void vacuous_destructor_call::vacuous_destructor_call() -# 2267| Block 0 -# 2267| v2267_1(void) = EnterFunction : -# 2267| m2267_2(unknown) = AliasedDefinition : -# 2267| m2267_3(unknown) = InitializeNonLocal : -# 2267| m2267_4(unknown) = Chi : total:m2267_2, partial:m2267_3 -# 2268| r2268_1(glval) = VariableAddress[i] : -# 2268| m2268_2(int) = Uninitialized[i] : &:r2268_1 -# 2269| r2269_1(glval) = FunctionAddress[call_destructor] : -# 2269| r2269_2(glval) = VariableAddress[i] : -# 2269| r2269_3(int &) = CopyValue : r2269_2 -# 2269| v2269_4(void) = Call[call_destructor] : func:r2269_1, 0:r2269_3 -# 2269| m2269_5(unknown) = ^CallSideEffect : ~m2267_4 -# 2269| m2269_6(unknown) = Chi : total:m2267_4, partial:m2269_5 -# 2269| v2269_7(void) = ^BufferReadSideEffect[0] : &:r2269_3, ~m2268_2 -# 2269| m2269_8(unknown) = ^BufferMayWriteSideEffect[0] : &:r2269_3 -# 2269| m2269_9(int) = Chi : total:m2268_2, partial:m2269_8 -# 2270| v2270_1(void) = NoOp : -# 2267| v2267_5(void) = ReturnVoid : -# 2267| v2267_6(void) = AliasedUse : ~m2269_6 -# 2267| v2267_7(void) = ExitFunction : +# 2268| void vacuous_destructor_call::vacuous_destructor_call() +# 2268| Block 0 +# 2268| v2268_1(void) = EnterFunction : +# 2268| m2268_2(unknown) = AliasedDefinition : +# 2268| m2268_3(unknown) = InitializeNonLocal : +# 2268| m2268_4(unknown) = Chi : total:m2268_2, partial:m2268_3 +# 2269| r2269_1(glval) = VariableAddress[i] : +# 2269| m2269_2(int) = Uninitialized[i] : &:r2269_1 +# 2270| r2270_1(glval) = FunctionAddress[call_destructor] : +# 2270| r2270_2(glval) = VariableAddress[i] : +# 2270| r2270_3(int &) = CopyValue : r2270_2 +# 2270| v2270_4(void) = Call[call_destructor] : func:r2270_1, 0:r2270_3 +# 2270| m2270_5(unknown) = ^CallSideEffect : ~m2268_4 +# 2270| m2270_6(unknown) = Chi : total:m2268_4, partial:m2270_5 +# 2270| v2270_7(void) = ^BufferReadSideEffect[0] : &:r2270_3, ~m2269_2 +# 2270| m2270_8(unknown) = ^BufferMayWriteSideEffect[0] : &:r2270_3 +# 2270| m2270_9(int) = Chi : total:m2269_2, partial:m2270_8 +# 2271| v2271_1(void) = NoOp : +# 2268| v2268_5(void) = ReturnVoid : +# 2268| v2268_6(void) = AliasedUse : ~m2270_6 +# 2268| v2268_7(void) = ExitFunction : -# 2273| void TryCatchDestructors(bool) -# 2273| Block 0 -# 2273| v2273_1(void) = EnterFunction : -# 2273| m2273_2(unknown) = AliasedDefinition : -# 2273| m2273_3(unknown) = InitializeNonLocal : -# 2273| m2273_4(unknown) = Chi : total:m2273_2, partial:m2273_3 -# 2273| r2273_5(glval) = VariableAddress[b] : -# 2273| m2273_6(bool) = InitializeParameter[b] : &:r2273_5 -# 2275| r2275_1(glval) = VariableAddress[s] : -# 2275| m2275_2(String) = Uninitialized[s] : &:r2275_1 -# 2275| m2275_3(unknown) = Chi : total:m2273_4, partial:m2275_2 -# 2275| r2275_4(glval) = FunctionAddress[String] : -# 2275| v2275_5(void) = Call[String] : func:r2275_4, this:r2275_1 -# 2275| m2275_6(unknown) = ^CallSideEffect : ~m2275_3 -# 2275| m2275_7(unknown) = Chi : total:m2275_3, partial:m2275_6 -# 2275| m2275_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2275_1 -# 2275| m2275_9(unknown) = Chi : total:m2275_7, partial:m2275_8 -# 2276| r2276_1(glval) = VariableAddress[b] : -# 2276| r2276_2(bool) = Load[b] : &:r2276_1, m2273_6 -# 2276| v2276_3(void) = ConditionalBranch : r2276_2 +# 2274| void TryCatchDestructors(bool) +# 2274| Block 0 +# 2274| v2274_1(void) = EnterFunction : +# 2274| m2274_2(unknown) = AliasedDefinition : +# 2274| m2274_3(unknown) = InitializeNonLocal : +# 2274| m2274_4(unknown) = Chi : total:m2274_2, partial:m2274_3 +# 2274| r2274_5(glval) = VariableAddress[b] : +# 2274| m2274_6(bool) = InitializeParameter[b] : &:r2274_5 +# 2276| r2276_1(glval) = VariableAddress[s] : +# 2276| m2276_2(String) = Uninitialized[s] : &:r2276_1 +# 2276| m2276_3(unknown) = Chi : total:m2274_4, partial:m2276_2 +# 2276| r2276_4(glval) = FunctionAddress[String] : +# 2276| v2276_5(void) = Call[String] : func:r2276_4, this:r2276_1 +# 2276| m2276_6(unknown) = ^CallSideEffect : ~m2276_3 +# 2276| m2276_7(unknown) = Chi : total:m2276_3, partial:m2276_6 +# 2276| m2276_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2276_1 +# 2276| m2276_9(unknown) = Chi : total:m2276_7, partial:m2276_8 +# 2277| r2277_1(glval) = VariableAddress[b] : +# 2277| r2277_2(bool) = Load[b] : &:r2277_1, m2274_6 +# 2277| v2277_3(void) = ConditionalBranch : r2277_2 #-----| False -> Block 4 #-----| True -> Block 3 -# 2273| Block 1 -# 2273| m2273_7(unknown) = Phi : from 2:~m2273_10, from 10:~m2289_1 -# 2273| v2273_8(void) = AliasedUse : ~m2273_7 -# 2273| v2273_9(void) = ExitFunction : +# 2274| Block 1 +# 2274| m2274_7(unknown) = Phi : from 2:~m2274_10, from 10:~m2290_1 +# 2274| v2274_8(void) = AliasedUse : ~m2274_7 +# 2274| v2274_9(void) = ExitFunction : -# 2273| Block 2 -# 2273| m2273_10(unknown) = Phi : from 6:~m2282_12, from 9:~m2280_8 -# 2273| v2273_11(void) = Unwind : +# 2274| Block 2 +# 2274| m2274_10(unknown) = Phi : from 6:~m2283_12, from 9:~m2281_8 +# 2274| v2274_11(void) = Unwind : #-----| Goto -> Block 1 -# 2277| Block 3 -# 2277| r2277_1(glval) = VariableAddress[#throw2277:7] : -# 2277| r2277_2(glval) = StringConstant["string literal"] : -# 2277| r2277_3(char *) = Convert : r2277_2 -# 2277| m2277_4(char *) = Store[#throw2277:7] : &:r2277_1, r2277_3 -# 2277| v2277_5(void) = ThrowValue : &:r2277_1, m2277_4 -# 2280| r2280_1(glval) = VariableAddress[s] : -# 2280| r2280_2(glval) = FunctionAddress[~String] : -# 2280| v2280_3(void) = Call[~String] : func:r2280_2, this:r2280_1 -# 2280| m2280_4(unknown) = ^CallSideEffect : ~m2275_9 -# 2280| m2280_5(unknown) = Chi : total:m2275_9, partial:m2280_4 -# 2280| v2280_6(void) = ^IndirectReadSideEffect[-1] : &:r2280_1, ~m2280_5 -# 2280| m2280_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_1 -# 2280| m2280_8(unknown) = Chi : total:m2280_5, partial:m2280_7 +# 2278| Block 3 +# 2278| r2278_1(glval) = VariableAddress[#throw2278:7] : +# 2278| r2278_2(glval) = StringConstant["string literal"] : +# 2278| r2278_3(char *) = Convert : r2278_2 +# 2278| m2278_4(char *) = Store[#throw2278:7] : &:r2278_1, r2278_3 +# 2278| v2278_5(void) = ThrowValue : &:r2278_1, m2278_4 +# 2281| r2281_1(glval) = VariableAddress[s] : +# 2281| r2281_2(glval) = FunctionAddress[~String] : +# 2281| v2281_3(void) = Call[~String] : func:r2281_2, this:r2281_1 +# 2281| m2281_4(unknown) = ^CallSideEffect : ~m2276_9 +# 2281| m2281_5(unknown) = Chi : total:m2276_9, partial:m2281_4 +# 2281| v2281_6(void) = ^IndirectReadSideEffect[-1] : &:r2281_1, ~m2281_5 +# 2281| m2281_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2281_1 +# 2281| m2281_8(unknown) = Chi : total:m2281_5, partial:m2281_7 #-----| Exception -> Block 5 -# 2279| Block 4 -# 2279| r2279_1(glval) = VariableAddress[s2] : -# 2279| m2279_2(String) = Uninitialized[s2] : &:r2279_1 -# 2279| m2279_3(unknown) = Chi : total:m2275_9, partial:m2279_2 -# 2279| r2279_4(glval) = FunctionAddress[String] : -# 2279| v2279_5(void) = Call[String] : func:r2279_4, this:r2279_1 -# 2279| m2279_6(unknown) = ^CallSideEffect : ~m2279_3 -# 2279| m2279_7(unknown) = Chi : total:m2279_3, partial:m2279_6 -# 2279| m2279_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2279_1 -# 2279| m2279_9(unknown) = Chi : total:m2279_7, partial:m2279_8 -# 2280| r2280_9(glval) = VariableAddress[s2] : -# 2280| r2280_10(glval) = FunctionAddress[~String] : -# 2280| v2280_11(void) = Call[~String] : func:r2280_10, this:r2280_9 -# 2280| m2280_12(unknown) = ^CallSideEffect : ~m2279_9 -# 2280| m2280_13(unknown) = Chi : total:m2279_9, partial:m2280_12 -# 2280| v2280_14(void) = ^IndirectReadSideEffect[-1] : &:r2280_9, ~m2280_13 -# 2280| m2280_15(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_9 -# 2280| m2280_16(unknown) = Chi : total:m2280_13, partial:m2280_15 -# 2280| r2280_17(glval) = VariableAddress[s] : -# 2280| r2280_18(glval) = FunctionAddress[~String] : -# 2280| v2280_19(void) = Call[~String] : func:r2280_18, this:r2280_17 -# 2280| m2280_20(unknown) = ^CallSideEffect : ~m2280_16 -# 2280| m2280_21(unknown) = Chi : total:m2280_16, partial:m2280_20 -# 2280| v2280_22(void) = ^IndirectReadSideEffect[-1] : &:r2280_17, ~m2280_21 -# 2280| m2280_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_17 -# 2280| m2280_24(unknown) = Chi : total:m2280_21, partial:m2280_23 +# 2280| Block 4 +# 2280| r2280_1(glval) = VariableAddress[s2] : +# 2280| m2280_2(String) = Uninitialized[s2] : &:r2280_1 +# 2280| m2280_3(unknown) = Chi : total:m2276_9, partial:m2280_2 +# 2280| r2280_4(glval) = FunctionAddress[String] : +# 2280| v2280_5(void) = Call[String] : func:r2280_4, this:r2280_1 +# 2280| m2280_6(unknown) = ^CallSideEffect : ~m2280_3 +# 2280| m2280_7(unknown) = Chi : total:m2280_3, partial:m2280_6 +# 2280| m2280_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_1 +# 2280| m2280_9(unknown) = Chi : total:m2280_7, partial:m2280_8 +# 2281| r2281_9(glval) = VariableAddress[s2] : +# 2281| r2281_10(glval) = FunctionAddress[~String] : +# 2281| v2281_11(void) = Call[~String] : func:r2281_10, this:r2281_9 +# 2281| m2281_12(unknown) = ^CallSideEffect : ~m2280_9 +# 2281| m2281_13(unknown) = Chi : total:m2280_9, partial:m2281_12 +# 2281| v2281_14(void) = ^IndirectReadSideEffect[-1] : &:r2281_9, ~m2281_13 +# 2281| m2281_15(String) = ^IndirectMayWriteSideEffect[-1] : &:r2281_9 +# 2281| m2281_16(unknown) = Chi : total:m2281_13, partial:m2281_15 +# 2281| r2281_17(glval) = VariableAddress[s] : +# 2281| r2281_18(glval) = FunctionAddress[~String] : +# 2281| v2281_19(void) = Call[~String] : func:r2281_18, this:r2281_17 +# 2281| m2281_20(unknown) = ^CallSideEffect : ~m2281_16 +# 2281| m2281_21(unknown) = Chi : total:m2281_16, partial:m2281_20 +# 2281| v2281_22(void) = ^IndirectReadSideEffect[-1] : &:r2281_17, ~m2281_21 +# 2281| m2281_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2281_17 +# 2281| m2281_24(unknown) = Chi : total:m2281_21, partial:m2281_23 #-----| Goto -> Block 10 -# 2281| Block 5 -# 2281| v2281_1(void) = CatchByType[const char *] : +# 2282| Block 5 +# 2282| v2282_1(void) = CatchByType[const char *] : #-----| Exception -> Block 7 #-----| Goto -> Block 6 -# 2281| Block 6 -# 2281| r2281_2(glval) = VariableAddress[s] : -# 2281| m2281_3(char *) = InitializeParameter[s] : &:r2281_2 -# 2281| r2281_4(char *) = Load[s] : &:r2281_2, m2281_3 -# 2281| m2281_5(unknown) = InitializeIndirection[s] : &:r2281_4 -# 2281| m2281_6(unknown) = Chi : total:m2280_8, partial:m2281_5 -# 2282| r2282_1(glval) = VariableAddress[#throw2282:5] : -# 2282| m2282_2(String) = Uninitialized[#throw2282:5] : &:r2282_1 -# 2282| m2282_3(unknown) = Chi : total:m2281_6, partial:m2282_2 -# 2282| r2282_4(glval) = FunctionAddress[String] : -# 2282| r2282_5(glval) = VariableAddress[s] : -# 2282| r2282_6(char *) = Load[s] : &:r2282_5, m2281_3 -# 2282| v2282_7(void) = Call[String] : func:r2282_4, this:r2282_1, 0:r2282_6 -# 2282| m2282_8(unknown) = ^CallSideEffect : ~m2282_3 -# 2282| m2282_9(unknown) = Chi : total:m2282_3, partial:m2282_8 -# 2282| v2282_10(void) = ^BufferReadSideEffect[0] : &:r2282_6, ~m2282_9 -# 2282| m2282_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2282_1 -# 2282| m2282_12(unknown) = Chi : total:m2282_9, partial:m2282_11 -# 2282| v2282_13(void) = ThrowValue : &:r2282_1, ~m2282_12 +# 2282| Block 6 +# 2282| r2282_2(glval) = VariableAddress[s] : +# 2282| m2282_3(char *) = InitializeParameter[s] : &:r2282_2 +# 2282| r2282_4(char *) = Load[s] : &:r2282_2, m2282_3 +# 2282| m2282_5(unknown) = InitializeIndirection[s] : &:r2282_4 +# 2282| m2282_6(unknown) = Chi : total:m2281_8, partial:m2282_5 +# 2283| r2283_1(glval) = VariableAddress[#throw2283:5] : +# 2283| m2283_2(String) = Uninitialized[#throw2283:5] : &:r2283_1 +# 2283| m2283_3(unknown) = Chi : total:m2282_6, partial:m2283_2 +# 2283| r2283_4(glval) = FunctionAddress[String] : +# 2283| r2283_5(glval) = VariableAddress[s] : +# 2283| r2283_6(char *) = Load[s] : &:r2283_5, m2282_3 +# 2283| v2283_7(void) = Call[String] : func:r2283_4, this:r2283_1, 0:r2283_6 +# 2283| m2283_8(unknown) = ^CallSideEffect : ~m2283_3 +# 2283| m2283_9(unknown) = Chi : total:m2283_3, partial:m2283_8 +# 2283| v2283_10(void) = ^BufferReadSideEffect[0] : &:r2283_6, ~m2283_9 +# 2283| m2283_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2283_1 +# 2283| m2283_12(unknown) = Chi : total:m2283_9, partial:m2283_11 +# 2283| v2283_13(void) = ThrowValue : &:r2283_1, ~m2283_12 #-----| Exception -> Block 2 -# 2284| Block 7 -# 2284| v2284_1(void) = CatchByType[const String &] : +# 2285| Block 7 +# 2285| v2285_1(void) = CatchByType[const String &] : #-----| Exception -> Block 9 #-----| Goto -> Block 8 -# 2284| Block 8 -# 2284| r2284_2(glval) = VariableAddress[e] : -# 2284| m2284_3(String &) = InitializeParameter[e] : &:r2284_2 -# 2284| r2284_4(String &) = Load[e] : &:r2284_2, m2284_3 -# 2284| m2284_5(unknown) = InitializeIndirection[e] : &:r2284_4 -# 2284| v2284_6(void) = NoOp : +# 2285| Block 8 +# 2285| r2285_2(glval) = VariableAddress[e] : +# 2285| m2285_3(String &) = InitializeParameter[e] : &:r2285_2 +# 2285| r2285_4(String &) = Load[e] : &:r2285_2, m2285_3 +# 2285| m2285_5(unknown) = InitializeIndirection[e] : &:r2285_4 +# 2285| v2285_6(void) = NoOp : #-----| Goto -> Block 10 -# 2286| Block 9 -# 2286| v2286_1(void) = CatchAny : -# 2287| v2287_1(void) = ReThrow : +# 2287| Block 9 +# 2287| v2287_1(void) = CatchAny : +# 2288| v2288_1(void) = ReThrow : #-----| Exception -> Block 2 -# 2289| Block 10 -# 2289| m2289_1(unknown) = Phi : from 4:~m2280_24, from 8:~m2280_8 -# 2289| v2289_2(void) = NoOp : -# 2273| v2273_12(void) = ReturnVoid : +# 2290| Block 10 +# 2290| m2290_1(unknown) = Phi : from 4:~m2281_24, from 8:~m2281_8 +# 2290| v2290_2(void) = NoOp : +# 2274| v2274_12(void) = ReturnVoid : #-----| Goto -> Block 1 -# 2291| void IfDestructors(bool) -# 2291| Block 0 -# 2291| v2291_1(void) = EnterFunction : -# 2291| m2291_2(unknown) = AliasedDefinition : -# 2291| m2291_3(unknown) = InitializeNonLocal : -# 2291| m2291_4(unknown) = Chi : total:m2291_2, partial:m2291_3 -# 2291| r2291_5(glval) = VariableAddress[b] : -# 2291| m2291_6(bool) = InitializeParameter[b] : &:r2291_5 -# 2292| r2292_1(glval) = VariableAddress[s1] : -# 2292| m2292_2(String) = Uninitialized[s1] : &:r2292_1 -# 2292| m2292_3(unknown) = Chi : total:m2291_4, partial:m2292_2 -# 2292| r2292_4(glval) = FunctionAddress[String] : -# 2292| v2292_5(void) = Call[String] : func:r2292_4, this:r2292_1 -# 2292| m2292_6(unknown) = ^CallSideEffect : ~m2292_3 -# 2292| m2292_7(unknown) = Chi : total:m2292_3, partial:m2292_6 -# 2292| m2292_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2292_1 -# 2292| m2292_9(unknown) = Chi : total:m2292_7, partial:m2292_8 -# 2293| r2293_1(glval) = VariableAddress[b] : -# 2293| r2293_2(bool) = Load[b] : &:r2293_1, m2291_6 -# 2293| v2293_3(void) = ConditionalBranch : r2293_2 +# 2292| void IfDestructors(bool) +# 2292| Block 0 +# 2292| v2292_1(void) = EnterFunction : +# 2292| m2292_2(unknown) = AliasedDefinition : +# 2292| m2292_3(unknown) = InitializeNonLocal : +# 2292| m2292_4(unknown) = Chi : total:m2292_2, partial:m2292_3 +# 2292| r2292_5(glval) = VariableAddress[b] : +# 2292| m2292_6(bool) = InitializeParameter[b] : &:r2292_5 +# 2293| r2293_1(glval) = VariableAddress[s1] : +# 2293| m2293_2(String) = Uninitialized[s1] : &:r2293_1 +# 2293| m2293_3(unknown) = Chi : total:m2292_4, partial:m2293_2 +# 2293| r2293_4(glval) = FunctionAddress[String] : +# 2293| v2293_5(void) = Call[String] : func:r2293_4, this:r2293_1 +# 2293| m2293_6(unknown) = ^CallSideEffect : ~m2293_3 +# 2293| m2293_7(unknown) = Chi : total:m2293_3, partial:m2293_6 +# 2293| m2293_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2293_1 +# 2293| m2293_9(unknown) = Chi : total:m2293_7, partial:m2293_8 +# 2294| r2294_1(glval) = VariableAddress[b] : +# 2294| r2294_2(bool) = Load[b] : &:r2294_1, m2292_6 +# 2294| v2294_3(void) = ConditionalBranch : r2294_2 #-----| False -> Block 2 #-----| True -> Block 1 -# 2294| Block 1 -# 2294| r2294_1(glval) = VariableAddress[s2] : -# 2294| m2294_2(String) = Uninitialized[s2] : &:r2294_1 -# 2294| m2294_3(unknown) = Chi : total:m2292_9, partial:m2294_2 -# 2294| r2294_4(glval) = FunctionAddress[String] : -# 2294| v2294_5(void) = Call[String] : func:r2294_4, this:r2294_1 -# 2294| m2294_6(unknown) = ^CallSideEffect : ~m2294_3 -# 2294| m2294_7(unknown) = Chi : total:m2294_3, partial:m2294_6 -# 2294| m2294_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2294_1 -# 2294| m2294_9(unknown) = Chi : total:m2294_7, partial:m2294_8 +# 2295| Block 1 # 2295| r2295_1(glval) = VariableAddress[s2] : -# 2295| r2295_2(glval) = FunctionAddress[~String] : -# 2295| v2295_3(void) = Call[~String] : func:r2295_2, this:r2295_1 -# 2295| m2295_4(unknown) = ^CallSideEffect : ~m2294_9 -# 2295| m2295_5(unknown) = Chi : total:m2294_9, partial:m2295_4 -# 2295| v2295_6(void) = ^IndirectReadSideEffect[-1] : &:r2295_1, ~m2295_5 -# 2295| m2295_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2295_1 -# 2295| m2295_8(unknown) = Chi : total:m2295_5, partial:m2295_7 +# 2295| m2295_2(String) = Uninitialized[s2] : &:r2295_1 +# 2295| m2295_3(unknown) = Chi : total:m2293_9, partial:m2295_2 +# 2295| r2295_4(glval) = FunctionAddress[String] : +# 2295| v2295_5(void) = Call[String] : func:r2295_4, this:r2295_1 +# 2295| m2295_6(unknown) = ^CallSideEffect : ~m2295_3 +# 2295| m2295_7(unknown) = Chi : total:m2295_3, partial:m2295_6 +# 2295| m2295_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2295_1 +# 2295| m2295_9(unknown) = Chi : total:m2295_7, partial:m2295_8 +# 2296| r2296_1(glval) = VariableAddress[s2] : +# 2296| r2296_2(glval) = FunctionAddress[~String] : +# 2296| v2296_3(void) = Call[~String] : func:r2296_2, this:r2296_1 +# 2296| m2296_4(unknown) = ^CallSideEffect : ~m2295_9 +# 2296| m2296_5(unknown) = Chi : total:m2295_9, partial:m2296_4 +# 2296| v2296_6(void) = ^IndirectReadSideEffect[-1] : &:r2296_1, ~m2296_5 +# 2296| m2296_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2296_1 +# 2296| m2296_8(unknown) = Chi : total:m2296_5, partial:m2296_7 #-----| Goto -> Block 3 -# 2296| Block 2 -# 2296| r2296_1(glval) = VariableAddress[s3] : -# 2296| m2296_2(String) = Uninitialized[s3] : &:r2296_1 -# 2296| m2296_3(unknown) = Chi : total:m2292_9, partial:m2296_2 -# 2296| r2296_4(glval) = FunctionAddress[String] : -# 2296| v2296_5(void) = Call[String] : func:r2296_4, this:r2296_1 -# 2296| m2296_6(unknown) = ^CallSideEffect : ~m2296_3 -# 2296| m2296_7(unknown) = Chi : total:m2296_3, partial:m2296_6 -# 2296| m2296_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2296_1 -# 2296| m2296_9(unknown) = Chi : total:m2296_7, partial:m2296_8 +# 2297| Block 2 # 2297| r2297_1(glval) = VariableAddress[s3] : -# 2297| r2297_2(glval) = FunctionAddress[~String] : -# 2297| v2297_3(void) = Call[~String] : func:r2297_2, this:r2297_1 -# 2297| m2297_4(unknown) = ^CallSideEffect : ~m2296_9 -# 2297| m2297_5(unknown) = Chi : total:m2296_9, partial:m2297_4 -# 2297| v2297_6(void) = ^IndirectReadSideEffect[-1] : &:r2297_1, ~m2297_5 -# 2297| m2297_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2297_1 -# 2297| m2297_8(unknown) = Chi : total:m2297_5, partial:m2297_7 +# 2297| m2297_2(String) = Uninitialized[s3] : &:r2297_1 +# 2297| m2297_3(unknown) = Chi : total:m2293_9, partial:m2297_2 +# 2297| r2297_4(glval) = FunctionAddress[String] : +# 2297| v2297_5(void) = Call[String] : func:r2297_4, this:r2297_1 +# 2297| m2297_6(unknown) = ^CallSideEffect : ~m2297_3 +# 2297| m2297_7(unknown) = Chi : total:m2297_3, partial:m2297_6 +# 2297| m2297_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2297_1 +# 2297| m2297_9(unknown) = Chi : total:m2297_7, partial:m2297_8 +# 2298| r2298_1(glval) = VariableAddress[s3] : +# 2298| r2298_2(glval) = FunctionAddress[~String] : +# 2298| v2298_3(void) = Call[~String] : func:r2298_2, this:r2298_1 +# 2298| m2298_4(unknown) = ^CallSideEffect : ~m2297_9 +# 2298| m2298_5(unknown) = Chi : total:m2297_9, partial:m2298_4 +# 2298| v2298_6(void) = ^IndirectReadSideEffect[-1] : &:r2298_1, ~m2298_5 +# 2298| m2298_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2298_1 +# 2298| m2298_8(unknown) = Chi : total:m2298_5, partial:m2298_7 #-----| Goto -> Block 3 -# 2298| Block 3 -# 2298| m2298_1(unknown) = Phi : from 1:~m2295_8, from 2:~m2297_8 -# 2298| r2298_2(glval) = VariableAddress[s4] : -# 2298| m2298_3(String) = Uninitialized[s4] : &:r2298_2 -# 2298| m2298_4(unknown) = Chi : total:m2298_1, partial:m2298_3 -# 2298| r2298_5(glval) = FunctionAddress[String] : -# 2298| v2298_6(void) = Call[String] : func:r2298_5, this:r2298_2 -# 2298| m2298_7(unknown) = ^CallSideEffect : ~m2298_4 -# 2298| m2298_8(unknown) = Chi : total:m2298_4, partial:m2298_7 -# 2298| m2298_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2298_2 -# 2298| m2298_10(unknown) = Chi : total:m2298_8, partial:m2298_9 -# 2299| v2299_1(void) = NoOp : +# 2299| Block 3 +# 2299| m2299_1(unknown) = Phi : from 1:~m2296_8, from 2:~m2298_8 # 2299| r2299_2(glval) = VariableAddress[s4] : -# 2299| r2299_3(glval) = FunctionAddress[~String] : -# 2299| v2299_4(void) = Call[~String] : func:r2299_3, this:r2299_2 -# 2299| m2299_5(unknown) = ^CallSideEffect : ~m2298_10 -# 2299| m2299_6(unknown) = Chi : total:m2298_10, partial:m2299_5 -# 2299| v2299_7(void) = ^IndirectReadSideEffect[-1] : &:r2299_2, ~m2299_6 -# 2299| m2299_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2299_2 -# 2299| m2299_9(unknown) = Chi : total:m2299_6, partial:m2299_8 -# 2299| r2299_10(glval) = VariableAddress[s1] : -# 2299| r2299_11(glval) = FunctionAddress[~String] : -# 2299| v2299_12(void) = Call[~String] : func:r2299_11, this:r2299_10 -# 2299| m2299_13(unknown) = ^CallSideEffect : ~m2299_9 -# 2299| m2299_14(unknown) = Chi : total:m2299_9, partial:m2299_13 -# 2299| v2299_15(void) = ^IndirectReadSideEffect[-1] : &:r2299_10, ~m2299_14 -# 2299| m2299_16(String) = ^IndirectMayWriteSideEffect[-1] : &:r2299_10 -# 2299| m2299_17(unknown) = Chi : total:m2299_14, partial:m2299_16 -# 2291| v2291_7(void) = ReturnVoid : -# 2291| v2291_8(void) = AliasedUse : ~m2299_14 -# 2291| v2291_9(void) = ExitFunction : +# 2299| m2299_3(String) = Uninitialized[s4] : &:r2299_2 +# 2299| m2299_4(unknown) = Chi : total:m2299_1, partial:m2299_3 +# 2299| r2299_5(glval) = FunctionAddress[String] : +# 2299| v2299_6(void) = Call[String] : func:r2299_5, this:r2299_2 +# 2299| m2299_7(unknown) = ^CallSideEffect : ~m2299_4 +# 2299| m2299_8(unknown) = Chi : total:m2299_4, partial:m2299_7 +# 2299| m2299_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2299_2 +# 2299| m2299_10(unknown) = Chi : total:m2299_8, partial:m2299_9 +# 2300| v2300_1(void) = NoOp : +# 2300| r2300_2(glval) = VariableAddress[s4] : +# 2300| r2300_3(glval) = FunctionAddress[~String] : +# 2300| v2300_4(void) = Call[~String] : func:r2300_3, this:r2300_2 +# 2300| m2300_5(unknown) = ^CallSideEffect : ~m2299_10 +# 2300| m2300_6(unknown) = Chi : total:m2299_10, partial:m2300_5 +# 2300| v2300_7(void) = ^IndirectReadSideEffect[-1] : &:r2300_2, ~m2300_6 +# 2300| m2300_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2300_2 +# 2300| m2300_9(unknown) = Chi : total:m2300_6, partial:m2300_8 +# 2300| r2300_10(glval) = VariableAddress[s1] : +# 2300| r2300_11(glval) = FunctionAddress[~String] : +# 2300| v2300_12(void) = Call[~String] : func:r2300_11, this:r2300_10 +# 2300| m2300_13(unknown) = ^CallSideEffect : ~m2300_9 +# 2300| m2300_14(unknown) = Chi : total:m2300_9, partial:m2300_13 +# 2300| v2300_15(void) = ^IndirectReadSideEffect[-1] : &:r2300_10, ~m2300_14 +# 2300| m2300_16(String) = ^IndirectMayWriteSideEffect[-1] : &:r2300_10 +# 2300| m2300_17(unknown) = Chi : total:m2300_14, partial:m2300_16 +# 2292| v2292_7(void) = ReturnVoid : +# 2292| v2292_8(void) = AliasedUse : ~m2300_14 +# 2292| v2292_9(void) = ExitFunction : -# 2301| void ForDestructors() -# 2301| Block 0 -# 2301| v2301_1(void) = EnterFunction : -# 2301| m2301_2(unknown) = AliasedDefinition : -# 2301| m2301_3(unknown) = InitializeNonLocal : -# 2301| m2301_4(unknown) = Chi : total:m2301_2, partial:m2301_3 -# 2302| r2302_1(glval) = VariableAddress[c] : -# 2302| r2302_2(char) = Constant[97] : -# 2302| m2302_3(char) = Store[c] : &:r2302_1, r2302_2 -# 2303| r2303_1(glval) = VariableAddress[s] : -# 2303| m2303_2(String) = Uninitialized[s] : &:r2303_1 -# 2303| m2303_3(unknown) = Chi : total:m2301_4, partial:m2303_2 -# 2303| r2303_4(glval) = FunctionAddress[String] : -# 2303| r2303_5(glval) = StringConstant["hello"] : -# 2303| r2303_6(char *) = Convert : r2303_5 -# 2303| v2303_7(void) = Call[String] : func:r2303_4, this:r2303_1, 0:r2303_6 -# 2303| m2303_8(unknown) = ^CallSideEffect : ~m2303_3 -# 2303| m2303_9(unknown) = Chi : total:m2303_3, partial:m2303_8 -# 2303| v2303_10(void) = ^BufferReadSideEffect[0] : &:r2303_6, ~m2301_3 -# 2303| m2303_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2303_1 -# 2303| m2303_12(unknown) = Chi : total:m2303_9, partial:m2303_11 +# 2302| void ForDestructors() +# 2302| Block 0 +# 2302| v2302_1(void) = EnterFunction : +# 2302| m2302_2(unknown) = AliasedDefinition : +# 2302| m2302_3(unknown) = InitializeNonLocal : +# 2302| m2302_4(unknown) = Chi : total:m2302_2, partial:m2302_3 +# 2303| r2303_1(glval) = VariableAddress[c] : +# 2303| r2303_2(char) = Constant[97] : +# 2303| m2303_3(char) = Store[c] : &:r2303_1, r2303_2 +# 2304| r2304_1(glval) = VariableAddress[s] : +# 2304| m2304_2(String) = Uninitialized[s] : &:r2304_1 +# 2304| m2304_3(unknown) = Chi : total:m2302_4, partial:m2304_2 +# 2304| r2304_4(glval) = FunctionAddress[String] : +# 2304| r2304_5(glval) = StringConstant["hello"] : +# 2304| r2304_6(char *) = Convert : r2304_5 +# 2304| v2304_7(void) = Call[String] : func:r2304_4, this:r2304_1, 0:r2304_6 +# 2304| m2304_8(unknown) = ^CallSideEffect : ~m2304_3 +# 2304| m2304_9(unknown) = Chi : total:m2304_3, partial:m2304_8 +# 2304| v2304_10(void) = ^BufferReadSideEffect[0] : &:r2304_6, ~m2302_3 +# 2304| m2304_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_1 +# 2304| m2304_12(unknown) = Chi : total:m2304_9, partial:m2304_11 #-----| Goto -> Block 1 -# 2303| Block 1 -# 2303| m2303_13(unknown) = Phi : from 0:~m2303_12, from 2:~m2303_28 -# 2303| m2303_14(char) = Phi : from 0:m2302_3, from 2:m2303_30 -# 2303| r2303_15(glval) = VariableAddress[c] : -# 2303| r2303_16(char) = Load[c] : &:r2303_15, m2303_14 -# 2303| r2303_17(int) = Convert : r2303_16 -# 2303| r2303_18(int) = Constant[0] : -# 2303| r2303_19(bool) = CompareNE : r2303_17, r2303_18 -# 2303| v2303_20(void) = ConditionalBranch : r2303_19 +# 2304| Block 1 +# 2304| m2304_13(unknown) = Phi : from 0:~m2304_12, from 2:~m2304_28 +# 2304| m2304_14(char) = Phi : from 0:m2303_3, from 2:m2304_30 +# 2304| r2304_15(glval) = VariableAddress[c] : +# 2304| r2304_16(char) = Load[c] : &:r2304_15, m2304_14 +# 2304| r2304_17(int) = Convert : r2304_16 +# 2304| r2304_18(int) = Constant[0] : +# 2304| r2304_19(bool) = CompareNE : r2304_17, r2304_18 +# 2304| v2304_20(void) = ConditionalBranch : r2304_19 #-----| False -> Block 3 #-----| True -> Block 2 -# 2304| Block 2 -# 2304| r2304_1(glval) = VariableAddress[s2] : -# 2304| m2304_2(String) = Uninitialized[s2] : &:r2304_1 -# 2304| m2304_3(unknown) = Chi : total:m2303_13, partial:m2304_2 -# 2304| r2304_4(glval) = FunctionAddress[String] : -# 2304| v2304_5(void) = Call[String] : func:r2304_4, this:r2304_1 -# 2304| m2304_6(unknown) = ^CallSideEffect : ~m2304_3 -# 2304| m2304_7(unknown) = Chi : total:m2304_3, partial:m2304_6 -# 2304| m2304_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_1 -# 2304| m2304_9(unknown) = Chi : total:m2304_7, partial:m2304_8 +# 2305| Block 2 # 2305| r2305_1(glval) = VariableAddress[s2] : -# 2305| r2305_2(glval) = FunctionAddress[~String] : -# 2305| v2305_3(void) = Call[~String] : func:r2305_2, this:r2305_1 -# 2305| m2305_4(unknown) = ^CallSideEffect : ~m2304_9 -# 2305| m2305_5(unknown) = Chi : total:m2304_9, partial:m2305_4 -# 2305| v2305_6(void) = ^IndirectReadSideEffect[-1] : &:r2305_1, ~m2305_5 -# 2305| m2305_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2305_1 -# 2305| m2305_8(unknown) = Chi : total:m2305_5, partial:m2305_7 -# 2303| r2303_21(glval) = VariableAddress[s] : -# 2303| r2303_22(glval) = FunctionAddress[pop_back] : -# 2303| r2303_23(char) = Call[pop_back] : func:r2303_22, this:r2303_21 -# 2303| m2303_24(unknown) = ^CallSideEffect : ~m2305_8 -# 2303| m2303_25(unknown) = Chi : total:m2305_8, partial:m2303_24 -# 2303| v2303_26(void) = ^IndirectReadSideEffect[-1] : &:r2303_21, ~m2303_25 -# 2303| m2303_27(String) = ^IndirectMayWriteSideEffect[-1] : &:r2303_21 -# 2303| m2303_28(unknown) = Chi : total:m2303_25, partial:m2303_27 -# 2303| r2303_29(glval) = VariableAddress[c] : -# 2303| m2303_30(char) = Store[c] : &:r2303_29, r2303_23 +# 2305| m2305_2(String) = Uninitialized[s2] : &:r2305_1 +# 2305| m2305_3(unknown) = Chi : total:m2304_13, partial:m2305_2 +# 2305| r2305_4(glval) = FunctionAddress[String] : +# 2305| v2305_5(void) = Call[String] : func:r2305_4, this:r2305_1 +# 2305| m2305_6(unknown) = ^CallSideEffect : ~m2305_3 +# 2305| m2305_7(unknown) = Chi : total:m2305_3, partial:m2305_6 +# 2305| m2305_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2305_1 +# 2305| m2305_9(unknown) = Chi : total:m2305_7, partial:m2305_8 +# 2306| r2306_1(glval) = VariableAddress[s2] : +# 2306| r2306_2(glval) = FunctionAddress[~String] : +# 2306| v2306_3(void) = Call[~String] : func:r2306_2, this:r2306_1 +# 2306| m2306_4(unknown) = ^CallSideEffect : ~m2305_9 +# 2306| m2306_5(unknown) = Chi : total:m2305_9, partial:m2306_4 +# 2306| v2306_6(void) = ^IndirectReadSideEffect[-1] : &:r2306_1, ~m2306_5 +# 2306| m2306_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2306_1 +# 2306| m2306_8(unknown) = Chi : total:m2306_5, partial:m2306_7 +# 2304| r2304_21(glval) = VariableAddress[s] : +# 2304| r2304_22(glval) = FunctionAddress[pop_back] : +# 2304| r2304_23(char) = Call[pop_back] : func:r2304_22, this:r2304_21 +# 2304| m2304_24(unknown) = ^CallSideEffect : ~m2306_8 +# 2304| m2304_25(unknown) = Chi : total:m2306_8, partial:m2304_24 +# 2304| v2304_26(void) = ^IndirectReadSideEffect[-1] : &:r2304_21, ~m2304_25 +# 2304| m2304_27(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_21 +# 2304| m2304_28(unknown) = Chi : total:m2304_25, partial:m2304_27 +# 2304| r2304_29(glval) = VariableAddress[c] : +# 2304| m2304_30(char) = Store[c] : &:r2304_29, r2304_23 #-----| Goto (back edge) -> Block 1 -# 2303| Block 3 -# 2303| r2303_31(glval) = VariableAddress[s] : -# 2303| r2303_32(glval) = FunctionAddress[~String] : -# 2303| v2303_33(void) = Call[~String] : func:r2303_32, this:r2303_31 -# 2303| m2303_34(unknown) = ^CallSideEffect : ~m2303_13 -# 2303| m2303_35(unknown) = Chi : total:m2303_13, partial:m2303_34 -# 2303| v2303_36(void) = ^IndirectReadSideEffect[-1] : &:r2303_31, ~m2303_35 -# 2303| m2303_37(String) = ^IndirectMayWriteSideEffect[-1] : &:r2303_31 -# 2303| m2303_38(unknown) = Chi : total:m2303_35, partial:m2303_37 -# 2307| r2307_1(glval &&>) = VariableAddress[(__range)] : -# 2307| r2307_2(glval>) = VariableAddress[#temp2307:20] : -# 2307| m2307_3(vector) = Uninitialized[#temp2307:20] : &:r2307_2 -# 2307| m2307_4(unknown) = Chi : total:m2303_38, partial:m2307_3 -# 2307| r2307_5(glval) = FunctionAddress[vector] : -# 2307| r2307_6(glval) = VariableAddress[#temp2307:40] : -# 2307| m2307_7(String) = Uninitialized[#temp2307:40] : &:r2307_6 -# 2307| m2307_8(unknown) = Chi : total:m2307_4, partial:m2307_7 -# 2307| r2307_9(glval) = FunctionAddress[String] : -# 2307| r2307_10(glval) = StringConstant["hello"] : -# 2307| r2307_11(char *) = Convert : r2307_10 -# 2307| v2307_12(void) = Call[String] : func:r2307_9, this:r2307_6, 0:r2307_11 -# 2307| m2307_13(unknown) = ^CallSideEffect : ~m2307_8 -# 2307| m2307_14(unknown) = Chi : total:m2307_8, partial:m2307_13 -# 2307| v2307_15(void) = ^BufferReadSideEffect[0] : &:r2307_11, ~m2301_3 -# 2307| m2307_16(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_6 -# 2307| m2307_17(unknown) = Chi : total:m2307_14, partial:m2307_16 -# 2307| r2307_18(String) = Load[#temp2307:40] : &:r2307_6, ~m2307_17 -# 2307| v2307_19(void) = Call[vector] : func:r2307_5, this:r2307_2, 0:r2307_18 -# 2307| m2307_20(unknown) = ^CallSideEffect : ~m2307_17 -# 2307| m2307_21(unknown) = Chi : total:m2307_17, partial:m2307_20 -# 2307| m2307_22(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2307_2 -# 2307| m2307_23(unknown) = Chi : total:m2307_21, partial:m2307_22 -# 2307| r2307_24(glval) = CopyValue : r2307_6 -# 2307| r2307_25(glval) = FunctionAddress[~String] : -# 2307| v2307_26(void) = Call[~String] : func:r2307_25, this:r2307_24 -# 2307| m2307_27(unknown) = ^CallSideEffect : ~m2307_23 -# 2307| m2307_28(unknown) = Chi : total:m2307_23, partial:m2307_27 -# 2307| v2307_29(void) = ^IndirectReadSideEffect[-1] : &:r2307_24, ~m2307_28 -# 2307| m2307_30(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_24 -# 2307| m2307_31(unknown) = Chi : total:m2307_28, partial:m2307_30 -# 2307| r2307_32(vector &) = CopyValue : r2307_2 -# 2307| m2307_33(vector &&) = Store[(__range)] : &:r2307_1, r2307_32 -# 2307| r2307_34(glval>) = VariableAddress[(__begin)] : -# 2307| r2307_35(glval &&>) = VariableAddress[(__range)] : -# 2307| r2307_36(vector &&) = Load[(__range)] : &:r2307_35, m2307_33 -#-----| r0_1(glval>) = CopyValue : r2307_36 +# 2304| Block 3 +# 2304| r2304_31(glval) = VariableAddress[s] : +# 2304| r2304_32(glval) = FunctionAddress[~String] : +# 2304| v2304_33(void) = Call[~String] : func:r2304_32, this:r2304_31 +# 2304| m2304_34(unknown) = ^CallSideEffect : ~m2304_13 +# 2304| m2304_35(unknown) = Chi : total:m2304_13, partial:m2304_34 +# 2304| v2304_36(void) = ^IndirectReadSideEffect[-1] : &:r2304_31, ~m2304_35 +# 2304| m2304_37(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_31 +# 2304| m2304_38(unknown) = Chi : total:m2304_35, partial:m2304_37 +# 2308| r2308_1(glval &&>) = VariableAddress[(__range)] : +# 2308| r2308_2(glval>) = VariableAddress[#temp2308:20] : +# 2308| m2308_3(vector) = Uninitialized[#temp2308:20] : &:r2308_2 +# 2308| m2308_4(unknown) = Chi : total:m2304_38, partial:m2308_3 +# 2308| r2308_5(glval) = FunctionAddress[vector] : +# 2308| r2308_6(glval) = VariableAddress[#temp2308:40] : +# 2308| m2308_7(String) = Uninitialized[#temp2308:40] : &:r2308_6 +# 2308| m2308_8(unknown) = Chi : total:m2308_4, partial:m2308_7 +# 2308| r2308_9(glval) = FunctionAddress[String] : +# 2308| r2308_10(glval) = StringConstant["hello"] : +# 2308| r2308_11(char *) = Convert : r2308_10 +# 2308| v2308_12(void) = Call[String] : func:r2308_9, this:r2308_6, 0:r2308_11 +# 2308| m2308_13(unknown) = ^CallSideEffect : ~m2308_8 +# 2308| m2308_14(unknown) = Chi : total:m2308_8, partial:m2308_13 +# 2308| v2308_15(void) = ^BufferReadSideEffect[0] : &:r2308_11, ~m2302_3 +# 2308| m2308_16(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_6 +# 2308| m2308_17(unknown) = Chi : total:m2308_14, partial:m2308_16 +# 2308| r2308_18(String) = Load[#temp2308:40] : &:r2308_6, ~m2308_17 +# 2308| v2308_19(void) = Call[vector] : func:r2308_5, this:r2308_2, 0:r2308_18 +# 2308| m2308_20(unknown) = ^CallSideEffect : ~m2308_17 +# 2308| m2308_21(unknown) = Chi : total:m2308_17, partial:m2308_20 +# 2308| m2308_22(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2308_2 +# 2308| m2308_23(unknown) = Chi : total:m2308_21, partial:m2308_22 +# 2308| r2308_24(glval) = CopyValue : r2308_6 +# 2308| r2308_25(glval) = FunctionAddress[~String] : +# 2308| v2308_26(void) = Call[~String] : func:r2308_25, this:r2308_24 +# 2308| m2308_27(unknown) = ^CallSideEffect : ~m2308_23 +# 2308| m2308_28(unknown) = Chi : total:m2308_23, partial:m2308_27 +# 2308| v2308_29(void) = ^IndirectReadSideEffect[-1] : &:r2308_24, ~m2308_28 +# 2308| m2308_30(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_24 +# 2308| m2308_31(unknown) = Chi : total:m2308_28, partial:m2308_30 +# 2308| r2308_32(vector &) = CopyValue : r2308_2 +# 2308| m2308_33(vector &&) = Store[(__range)] : &:r2308_1, r2308_32 +# 2308| r2308_34(glval>) = VariableAddress[(__begin)] : +# 2308| r2308_35(glval &&>) = VariableAddress[(__range)] : +# 2308| r2308_36(vector &&) = Load[(__range)] : &:r2308_35, m2308_33 +#-----| r0_1(glval>) = CopyValue : r2308_36 #-----| r0_2(glval>) = Convert : r0_1 -# 2307| r2307_37(glval) = FunctionAddress[begin] : -# 2307| r2307_38(iterator) = Call[begin] : func:r2307_37, this:r0_2 -#-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m2307_28 -# 2307| m2307_39(iterator) = Store[(__begin)] : &:r2307_34, r2307_38 -# 2307| r2307_40(glval>) = VariableAddress[(__end)] : -# 2307| r2307_41(glval &&>) = VariableAddress[(__range)] : -# 2307| r2307_42(vector &&) = Load[(__range)] : &:r2307_41, m2307_33 -#-----| r0_4(glval>) = CopyValue : r2307_42 +# 2308| r2308_37(glval) = FunctionAddress[begin] : +# 2308| r2308_38(iterator) = Call[begin] : func:r2308_37, this:r0_2 +#-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m2308_28 +# 2308| m2308_39(iterator) = Store[(__begin)] : &:r2308_34, r2308_38 +# 2308| r2308_40(glval>) = VariableAddress[(__end)] : +# 2308| r2308_41(glval &&>) = VariableAddress[(__range)] : +# 2308| r2308_42(vector &&) = Load[(__range)] : &:r2308_41, m2308_33 +#-----| r0_4(glval>) = CopyValue : r2308_42 #-----| r0_5(glval>) = Convert : r0_4 -# 2307| r2307_43(glval) = FunctionAddress[end] : -# 2307| r2307_44(iterator) = Call[end] : func:r2307_43, this:r0_5 -#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m2307_28 -# 2307| m2307_45(iterator) = Store[(__end)] : &:r2307_40, r2307_44 -# 2307| m2307_46(unknown) = Chi : total:m2307_31, partial:m2307_45 +# 2308| r2308_43(glval) = FunctionAddress[end] : +# 2308| r2308_44(iterator) = Call[end] : func:r2308_43, this:r0_5 +#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m2308_28 +# 2308| m2308_45(iterator) = Store[(__end)] : &:r2308_40, r2308_44 +# 2308| m2308_46(unknown) = Chi : total:m2308_31, partial:m2308_45 #-----| Goto -> Block 4 -# 2307| Block 4 -# 2307| m2307_47(iterator) = Phi : from 3:m2307_39, from 5:m2307_81 -# 2307| m2307_48(unknown) = Phi : from 3:~m2307_46, from 5:~m2307_89 -# 2307| r2307_49(glval>) = VariableAddress[(__begin)] : -#-----| r0_7(glval>) = Convert : r2307_49 -# 2307| r2307_50(glval) = FunctionAddress[operator!=] : +# 2308| Block 4 +# 2308| m2308_47(iterator) = Phi : from 3:m2308_39, from 5:m2308_81 +# 2308| m2308_48(unknown) = Phi : from 3:~m2308_46, from 5:~m2308_89 +# 2308| r2308_49(glval>) = VariableAddress[(__begin)] : +#-----| r0_7(glval>) = Convert : r2308_49 +# 2308| r2308_50(glval) = FunctionAddress[operator!=] : #-----| r0_8(glval>) = VariableAddress[#temp0:0] : #-----| m0_9(iterator) = Uninitialized[#temp0:0] : &:r0_8 -#-----| m0_10(unknown) = Chi : total:m2307_48, partial:m0_9 -# 2307| r2307_51(glval) = FunctionAddress[iterator] : -# 2307| r2307_52(glval>) = VariableAddress[(__end)] : -#-----| r0_11(glval>) = Convert : r2307_52 +#-----| m0_10(unknown) = Chi : total:m2308_48, partial:m0_9 +# 2308| r2308_51(glval) = FunctionAddress[iterator] : +# 2308| r2308_52(glval>) = VariableAddress[(__end)] : +#-----| r0_11(glval>) = Convert : r2308_52 #-----| r0_12(iterator &) = CopyValue : r0_11 -# 2307| v2307_53(void) = Call[iterator] : func:r2307_51, this:r0_8, 0:r0_12 -# 2307| m2307_54(unknown) = ^CallSideEffect : ~m0_10 -# 2307| m2307_55(unknown) = Chi : total:m0_10, partial:m2307_54 -#-----| v0_13(void) = ^BufferReadSideEffect[0] : &:r0_12, ~m2307_55 -# 2307| m2307_56(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 -# 2307| m2307_57(unknown) = Chi : total:m2307_55, partial:m2307_56 -#-----| r0_14(iterator) = Load[#temp0:0] : &:r0_8, ~m2307_57 -# 2307| r2307_58(bool) = Call[operator!=] : func:r2307_50, this:r0_7, 0:r0_14 -#-----| v0_15(void) = ^IndirectReadSideEffect[-1] : &:r0_7, m2307_47 -# 2307| v2307_59(void) = ConditionalBranch : r2307_58 +# 2308| v2308_53(void) = Call[iterator] : func:r2308_51, this:r0_8, 0:r0_12 +# 2308| m2308_54(unknown) = ^CallSideEffect : ~m0_10 +# 2308| m2308_55(unknown) = Chi : total:m0_10, partial:m2308_54 +#-----| v0_13(void) = ^BufferReadSideEffect[0] : &:r0_12, ~m2308_55 +# 2308| m2308_56(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 +# 2308| m2308_57(unknown) = Chi : total:m2308_55, partial:m2308_56 +#-----| r0_14(iterator) = Load[#temp0:0] : &:r0_8, ~m2308_57 +# 2308| r2308_58(bool) = Call[operator!=] : func:r2308_50, this:r0_7, 0:r0_14 +#-----| v0_15(void) = ^IndirectReadSideEffect[-1] : &:r0_7, m2308_47 +# 2308| v2308_59(void) = ConditionalBranch : r2308_58 #-----| False -> Block 6 #-----| True -> Block 5 -# 2307| Block 5 -# 2307| r2307_60(glval) = VariableAddress[s] : -# 2307| m2307_61(String) = Uninitialized[s] : &:r2307_60 -# 2307| m2307_62(unknown) = Chi : total:m2307_57, partial:m2307_61 -# 2307| r2307_63(glval) = FunctionAddress[String] : -# 2307| r2307_64(glval>) = VariableAddress[(__begin)] : -#-----| r0_16(glval>) = Convert : r2307_64 -# 2307| r2307_65(glval) = FunctionAddress[operator*] : -# 2307| r2307_66(String &) = Call[operator*] : func:r2307_65, this:r0_16 -#-----| v0_17(void) = ^IndirectReadSideEffect[-1] : &:r0_16, m2307_47 -# 2307| r2307_67(glval) = CopyValue : r2307_66 -# 2307| r2307_68(glval) = Convert : r2307_67 -# 2307| r2307_69(String &) = CopyValue : r2307_68 -# 2307| v2307_70(void) = Call[String] : func:r2307_63, this:r2307_60, 0:r2307_69 -# 2307| m2307_71(unknown) = ^CallSideEffect : ~m2307_62 -# 2307| m2307_72(unknown) = Chi : total:m2307_62, partial:m2307_71 -# 2307| v2307_73(void) = ^BufferReadSideEffect[0] : &:r2307_69, ~m2307_72 -# 2307| m2307_74(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_60 -# 2307| m2307_75(unknown) = Chi : total:m2307_72, partial:m2307_74 -# 2308| r2308_1(glval) = VariableAddress[s2] : -# 2308| m2308_2(String) = Uninitialized[s2] : &:r2308_1 -# 2308| m2308_3(unknown) = Chi : total:m2307_75, partial:m2308_2 -# 2308| r2308_4(glval) = FunctionAddress[String] : -# 2308| v2308_5(void) = Call[String] : func:r2308_4, this:r2308_1 -# 2308| m2308_6(unknown) = ^CallSideEffect : ~m2308_3 -# 2308| m2308_7(unknown) = Chi : total:m2308_3, partial:m2308_6 -# 2308| m2308_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_1 -# 2308| m2308_9(unknown) = Chi : total:m2308_7, partial:m2308_8 +# 2308| Block 5 +# 2308| r2308_60(glval) = VariableAddress[s] : +# 2308| m2308_61(String) = Uninitialized[s] : &:r2308_60 +# 2308| m2308_62(unknown) = Chi : total:m2308_57, partial:m2308_61 +# 2308| r2308_63(glval) = FunctionAddress[String] : +# 2308| r2308_64(glval>) = VariableAddress[(__begin)] : +#-----| r0_16(glval>) = Convert : r2308_64 +# 2308| r2308_65(glval) = FunctionAddress[operator*] : +# 2308| r2308_66(String &) = Call[operator*] : func:r2308_65, this:r0_16 +#-----| v0_17(void) = ^IndirectReadSideEffect[-1] : &:r0_16, m2308_47 +# 2308| r2308_67(glval) = CopyValue : r2308_66 +# 2308| r2308_68(glval) = Convert : r2308_67 +# 2308| r2308_69(String &) = CopyValue : r2308_68 +# 2308| v2308_70(void) = Call[String] : func:r2308_63, this:r2308_60, 0:r2308_69 +# 2308| m2308_71(unknown) = ^CallSideEffect : ~m2308_62 +# 2308| m2308_72(unknown) = Chi : total:m2308_62, partial:m2308_71 +# 2308| v2308_73(void) = ^BufferReadSideEffect[0] : &:r2308_69, ~m2308_72 +# 2308| m2308_74(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_60 +# 2308| m2308_75(unknown) = Chi : total:m2308_72, partial:m2308_74 # 2309| r2309_1(glval) = VariableAddress[s2] : -# 2309| r2309_2(glval) = FunctionAddress[~String] : -# 2309| v2309_3(void) = Call[~String] : func:r2309_2, this:r2309_1 -# 2309| m2309_4(unknown) = ^CallSideEffect : ~m2308_9 -# 2309| m2309_5(unknown) = Chi : total:m2308_9, partial:m2309_4 -# 2309| v2309_6(void) = ^IndirectReadSideEffect[-1] : &:r2309_1, ~m2309_5 -# 2309| m2309_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2309_1 -# 2309| m2309_8(unknown) = Chi : total:m2309_5, partial:m2309_7 -# 2307| r2307_76(glval>) = VariableAddress[(__begin)] : -# 2307| r2307_77(glval) = FunctionAddress[operator++] : -# 2307| r2307_78(iterator &) = Call[operator++] : func:r2307_77, this:r2307_76 -# 2307| v2307_79(void) = ^IndirectReadSideEffect[-1] : &:r2307_76, m2307_47 -# 2307| m2307_80(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2307_76 -# 2307| m2307_81(iterator) = Chi : total:m2307_47, partial:m2307_80 -# 2307| r2307_82(glval) = VariableAddress[s] : -# 2307| r2307_83(glval) = FunctionAddress[~String] : -# 2307| v2307_84(void) = Call[~String] : func:r2307_83, this:r2307_82 -# 2307| m2307_85(unknown) = ^CallSideEffect : ~m2309_8 -# 2307| m2307_86(unknown) = Chi : total:m2309_8, partial:m2307_85 -# 2307| v2307_87(void) = ^IndirectReadSideEffect[-1] : &:r2307_82, ~m2307_86 -# 2307| m2307_88(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_82 -# 2307| m2307_89(unknown) = Chi : total:m2307_86, partial:m2307_88 -# 2307| r2307_90(glval>) = CopyValue : r2307_78 +# 2309| m2309_2(String) = Uninitialized[s2] : &:r2309_1 +# 2309| m2309_3(unknown) = Chi : total:m2308_75, partial:m2309_2 +# 2309| r2309_4(glval) = FunctionAddress[String] : +# 2309| v2309_5(void) = Call[String] : func:r2309_4, this:r2309_1 +# 2309| m2309_6(unknown) = ^CallSideEffect : ~m2309_3 +# 2309| m2309_7(unknown) = Chi : total:m2309_3, partial:m2309_6 +# 2309| m2309_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2309_1 +# 2309| m2309_9(unknown) = Chi : total:m2309_7, partial:m2309_8 +# 2310| r2310_1(glval) = VariableAddress[s2] : +# 2310| r2310_2(glval) = FunctionAddress[~String] : +# 2310| v2310_3(void) = Call[~String] : func:r2310_2, this:r2310_1 +# 2310| m2310_4(unknown) = ^CallSideEffect : ~m2309_9 +# 2310| m2310_5(unknown) = Chi : total:m2309_9, partial:m2310_4 +# 2310| v2310_6(void) = ^IndirectReadSideEffect[-1] : &:r2310_1, ~m2310_5 +# 2310| m2310_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2310_1 +# 2310| m2310_8(unknown) = Chi : total:m2310_5, partial:m2310_7 +# 2308| r2308_76(glval>) = VariableAddress[(__begin)] : +# 2308| r2308_77(glval) = FunctionAddress[operator++] : +# 2308| r2308_78(iterator &) = Call[operator++] : func:r2308_77, this:r2308_76 +# 2308| v2308_79(void) = ^IndirectReadSideEffect[-1] : &:r2308_76, m2308_47 +# 2308| m2308_80(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2308_76 +# 2308| m2308_81(iterator) = Chi : total:m2308_47, partial:m2308_80 +# 2308| r2308_82(glval) = VariableAddress[s] : +# 2308| r2308_83(glval) = FunctionAddress[~String] : +# 2308| v2308_84(void) = Call[~String] : func:r2308_83, this:r2308_82 +# 2308| m2308_85(unknown) = ^CallSideEffect : ~m2310_8 +# 2308| m2308_86(unknown) = Chi : total:m2310_8, partial:m2308_85 +# 2308| v2308_87(void) = ^IndirectReadSideEffect[-1] : &:r2308_82, ~m2308_86 +# 2308| m2308_88(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_82 +# 2308| m2308_89(unknown) = Chi : total:m2308_86, partial:m2308_88 +# 2308| r2308_90(glval>) = CopyValue : r2308_78 #-----| Goto (back edge) -> Block 4 -# 2307| Block 6 -# 2307| r2307_91(glval>) = CopyValue : r2307_2 -# 2307| r2307_92(glval) = FunctionAddress[~vector] : -# 2307| v2307_93(void) = Call[~vector] : func:r2307_92, this:r2307_91 -# 2307| m2307_94(unknown) = ^CallSideEffect : ~m2307_57 -# 2307| m2307_95(unknown) = Chi : total:m2307_57, partial:m2307_94 -# 2307| v2307_96(void) = ^IndirectReadSideEffect[-1] : &:r2307_91, ~m2307_95 -# 2307| m2307_97(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2307_91 -# 2307| m2307_98(unknown) = Chi : total:m2307_95, partial:m2307_97 -# 2311| r2311_1(glval) = VariableAddress[s] : -# 2311| m2311_2(String) = Uninitialized[s] : &:r2311_1 -# 2311| m2311_3(unknown) = Chi : total:m2307_98, partial:m2311_2 -# 2311| r2311_4(glval) = FunctionAddress[String] : -# 2311| r2311_5(glval) = StringConstant["hello"] : -# 2311| r2311_6(char *) = Convert : r2311_5 -# 2311| v2311_7(void) = Call[String] : func:r2311_4, this:r2311_1, 0:r2311_6 -# 2311| m2311_8(unknown) = ^CallSideEffect : ~m2311_3 -# 2311| m2311_9(unknown) = Chi : total:m2311_3, partial:m2311_8 -# 2311| v2311_10(void) = ^BufferReadSideEffect[0] : &:r2311_6, ~m2301_3 -# 2311| m2311_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 -# 2311| m2311_12(unknown) = Chi : total:m2311_9, partial:m2311_11 -# 2311| r2311_13(glval) = VariableAddress[s2] : -# 2311| m2311_14(String) = Uninitialized[s2] : &:r2311_13 -# 2311| m2311_15(unknown) = Chi : total:m2311_12, partial:m2311_14 -# 2311| r2311_16(glval) = FunctionAddress[String] : -# 2311| r2311_17(glval) = StringConstant["world"] : -# 2311| r2311_18(char *) = Convert : r2311_17 -# 2311| v2311_19(void) = Call[String] : func:r2311_16, this:r2311_13, 0:r2311_18 -# 2311| m2311_20(unknown) = ^CallSideEffect : ~m2311_15 -# 2311| m2311_21(unknown) = Chi : total:m2311_15, partial:m2311_20 -# 2311| v2311_22(void) = ^BufferReadSideEffect[0] : &:r2311_18, ~m2301_3 -# 2311| m2311_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_13 -# 2311| m2311_24(unknown) = Chi : total:m2311_21, partial:m2311_23 +# 2308| Block 6 +# 2308| r2308_91(glval>) = CopyValue : r2308_2 +# 2308| r2308_92(glval) = FunctionAddress[~vector] : +# 2308| v2308_93(void) = Call[~vector] : func:r2308_92, this:r2308_91 +# 2308| m2308_94(unknown) = ^CallSideEffect : ~m2308_57 +# 2308| m2308_95(unknown) = Chi : total:m2308_57, partial:m2308_94 +# 2308| v2308_96(void) = ^IndirectReadSideEffect[-1] : &:r2308_91, ~m2308_95 +# 2308| m2308_97(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2308_91 +# 2308| m2308_98(unknown) = Chi : total:m2308_95, partial:m2308_97 +# 2312| r2312_1(glval) = VariableAddress[s] : +# 2312| m2312_2(String) = Uninitialized[s] : &:r2312_1 +# 2312| m2312_3(unknown) = Chi : total:m2308_98, partial:m2312_2 +# 2312| r2312_4(glval) = FunctionAddress[String] : +# 2312| r2312_5(glval) = StringConstant["hello"] : +# 2312| r2312_6(char *) = Convert : r2312_5 +# 2312| v2312_7(void) = Call[String] : func:r2312_4, this:r2312_1, 0:r2312_6 +# 2312| m2312_8(unknown) = ^CallSideEffect : ~m2312_3 +# 2312| m2312_9(unknown) = Chi : total:m2312_3, partial:m2312_8 +# 2312| v2312_10(void) = ^BufferReadSideEffect[0] : &:r2312_6, ~m2302_3 +# 2312| m2312_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_1 +# 2312| m2312_12(unknown) = Chi : total:m2312_9, partial:m2312_11 +# 2312| r2312_13(glval) = VariableAddress[s2] : +# 2312| m2312_14(String) = Uninitialized[s2] : &:r2312_13 +# 2312| m2312_15(unknown) = Chi : total:m2312_12, partial:m2312_14 +# 2312| r2312_16(glval) = FunctionAddress[String] : +# 2312| r2312_17(glval) = StringConstant["world"] : +# 2312| r2312_18(char *) = Convert : r2312_17 +# 2312| v2312_19(void) = Call[String] : func:r2312_16, this:r2312_13, 0:r2312_18 +# 2312| m2312_20(unknown) = ^CallSideEffect : ~m2312_15 +# 2312| m2312_21(unknown) = Chi : total:m2312_15, partial:m2312_20 +# 2312| v2312_22(void) = ^BufferReadSideEffect[0] : &:r2312_18, ~m2302_3 +# 2312| m2312_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_13 +# 2312| m2312_24(unknown) = Chi : total:m2312_21, partial:m2312_23 #-----| Goto -> Block 7 -# 2311| Block 7 -# 2311| m2311_25(unknown) = Phi : from 6:~m2311_24, from 8:~m2311_40 -# 2311| m2311_26(char) = Phi : from 6:m2303_14, from 8:m2311_42 -# 2311| r2311_27(glval) = VariableAddress[c] : -# 2311| r2311_28(char) = Load[c] : &:r2311_27, m2311_26 -# 2311| r2311_29(int) = Convert : r2311_28 -# 2311| r2311_30(int) = Constant[0] : -# 2311| r2311_31(bool) = CompareNE : r2311_29, r2311_30 -# 2311| v2311_32(void) = ConditionalBranch : r2311_31 +# 2312| Block 7 +# 2312| m2312_25(unknown) = Phi : from 6:~m2312_24, from 8:~m2312_40 +# 2312| m2312_26(char) = Phi : from 6:m2304_14, from 8:m2312_42 +# 2312| r2312_27(glval) = VariableAddress[c] : +# 2312| r2312_28(char) = Load[c] : &:r2312_27, m2312_26 +# 2312| r2312_29(int) = Convert : r2312_28 +# 2312| r2312_30(int) = Constant[0] : +# 2312| r2312_31(bool) = CompareNE : r2312_29, r2312_30 +# 2312| v2312_32(void) = ConditionalBranch : r2312_31 #-----| False -> Block 9 #-----| True -> Block 8 -# 2312| Block 8 -# 2312| r2312_1(char) = Constant[0] : -# 2312| r2312_2(glval) = VariableAddress[c] : -# 2312| m2312_3(char) = Store[c] : &:r2312_2, r2312_1 -# 2311| r2311_33(glval) = VariableAddress[s] : -# 2311| r2311_34(glval) = FunctionAddress[pop_back] : -# 2311| r2311_35(char) = Call[pop_back] : func:r2311_34, this:r2311_33 -# 2311| m2311_36(unknown) = ^CallSideEffect : ~m2311_25 -# 2311| m2311_37(unknown) = Chi : total:m2311_25, partial:m2311_36 -# 2311| v2311_38(void) = ^IndirectReadSideEffect[-1] : &:r2311_33, ~m2311_37 -# 2311| m2311_39(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_33 -# 2311| m2311_40(unknown) = Chi : total:m2311_37, partial:m2311_39 -# 2311| r2311_41(glval) = VariableAddress[c] : -# 2311| m2311_42(char) = Store[c] : &:r2311_41, r2311_35 +# 2313| Block 8 +# 2313| r2313_1(char) = Constant[0] : +# 2313| r2313_2(glval) = VariableAddress[c] : +# 2313| m2313_3(char) = Store[c] : &:r2313_2, r2313_1 +# 2312| r2312_33(glval) = VariableAddress[s] : +# 2312| r2312_34(glval) = FunctionAddress[pop_back] : +# 2312| r2312_35(char) = Call[pop_back] : func:r2312_34, this:r2312_33 +# 2312| m2312_36(unknown) = ^CallSideEffect : ~m2312_25 +# 2312| m2312_37(unknown) = Chi : total:m2312_25, partial:m2312_36 +# 2312| v2312_38(void) = ^IndirectReadSideEffect[-1] : &:r2312_33, ~m2312_37 +# 2312| m2312_39(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_33 +# 2312| m2312_40(unknown) = Chi : total:m2312_37, partial:m2312_39 +# 2312| r2312_41(glval) = VariableAddress[c] : +# 2312| m2312_42(char) = Store[c] : &:r2312_41, r2312_35 #-----| Goto (back edge) -> Block 7 -# 2311| Block 9 -# 2311| r2311_43(glval) = VariableAddress[s2] : -# 2311| r2311_44(glval) = FunctionAddress[~String] : -# 2311| v2311_45(void) = Call[~String] : func:r2311_44, this:r2311_43 -# 2311| m2311_46(unknown) = ^CallSideEffect : ~m2311_25 -# 2311| m2311_47(unknown) = Chi : total:m2311_25, partial:m2311_46 -# 2311| v2311_48(void) = ^IndirectReadSideEffect[-1] : &:r2311_43, ~m2311_47 -# 2311| m2311_49(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_43 -# 2311| m2311_50(unknown) = Chi : total:m2311_47, partial:m2311_49 -# 2311| r2311_51(glval) = VariableAddress[s] : -# 2311| r2311_52(glval) = FunctionAddress[~String] : -# 2311| v2311_53(void) = Call[~String] : func:r2311_52, this:r2311_51 -# 2311| m2311_54(unknown) = ^CallSideEffect : ~m2311_50 -# 2311| m2311_55(unknown) = Chi : total:m2311_50, partial:m2311_54 -# 2311| v2311_56(void) = ^IndirectReadSideEffect[-1] : &:r2311_51, ~m2311_55 -# 2311| m2311_57(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_51 -# 2311| m2311_58(unknown) = Chi : total:m2311_55, partial:m2311_57 -# 2314| v2314_1(void) = NoOp : -# 2301| v2301_5(void) = ReturnVoid : -# 2301| v2301_6(void) = AliasedUse : ~m2311_55 -# 2301| v2301_7(void) = ExitFunction : +# 2312| Block 9 +# 2312| r2312_43(glval) = VariableAddress[s2] : +# 2312| r2312_44(glval) = FunctionAddress[~String] : +# 2312| v2312_45(void) = Call[~String] : func:r2312_44, this:r2312_43 +# 2312| m2312_46(unknown) = ^CallSideEffect : ~m2312_25 +# 2312| m2312_47(unknown) = Chi : total:m2312_25, partial:m2312_46 +# 2312| v2312_48(void) = ^IndirectReadSideEffect[-1] : &:r2312_43, ~m2312_47 +# 2312| m2312_49(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_43 +# 2312| m2312_50(unknown) = Chi : total:m2312_47, partial:m2312_49 +# 2312| r2312_51(glval) = VariableAddress[s] : +# 2312| r2312_52(glval) = FunctionAddress[~String] : +# 2312| v2312_53(void) = Call[~String] : func:r2312_52, this:r2312_51 +# 2312| m2312_54(unknown) = ^CallSideEffect : ~m2312_50 +# 2312| m2312_55(unknown) = Chi : total:m2312_50, partial:m2312_54 +# 2312| v2312_56(void) = ^IndirectReadSideEffect[-1] : &:r2312_51, ~m2312_55 +# 2312| m2312_57(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_51 +# 2312| m2312_58(unknown) = Chi : total:m2312_55, partial:m2312_57 +# 2315| v2315_1(void) = NoOp : +# 2302| v2302_5(void) = ReturnVoid : +# 2302| v2302_6(void) = AliasedUse : ~m2312_55 +# 2302| v2302_7(void) = ExitFunction : -# 2316| void IfDestructors2(bool) -# 2316| Block 0 -# 2316| v2316_1(void) = EnterFunction : -# 2316| m2316_2(unknown) = AliasedDefinition : -# 2316| m2316_3(unknown) = InitializeNonLocal : -# 2316| m2316_4(unknown) = Chi : total:m2316_2, partial:m2316_3 -# 2316| r2316_5(glval) = VariableAddress[b] : -# 2316| m2316_6(bool) = InitializeParameter[b] : &:r2316_5 -# 2317| r2317_1(glval) = VariableAddress[s] : -# 2317| m2317_2(String) = Uninitialized[s] : &:r2317_1 -# 2317| m2317_3(unknown) = Chi : total:m2316_4, partial:m2317_2 -# 2317| r2317_4(glval) = FunctionAddress[String] : -# 2317| r2317_5(glval) = StringConstant["hello"] : -# 2317| r2317_6(char *) = Convert : r2317_5 -# 2317| v2317_7(void) = Call[String] : func:r2317_4, this:r2317_1, 0:r2317_6 -# 2317| m2317_8(unknown) = ^CallSideEffect : ~m2317_3 -# 2317| m2317_9(unknown) = Chi : total:m2317_3, partial:m2317_8 -# 2317| v2317_10(void) = ^BufferReadSideEffect[0] : &:r2317_6, ~m2316_3 -# 2317| m2317_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2317_1 -# 2317| m2317_12(unknown) = Chi : total:m2317_9, partial:m2317_11 -# 2317| r2317_13(glval) = VariableAddress[b] : -# 2317| r2317_14(bool) = Load[b] : &:r2317_13, m2316_6 -# 2317| v2317_15(void) = ConditionalBranch : r2317_14 +# 2317| void IfDestructors2(bool) +# 2317| Block 0 +# 2317| v2317_1(void) = EnterFunction : +# 2317| m2317_2(unknown) = AliasedDefinition : +# 2317| m2317_3(unknown) = InitializeNonLocal : +# 2317| m2317_4(unknown) = Chi : total:m2317_2, partial:m2317_3 +# 2317| r2317_5(glval) = VariableAddress[b] : +# 2317| m2317_6(bool) = InitializeParameter[b] : &:r2317_5 +# 2318| r2318_1(glval) = VariableAddress[s] : +# 2318| m2318_2(String) = Uninitialized[s] : &:r2318_1 +# 2318| m2318_3(unknown) = Chi : total:m2317_4, partial:m2318_2 +# 2318| r2318_4(glval) = FunctionAddress[String] : +# 2318| r2318_5(glval) = StringConstant["hello"] : +# 2318| r2318_6(char *) = Convert : r2318_5 +# 2318| v2318_7(void) = Call[String] : func:r2318_4, this:r2318_1, 0:r2318_6 +# 2318| m2318_8(unknown) = ^CallSideEffect : ~m2318_3 +# 2318| m2318_9(unknown) = Chi : total:m2318_3, partial:m2318_8 +# 2318| v2318_10(void) = ^BufferReadSideEffect[0] : &:r2318_6, ~m2317_3 +# 2318| m2318_11(String) = ^IndirectMayWriteSideEffect[-1] : &:r2318_1 +# 2318| m2318_12(unknown) = Chi : total:m2318_9, partial:m2318_11 +# 2318| r2318_13(glval) = VariableAddress[b] : +# 2318| r2318_14(bool) = Load[b] : &:r2318_13, m2317_6 +# 2318| v2318_15(void) = ConditionalBranch : r2318_14 #-----| False -> Block 2 #-----| True -> Block 1 -# 2318| Block 1 -# 2318| r2318_1(glval) = VariableAddress[x] : -# 2318| r2318_2(int) = Constant[0] : -# 2318| m2318_3(int) = Store[x] : &:r2318_1, r2318_2 +# 2319| Block 1 +# 2319| r2319_1(glval) = VariableAddress[x] : +# 2319| r2319_2(int) = Constant[0] : +# 2319| m2319_3(int) = Store[x] : &:r2319_1, r2319_2 #-----| Goto -> Block 3 -# 2320| Block 2 -# 2320| r2320_1(glval) = VariableAddress[y] : -# 2320| r2320_2(int) = Constant[0] : -# 2320| m2320_3(int) = Store[y] : &:r2320_1, r2320_2 +# 2321| Block 2 +# 2321| r2321_1(glval) = VariableAddress[y] : +# 2321| r2321_2(int) = Constant[0] : +# 2321| m2321_3(int) = Store[y] : &:r2321_1, r2321_2 #-----| Goto -> Block 3 -# 2321| Block 3 -# 2321| r2321_1(glval) = VariableAddress[s] : -# 2321| r2321_2(glval) = FunctionAddress[~String] : -# 2321| v2321_3(void) = Call[~String] : func:r2321_2, this:r2321_1 -# 2321| m2321_4(unknown) = ^CallSideEffect : ~m2317_12 -# 2321| m2321_5(unknown) = Chi : total:m2317_12, partial:m2321_4 -# 2321| v2321_6(void) = ^IndirectReadSideEffect[-1] : &:r2321_1, ~m2321_5 -# 2321| m2321_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2321_1 -# 2321| m2321_8(unknown) = Chi : total:m2321_5, partial:m2321_7 -# 2322| v2322_1(void) = NoOp : -# 2316| v2316_7(void) = ReturnVoid : -# 2316| v2316_8(void) = AliasedUse : ~m2321_5 -# 2316| v2316_9(void) = ExitFunction : +# 2322| Block 3 +# 2322| r2322_1(glval) = VariableAddress[s] : +# 2322| r2322_2(glval) = FunctionAddress[~String] : +# 2322| v2322_3(void) = Call[~String] : func:r2322_2, this:r2322_1 +# 2322| m2322_4(unknown) = ^CallSideEffect : ~m2318_12 +# 2322| m2322_5(unknown) = Chi : total:m2318_12, partial:m2322_4 +# 2322| v2322_6(void) = ^IndirectReadSideEffect[-1] : &:r2322_1, ~m2322_5 +# 2322| m2322_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2322_1 +# 2322| m2322_8(unknown) = Chi : total:m2322_5, partial:m2322_7 +# 2323| v2323_1(void) = NoOp : +# 2317| v2317_7(void) = ReturnVoid : +# 2317| v2317_8(void) = AliasedUse : ~m2322_5 +# 2317| v2317_9(void) = ExitFunction : -# 2331| void IfDestructors3(bool) -# 2331| Block 0 -# 2331| v2331_1(void) = EnterFunction : -# 2331| m2331_2(unknown) = AliasedDefinition : -# 2331| m2331_3(unknown) = InitializeNonLocal : -# 2331| m2331_4(unknown) = Chi : total:m2331_2, partial:m2331_3 -# 2331| r2331_5(glval) = VariableAddress[b] : -# 2331| m2331_6(bool) = InitializeParameter[b] : &:r2331_5 -# 2332| r2332_1(glval) = VariableAddress[B] : -# 2332| m2332_2(Bool) = Uninitialized[B] : &:r2332_1 -# 2332| m2332_3(unknown) = Chi : total:m2331_4, partial:m2332_2 -# 2332| r2332_4(glval) = FunctionAddress[Bool] : +# 2332| void IfDestructors3(bool) +# 2332| Block 0 +# 2332| v2332_1(void) = EnterFunction : +# 2332| m2332_2(unknown) = AliasedDefinition : +# 2332| m2332_3(unknown) = InitializeNonLocal : +# 2332| m2332_4(unknown) = Chi : total:m2332_2, partial:m2332_3 # 2332| r2332_5(glval) = VariableAddress[b] : -# 2332| r2332_6(bool) = Load[b] : &:r2332_5, m2331_6 -# 2332| v2332_7(void) = Call[Bool] : func:r2332_4, this:r2332_1, 0:r2332_6 -# 2332| m2332_8(unknown) = ^CallSideEffect : ~m2332_3 -# 2332| m2332_9(unknown) = Chi : total:m2332_3, partial:m2332_8 -# 2332| m2332_10(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2332_1 -# 2332| m2332_11(unknown) = Chi : total:m2332_9, partial:m2332_10 -# 2332| r2332_12(glval) = VariableAddress[B] : -# 2332| r2332_13(glval) = FunctionAddress[operator bool] : -# 2332| r2332_14(bool) = Call[operator bool] : func:r2332_13, this:r2332_12 -# 2332| m2332_15(unknown) = ^CallSideEffect : ~m2332_11 -# 2332| m2332_16(unknown) = Chi : total:m2332_11, partial:m2332_15 -# 2332| v2332_17(void) = ^IndirectReadSideEffect[-1] : &:r2332_12, ~m2332_16 -# 2332| m2332_18(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2332_12 -# 2332| m2332_19(unknown) = Chi : total:m2332_16, partial:m2332_18 -# 2332| r2332_20(bool) = CopyValue : r2332_14 -# 2332| v2332_21(void) = ConditionalBranch : r2332_20 +# 2332| m2332_6(bool) = InitializeParameter[b] : &:r2332_5 +# 2333| r2333_1(glval) = VariableAddress[B] : +# 2333| m2333_2(Bool) = Uninitialized[B] : &:r2333_1 +# 2333| m2333_3(unknown) = Chi : total:m2332_4, partial:m2333_2 +# 2333| r2333_4(glval) = FunctionAddress[Bool] : +# 2333| r2333_5(glval) = VariableAddress[b] : +# 2333| r2333_6(bool) = Load[b] : &:r2333_5, m2332_6 +# 2333| v2333_7(void) = Call[Bool] : func:r2333_4, this:r2333_1, 0:r2333_6 +# 2333| m2333_8(unknown) = ^CallSideEffect : ~m2333_3 +# 2333| m2333_9(unknown) = Chi : total:m2333_3, partial:m2333_8 +# 2333| m2333_10(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2333_1 +# 2333| m2333_11(unknown) = Chi : total:m2333_9, partial:m2333_10 +# 2333| r2333_12(glval) = VariableAddress[B] : +# 2333| r2333_13(glval) = FunctionAddress[operator bool] : +# 2333| r2333_14(bool) = Call[operator bool] : func:r2333_13, this:r2333_12 +# 2333| m2333_15(unknown) = ^CallSideEffect : ~m2333_11 +# 2333| m2333_16(unknown) = Chi : total:m2333_11, partial:m2333_15 +# 2333| v2333_17(void) = ^IndirectReadSideEffect[-1] : &:r2333_12, ~m2333_16 +# 2333| m2333_18(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2333_12 +# 2333| m2333_19(unknown) = Chi : total:m2333_16, partial:m2333_18 +# 2333| r2333_20(bool) = CopyValue : r2333_14 +# 2333| v2333_21(void) = ConditionalBranch : r2333_20 #-----| False -> Block 2 #-----| True -> Block 1 -# 2333| Block 1 -# 2333| r2333_1(glval) = VariableAddress[s1] : -# 2333| m2333_2(String) = Uninitialized[s1] : &:r2333_1 -# 2333| m2333_3(unknown) = Chi : total:m2332_19, partial:m2333_2 -# 2333| r2333_4(glval) = FunctionAddress[String] : -# 2333| v2333_5(void) = Call[String] : func:r2333_4, this:r2333_1 -# 2333| m2333_6(unknown) = ^CallSideEffect : ~m2333_3 -# 2333| m2333_7(unknown) = Chi : total:m2333_3, partial:m2333_6 -# 2333| m2333_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2333_1 -# 2333| m2333_9(unknown) = Chi : total:m2333_7, partial:m2333_8 +# 2334| Block 1 # 2334| r2334_1(glval) = VariableAddress[s1] : -# 2334| r2334_2(glval) = FunctionAddress[~String] : -# 2334| v2334_3(void) = Call[~String] : func:r2334_2, this:r2334_1 -# 2334| m2334_4(unknown) = ^CallSideEffect : ~m2333_9 -# 2334| m2334_5(unknown) = Chi : total:m2333_9, partial:m2334_4 -# 2334| v2334_6(void) = ^IndirectReadSideEffect[-1] : &:r2334_1, ~m2334_5 -# 2334| m2334_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2334_1 -# 2334| m2334_8(unknown) = Chi : total:m2334_5, partial:m2334_7 +# 2334| m2334_2(String) = Uninitialized[s1] : &:r2334_1 +# 2334| m2334_3(unknown) = Chi : total:m2333_19, partial:m2334_2 +# 2334| r2334_4(glval) = FunctionAddress[String] : +# 2334| v2334_5(void) = Call[String] : func:r2334_4, this:r2334_1 +# 2334| m2334_6(unknown) = ^CallSideEffect : ~m2334_3 +# 2334| m2334_7(unknown) = Chi : total:m2334_3, partial:m2334_6 +# 2334| m2334_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2334_1 +# 2334| m2334_9(unknown) = Chi : total:m2334_7, partial:m2334_8 +# 2335| r2335_1(glval) = VariableAddress[s1] : +# 2335| r2335_2(glval) = FunctionAddress[~String] : +# 2335| v2335_3(void) = Call[~String] : func:r2335_2, this:r2335_1 +# 2335| m2335_4(unknown) = ^CallSideEffect : ~m2334_9 +# 2335| m2335_5(unknown) = Chi : total:m2334_9, partial:m2335_4 +# 2335| v2335_6(void) = ^IndirectReadSideEffect[-1] : &:r2335_1, ~m2335_5 +# 2335| m2335_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2335_1 +# 2335| m2335_8(unknown) = Chi : total:m2335_5, partial:m2335_7 #-----| Goto -> Block 3 -# 2335| Block 2 -# 2335| r2335_1(glval) = VariableAddress[s2] : -# 2335| m2335_2(String) = Uninitialized[s2] : &:r2335_1 -# 2335| m2335_3(unknown) = Chi : total:m2332_19, partial:m2335_2 -# 2335| r2335_4(glval) = FunctionAddress[String] : -# 2335| v2335_5(void) = Call[String] : func:r2335_4, this:r2335_1 -# 2335| m2335_6(unknown) = ^CallSideEffect : ~m2335_3 -# 2335| m2335_7(unknown) = Chi : total:m2335_3, partial:m2335_6 -# 2335| m2335_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2335_1 -# 2335| m2335_9(unknown) = Chi : total:m2335_7, partial:m2335_8 +# 2336| Block 2 # 2336| r2336_1(glval) = VariableAddress[s2] : -# 2336| r2336_2(glval) = FunctionAddress[~String] : -# 2336| v2336_3(void) = Call[~String] : func:r2336_2, this:r2336_1 -# 2336| m2336_4(unknown) = ^CallSideEffect : ~m2335_9 -# 2336| m2336_5(unknown) = Chi : total:m2335_9, partial:m2336_4 -# 2336| v2336_6(void) = ^IndirectReadSideEffect[-1] : &:r2336_1, ~m2336_5 -# 2336| m2336_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2336_1 -# 2336| m2336_8(unknown) = Chi : total:m2336_5, partial:m2336_7 +# 2336| m2336_2(String) = Uninitialized[s2] : &:r2336_1 +# 2336| m2336_3(unknown) = Chi : total:m2333_19, partial:m2336_2 +# 2336| r2336_4(glval) = FunctionAddress[String] : +# 2336| v2336_5(void) = Call[String] : func:r2336_4, this:r2336_1 +# 2336| m2336_6(unknown) = ^CallSideEffect : ~m2336_3 +# 2336| m2336_7(unknown) = Chi : total:m2336_3, partial:m2336_6 +# 2336| m2336_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2336_1 +# 2336| m2336_9(unknown) = Chi : total:m2336_7, partial:m2336_8 +# 2337| r2337_1(glval) = VariableAddress[s2] : +# 2337| r2337_2(glval) = FunctionAddress[~String] : +# 2337| v2337_3(void) = Call[~String] : func:r2337_2, this:r2337_1 +# 2337| m2337_4(unknown) = ^CallSideEffect : ~m2336_9 +# 2337| m2337_5(unknown) = Chi : total:m2336_9, partial:m2337_4 +# 2337| v2337_6(void) = ^IndirectReadSideEffect[-1] : &:r2337_1, ~m2337_5 +# 2337| m2337_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2337_1 +# 2337| m2337_8(unknown) = Chi : total:m2337_5, partial:m2337_7 #-----| Goto -> Block 3 -# 2336| Block 3 -# 2336| m2336_9(unknown) = Phi : from 1:~m2334_8, from 2:~m2336_8 -# 2336| r2336_10(glval) = VariableAddress[B] : -# 2336| r2336_11(glval) = FunctionAddress[~Bool] : -# 2336| v2336_12(void) = Call[~Bool] : func:r2336_11, this:r2336_10 -# 2336| m2336_13(unknown) = ^CallSideEffect : ~m2336_9 -# 2336| m2336_14(unknown) = Chi : total:m2336_9, partial:m2336_13 -# 2336| v2336_15(void) = ^IndirectReadSideEffect[-1] : &:r2336_10, ~m2336_14 -# 2336| m2336_16(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2336_10 -# 2336| m2336_17(unknown) = Chi : total:m2336_14, partial:m2336_16 -# 2337| v2337_1(void) = NoOp : -# 2331| v2331_7(void) = ReturnVoid : -# 2331| v2331_8(void) = AliasedUse : ~m2336_14 -# 2331| v2331_9(void) = ExitFunction : +# 2337| Block 3 +# 2337| m2337_9(unknown) = Phi : from 1:~m2335_8, from 2:~m2337_8 +# 2337| r2337_10(glval) = VariableAddress[B] : +# 2337| r2337_11(glval) = FunctionAddress[~Bool] : +# 2337| v2337_12(void) = Call[~Bool] : func:r2337_11, this:r2337_10 +# 2337| m2337_13(unknown) = ^CallSideEffect : ~m2337_9 +# 2337| m2337_14(unknown) = Chi : total:m2337_9, partial:m2337_13 +# 2337| v2337_15(void) = ^IndirectReadSideEffect[-1] : &:r2337_10, ~m2337_14 +# 2337| m2337_16(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2337_10 +# 2337| m2337_17(unknown) = Chi : total:m2337_14, partial:m2337_16 +# 2338| v2338_1(void) = NoOp : +# 2332| v2332_7(void) = ReturnVoid : +# 2332| v2332_8(void) = AliasedUse : ~m2337_14 +# 2332| v2332_9(void) = ExitFunction : -# 2339| void WhileLoopDestructors(bool) -# 2339| Block 0 -# 2339| v2339_1(void) = EnterFunction : -# 2339| m2339_2(unknown) = AliasedDefinition : -# 2339| m2339_3(unknown) = InitializeNonLocal : -# 2339| m2339_4(unknown) = Chi : total:m2339_2, partial:m2339_3 -# 2339| r2339_5(glval) = VariableAddress[b] : -# 2339| m2339_6(bool) = InitializeParameter[b] : &:r2339_5 -# 2341| r2341_1(glval) = VariableAddress[s] : -# 2341| m2341_2(String) = Uninitialized[s] : &:r2341_1 -# 2341| m2341_3(unknown) = Chi : total:m2339_4, partial:m2341_2 -# 2341| r2341_4(glval) = FunctionAddress[String] : -# 2341| v2341_5(void) = Call[String] : func:r2341_4, this:r2341_1 -# 2341| m2341_6(unknown) = ^CallSideEffect : ~m2341_3 -# 2341| m2341_7(unknown) = Chi : total:m2341_3, partial:m2341_6 -# 2341| m2341_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2341_1 -# 2341| m2341_9(unknown) = Chi : total:m2341_7, partial:m2341_8 +# 2340| void WhileLoopDestructors(bool) +# 2340| Block 0 +# 2340| v2340_1(void) = EnterFunction : +# 2340| m2340_2(unknown) = AliasedDefinition : +# 2340| m2340_3(unknown) = InitializeNonLocal : +# 2340| m2340_4(unknown) = Chi : total:m2340_2, partial:m2340_3 +# 2340| r2340_5(glval) = VariableAddress[b] : +# 2340| m2340_6(bool) = InitializeParameter[b] : &:r2340_5 +# 2342| r2342_1(glval) = VariableAddress[s] : +# 2342| m2342_2(String) = Uninitialized[s] : &:r2342_1 +# 2342| m2342_3(unknown) = Chi : total:m2340_4, partial:m2342_2 +# 2342| r2342_4(glval) = FunctionAddress[String] : +# 2342| v2342_5(void) = Call[String] : func:r2342_4, this:r2342_1 +# 2342| m2342_6(unknown) = ^CallSideEffect : ~m2342_3 +# 2342| m2342_7(unknown) = Chi : total:m2342_3, partial:m2342_6 +# 2342| m2342_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2342_1 +# 2342| m2342_9(unknown) = Chi : total:m2342_7, partial:m2342_8 #-----| Goto -> Block 1 -# 2342| Block 1 -# 2342| m2342_1(bool) = Phi : from 0:m2339_6, from 2:m2343_3 -# 2342| r2342_2(glval) = VariableAddress[b] : -# 2342| r2342_3(bool) = Load[b] : &:r2342_2, m2342_1 -# 2342| v2342_4(void) = ConditionalBranch : r2342_3 +# 2343| Block 1 +# 2343| m2343_1(bool) = Phi : from 0:m2340_6, from 2:m2344_3 +# 2343| r2343_2(glval) = VariableAddress[b] : +# 2343| r2343_3(bool) = Load[b] : &:r2343_2, m2343_1 +# 2343| v2343_4(void) = ConditionalBranch : r2343_3 #-----| False -> Block 3 #-----| True -> Block 2 -# 2343| Block 2 -# 2343| r2343_1(bool) = Constant[0] : -# 2343| r2343_2(glval) = VariableAddress[b] : -# 2343| m2343_3(bool) = Store[b] : &:r2343_2, r2343_1 +# 2344| Block 2 +# 2344| r2344_1(bool) = Constant[0] : +# 2344| r2344_2(glval) = VariableAddress[b] : +# 2344| m2344_3(bool) = Store[b] : &:r2344_2, r2344_1 #-----| Goto (back edge) -> Block 1 -# 2345| Block 3 -# 2345| r2345_1(glval) = VariableAddress[s] : -# 2345| r2345_2(glval) = FunctionAddress[~String] : -# 2345| v2345_3(void) = Call[~String] : func:r2345_2, this:r2345_1 -# 2345| m2345_4(unknown) = ^CallSideEffect : ~m2341_9 -# 2345| m2345_5(unknown) = Chi : total:m2341_9, partial:m2345_4 -# 2345| v2345_6(void) = ^IndirectReadSideEffect[-1] : &:r2345_1, ~m2345_5 -# 2345| m2345_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2345_1 -# 2345| m2345_8(unknown) = Chi : total:m2345_5, partial:m2345_7 +# 2346| Block 3 +# 2346| r2346_1(glval) = VariableAddress[s] : +# 2346| r2346_2(glval) = FunctionAddress[~String] : +# 2346| v2346_3(void) = Call[~String] : func:r2346_2, this:r2346_1 +# 2346| m2346_4(unknown) = ^CallSideEffect : ~m2342_9 +# 2346| m2346_5(unknown) = Chi : total:m2342_9, partial:m2346_4 +# 2346| v2346_6(void) = ^IndirectReadSideEffect[-1] : &:r2346_1, ~m2346_5 +# 2346| m2346_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2346_1 +# 2346| m2346_8(unknown) = Chi : total:m2346_5, partial:m2346_7 #-----| Goto -> Block 4 -# 2348| Block 4 -# 2348| m2348_1(unknown) = Phi : from 3:~m2345_8, from 5:~m2350_8 -# 2348| m2348_2(bool) = Phi : from 3:m2342_1, from 5:m2349_3 -# 2348| r2348_3(glval) = VariableAddress[B] : -# 2348| m2348_4(Bool) = Uninitialized[B] : &:r2348_3 -# 2348| m2348_5(unknown) = Chi : total:m2348_1, partial:m2348_4 -# 2348| r2348_6(glval) = FunctionAddress[Bool] : -# 2348| r2348_7(glval) = VariableAddress[b] : -# 2348| r2348_8(bool) = Load[b] : &:r2348_7, m2348_2 -# 2348| v2348_9(void) = Call[Bool] : func:r2348_6, this:r2348_3, 0:r2348_8 -# 2348| m2348_10(unknown) = ^CallSideEffect : ~m2348_5 -# 2348| m2348_11(unknown) = Chi : total:m2348_5, partial:m2348_10 -# 2348| m2348_12(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2348_3 -# 2348| m2348_13(unknown) = Chi : total:m2348_11, partial:m2348_12 -# 2348| r2348_14(glval) = VariableAddress[B] : -# 2348| r2348_15(glval) = FunctionAddress[operator bool] : -# 2348| r2348_16(bool) = Call[operator bool] : func:r2348_15, this:r2348_14 -# 2348| m2348_17(unknown) = ^CallSideEffect : ~m2348_13 -# 2348| m2348_18(unknown) = Chi : total:m2348_13, partial:m2348_17 -# 2348| v2348_19(void) = ^IndirectReadSideEffect[-1] : &:r2348_14, ~m2348_18 -# 2348| m2348_20(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2348_14 -# 2348| m2348_21(unknown) = Chi : total:m2348_18, partial:m2348_20 -# 2348| r2348_22(bool) = CopyValue : r2348_16 -# 2348| v2348_23(void) = ConditionalBranch : r2348_22 +# 2349| Block 4 +# 2349| m2349_1(unknown) = Phi : from 3:~m2346_8, from 5:~m2351_8 +# 2349| m2349_2(bool) = Phi : from 3:m2343_1, from 5:m2350_3 +# 2349| r2349_3(glval) = VariableAddress[B] : +# 2349| m2349_4(Bool) = Uninitialized[B] : &:r2349_3 +# 2349| m2349_5(unknown) = Chi : total:m2349_1, partial:m2349_4 +# 2349| r2349_6(glval) = FunctionAddress[Bool] : +# 2349| r2349_7(glval) = VariableAddress[b] : +# 2349| r2349_8(bool) = Load[b] : &:r2349_7, m2349_2 +# 2349| v2349_9(void) = Call[Bool] : func:r2349_6, this:r2349_3, 0:r2349_8 +# 2349| m2349_10(unknown) = ^CallSideEffect : ~m2349_5 +# 2349| m2349_11(unknown) = Chi : total:m2349_5, partial:m2349_10 +# 2349| m2349_12(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2349_3 +# 2349| m2349_13(unknown) = Chi : total:m2349_11, partial:m2349_12 +# 2349| r2349_14(glval) = VariableAddress[B] : +# 2349| r2349_15(glval) = FunctionAddress[operator bool] : +# 2349| r2349_16(bool) = Call[operator bool] : func:r2349_15, this:r2349_14 +# 2349| m2349_17(unknown) = ^CallSideEffect : ~m2349_13 +# 2349| m2349_18(unknown) = Chi : total:m2349_13, partial:m2349_17 +# 2349| v2349_19(void) = ^IndirectReadSideEffect[-1] : &:r2349_14, ~m2349_18 +# 2349| m2349_20(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2349_14 +# 2349| m2349_21(unknown) = Chi : total:m2349_18, partial:m2349_20 +# 2349| r2349_22(bool) = CopyValue : r2349_16 +# 2349| v2349_23(void) = ConditionalBranch : r2349_22 #-----| False -> Block 6 #-----| True -> Block 5 -# 2349| Block 5 -# 2349| r2349_1(bool) = Constant[0] : -# 2349| r2349_2(glval) = VariableAddress[b] : -# 2349| m2349_3(bool) = Store[b] : &:r2349_2, r2349_1 -# 2350| r2350_1(glval) = VariableAddress[B] : -# 2350| r2350_2(glval) = FunctionAddress[~Bool] : -# 2350| v2350_3(void) = Call[~Bool] : func:r2350_2, this:r2350_1 -# 2350| m2350_4(unknown) = ^CallSideEffect : ~m2348_21 -# 2350| m2350_5(unknown) = Chi : total:m2348_21, partial:m2350_4 -# 2350| v2350_6(void) = ^IndirectReadSideEffect[-1] : &:r2350_1, ~m2350_5 -# 2350| m2350_7(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2350_1 -# 2350| m2350_8(unknown) = Chi : total:m2350_5, partial:m2350_7 +# 2350| Block 5 +# 2350| r2350_1(bool) = Constant[0] : +# 2350| r2350_2(glval) = VariableAddress[b] : +# 2350| m2350_3(bool) = Store[b] : &:r2350_2, r2350_1 +# 2351| r2351_1(glval) = VariableAddress[B] : +# 2351| r2351_2(glval) = FunctionAddress[~Bool] : +# 2351| v2351_3(void) = Call[~Bool] : func:r2351_2, this:r2351_1 +# 2351| m2351_4(unknown) = ^CallSideEffect : ~m2349_21 +# 2351| m2351_5(unknown) = Chi : total:m2349_21, partial:m2351_4 +# 2351| v2351_6(void) = ^IndirectReadSideEffect[-1] : &:r2351_1, ~m2351_5 +# 2351| m2351_7(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2351_1 +# 2351| m2351_8(unknown) = Chi : total:m2351_5, partial:m2351_7 #-----| Goto (back edge) -> Block 4 -# 2350| Block 6 -# 2350| r2350_9(glval) = VariableAddress[B] : -# 2350| r2350_10(glval) = FunctionAddress[~Bool] : -# 2350| v2350_11(void) = Call[~Bool] : func:r2350_10, this:r2350_9 -# 2350| m2350_12(unknown) = ^CallSideEffect : ~m2348_21 -# 2350| m2350_13(unknown) = Chi : total:m2348_21, partial:m2350_12 -# 2350| v2350_14(void) = ^IndirectReadSideEffect[-1] : &:r2350_9, ~m2350_13 -# 2350| m2350_15(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2350_9 -# 2350| m2350_16(unknown) = Chi : total:m2350_13, partial:m2350_15 -# 2352| v2352_1(void) = NoOp : -# 2339| v2339_7(void) = ReturnVoid : -# 2339| v2339_8(void) = AliasedUse : ~m2350_13 -# 2339| v2339_9(void) = ExitFunction : +# 2351| Block 6 +# 2351| r2351_9(glval) = VariableAddress[B] : +# 2351| r2351_10(glval) = FunctionAddress[~Bool] : +# 2351| v2351_11(void) = Call[~Bool] : func:r2351_10, this:r2351_9 +# 2351| m2351_12(unknown) = ^CallSideEffect : ~m2349_21 +# 2351| m2351_13(unknown) = Chi : total:m2349_21, partial:m2351_12 +# 2351| v2351_14(void) = ^IndirectReadSideEffect[-1] : &:r2351_9, ~m2351_13 +# 2351| m2351_15(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2351_9 +# 2351| m2351_16(unknown) = Chi : total:m2351_13, partial:m2351_15 +# 2353| v2353_1(void) = NoOp : +# 2340| v2340_7(void) = ReturnVoid : +# 2340| v2340_8(void) = AliasedUse : ~m2351_13 +# 2340| v2340_9(void) = ExitFunction : -# 2354| void VoidFunc() -# 2354| Block 0 -# 2354| v2354_1(void) = EnterFunction : -# 2354| m2354_2(unknown) = AliasedDefinition : -# 2354| m2354_3(unknown) = InitializeNonLocal : -# 2354| m2354_4(unknown) = Chi : total:m2354_2, partial:m2354_3 -# 2354| v2354_5(void) = NoOp : -# 2354| v2354_6(void) = ReturnVoid : -# 2354| v2354_7(void) = AliasedUse : m2354_3 -# 2354| v2354_8(void) = ExitFunction : +# 2355| void VoidFunc() +# 2355| Block 0 +# 2355| v2355_1(void) = EnterFunction : +# 2355| m2355_2(unknown) = AliasedDefinition : +# 2355| m2355_3(unknown) = InitializeNonLocal : +# 2355| m2355_4(unknown) = Chi : total:m2355_2, partial:m2355_3 +# 2355| v2355_5(void) = NoOp : +# 2355| v2355_6(void) = ReturnVoid : +# 2355| v2355_7(void) = AliasedUse : m2355_3 +# 2355| v2355_8(void) = ExitFunction : -# 2356| void IfReturnDestructors(bool) -# 2356| Block 0 -# 2356| v2356_1(void) = EnterFunction : -# 2356| m2356_2(unknown) = AliasedDefinition : -# 2356| m2356_3(unknown) = InitializeNonLocal : -# 2356| m2356_4(unknown) = Chi : total:m2356_2, partial:m2356_3 -# 2356| r2356_5(glval) = VariableAddress[b] : -# 2356| m2356_6(bool) = InitializeParameter[b] : &:r2356_5 -# 2357| r2357_1(glval) = VariableAddress[s] : -# 2357| m2357_2(String) = Uninitialized[s] : &:r2357_1 -# 2357| m2357_3(unknown) = Chi : total:m2356_4, partial:m2357_2 -# 2357| r2357_4(glval) = FunctionAddress[String] : -# 2357| v2357_5(void) = Call[String] : func:r2357_4, this:r2357_1 -# 2357| m2357_6(unknown) = ^CallSideEffect : ~m2357_3 -# 2357| m2357_7(unknown) = Chi : total:m2357_3, partial:m2357_6 -# 2357| m2357_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2357_1 -# 2357| m2357_9(unknown) = Chi : total:m2357_7, partial:m2357_8 -# 2358| r2358_1(glval) = VariableAddress[b] : -# 2358| r2358_2(bool) = Load[b] : &:r2358_1, m2356_6 -# 2358| v2358_3(void) = ConditionalBranch : r2358_2 +# 2357| void IfReturnDestructors(bool) +# 2357| Block 0 +# 2357| v2357_1(void) = EnterFunction : +# 2357| m2357_2(unknown) = AliasedDefinition : +# 2357| m2357_3(unknown) = InitializeNonLocal : +# 2357| m2357_4(unknown) = Chi : total:m2357_2, partial:m2357_3 +# 2357| r2357_5(glval) = VariableAddress[b] : +# 2357| m2357_6(bool) = InitializeParameter[b] : &:r2357_5 +# 2358| r2358_1(glval) = VariableAddress[s] : +# 2358| m2358_2(String) = Uninitialized[s] : &:r2358_1 +# 2358| m2358_3(unknown) = Chi : total:m2357_4, partial:m2358_2 +# 2358| r2358_4(glval) = FunctionAddress[String] : +# 2358| v2358_5(void) = Call[String] : func:r2358_4, this:r2358_1 +# 2358| m2358_6(unknown) = ^CallSideEffect : ~m2358_3 +# 2358| m2358_7(unknown) = Chi : total:m2358_3, partial:m2358_6 +# 2358| m2358_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2358_1 +# 2358| m2358_9(unknown) = Chi : total:m2358_7, partial:m2358_8 +# 2359| r2359_1(glval) = VariableAddress[b] : +# 2359| r2359_2(bool) = Load[b] : &:r2359_1, m2357_6 +# 2359| v2359_3(void) = ConditionalBranch : r2359_2 #-----| False -> Block 3 #-----| True -> Block 2 -# 2356| Block 1 -# 2356| m2356_7(unknown) = Phi : from 2:~m2365_8, from 4:~m2365_16, from 5:~m2365_25 -# 2356| v2356_8(void) = ReturnVoid : -# 2356| v2356_9(void) = AliasedUse : ~m2356_7 -# 2356| v2356_10(void) = ExitFunction : +# 2357| Block 1 +# 2357| m2357_7(unknown) = Phi : from 2:~m2366_8, from 4:~m2366_16, from 5:~m2366_25 +# 2357| v2357_8(void) = ReturnVoid : +# 2357| v2357_9(void) = AliasedUse : ~m2357_7 +# 2357| v2357_10(void) = ExitFunction : -# 2359| Block 2 -# 2359| v2359_1(void) = NoOp : -# 2365| r2365_1(glval) = VariableAddress[s] : -# 2365| r2365_2(glval) = FunctionAddress[~String] : -# 2365| v2365_3(void) = Call[~String] : func:r2365_2, this:r2365_1 -# 2365| m2365_4(unknown) = ^CallSideEffect : ~m2357_9 -# 2365| m2365_5(unknown) = Chi : total:m2357_9, partial:m2365_4 -# 2365| v2365_6(void) = ^IndirectReadSideEffect[-1] : &:r2365_1, ~m2365_5 -# 2365| m2365_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2365_1 -# 2365| m2365_8(unknown) = Chi : total:m2365_5, partial:m2365_7 +# 2360| Block 2 +# 2360| v2360_1(void) = NoOp : +# 2366| r2366_1(glval) = VariableAddress[s] : +# 2366| r2366_2(glval) = FunctionAddress[~String] : +# 2366| v2366_3(void) = Call[~String] : func:r2366_2, this:r2366_1 +# 2366| m2366_4(unknown) = ^CallSideEffect : ~m2358_9 +# 2366| m2366_5(unknown) = Chi : total:m2358_9, partial:m2366_4 +# 2366| v2366_6(void) = ^IndirectReadSideEffect[-1] : &:r2366_1, ~m2366_5 +# 2366| m2366_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2366_1 +# 2366| m2366_8(unknown) = Chi : total:m2366_5, partial:m2366_7 #-----| Goto -> Block 1 -# 2361| Block 3 -# 2361| r2361_1(glval) = VariableAddress[b] : -# 2361| r2361_2(bool) = Load[b] : &:r2361_1, m2356_6 -# 2361| v2361_3(void) = ConditionalBranch : r2361_2 +# 2362| Block 3 +# 2362| r2362_1(glval) = VariableAddress[b] : +# 2362| r2362_2(bool) = Load[b] : &:r2362_1, m2357_6 +# 2362| v2362_3(void) = ConditionalBranch : r2362_2 #-----| False -> Block 5 #-----| True -> Block 4 -# 2362| Block 4 -# 2362| r2362_1(glval) = FunctionAddress[VoidFunc] : -# 2362| v2362_2(void) = Call[VoidFunc] : func:r2362_1 -# 2362| m2362_3(unknown) = ^CallSideEffect : ~m2357_9 -# 2362| m2362_4(unknown) = Chi : total:m2357_9, partial:m2362_3 -# 2362| v2362_5(void) = NoOp : -# 2365| r2365_9(glval) = VariableAddress[s] : -# 2365| r2365_10(glval) = FunctionAddress[~String] : -# 2365| v2365_11(void) = Call[~String] : func:r2365_10, this:r2365_9 -# 2365| m2365_12(unknown) = ^CallSideEffect : ~m2362_4 -# 2365| m2365_13(unknown) = Chi : total:m2362_4, partial:m2365_12 -# 2365| v2365_14(void) = ^IndirectReadSideEffect[-1] : &:r2365_9, ~m2365_13 -# 2365| m2365_15(String) = ^IndirectMayWriteSideEffect[-1] : &:r2365_9 -# 2365| m2365_16(unknown) = Chi : total:m2365_13, partial:m2365_15 +# 2363| Block 4 +# 2363| r2363_1(glval) = FunctionAddress[VoidFunc] : +# 2363| v2363_2(void) = Call[VoidFunc] : func:r2363_1 +# 2363| m2363_3(unknown) = ^CallSideEffect : ~m2358_9 +# 2363| m2363_4(unknown) = Chi : total:m2358_9, partial:m2363_3 +# 2363| v2363_5(void) = NoOp : +# 2366| r2366_9(glval) = VariableAddress[s] : +# 2366| r2366_10(glval) = FunctionAddress[~String] : +# 2366| v2366_11(void) = Call[~String] : func:r2366_10, this:r2366_9 +# 2366| m2366_12(unknown) = ^CallSideEffect : ~m2363_4 +# 2366| m2366_13(unknown) = Chi : total:m2363_4, partial:m2366_12 +# 2366| v2366_14(void) = ^IndirectReadSideEffect[-1] : &:r2366_9, ~m2366_13 +# 2366| m2366_15(String) = ^IndirectMayWriteSideEffect[-1] : &:r2366_9 +# 2366| m2366_16(unknown) = Chi : total:m2366_13, partial:m2366_15 #-----| Goto -> Block 1 -# 2364| Block 5 -# 2364| r2364_1(glval) = VariableAddress[s] : -# 2365| v2365_17(void) = NoOp : -# 2365| r2365_18(glval) = VariableAddress[s] : -# 2365| r2365_19(glval) = FunctionAddress[~String] : -# 2365| v2365_20(void) = Call[~String] : func:r2365_19, this:r2365_18 -# 2365| m2365_21(unknown) = ^CallSideEffect : ~m2357_9 -# 2365| m2365_22(unknown) = Chi : total:m2357_9, partial:m2365_21 -# 2365| v2365_23(void) = ^IndirectReadSideEffect[-1] : &:r2365_18, ~m2365_22 -# 2365| m2365_24(String) = ^IndirectMayWriteSideEffect[-1] : &:r2365_18 -# 2365| m2365_25(unknown) = Chi : total:m2365_22, partial:m2365_24 +# 2365| Block 5 +# 2365| r2365_1(glval) = VariableAddress[s] : +# 2366| v2366_17(void) = NoOp : +# 2366| r2366_18(glval) = VariableAddress[s] : +# 2366| r2366_19(glval) = FunctionAddress[~String] : +# 2366| v2366_20(void) = Call[~String] : func:r2366_19, this:r2366_18 +# 2366| m2366_21(unknown) = ^CallSideEffect : ~m2358_9 +# 2366| m2366_22(unknown) = Chi : total:m2358_9, partial:m2366_21 +# 2366| v2366_23(void) = ^IndirectReadSideEffect[-1] : &:r2366_18, ~m2366_22 +# 2366| m2366_24(String) = ^IndirectMayWriteSideEffect[-1] : &:r2366_18 +# 2366| m2366_25(unknown) = Chi : total:m2366_22, partial:m2366_24 #-----| Goto -> Block 1 -# 2367| int IfReturnDestructors3(bool) -# 2367| Block 0 -# 2367| v2367_1(void) = EnterFunction : -# 2367| m2367_2(unknown) = AliasedDefinition : -# 2367| m2367_3(unknown) = InitializeNonLocal : -# 2367| m2367_4(unknown) = Chi : total:m2367_2, partial:m2367_3 -# 2367| r2367_5(glval) = VariableAddress[b] : -# 2367| m2367_6(bool) = InitializeParameter[b] : &:r2367_5 -# 2368| r2368_1(glval) = VariableAddress[s] : -# 2368| m2368_2(String) = Uninitialized[s] : &:r2368_1 -# 2368| m2368_3(unknown) = Chi : total:m2367_4, partial:m2368_2 -# 2368| r2368_4(glval) = FunctionAddress[String] : -# 2368| v2368_5(void) = Call[String] : func:r2368_4, this:r2368_1 -# 2368| m2368_6(unknown) = ^CallSideEffect : ~m2368_3 -# 2368| m2368_7(unknown) = Chi : total:m2368_3, partial:m2368_6 -# 2368| m2368_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2368_1 -# 2368| m2368_9(unknown) = Chi : total:m2368_7, partial:m2368_8 -# 2369| r2369_1(glval) = VariableAddress[b] : -# 2369| r2369_2(bool) = Load[b] : &:r2369_1, m2367_6 -# 2369| v2369_3(void) = ConditionalBranch : r2369_2 +# 2368| int IfReturnDestructors3(bool) +# 2368| Block 0 +# 2368| v2368_1(void) = EnterFunction : +# 2368| m2368_2(unknown) = AliasedDefinition : +# 2368| m2368_3(unknown) = InitializeNonLocal : +# 2368| m2368_4(unknown) = Chi : total:m2368_2, partial:m2368_3 +# 2368| r2368_5(glval) = VariableAddress[b] : +# 2368| m2368_6(bool) = InitializeParameter[b] : &:r2368_5 +# 2369| r2369_1(glval) = VariableAddress[s] : +# 2369| m2369_2(String) = Uninitialized[s] : &:r2369_1 +# 2369| m2369_3(unknown) = Chi : total:m2368_4, partial:m2369_2 +# 2369| r2369_4(glval) = FunctionAddress[String] : +# 2369| v2369_5(void) = Call[String] : func:r2369_4, this:r2369_1 +# 2369| m2369_6(unknown) = ^CallSideEffect : ~m2369_3 +# 2369| m2369_7(unknown) = Chi : total:m2369_3, partial:m2369_6 +# 2369| m2369_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2369_1 +# 2369| m2369_9(unknown) = Chi : total:m2369_7, partial:m2369_8 +# 2370| r2370_1(glval) = VariableAddress[b] : +# 2370| r2370_2(bool) = Load[b] : &:r2370_1, m2368_6 +# 2370| v2370_3(void) = ConditionalBranch : r2370_2 #-----| False -> Block 3 #-----| True -> Block 2 -# 2367| Block 1 -# 2367| m2367_7(unknown) = Phi : from 2:~m2373_8, from 3:~m2373_16 -# 2367| m2367_8(int) = Phi : from 2:m2370_3, from 3:m2372_3 -# 2367| r2367_9(glval) = VariableAddress[#return] : -# 2367| v2367_10(void) = ReturnValue : &:r2367_9, m2367_8 -# 2367| v2367_11(void) = AliasedUse : ~m2367_7 -# 2367| v2367_12(void) = ExitFunction : +# 2368| Block 1 +# 2368| m2368_7(unknown) = Phi : from 2:~m2374_8, from 3:~m2374_16 +# 2368| m2368_8(int) = Phi : from 2:m2371_3, from 3:m2373_3 +# 2368| r2368_9(glval) = VariableAddress[#return] : +# 2368| v2368_10(void) = ReturnValue : &:r2368_9, m2368_8 +# 2368| v2368_11(void) = AliasedUse : ~m2368_7 +# 2368| v2368_12(void) = ExitFunction : -# 2370| Block 2 -# 2370| r2370_1(glval) = VariableAddress[#return] : -# 2370| r2370_2(int) = Constant[1] : -# 2370| m2370_3(int) = Store[#return] : &:r2370_1, r2370_2 -# 2373| r2373_1(glval) = VariableAddress[s] : -# 2373| r2373_2(glval) = FunctionAddress[~String] : -# 2373| v2373_3(void) = Call[~String] : func:r2373_2, this:r2373_1 -# 2373| m2373_4(unknown) = ^CallSideEffect : ~m2368_9 -# 2373| m2373_5(unknown) = Chi : total:m2368_9, partial:m2373_4 -# 2373| v2373_6(void) = ^IndirectReadSideEffect[-1] : &:r2373_1, ~m2373_5 -# 2373| m2373_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2373_1 -# 2373| m2373_8(unknown) = Chi : total:m2373_5, partial:m2373_7 +# 2371| Block 2 +# 2371| r2371_1(glval) = VariableAddress[#return] : +# 2371| r2371_2(int) = Constant[1] : +# 2371| m2371_3(int) = Store[#return] : &:r2371_1, r2371_2 +# 2374| r2374_1(glval) = VariableAddress[s] : +# 2374| r2374_2(glval) = FunctionAddress[~String] : +# 2374| v2374_3(void) = Call[~String] : func:r2374_2, this:r2374_1 +# 2374| m2374_4(unknown) = ^CallSideEffect : ~m2369_9 +# 2374| m2374_5(unknown) = Chi : total:m2369_9, partial:m2374_4 +# 2374| v2374_6(void) = ^IndirectReadSideEffect[-1] : &:r2374_1, ~m2374_5 +# 2374| m2374_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2374_1 +# 2374| m2374_8(unknown) = Chi : total:m2374_5, partial:m2374_7 #-----| Goto -> Block 1 -# 2372| Block 3 -# 2372| r2372_1(glval) = VariableAddress[#return] : -# 2372| r2372_2(int) = Constant[0] : -# 2372| m2372_3(int) = Store[#return] : &:r2372_1, r2372_2 -# 2373| r2373_9(glval) = VariableAddress[s] : -# 2373| r2373_10(glval) = FunctionAddress[~String] : -# 2373| v2373_11(void) = Call[~String] : func:r2373_10, this:r2373_9 -# 2373| m2373_12(unknown) = ^CallSideEffect : ~m2368_9 -# 2373| m2373_13(unknown) = Chi : total:m2368_9, partial:m2373_12 -# 2373| v2373_14(void) = ^IndirectReadSideEffect[-1] : &:r2373_9, ~m2373_13 -# 2373| m2373_15(String) = ^IndirectMayWriteSideEffect[-1] : &:r2373_9 -# 2373| m2373_16(unknown) = Chi : total:m2373_13, partial:m2373_15 +# 2373| Block 3 +# 2373| r2373_1(glval) = VariableAddress[#return] : +# 2373| r2373_2(int) = Constant[0] : +# 2373| m2373_3(int) = Store[#return] : &:r2373_1, r2373_2 +# 2374| r2374_9(glval) = VariableAddress[s] : +# 2374| r2374_10(glval) = FunctionAddress[~String] : +# 2374| v2374_11(void) = Call[~String] : func:r2374_10, this:r2374_9 +# 2374| m2374_12(unknown) = ^CallSideEffect : ~m2369_9 +# 2374| m2374_13(unknown) = Chi : total:m2369_9, partial:m2374_12 +# 2374| v2374_14(void) = ^IndirectReadSideEffect[-1] : &:r2374_9, ~m2374_13 +# 2374| m2374_15(String) = ^IndirectMayWriteSideEffect[-1] : &:r2374_9 +# 2374| m2374_16(unknown) = Chi : total:m2374_13, partial:m2374_15 #-----| Goto -> Block 1 -# 2375| void VoidReturnDestructors() -# 2375| Block 0 -# 2375| v2375_1(void) = EnterFunction : -# 2375| m2375_2(unknown) = AliasedDefinition : -# 2375| m2375_3(unknown) = InitializeNonLocal : -# 2375| m2375_4(unknown) = Chi : total:m2375_2, partial:m2375_3 -# 2376| r2376_1(glval) = VariableAddress[s] : -# 2376| m2376_2(String) = Uninitialized[s] : &:r2376_1 -# 2376| m2376_3(unknown) = Chi : total:m2375_4, partial:m2376_2 -# 2376| r2376_4(glval) = FunctionAddress[String] : -# 2376| v2376_5(void) = Call[String] : func:r2376_4, this:r2376_1 -# 2376| m2376_6(unknown) = ^CallSideEffect : ~m2376_3 -# 2376| m2376_7(unknown) = Chi : total:m2376_3, partial:m2376_6 -# 2376| m2376_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2376_1 -# 2376| m2376_9(unknown) = Chi : total:m2376_7, partial:m2376_8 -# 2377| r2377_1(glval) = FunctionAddress[VoidFunc] : -# 2377| v2377_2(void) = Call[VoidFunc] : func:r2377_1 -# 2377| m2377_3(unknown) = ^CallSideEffect : ~m2376_9 -# 2377| m2377_4(unknown) = Chi : total:m2376_9, partial:m2377_3 -# 2377| v2377_5(void) = NoOp : -# 2378| r2378_1(glval) = VariableAddress[s] : -# 2378| r2378_2(glval) = FunctionAddress[~String] : -# 2378| v2378_3(void) = Call[~String] : func:r2378_2, this:r2378_1 -# 2378| m2378_4(unknown) = ^CallSideEffect : ~m2377_4 -# 2378| m2378_5(unknown) = Chi : total:m2377_4, partial:m2378_4 -# 2378| v2378_6(void) = ^IndirectReadSideEffect[-1] : &:r2378_1, ~m2378_5 -# 2378| m2378_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2378_1 -# 2378| m2378_8(unknown) = Chi : total:m2378_5, partial:m2378_7 -# 2375| v2375_5(void) = ReturnVoid : -# 2375| v2375_6(void) = AliasedUse : ~m2378_5 -# 2375| v2375_7(void) = ExitFunction : +# 2376| void VoidReturnDestructors() +# 2376| Block 0 +# 2376| v2376_1(void) = EnterFunction : +# 2376| m2376_2(unknown) = AliasedDefinition : +# 2376| m2376_3(unknown) = InitializeNonLocal : +# 2376| m2376_4(unknown) = Chi : total:m2376_2, partial:m2376_3 +# 2377| r2377_1(glval) = VariableAddress[s] : +# 2377| m2377_2(String) = Uninitialized[s] : &:r2377_1 +# 2377| m2377_3(unknown) = Chi : total:m2376_4, partial:m2377_2 +# 2377| r2377_4(glval) = FunctionAddress[String] : +# 2377| v2377_5(void) = Call[String] : func:r2377_4, this:r2377_1 +# 2377| m2377_6(unknown) = ^CallSideEffect : ~m2377_3 +# 2377| m2377_7(unknown) = Chi : total:m2377_3, partial:m2377_6 +# 2377| m2377_8(String) = ^IndirectMayWriteSideEffect[-1] : &:r2377_1 +# 2377| m2377_9(unknown) = Chi : total:m2377_7, partial:m2377_8 +# 2378| r2378_1(glval) = FunctionAddress[VoidFunc] : +# 2378| v2378_2(void) = Call[VoidFunc] : func:r2378_1 +# 2378| m2378_3(unknown) = ^CallSideEffect : ~m2377_9 +# 2378| m2378_4(unknown) = Chi : total:m2377_9, partial:m2378_3 +# 2378| v2378_5(void) = NoOp : +# 2379| r2379_1(glval) = VariableAddress[s] : +# 2379| r2379_2(glval) = FunctionAddress[~String] : +# 2379| v2379_3(void) = Call[~String] : func:r2379_2, this:r2379_1 +# 2379| m2379_4(unknown) = ^CallSideEffect : ~m2378_4 +# 2379| m2379_5(unknown) = Chi : total:m2378_4, partial:m2379_4 +# 2379| v2379_6(void) = ^IndirectReadSideEffect[-1] : &:r2379_1, ~m2379_5 +# 2379| m2379_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2379_1 +# 2379| m2379_8(unknown) = Chi : total:m2379_5, partial:m2379_7 +# 2376| v2376_5(void) = ReturnVoid : +# 2376| v2376_6(void) = AliasedUse : ~m2379_5 +# 2376| v2376_7(void) = ExitFunction : -# 2388| return_routine_type::VoidToIntMemberFunc return_routine_type::GetVoidToIntFunc() -# 2388| Block 0 -# 2388| v2388_1(void) = EnterFunction : -# 2388| m2388_2(unknown) = AliasedDefinition : -# 2388| m2388_3(unknown) = InitializeNonLocal : -# 2388| m2388_4(unknown) = Chi : total:m2388_2, partial:m2388_3 -# 2390| r2390_1(glval<..:: *>) = VariableAddress[#return] : -# 2390| r2390_2(..()(..)) = FunctionAddress[VoidToInt] : -# 2390| m2390_3(..:: *) = Store[#return] : &:r2390_1, r2390_2 -# 2388| r2388_5(glval<..:: *>) = VariableAddress[#return] : -# 2388| v2388_6(void) = ReturnValue : &:r2388_5, m2390_3 -# 2388| v2388_7(void) = AliasedUse : m2388_3 -# 2388| v2388_8(void) = ExitFunction : +# 2389| return_routine_type::VoidToIntMemberFunc return_routine_type::GetVoidToIntFunc() +# 2389| Block 0 +# 2389| v2389_1(void) = EnterFunction : +# 2389| m2389_2(unknown) = AliasedDefinition : +# 2389| m2389_3(unknown) = InitializeNonLocal : +# 2389| m2389_4(unknown) = Chi : total:m2389_2, partial:m2389_3 +# 2391| r2391_1(glval<..:: *>) = VariableAddress[#return] : +# 2391| r2391_2(..()(..)) = FunctionAddress[VoidToInt] : +# 2391| m2391_3(..:: *) = Store[#return] : &:r2391_1, r2391_2 +# 2389| r2389_5(glval<..:: *>) = VariableAddress[#return] : +# 2389| v2389_6(void) = ReturnValue : &:r2389_5, m2391_3 +# 2389| v2389_7(void) = AliasedUse : m2389_3 +# 2389| v2389_8(void) = ExitFunction : -# 2395| int small_operation_should_not_be_constant_folded() -# 2395| Block 0 -# 2395| v2395_1(void) = EnterFunction : -# 2395| m2395_2(unknown) = AliasedDefinition : -# 2395| m2395_3(unknown) = InitializeNonLocal : -# 2395| m2395_4(unknown) = Chi : total:m2395_2, partial:m2395_3 -# 2396| r2396_1(glval) = VariableAddress[#return] : -# 2396| r2396_2(int) = Constant[1] : -# 2396| r2396_3(int) = Constant[2] : -# 2396| r2396_4(int) = BitXor : r2396_2, r2396_3 -# 2396| m2396_5(int) = Store[#return] : &:r2396_1, r2396_4 -# 2395| r2395_5(glval) = VariableAddress[#return] : -# 2395| v2395_6(void) = ReturnValue : &:r2395_5, m2396_5 -# 2395| v2395_7(void) = AliasedUse : m2395_3 -# 2395| v2395_8(void) = ExitFunction : +# 2396| int small_operation_should_not_be_constant_folded() +# 2396| Block 0 +# 2396| v2396_1(void) = EnterFunction : +# 2396| m2396_2(unknown) = AliasedDefinition : +# 2396| m2396_3(unknown) = InitializeNonLocal : +# 2396| m2396_4(unknown) = Chi : total:m2396_2, partial:m2396_3 +# 2397| r2397_1(glval) = VariableAddress[#return] : +# 2397| r2397_2(int) = Constant[1] : +# 2397| r2397_3(int) = Constant[2] : +# 2397| r2397_4(int) = BitXor : r2397_2, r2397_3 +# 2397| m2397_5(int) = Store[#return] : &:r2397_1, r2397_4 +# 2396| r2396_5(glval) = VariableAddress[#return] : +# 2396| v2396_6(void) = ReturnValue : &:r2396_5, m2397_5 +# 2396| v2396_7(void) = AliasedUse : m2396_3 +# 2396| v2396_8(void) = ExitFunction : -# 2406| int large_operation_should_be_constant_folded() -# 2406| Block 0 -# 2406| v2406_1(void) = EnterFunction : -# 2406| m2406_2(unknown) = AliasedDefinition : -# 2406| m2406_3(unknown) = InitializeNonLocal : -# 2406| m2406_4(unknown) = Chi : total:m2406_2, partial:m2406_3 -# 2407| r2407_1(glval) = VariableAddress[#return] : -# 2407| r2407_2(int) = Constant[0] : -# 2407| m2407_3(int) = Store[#return] : &:r2407_1, r2407_2 -# 2406| r2406_5(glval) = VariableAddress[#return] : -# 2406| v2406_6(void) = ReturnValue : &:r2406_5, m2407_3 -# 2406| v2406_7(void) = AliasedUse : m2406_3 -# 2406| v2406_8(void) = ExitFunction : +# 2407| int large_operation_should_be_constant_folded() +# 2407| Block 0 +# 2407| v2407_1(void) = EnterFunction : +# 2407| m2407_2(unknown) = AliasedDefinition : +# 2407| m2407_3(unknown) = InitializeNonLocal : +# 2407| m2407_4(unknown) = Chi : total:m2407_2, partial:m2407_3 +# 2408| r2408_1(glval) = VariableAddress[#return] : +# 2408| r2408_2(int) = Constant[0] : +# 2408| m2408_3(int) = Store[#return] : &:r2408_1, r2408_2 +# 2407| r2407_5(glval) = VariableAddress[#return] : +# 2407| v2407_6(void) = ReturnValue : &:r2407_5, m2408_3 +# 2407| v2407_7(void) = AliasedUse : m2407_3 +# 2407| v2407_8(void) = ExitFunction : -# 2410| void initialization_with_temp_destructor() -# 2410| Block 0 -# 2410| v2410_1(void) = EnterFunction : -# 2410| m2410_2(unknown) = AliasedDefinition : -# 2410| m2410_3(unknown) = InitializeNonLocal : -# 2410| m2410_4(unknown) = Chi : total:m2410_2, partial:m2410_3 -# 2411| r2411_1(glval) = VariableAddress[x] : -# 2411| r2411_2(glval) = VariableAddress[#temp2411:18] : -# 2411| m2411_3(ClassWithDestructor) = Uninitialized[#temp2411:18] : &:r2411_2 -# 2411| r2411_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2411| v2411_5(void) = Call[ClassWithDestructor] : func:r2411_4, this:r2411_2 -# 2411| m2411_6(unknown) = ^CallSideEffect : ~m2410_4 -# 2411| m2411_7(unknown) = Chi : total:m2410_4, partial:m2411_6 -# 2411| m2411_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2411_2 -# 2411| m2411_9(ClassWithDestructor) = Chi : total:m2411_3, partial:m2411_8 -# 2411| r2411_10(glval) = FunctionAddress[get_x] : -# 2411| r2411_11(char) = Call[get_x] : func:r2411_10, this:r2411_2 -# 2411| m2411_12(unknown) = ^CallSideEffect : ~m2411_7 -# 2411| m2411_13(unknown) = Chi : total:m2411_7, partial:m2411_12 -# 2411| v2411_14(void) = ^IndirectReadSideEffect[-1] : &:r2411_2, m2411_9 -# 2411| m2411_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2411_2 -# 2411| m2411_16(ClassWithDestructor) = Chi : total:m2411_9, partial:m2411_15 -# 2411| r2411_17(glval) = CopyValue : r2411_2 -# 2411| r2411_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2411| v2411_19(void) = Call[~ClassWithDestructor] : func:r2411_18, this:r2411_17 -# 2411| m2411_20(unknown) = ^CallSideEffect : ~m2411_13 -# 2411| m2411_21(unknown) = Chi : total:m2411_13, partial:m2411_20 -# 2411| v2411_22(void) = ^IndirectReadSideEffect[-1] : &:r2411_17, m2411_16 -# 2411| m2411_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2411_17 -# 2411| m2411_24(ClassWithDestructor) = Chi : total:m2411_16, partial:m2411_23 -# 2411| m2411_25(char) = Store[x] : &:r2411_1, r2411_11 -# 2411| r2411_26(glval) = VariableAddress[x] : -# 2411| r2411_27(char) = Load[x] : &:r2411_26, m2411_25 -# 2411| r2411_28(char) = Constant[0] : -# 2411| r2411_29(bool) = CompareNE : r2411_27, r2411_28 -# 2411| r2411_30(bool) = CopyValue : r2411_29 -# 2411| v2411_31(void) = ConditionalBranch : r2411_30 +# 2411| void initialization_with_temp_destructor() +# 2411| Block 0 +# 2411| v2411_1(void) = EnterFunction : +# 2411| m2411_2(unknown) = AliasedDefinition : +# 2411| m2411_3(unknown) = InitializeNonLocal : +# 2411| m2411_4(unknown) = Chi : total:m2411_2, partial:m2411_3 +# 2412| r2412_1(glval) = VariableAddress[x] : +# 2412| r2412_2(glval) = VariableAddress[#temp2412:18] : +# 2412| m2412_3(ClassWithDestructor) = Uninitialized[#temp2412:18] : &:r2412_2 +# 2412| r2412_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2412| v2412_5(void) = Call[ClassWithDestructor] : func:r2412_4, this:r2412_2 +# 2412| m2412_6(unknown) = ^CallSideEffect : ~m2411_4 +# 2412| m2412_7(unknown) = Chi : total:m2411_4, partial:m2412_6 +# 2412| m2412_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2412_2 +# 2412| m2412_9(ClassWithDestructor) = Chi : total:m2412_3, partial:m2412_8 +# 2412| r2412_10(glval) = FunctionAddress[get_x] : +# 2412| r2412_11(char) = Call[get_x] : func:r2412_10, this:r2412_2 +# 2412| m2412_12(unknown) = ^CallSideEffect : ~m2412_7 +# 2412| m2412_13(unknown) = Chi : total:m2412_7, partial:m2412_12 +# 2412| v2412_14(void) = ^IndirectReadSideEffect[-1] : &:r2412_2, m2412_9 +# 2412| m2412_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2412_2 +# 2412| m2412_16(ClassWithDestructor) = Chi : total:m2412_9, partial:m2412_15 +# 2412| r2412_17(glval) = CopyValue : r2412_2 +# 2412| r2412_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2412| v2412_19(void) = Call[~ClassWithDestructor] : func:r2412_18, this:r2412_17 +# 2412| m2412_20(unknown) = ^CallSideEffect : ~m2412_13 +# 2412| m2412_21(unknown) = Chi : total:m2412_13, partial:m2412_20 +# 2412| v2412_22(void) = ^IndirectReadSideEffect[-1] : &:r2412_17, m2412_16 +# 2412| m2412_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2412_17 +# 2412| m2412_24(ClassWithDestructor) = Chi : total:m2412_16, partial:m2412_23 +# 2412| m2412_25(char) = Store[x] : &:r2412_1, r2412_11 +# 2412| r2412_26(glval) = VariableAddress[x] : +# 2412| r2412_27(char) = Load[x] : &:r2412_26, m2412_25 +# 2412| r2412_28(char) = Constant[0] : +# 2412| r2412_29(bool) = CompareNE : r2412_27, r2412_28 +# 2412| r2412_30(bool) = CopyValue : r2412_29 +# 2412| v2412_31(void) = ConditionalBranch : r2412_30 #-----| False -> Block 2 #-----| True -> Block 1 -# 2412| Block 1 -# 2412| r2412_1(glval) = VariableAddress[x] : -# 2412| r2412_2(char) = Load[x] : &:r2412_1, m2411_25 -# 2412| r2412_3(char) = Constant[1] : -# 2412| r2412_4(char) = Add : r2412_2, r2412_3 -# 2412| m2412_5(char) = Store[x] : &:r2412_1, r2412_4 +# 2413| Block 1 +# 2413| r2413_1(glval) = VariableAddress[x] : +# 2413| r2413_2(char) = Load[x] : &:r2413_1, m2412_25 +# 2413| r2413_3(char) = Constant[1] : +# 2413| r2413_4(char) = Add : r2413_2, r2413_3 +# 2413| m2413_5(char) = Store[x] : &:r2413_1, r2413_4 #-----| Goto -> Block 2 -# 2414| Block 2 -# 2414| r2414_1(glval) = VariableAddress[x] : -# 2414| r2414_2(glval) = VariableAddress[#temp2414:18] : -# 2414| m2414_3(ClassWithDestructor) = Uninitialized[#temp2414:18] : &:r2414_2 -# 2414| r2414_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2414| v2414_5(void) = Call[ClassWithDestructor] : func:r2414_4, this:r2414_2 -# 2414| m2414_6(unknown) = ^CallSideEffect : ~m2411_21 -# 2414| m2414_7(unknown) = Chi : total:m2411_21, partial:m2414_6 -# 2414| m2414_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2414_2 -# 2414| m2414_9(ClassWithDestructor) = Chi : total:m2414_3, partial:m2414_8 -# 2414| r2414_10(glval) = FunctionAddress[get_x] : -# 2414| r2414_11(char) = Call[get_x] : func:r2414_10, this:r2414_2 -# 2414| m2414_12(unknown) = ^CallSideEffect : ~m2414_7 -# 2414| m2414_13(unknown) = Chi : total:m2414_7, partial:m2414_12 -# 2414| v2414_14(void) = ^IndirectReadSideEffect[-1] : &:r2414_2, m2414_9 -# 2414| m2414_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2414_2 -# 2414| m2414_16(ClassWithDestructor) = Chi : total:m2414_9, partial:m2414_15 -# 2414| r2414_17(glval) = CopyValue : r2414_2 -# 2414| r2414_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2414| v2414_19(void) = Call[~ClassWithDestructor] : func:r2414_18, this:r2414_17 -# 2414| m2414_20(unknown) = ^CallSideEffect : ~m2414_13 -# 2414| m2414_21(unknown) = Chi : total:m2414_13, partial:m2414_20 -# 2414| v2414_22(void) = ^IndirectReadSideEffect[-1] : &:r2414_17, m2414_16 -# 2414| m2414_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2414_17 -# 2414| m2414_24(ClassWithDestructor) = Chi : total:m2414_16, partial:m2414_23 -# 2414| m2414_25(char) = Store[x] : &:r2414_1, r2414_11 -# 2414| r2414_26(glval) = VariableAddress[x] : -# 2414| r2414_27(char) = Load[x] : &:r2414_26, m2414_25 -# 2414| r2414_28(char) = Constant[0] : -# 2414| r2414_29(bool) = CompareNE : r2414_27, r2414_28 -# 2414| v2414_30(void) = ConditionalBranch : r2414_29 +# 2415| Block 2 +# 2415| r2415_1(glval) = VariableAddress[x] : +# 2415| r2415_2(glval) = VariableAddress[#temp2415:18] : +# 2415| m2415_3(ClassWithDestructor) = Uninitialized[#temp2415:18] : &:r2415_2 +# 2415| r2415_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2415| v2415_5(void) = Call[ClassWithDestructor] : func:r2415_4, this:r2415_2 +# 2415| m2415_6(unknown) = ^CallSideEffect : ~m2412_21 +# 2415| m2415_7(unknown) = Chi : total:m2412_21, partial:m2415_6 +# 2415| m2415_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2415_2 +# 2415| m2415_9(ClassWithDestructor) = Chi : total:m2415_3, partial:m2415_8 +# 2415| r2415_10(glval) = FunctionAddress[get_x] : +# 2415| r2415_11(char) = Call[get_x] : func:r2415_10, this:r2415_2 +# 2415| m2415_12(unknown) = ^CallSideEffect : ~m2415_7 +# 2415| m2415_13(unknown) = Chi : total:m2415_7, partial:m2415_12 +# 2415| v2415_14(void) = ^IndirectReadSideEffect[-1] : &:r2415_2, m2415_9 +# 2415| m2415_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2415_2 +# 2415| m2415_16(ClassWithDestructor) = Chi : total:m2415_9, partial:m2415_15 +# 2415| r2415_17(glval) = CopyValue : r2415_2 +# 2415| r2415_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2415| v2415_19(void) = Call[~ClassWithDestructor] : func:r2415_18, this:r2415_17 +# 2415| m2415_20(unknown) = ^CallSideEffect : ~m2415_13 +# 2415| m2415_21(unknown) = Chi : total:m2415_13, partial:m2415_20 +# 2415| v2415_22(void) = ^IndirectReadSideEffect[-1] : &:r2415_17, m2415_16 +# 2415| m2415_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2415_17 +# 2415| m2415_24(ClassWithDestructor) = Chi : total:m2415_16, partial:m2415_23 +# 2415| m2415_25(char) = Store[x] : &:r2415_1, r2415_11 +# 2415| r2415_26(glval) = VariableAddress[x] : +# 2415| r2415_27(char) = Load[x] : &:r2415_26, m2415_25 +# 2415| r2415_28(char) = Constant[0] : +# 2415| r2415_29(bool) = CompareNE : r2415_27, r2415_28 +# 2415| v2415_30(void) = ConditionalBranch : r2415_29 #-----| False -> Block 4 #-----| True -> Block 3 -# 2415| Block 3 -# 2415| r2415_1(glval) = VariableAddress[x] : -# 2415| r2415_2(char) = Load[x] : &:r2415_1, m2414_25 -# 2415| r2415_3(char) = Constant[1] : -# 2415| r2415_4(char) = Add : r2415_2, r2415_3 -# 2415| m2415_5(char) = Store[x] : &:r2415_1, r2415_4 +# 2416| Block 3 +# 2416| r2416_1(glval) = VariableAddress[x] : +# 2416| r2416_2(char) = Load[x] : &:r2416_1, m2415_25 +# 2416| r2416_3(char) = Constant[1] : +# 2416| r2416_4(char) = Add : r2416_2, r2416_3 +# 2416| m2416_5(char) = Store[x] : &:r2416_1, r2416_4 #-----| Goto -> Block 4 -# 2417| Block 4 -# 2417| r2417_1(glval) = VariableAddress[x] : -# 2417| r2417_2(glval) = VariableAddress[#temp2417:28] : -# 2417| m2417_3(ClassWithDestructor) = Uninitialized[#temp2417:28] : &:r2417_2 -# 2417| r2417_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2417| v2417_5(void) = Call[ClassWithDestructor] : func:r2417_4, this:r2417_2 -# 2417| m2417_6(unknown) = ^CallSideEffect : ~m2414_21 -# 2417| m2417_7(unknown) = Chi : total:m2414_21, partial:m2417_6 -# 2417| m2417_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2417_2 -# 2417| m2417_9(ClassWithDestructor) = Chi : total:m2417_3, partial:m2417_8 -# 2417| r2417_10(glval) = FunctionAddress[get_x] : -# 2417| r2417_11(char) = Call[get_x] : func:r2417_10, this:r2417_2 -# 2417| m2417_12(unknown) = ^CallSideEffect : ~m2417_7 -# 2417| m2417_13(unknown) = Chi : total:m2417_7, partial:m2417_12 -# 2417| v2417_14(void) = ^IndirectReadSideEffect[-1] : &:r2417_2, m2417_9 -# 2417| m2417_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2417_2 -# 2417| m2417_16(ClassWithDestructor) = Chi : total:m2417_9, partial:m2417_15 -# 2417| r2417_17(glval) = CopyValue : r2417_2 -# 2417| r2417_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2417| v2417_19(void) = Call[~ClassWithDestructor] : func:r2417_18, this:r2417_17 -# 2417| m2417_20(unknown) = ^CallSideEffect : ~m2417_13 -# 2417| m2417_21(unknown) = Chi : total:m2417_13, partial:m2417_20 -# 2417| v2417_22(void) = ^IndirectReadSideEffect[-1] : &:r2417_17, m2417_16 -# 2417| m2417_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2417_17 -# 2417| m2417_24(ClassWithDestructor) = Chi : total:m2417_16, partial:m2417_23 -# 2417| m2417_25(char) = Store[x] : &:r2417_1, r2417_11 -# 2417| r2417_26(bool) = Constant[1] : -# 2417| v2417_27(void) = ConditionalBranch : r2417_26 +# 2418| Block 4 +# 2418| r2418_1(glval) = VariableAddress[x] : +# 2418| r2418_2(glval) = VariableAddress[#temp2418:28] : +# 2418| m2418_3(ClassWithDestructor) = Uninitialized[#temp2418:28] : &:r2418_2 +# 2418| r2418_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2418| v2418_5(void) = Call[ClassWithDestructor] : func:r2418_4, this:r2418_2 +# 2418| m2418_6(unknown) = ^CallSideEffect : ~m2415_21 +# 2418| m2418_7(unknown) = Chi : total:m2415_21, partial:m2418_6 +# 2418| m2418_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2418_2 +# 2418| m2418_9(ClassWithDestructor) = Chi : total:m2418_3, partial:m2418_8 +# 2418| r2418_10(glval) = FunctionAddress[get_x] : +# 2418| r2418_11(char) = Call[get_x] : func:r2418_10, this:r2418_2 +# 2418| m2418_12(unknown) = ^CallSideEffect : ~m2418_7 +# 2418| m2418_13(unknown) = Chi : total:m2418_7, partial:m2418_12 +# 2418| v2418_14(void) = ^IndirectReadSideEffect[-1] : &:r2418_2, m2418_9 +# 2418| m2418_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2418_2 +# 2418| m2418_16(ClassWithDestructor) = Chi : total:m2418_9, partial:m2418_15 +# 2418| r2418_17(glval) = CopyValue : r2418_2 +# 2418| r2418_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2418| v2418_19(void) = Call[~ClassWithDestructor] : func:r2418_18, this:r2418_17 +# 2418| m2418_20(unknown) = ^CallSideEffect : ~m2418_13 +# 2418| m2418_21(unknown) = Chi : total:m2418_13, partial:m2418_20 +# 2418| v2418_22(void) = ^IndirectReadSideEffect[-1] : &:r2418_17, m2418_16 +# 2418| m2418_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2418_17 +# 2418| m2418_24(ClassWithDestructor) = Chi : total:m2418_16, partial:m2418_23 +# 2418| m2418_25(char) = Store[x] : &:r2418_1, r2418_11 +# 2418| r2418_26(bool) = Constant[1] : +# 2418| v2418_27(void) = ConditionalBranch : r2418_26 #-----| False -> Block 13 #-----| True -> Block 5 -# 2418| Block 5 -# 2418| r2418_1(glval) = VariableAddress[x] : -# 2418| r2418_2(char) = Load[x] : &:r2418_1, m2417_25 -# 2418| r2418_3(char) = Constant[1] : -# 2418| r2418_4(char) = Add : r2418_2, r2418_3 -# 2418| m2418_5(char) = Store[x] : &:r2418_1, r2418_4 -# 2420| r2420_1(glval) = VariableAddress[x] : -# 2420| r2420_2(glval) = VariableAddress[#temp2420:21] : -# 2420| m2420_3(ClassWithDestructor) = Uninitialized[#temp2420:21] : &:r2420_2 -# 2420| r2420_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2420| v2420_5(void) = Call[ClassWithDestructor] : func:r2420_4, this:r2420_2 -# 2420| m2420_6(unknown) = ^CallSideEffect : ~m2417_21 -# 2420| m2420_7(unknown) = Chi : total:m2417_21, partial:m2420_6 -# 2420| m2420_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2420_2 -# 2420| m2420_9(ClassWithDestructor) = Chi : total:m2420_3, partial:m2420_8 -# 2420| r2420_10(glval) = FunctionAddress[get_x] : -# 2420| r2420_11(char) = Call[get_x] : func:r2420_10, this:r2420_2 -# 2420| m2420_12(unknown) = ^CallSideEffect : ~m2420_7 -# 2420| m2420_13(unknown) = Chi : total:m2420_7, partial:m2420_12 -# 2420| v2420_14(void) = ^IndirectReadSideEffect[-1] : &:r2420_2, m2420_9 -# 2420| m2420_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2420_2 -# 2420| m2420_16(ClassWithDestructor) = Chi : total:m2420_9, partial:m2420_15 -# 2420| r2420_17(glval) = CopyValue : r2420_2 -# 2420| r2420_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2420| v2420_19(void) = Call[~ClassWithDestructor] : func:r2420_18, this:r2420_17 -# 2420| m2420_20(unknown) = ^CallSideEffect : ~m2420_13 -# 2420| m2420_21(unknown) = Chi : total:m2420_13, partial:m2420_20 -# 2420| v2420_22(void) = ^IndirectReadSideEffect[-1] : &:r2420_17, m2420_16 -# 2420| m2420_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2420_17 -# 2420| m2420_24(ClassWithDestructor) = Chi : total:m2420_16, partial:m2420_23 -# 2420| m2420_25(char) = Store[x] : &:r2420_1, r2420_11 -# 2420| r2420_26(glval) = VariableAddress[x] : -# 2420| r2420_27(char) = Load[x] : &:r2420_26, m2420_25 -# 2420| r2420_28(int) = Convert : r2420_27 -# 2420| r2420_29(int) = CopyValue : r2420_28 -# 2420| v2420_30(void) = Switch : r2420_29 +# 2419| Block 5 +# 2419| r2419_1(glval) = VariableAddress[x] : +# 2419| r2419_2(char) = Load[x] : &:r2419_1, m2418_25 +# 2419| r2419_3(char) = Constant[1] : +# 2419| r2419_4(char) = Add : r2419_2, r2419_3 +# 2419| m2419_5(char) = Store[x] : &:r2419_1, r2419_4 +# 2421| r2421_1(glval) = VariableAddress[x] : +# 2421| r2421_2(glval) = VariableAddress[#temp2421:21] : +# 2421| m2421_3(ClassWithDestructor) = Uninitialized[#temp2421:21] : &:r2421_2 +# 2421| r2421_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2421| v2421_5(void) = Call[ClassWithDestructor] : func:r2421_4, this:r2421_2 +# 2421| m2421_6(unknown) = ^CallSideEffect : ~m2418_21 +# 2421| m2421_7(unknown) = Chi : total:m2418_21, partial:m2421_6 +# 2421| m2421_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2421_2 +# 2421| m2421_9(ClassWithDestructor) = Chi : total:m2421_3, partial:m2421_8 +# 2421| r2421_10(glval) = FunctionAddress[get_x] : +# 2421| r2421_11(char) = Call[get_x] : func:r2421_10, this:r2421_2 +# 2421| m2421_12(unknown) = ^CallSideEffect : ~m2421_7 +# 2421| m2421_13(unknown) = Chi : total:m2421_7, partial:m2421_12 +# 2421| v2421_14(void) = ^IndirectReadSideEffect[-1] : &:r2421_2, m2421_9 +# 2421| m2421_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2421_2 +# 2421| m2421_16(ClassWithDestructor) = Chi : total:m2421_9, partial:m2421_15 +# 2421| r2421_17(glval) = CopyValue : r2421_2 +# 2421| r2421_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2421| v2421_19(void) = Call[~ClassWithDestructor] : func:r2421_18, this:r2421_17 +# 2421| m2421_20(unknown) = ^CallSideEffect : ~m2421_13 +# 2421| m2421_21(unknown) = Chi : total:m2421_13, partial:m2421_20 +# 2421| v2421_22(void) = ^IndirectReadSideEffect[-1] : &:r2421_17, m2421_16 +# 2421| m2421_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2421_17 +# 2421| m2421_24(ClassWithDestructor) = Chi : total:m2421_16, partial:m2421_23 +# 2421| m2421_25(char) = Store[x] : &:r2421_1, r2421_11 +# 2421| r2421_26(glval) = VariableAddress[x] : +# 2421| r2421_27(char) = Load[x] : &:r2421_26, m2421_25 +# 2421| r2421_28(int) = Convert : r2421_27 +# 2421| r2421_29(int) = CopyValue : r2421_28 +# 2421| v2421_30(void) = Switch : r2421_29 #-----| Case[97] -> Block 6 #-----| Default -> Block 7 -# 2421| Block 6 -# 2421| v2421_1(void) = NoOp : -# 2422| r2422_1(glval) = VariableAddress[x] : -# 2422| r2422_2(char) = Load[x] : &:r2422_1, m2420_25 -# 2422| r2422_3(char) = Constant[1] : -# 2422| r2422_4(char) = Add : r2422_2, r2422_3 -# 2422| m2422_5(char) = Store[x] : &:r2422_1, r2422_4 +# 2422| Block 6 +# 2422| v2422_1(void) = NoOp : +# 2423| r2423_1(glval) = VariableAddress[x] : +# 2423| r2423_2(char) = Load[x] : &:r2423_1, m2421_25 +# 2423| r2423_3(char) = Constant[1] : +# 2423| r2423_4(char) = Add : r2423_2, r2423_3 +# 2423| m2423_5(char) = Store[x] : &:r2423_1, r2423_4 #-----| Goto -> Block 7 -# 2425| Block 7 -# 2425| r2425_1(glval) = VariableAddress[x] : -# 2425| r2425_2(glval) = VariableAddress[#temp2425:21] : -# 2425| m2425_3(ClassWithDestructor) = Uninitialized[#temp2425:21] : &:r2425_2 -# 2425| r2425_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2425| v2425_5(void) = Call[ClassWithDestructor] : func:r2425_4, this:r2425_2 -# 2425| m2425_6(unknown) = ^CallSideEffect : ~m2420_21 -# 2425| m2425_7(unknown) = Chi : total:m2420_21, partial:m2425_6 -# 2425| m2425_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2425_2 -# 2425| m2425_9(ClassWithDestructor) = Chi : total:m2425_3, partial:m2425_8 -# 2425| r2425_10(glval) = FunctionAddress[get_x] : -# 2425| r2425_11(char) = Call[get_x] : func:r2425_10, this:r2425_2 -# 2425| m2425_12(unknown) = ^CallSideEffect : ~m2425_7 -# 2425| m2425_13(unknown) = Chi : total:m2425_7, partial:m2425_12 -# 2425| v2425_14(void) = ^IndirectReadSideEffect[-1] : &:r2425_2, m2425_9 -# 2425| m2425_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2425_2 -# 2425| m2425_16(ClassWithDestructor) = Chi : total:m2425_9, partial:m2425_15 -# 2425| r2425_17(glval) = CopyValue : r2425_2 -# 2425| r2425_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2425| v2425_19(void) = Call[~ClassWithDestructor] : func:r2425_18, this:r2425_17 -# 2425| m2425_20(unknown) = ^CallSideEffect : ~m2425_13 -# 2425| m2425_21(unknown) = Chi : total:m2425_13, partial:m2425_20 -# 2425| v2425_22(void) = ^IndirectReadSideEffect[-1] : &:r2425_17, m2425_16 -# 2425| m2425_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2425_17 -# 2425| m2425_24(ClassWithDestructor) = Chi : total:m2425_16, partial:m2425_23 -# 2425| m2425_25(char) = Store[x] : &:r2425_1, r2425_11 -# 2425| r2425_26(glval) = VariableAddress[x] : -# 2425| r2425_27(char) = Load[x] : &:r2425_26, m2425_25 -# 2425| r2425_28(int) = Convert : r2425_27 -# 2425| v2425_29(void) = Switch : r2425_28 +# 2426| Block 7 +# 2426| r2426_1(glval) = VariableAddress[x] : +# 2426| r2426_2(glval) = VariableAddress[#temp2426:21] : +# 2426| m2426_3(ClassWithDestructor) = Uninitialized[#temp2426:21] : &:r2426_2 +# 2426| r2426_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2426| v2426_5(void) = Call[ClassWithDestructor] : func:r2426_4, this:r2426_2 +# 2426| m2426_6(unknown) = ^CallSideEffect : ~m2421_21 +# 2426| m2426_7(unknown) = Chi : total:m2421_21, partial:m2426_6 +# 2426| m2426_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2426_2 +# 2426| m2426_9(ClassWithDestructor) = Chi : total:m2426_3, partial:m2426_8 +# 2426| r2426_10(glval) = FunctionAddress[get_x] : +# 2426| r2426_11(char) = Call[get_x] : func:r2426_10, this:r2426_2 +# 2426| m2426_12(unknown) = ^CallSideEffect : ~m2426_7 +# 2426| m2426_13(unknown) = Chi : total:m2426_7, partial:m2426_12 +# 2426| v2426_14(void) = ^IndirectReadSideEffect[-1] : &:r2426_2, m2426_9 +# 2426| m2426_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2426_2 +# 2426| m2426_16(ClassWithDestructor) = Chi : total:m2426_9, partial:m2426_15 +# 2426| r2426_17(glval) = CopyValue : r2426_2 +# 2426| r2426_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2426| v2426_19(void) = Call[~ClassWithDestructor] : func:r2426_18, this:r2426_17 +# 2426| m2426_20(unknown) = ^CallSideEffect : ~m2426_13 +# 2426| m2426_21(unknown) = Chi : total:m2426_13, partial:m2426_20 +# 2426| v2426_22(void) = ^IndirectReadSideEffect[-1] : &:r2426_17, m2426_16 +# 2426| m2426_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2426_17 +# 2426| m2426_24(ClassWithDestructor) = Chi : total:m2426_16, partial:m2426_23 +# 2426| m2426_25(char) = Store[x] : &:r2426_1, r2426_11 +# 2426| r2426_26(glval) = VariableAddress[x] : +# 2426| r2426_27(char) = Load[x] : &:r2426_26, m2426_25 +# 2426| r2426_28(int) = Convert : r2426_27 +# 2426| v2426_29(void) = Switch : r2426_28 #-----| Case[97] -> Block 8 #-----| Default -> Block 9 -# 2426| Block 8 -# 2426| v2426_1(void) = NoOp : -# 2427| r2427_1(glval) = VariableAddress[x] : -# 2427| r2427_2(char) = Load[x] : &:r2427_1, m2425_25 -# 2427| r2427_3(char) = Constant[1] : -# 2427| r2427_4(char) = Add : r2427_2, r2427_3 -# 2427| m2427_5(char) = Store[x] : &:r2427_1, r2427_4 +# 2427| Block 8 +# 2427| v2427_1(void) = NoOp : +# 2428| r2428_1(glval) = VariableAddress[x] : +# 2428| r2428_2(char) = Load[x] : &:r2428_1, m2426_25 +# 2428| r2428_3(char) = Constant[1] : +# 2428| r2428_4(char) = Add : r2428_2, r2428_3 +# 2428| m2428_5(char) = Store[x] : &:r2428_1, r2428_4 #-----| Goto -> Block 9 -# 2430| Block 9 -# 2430| r2430_1(glval) = VariableAddress[x] : -# 2430| r2430_2(glval) = VariableAddress[#temp2430:18] : -# 2430| m2430_3(ClassWithDestructor) = Uninitialized[#temp2430:18] : &:r2430_2 -# 2430| r2430_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2430| v2430_5(void) = Call[ClassWithDestructor] : func:r2430_4, this:r2430_2 -# 2430| m2430_6(unknown) = ^CallSideEffect : ~m2425_21 -# 2430| m2430_7(unknown) = Chi : total:m2425_21, partial:m2430_6 -# 2430| m2430_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2430_2 -# 2430| m2430_9(ClassWithDestructor) = Chi : total:m2430_3, partial:m2430_8 -# 2430| r2430_10(glval) = FunctionAddress[get_x] : -# 2430| r2430_11(char) = Call[get_x] : func:r2430_10, this:r2430_2 -# 2430| m2430_12(unknown) = ^CallSideEffect : ~m2430_7 -# 2430| m2430_13(unknown) = Chi : total:m2430_7, partial:m2430_12 -# 2430| v2430_14(void) = ^IndirectReadSideEffect[-1] : &:r2430_2, m2430_9 -# 2430| m2430_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2430_2 -# 2430| m2430_16(ClassWithDestructor) = Chi : total:m2430_9, partial:m2430_15 -# 2430| r2430_17(glval) = CopyValue : r2430_2 -# 2430| r2430_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2430| v2430_19(void) = Call[~ClassWithDestructor] : func:r2430_18, this:r2430_17 -# 2430| m2430_20(unknown) = ^CallSideEffect : ~m2430_13 -# 2430| m2430_21(unknown) = Chi : total:m2430_13, partial:m2430_20 -# 2430| v2430_22(void) = ^IndirectReadSideEffect[-1] : &:r2430_17, m2430_16 -# 2430| m2430_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2430_17 -# 2430| m2430_24(ClassWithDestructor) = Chi : total:m2430_16, partial:m2430_23 -# 2430| m2430_25(char) = Store[x] : &:r2430_1, r2430_11 -# 2430| r2430_26(glval &&>) = VariableAddress[(__range)] : -# 2430| r2430_27(glval>) = VariableAddress[#temp2430:58] : -# 2430| m2430_28(vector) = Uninitialized[#temp2430:58] : &:r2430_27 -# 2430| m2430_29(unknown) = Chi : total:m2430_21, partial:m2430_28 -# 2430| r2430_30(glval) = FunctionAddress[vector] : -# 2430| r2430_31(glval) = VariableAddress[x] : -# 2430| r2430_32(char) = Load[x] : &:r2430_31, m2430_25 -# 2430| v2430_33(void) = Call[vector] : func:r2430_30, this:r2430_27, 0:r2430_32 -# 2430| m2430_34(unknown) = ^CallSideEffect : ~m2430_29 -# 2430| m2430_35(unknown) = Chi : total:m2430_29, partial:m2430_34 -# 2430| m2430_36(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2430_27 -# 2430| m2430_37(unknown) = Chi : total:m2430_35, partial:m2430_36 -# 2430| r2430_38(vector &) = CopyValue : r2430_27 -# 2430| m2430_39(vector &&) = Store[(__range)] : &:r2430_26, r2430_38 -# 2430| r2430_40(glval>) = VariableAddress[(__begin)] : -# 2430| r2430_41(glval &&>) = VariableAddress[(__range)] : -# 2430| r2430_42(vector &&) = Load[(__range)] : &:r2430_41, m2430_39 -#-----| r0_1(glval>) = CopyValue : r2430_42 +# 2431| Block 9 +# 2431| r2431_1(glval) = VariableAddress[x] : +# 2431| r2431_2(glval) = VariableAddress[#temp2431:18] : +# 2431| m2431_3(ClassWithDestructor) = Uninitialized[#temp2431:18] : &:r2431_2 +# 2431| r2431_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2431| v2431_5(void) = Call[ClassWithDestructor] : func:r2431_4, this:r2431_2 +# 2431| m2431_6(unknown) = ^CallSideEffect : ~m2426_21 +# 2431| m2431_7(unknown) = Chi : total:m2426_21, partial:m2431_6 +# 2431| m2431_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2431_2 +# 2431| m2431_9(ClassWithDestructor) = Chi : total:m2431_3, partial:m2431_8 +# 2431| r2431_10(glval) = FunctionAddress[get_x] : +# 2431| r2431_11(char) = Call[get_x] : func:r2431_10, this:r2431_2 +# 2431| m2431_12(unknown) = ^CallSideEffect : ~m2431_7 +# 2431| m2431_13(unknown) = Chi : total:m2431_7, partial:m2431_12 +# 2431| v2431_14(void) = ^IndirectReadSideEffect[-1] : &:r2431_2, m2431_9 +# 2431| m2431_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2431_2 +# 2431| m2431_16(ClassWithDestructor) = Chi : total:m2431_9, partial:m2431_15 +# 2431| r2431_17(glval) = CopyValue : r2431_2 +# 2431| r2431_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2431| v2431_19(void) = Call[~ClassWithDestructor] : func:r2431_18, this:r2431_17 +# 2431| m2431_20(unknown) = ^CallSideEffect : ~m2431_13 +# 2431| m2431_21(unknown) = Chi : total:m2431_13, partial:m2431_20 +# 2431| v2431_22(void) = ^IndirectReadSideEffect[-1] : &:r2431_17, m2431_16 +# 2431| m2431_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2431_17 +# 2431| m2431_24(ClassWithDestructor) = Chi : total:m2431_16, partial:m2431_23 +# 2431| m2431_25(char) = Store[x] : &:r2431_1, r2431_11 +# 2431| r2431_26(glval &&>) = VariableAddress[(__range)] : +# 2431| r2431_27(glval>) = VariableAddress[#temp2431:58] : +# 2431| m2431_28(vector) = Uninitialized[#temp2431:58] : &:r2431_27 +# 2431| m2431_29(unknown) = Chi : total:m2431_21, partial:m2431_28 +# 2431| r2431_30(glval) = FunctionAddress[vector] : +# 2431| r2431_31(glval) = VariableAddress[x] : +# 2431| r2431_32(char) = Load[x] : &:r2431_31, m2431_25 +# 2431| v2431_33(void) = Call[vector] : func:r2431_30, this:r2431_27, 0:r2431_32 +# 2431| m2431_34(unknown) = ^CallSideEffect : ~m2431_29 +# 2431| m2431_35(unknown) = Chi : total:m2431_29, partial:m2431_34 +# 2431| m2431_36(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2431_27 +# 2431| m2431_37(unknown) = Chi : total:m2431_35, partial:m2431_36 +# 2431| r2431_38(vector &) = CopyValue : r2431_27 +# 2431| m2431_39(vector &&) = Store[(__range)] : &:r2431_26, r2431_38 +# 2431| r2431_40(glval>) = VariableAddress[(__begin)] : +# 2431| r2431_41(glval &&>) = VariableAddress[(__range)] : +# 2431| r2431_42(vector &&) = Load[(__range)] : &:r2431_41, m2431_39 +#-----| r0_1(glval>) = CopyValue : r2431_42 #-----| r0_2(glval>) = Convert : r0_1 -# 2430| r2430_43(glval) = FunctionAddress[begin] : -# 2430| r2430_44(iterator) = Call[begin] : func:r2430_43, this:r0_2 -#-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m2430_37 -# 2430| m2430_45(iterator) = Store[(__begin)] : &:r2430_40, r2430_44 -# 2430| r2430_46(glval>) = VariableAddress[(__end)] : -# 2430| r2430_47(glval &&>) = VariableAddress[(__range)] : -# 2430| r2430_48(vector &&) = Load[(__range)] : &:r2430_47, m2430_39 -#-----| r0_4(glval>) = CopyValue : r2430_48 +# 2431| r2431_43(glval) = FunctionAddress[begin] : +# 2431| r2431_44(iterator) = Call[begin] : func:r2431_43, this:r0_2 +#-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m2431_37 +# 2431| m2431_45(iterator) = Store[(__begin)] : &:r2431_40, r2431_44 +# 2431| r2431_46(glval>) = VariableAddress[(__end)] : +# 2431| r2431_47(glval &&>) = VariableAddress[(__range)] : +# 2431| r2431_48(vector &&) = Load[(__range)] : &:r2431_47, m2431_39 +#-----| r0_4(glval>) = CopyValue : r2431_48 #-----| r0_5(glval>) = Convert : r0_4 -# 2430| r2430_49(glval) = FunctionAddress[end] : -# 2430| r2430_50(iterator) = Call[end] : func:r2430_49, this:r0_5 -#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m2430_37 -# 2430| m2430_51(iterator) = Store[(__end)] : &:r2430_46, r2430_50 -# 2430| m2430_52(unknown) = Chi : total:m2430_37, partial:m2430_51 +# 2431| r2431_49(glval) = FunctionAddress[end] : +# 2431| r2431_50(iterator) = Call[end] : func:r2431_49, this:r0_5 +#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m2431_37 +# 2431| m2431_51(iterator) = Store[(__end)] : &:r2431_46, r2431_50 +# 2431| m2431_52(unknown) = Chi : total:m2431_37, partial:m2431_51 #-----| Goto -> Block 10 -# 2430| Block 10 -# 2430| m2430_53(iterator) = Phi : from 9:m2430_45, from 11:m2430_77 -# 2430| m2430_54(unknown) = Phi : from 9:~m2430_52, from 11:~m2430_63 -# 2430| r2430_55(glval>) = VariableAddress[(__begin)] : -#-----| r0_7(glval>) = Convert : r2430_55 -# 2430| r2430_56(glval) = FunctionAddress[operator!=] : +# 2431| Block 10 +# 2431| m2431_53(iterator) = Phi : from 9:m2431_45, from 11:m2431_77 +# 2431| m2431_54(unknown) = Phi : from 9:~m2431_52, from 11:~m2431_63 +# 2431| r2431_55(glval>) = VariableAddress[(__begin)] : +#-----| r0_7(glval>) = Convert : r2431_55 +# 2431| r2431_56(glval) = FunctionAddress[operator!=] : #-----| r0_8(glval>) = VariableAddress[#temp0:0] : #-----| m0_9(iterator) = Uninitialized[#temp0:0] : &:r0_8 -#-----| m0_10(unknown) = Chi : total:m2430_54, partial:m0_9 -# 2430| r2430_57(glval) = FunctionAddress[iterator] : -# 2430| r2430_58(glval>) = VariableAddress[(__end)] : -#-----| r0_11(glval>) = Convert : r2430_58 +#-----| m0_10(unknown) = Chi : total:m2431_54, partial:m0_9 +# 2431| r2431_57(glval) = FunctionAddress[iterator] : +# 2431| r2431_58(glval>) = VariableAddress[(__end)] : +#-----| r0_11(glval>) = Convert : r2431_58 #-----| r0_12(iterator &) = CopyValue : r0_11 -# 2430| v2430_59(void) = Call[iterator] : func:r2430_57, this:r0_8, 0:r0_12 -# 2430| m2430_60(unknown) = ^CallSideEffect : ~m0_10 -# 2430| m2430_61(unknown) = Chi : total:m0_10, partial:m2430_60 -#-----| v0_13(void) = ^BufferReadSideEffect[0] : &:r0_12, ~m2430_61 -# 2430| m2430_62(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 -# 2430| m2430_63(unknown) = Chi : total:m2430_61, partial:m2430_62 -#-----| r0_14(iterator) = Load[#temp0:0] : &:r0_8, ~m2430_63 -# 2430| r2430_64(bool) = Call[operator!=] : func:r2430_56, this:r0_7, 0:r0_14 -#-----| v0_15(void) = ^IndirectReadSideEffect[-1] : &:r0_7, m2430_53 -# 2430| v2430_65(void) = ConditionalBranch : r2430_64 +# 2431| v2431_59(void) = Call[iterator] : func:r2431_57, this:r0_8, 0:r0_12 +# 2431| m2431_60(unknown) = ^CallSideEffect : ~m0_10 +# 2431| m2431_61(unknown) = Chi : total:m0_10, partial:m2431_60 +#-----| v0_13(void) = ^BufferReadSideEffect[0] : &:r0_12, ~m2431_61 +# 2431| m2431_62(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 +# 2431| m2431_63(unknown) = Chi : total:m2431_61, partial:m2431_62 +#-----| r0_14(iterator) = Load[#temp0:0] : &:r0_8, ~m2431_63 +# 2431| r2431_64(bool) = Call[operator!=] : func:r2431_56, this:r0_7, 0:r0_14 +#-----| v0_15(void) = ^IndirectReadSideEffect[-1] : &:r0_7, m2431_53 +# 2431| v2431_65(void) = ConditionalBranch : r2431_64 #-----| False -> Block 12 #-----| True -> Block 11 -# 2430| Block 11 -# 2430| r2430_66(glval) = VariableAddress[y] : -# 2430| r2430_67(glval>) = VariableAddress[(__begin)] : -#-----| r0_16(glval>) = Convert : r2430_67 -# 2430| r2430_68(glval) = FunctionAddress[operator*] : -# 2430| r2430_69(char &) = Call[operator*] : func:r2430_68, this:r0_16 -#-----| v0_17(void) = ^IndirectReadSideEffect[-1] : &:r0_16, m2430_53 -# 2430| r2430_70(char) = Load[?] : &:r2430_69, ~m2430_63 -# 2430| m2430_71(char) = Store[y] : &:r2430_66, r2430_70 -# 2431| r2431_1(glval) = VariableAddress[x] : -# 2431| r2431_2(char) = Load[x] : &:r2431_1, m2430_25 -# 2431| r2431_3(int) = Convert : r2431_2 -# 2431| r2431_4(glval) = VariableAddress[y] : -# 2431| r2431_5(char) = Load[y] : &:r2431_4, m2430_71 -# 2431| r2431_6(int) = Convert : r2431_5 -# 2431| r2431_7(int) = Add : r2431_6, r2431_3 -# 2431| r2431_8(char) = Convert : r2431_7 -# 2431| m2431_9(char) = Store[y] : &:r2431_4, r2431_8 -# 2430| r2430_72(glval>) = VariableAddress[(__begin)] : -# 2430| r2430_73(glval) = FunctionAddress[operator++] : -# 2430| r2430_74(iterator &) = Call[operator++] : func:r2430_73, this:r2430_72 -# 2430| v2430_75(void) = ^IndirectReadSideEffect[-1] : &:r2430_72, m2430_53 -# 2430| m2430_76(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2430_72 -# 2430| m2430_77(iterator) = Chi : total:m2430_53, partial:m2430_76 -# 2430| r2430_78(glval>) = CopyValue : r2430_74 +# 2431| Block 11 +# 2431| r2431_66(glval) = VariableAddress[y] : +# 2431| r2431_67(glval>) = VariableAddress[(__begin)] : +#-----| r0_16(glval>) = Convert : r2431_67 +# 2431| r2431_68(glval) = FunctionAddress[operator*] : +# 2431| r2431_69(char &) = Call[operator*] : func:r2431_68, this:r0_16 +#-----| v0_17(void) = ^IndirectReadSideEffect[-1] : &:r0_16, m2431_53 +# 2431| r2431_70(char) = Load[?] : &:r2431_69, ~m2431_63 +# 2431| m2431_71(char) = Store[y] : &:r2431_66, r2431_70 +# 2432| r2432_1(glval) = VariableAddress[x] : +# 2432| r2432_2(char) = Load[x] : &:r2432_1, m2431_25 +# 2432| r2432_3(int) = Convert : r2432_2 +# 2432| r2432_4(glval) = VariableAddress[y] : +# 2432| r2432_5(char) = Load[y] : &:r2432_4, m2431_71 +# 2432| r2432_6(int) = Convert : r2432_5 +# 2432| r2432_7(int) = Add : r2432_6, r2432_3 +# 2432| r2432_8(char) = Convert : r2432_7 +# 2432| m2432_9(char) = Store[y] : &:r2432_4, r2432_8 +# 2431| r2431_72(glval>) = VariableAddress[(__begin)] : +# 2431| r2431_73(glval) = FunctionAddress[operator++] : +# 2431| r2431_74(iterator &) = Call[operator++] : func:r2431_73, this:r2431_72 +# 2431| v2431_75(void) = ^IndirectReadSideEffect[-1] : &:r2431_72, m2431_53 +# 2431| m2431_76(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2431_72 +# 2431| m2431_77(iterator) = Chi : total:m2431_53, partial:m2431_76 +# 2431| r2431_78(glval>) = CopyValue : r2431_74 #-----| Goto (back edge) -> Block 10 -# 2430| Block 12 -# 2430| r2430_79(glval>) = CopyValue : r2430_27 -# 2430| r2430_80(glval) = FunctionAddress[~vector] : -# 2430| v2430_81(void) = Call[~vector] : func:r2430_80, this:r2430_79 -# 2430| m2430_82(unknown) = ^CallSideEffect : ~m2430_63 -# 2430| m2430_83(unknown) = Chi : total:m2430_63, partial:m2430_82 -# 2430| v2430_84(void) = ^IndirectReadSideEffect[-1] : &:r2430_79, ~m2430_83 -# 2430| m2430_85(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2430_79 -# 2430| m2430_86(unknown) = Chi : total:m2430_83, partial:m2430_85 -# 2432| v2432_1(void) = NoOp : -# 2410| v2410_5(void) = ReturnVoid : -# 2410| v2410_6(void) = AliasedUse : ~m2430_83 -# 2410| v2410_7(void) = ExitFunction : +# 2431| Block 12 +# 2431| r2431_79(glval>) = CopyValue : r2431_27 +# 2431| r2431_80(glval) = FunctionAddress[~vector] : +# 2431| v2431_81(void) = Call[~vector] : func:r2431_80, this:r2431_79 +# 2431| m2431_82(unknown) = ^CallSideEffect : ~m2431_63 +# 2431| m2431_83(unknown) = Chi : total:m2431_63, partial:m2431_82 +# 2431| v2431_84(void) = ^IndirectReadSideEffect[-1] : &:r2431_79, ~m2431_83 +# 2431| m2431_85(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2431_79 +# 2431| m2431_86(unknown) = Chi : total:m2431_83, partial:m2431_85 +# 2433| v2433_1(void) = NoOp : +# 2411| v2411_5(void) = ReturnVoid : +# 2411| v2411_6(void) = AliasedUse : ~m2431_83 +# 2411| v2411_7(void) = ExitFunction : -# 2410| Block 13 -# 2410| v2410_8(void) = Unreached : +# 2411| Block 13 +# 2411| v2411_8(void) = Unreached : -# 2434| void param_with_destructor_by_value(ClassWithDestructor) -# 2434| Block 0 -# 2434| v2434_1(void) = EnterFunction : -# 2434| m2434_2(unknown) = AliasedDefinition : -# 2434| m2434_3(unknown) = InitializeNonLocal : -# 2434| m2434_4(unknown) = Chi : total:m2434_2, partial:m2434_3 -# 2434| r2434_5(glval) = VariableAddress[c] : -# 2434| m2434_6(ClassWithDestructor) = InitializeParameter[c] : &:r2434_5 -# 2436| v2436_1(void) = NoOp : -# 2434| v2434_7(void) = ReturnVoid : -# 2434| v2434_8(void) = AliasedUse : m2434_3 -# 2434| v2434_9(void) = ExitFunction : +# 2435| void param_with_destructor_by_value(ClassWithDestructor) +# 2435| Block 0 +# 2435| v2435_1(void) = EnterFunction : +# 2435| m2435_2(unknown) = AliasedDefinition : +# 2435| m2435_3(unknown) = InitializeNonLocal : +# 2435| m2435_4(unknown) = Chi : total:m2435_2, partial:m2435_3 +# 2435| r2435_5(glval) = VariableAddress[c] : +# 2435| m2435_6(ClassWithDestructor) = InitializeParameter[c] : &:r2435_5 +# 2437| v2437_1(void) = NoOp : +# 2435| v2435_7(void) = ReturnVoid : +# 2435| v2435_8(void) = AliasedUse : m2435_3 +# 2435| v2435_9(void) = ExitFunction : -# 2438| void param_with_destructor_by_pointer(ClassWithDestructor*) -# 2438| Block 0 -# 2438| v2438_1(void) = EnterFunction : -# 2438| m2438_2(unknown) = AliasedDefinition : -# 2438| m2438_3(unknown) = InitializeNonLocal : -# 2438| m2438_4(unknown) = Chi : total:m2438_2, partial:m2438_3 -# 2438| r2438_5(glval) = VariableAddress[c] : -# 2438| m2438_6(ClassWithDestructor *) = InitializeParameter[c] : &:r2438_5 -# 2438| r2438_7(ClassWithDestructor *) = Load[c] : &:r2438_5, m2438_6 -# 2438| m2438_8(unknown) = InitializeIndirection[c] : &:r2438_7 -# 2440| v2440_1(void) = NoOp : -# 2438| v2438_9(void) = ReturnIndirection[c] : &:r2438_7, m2438_8 -# 2438| v2438_10(void) = ReturnVoid : -# 2438| v2438_11(void) = AliasedUse : m2438_3 -# 2438| v2438_12(void) = ExitFunction : +# 2439| void param_with_destructor_by_pointer(ClassWithDestructor*) +# 2439| Block 0 +# 2439| v2439_1(void) = EnterFunction : +# 2439| m2439_2(unknown) = AliasedDefinition : +# 2439| m2439_3(unknown) = InitializeNonLocal : +# 2439| m2439_4(unknown) = Chi : total:m2439_2, partial:m2439_3 +# 2439| r2439_5(glval) = VariableAddress[c] : +# 2439| m2439_6(ClassWithDestructor *) = InitializeParameter[c] : &:r2439_5 +# 2439| r2439_7(ClassWithDestructor *) = Load[c] : &:r2439_5, m2439_6 +# 2439| m2439_8(unknown) = InitializeIndirection[c] : &:r2439_7 +# 2441| v2441_1(void) = NoOp : +# 2439| v2439_9(void) = ReturnIndirection[c] : &:r2439_7, m2439_8 +# 2439| v2439_10(void) = ReturnVoid : +# 2439| v2439_11(void) = AliasedUse : m2439_3 +# 2439| v2439_12(void) = ExitFunction : -# 2442| void param_with_destructor_by_ref(ClassWithDestructor&) -# 2442| Block 0 -# 2442| v2442_1(void) = EnterFunction : -# 2442| m2442_2(unknown) = AliasedDefinition : -# 2442| m2442_3(unknown) = InitializeNonLocal : -# 2442| m2442_4(unknown) = Chi : total:m2442_2, partial:m2442_3 -# 2442| r2442_5(glval) = VariableAddress[c] : -# 2442| m2442_6(ClassWithDestructor &) = InitializeParameter[c] : &:r2442_5 -# 2442| r2442_7(ClassWithDestructor &) = Load[c] : &:r2442_5, m2442_6 -# 2442| m2442_8(unknown) = InitializeIndirection[c] : &:r2442_7 -# 2444| v2444_1(void) = NoOp : -# 2442| v2442_9(void) = ReturnIndirection[c] : &:r2442_7, m2442_8 -# 2442| v2442_10(void) = ReturnVoid : -# 2442| v2442_11(void) = AliasedUse : m2442_3 -# 2442| v2442_12(void) = ExitFunction : +# 2443| void param_with_destructor_by_ref(ClassWithDestructor&) +# 2443| Block 0 +# 2443| v2443_1(void) = EnterFunction : +# 2443| m2443_2(unknown) = AliasedDefinition : +# 2443| m2443_3(unknown) = InitializeNonLocal : +# 2443| m2443_4(unknown) = Chi : total:m2443_2, partial:m2443_3 +# 2443| r2443_5(glval) = VariableAddress[c] : +# 2443| m2443_6(ClassWithDestructor &) = InitializeParameter[c] : &:r2443_5 +# 2443| r2443_7(ClassWithDestructor &) = Load[c] : &:r2443_5, m2443_6 +# 2443| m2443_8(unknown) = InitializeIndirection[c] : &:r2443_7 +# 2445| v2445_1(void) = NoOp : +# 2443| v2443_9(void) = ReturnIndirection[c] : &:r2443_7, m2443_8 +# 2443| v2443_10(void) = ReturnVoid : +# 2443| v2443_11(void) = AliasedUse : m2443_3 +# 2443| v2443_12(void) = ExitFunction : -# 2446| void param_with_destructor_by_rref(ClassWithDestructor&&) -# 2446| Block 0 -# 2446| v2446_1(void) = EnterFunction : -# 2446| m2446_2(unknown) = AliasedDefinition : -# 2446| m2446_3(unknown) = InitializeNonLocal : -# 2446| m2446_4(unknown) = Chi : total:m2446_2, partial:m2446_3 -# 2446| r2446_5(glval) = VariableAddress[c] : -# 2446| m2446_6(ClassWithDestructor &&) = InitializeParameter[c] : &:r2446_5 -# 2446| r2446_7(ClassWithDestructor &&) = Load[c] : &:r2446_5, m2446_6 -# 2446| m2446_8(unknown) = InitializeIndirection[c] : &:r2446_7 -# 2448| v2448_1(void) = NoOp : -# 2446| v2446_9(void) = ReturnIndirection[c] : &:r2446_7, m2446_8 -# 2446| v2446_10(void) = ReturnVoid : -# 2446| v2446_11(void) = AliasedUse : m2446_3 -# 2446| v2446_12(void) = ExitFunction : +# 2447| void param_with_destructor_by_rref(ClassWithDestructor&&) +# 2447| Block 0 +# 2447| v2447_1(void) = EnterFunction : +# 2447| m2447_2(unknown) = AliasedDefinition : +# 2447| m2447_3(unknown) = InitializeNonLocal : +# 2447| m2447_4(unknown) = Chi : total:m2447_2, partial:m2447_3 +# 2447| r2447_5(glval) = VariableAddress[c] : +# 2447| m2447_6(ClassWithDestructor &&) = InitializeParameter[c] : &:r2447_5 +# 2447| r2447_7(ClassWithDestructor &&) = Load[c] : &:r2447_5, m2447_6 +# 2447| m2447_8(unknown) = InitializeIndirection[c] : &:r2447_7 +# 2449| v2449_1(void) = NoOp : +# 2447| v2447_9(void) = ReturnIndirection[c] : &:r2447_7, m2447_8 +# 2447| v2447_10(void) = ReturnVoid : +# 2447| v2447_11(void) = AliasedUse : m2447_3 +# 2447| v2447_12(void) = ExitFunction : -# 2450| void rethrow_with_destruction(int) -# 2450| Block 0 -# 2450| v2450_1(void) = EnterFunction : -# 2450| m2450_2(unknown) = AliasedDefinition : -# 2450| m2450_3(unknown) = InitializeNonLocal : -# 2450| m2450_4(unknown) = Chi : total:m2450_2, partial:m2450_3 -# 2450| r2450_5(glval) = VariableAddress[x] : -# 2450| m2450_6(int) = InitializeParameter[x] : &:r2450_5 -# 2451| r2451_1(glval) = VariableAddress[c] : -# 2451| m2451_2(ClassWithDestructor) = Uninitialized[c] : &:r2451_1 -# 2451| r2451_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2451| v2451_4(void) = Call[ClassWithDestructor] : func:r2451_3, this:r2451_1 -# 2451| m2451_5(unknown) = ^CallSideEffect : ~m2450_4 -# 2451| m2451_6(unknown) = Chi : total:m2450_4, partial:m2451_5 -# 2451| m2451_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2451_1 -# 2451| m2451_8(ClassWithDestructor) = Chi : total:m2451_2, partial:m2451_7 -# 2452| v2452_1(void) = ReThrow : -# 2453| r2453_1(glval) = VariableAddress[c] : -# 2453| r2453_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2453| v2453_3(void) = Call[~ClassWithDestructor] : func:r2453_2, this:r2453_1 -# 2453| m2453_4(unknown) = ^CallSideEffect : ~m2451_6 -# 2453| m2453_5(unknown) = Chi : total:m2451_6, partial:m2453_4 -# 2453| v2453_6(void) = ^IndirectReadSideEffect[-1] : &:r2453_1, m2451_8 -# 2453| m2453_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2453_1 -# 2453| m2453_8(ClassWithDestructor) = Chi : total:m2451_8, partial:m2453_7 +# 2451| void rethrow_with_destruction(int) +# 2451| Block 0 +# 2451| v2451_1(void) = EnterFunction : +# 2451| m2451_2(unknown) = AliasedDefinition : +# 2451| m2451_3(unknown) = InitializeNonLocal : +# 2451| m2451_4(unknown) = Chi : total:m2451_2, partial:m2451_3 +# 2451| r2451_5(glval) = VariableAddress[x] : +# 2451| m2451_6(int) = InitializeParameter[x] : &:r2451_5 +# 2452| r2452_1(glval) = VariableAddress[c] : +# 2452| m2452_2(ClassWithDestructor) = Uninitialized[c] : &:r2452_1 +# 2452| r2452_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2452| v2452_4(void) = Call[ClassWithDestructor] : func:r2452_3, this:r2452_1 +# 2452| m2452_5(unknown) = ^CallSideEffect : ~m2451_4 +# 2452| m2452_6(unknown) = Chi : total:m2451_4, partial:m2452_5 +# 2452| m2452_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2452_1 +# 2452| m2452_8(ClassWithDestructor) = Chi : total:m2452_2, partial:m2452_7 +# 2453| v2453_1(void) = ReThrow : +# 2454| r2454_1(glval) = VariableAddress[c] : +# 2454| r2454_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2454| v2454_3(void) = Call[~ClassWithDestructor] : func:r2454_2, this:r2454_1 +# 2454| m2454_4(unknown) = ^CallSideEffect : ~m2452_6 +# 2454| m2454_5(unknown) = Chi : total:m2452_6, partial:m2454_4 +# 2454| v2454_6(void) = ^IndirectReadSideEffect[-1] : &:r2454_1, m2452_8 +# 2454| m2454_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2454_1 +# 2454| m2454_8(ClassWithDestructor) = Chi : total:m2452_8, partial:m2454_7 #-----| Exception -> Block 1 -# 2450| Block 1 -# 2450| v2450_7(void) = Unwind : -# 2450| v2450_8(void) = AliasedUse : ~m2453_5 -# 2450| v2450_9(void) = ExitFunction : +# 2451| Block 1 +# 2451| v2451_7(void) = Unwind : +# 2451| v2451_8(void) = AliasedUse : ~m2454_5 +# 2451| v2451_9(void) = ExitFunction : -# 2459| void new_with_destructor(ClassWithDestructor) -# 2459| Block 0 -# 2459| v2459_1(void) = EnterFunction : -# 2459| m2459_2(unknown) = AliasedDefinition : -# 2459| m2459_3(unknown) = InitializeNonLocal : -# 2459| m2459_4(unknown) = Chi : total:m2459_2, partial:m2459_3 -# 2459| r2459_5(glval) = VariableAddress[a] : -# 2459| m2459_6(ClassWithDestructor) = InitializeParameter[a] : &:r2459_5 -# 2461| r2461_1(glval) = VariableAddress[b] : -# 2461| r2461_2(glval) = FunctionAddress[operator new] : -# 2461| r2461_3(unsigned long) = Constant[1] : -# 2461| r2461_4(void *) = Call[operator new] : func:r2461_2, 0:r2461_3 -# 2461| m2461_5(unknown) = ^CallSideEffect : ~m2459_4 -# 2461| m2461_6(unknown) = Chi : total:m2459_4, partial:m2461_5 -# 2461| m2461_7(unknown) = ^InitializeDynamicAllocation : &:r2461_4 -# 2461| m2461_8(unknown) = Chi : total:m2461_6, partial:m2461_7 -# 2461| r2461_9(ByValueConstructor *) = Convert : r2461_4 -# 2461| r2461_10(glval) = FunctionAddress[ByValueConstructor] : -# 2461| r2461_11(glval) = VariableAddress[#temp2461:52] : -# 2461| r2461_12(glval) = VariableAddress[a] : -# 2461| r2461_13(ClassWithDestructor) = Load[a] : &:r2461_12, m2459_6 -# 2461| m2461_14(ClassWithDestructor) = Store[#temp2461:52] : &:r2461_11, r2461_13 -# 2461| r2461_15(ClassWithDestructor) = Load[#temp2461:52] : &:r2461_11, m2461_14 -# 2461| v2461_16(void) = Call[ByValueConstructor] : func:r2461_10, this:r2461_9, 0:r2461_15 -# 2461| m2461_17(unknown) = ^CallSideEffect : ~m2461_8 -# 2461| m2461_18(unknown) = Chi : total:m2461_8, partial:m2461_17 -# 2461| m2461_19(ByValueConstructor) = ^IndirectMayWriteSideEffect[-1] : &:r2461_9 -# 2461| m2461_20(unknown) = Chi : total:m2461_18, partial:m2461_19 -# 2461| r2461_21(glval) = CopyValue : r2461_11 -# 2461| r2461_22(glval) = FunctionAddress[~ClassWithDestructor] : -# 2461| v2461_23(void) = Call[~ClassWithDestructor] : func:r2461_22, this:r2461_21 -# 2461| m2461_24(unknown) = ^CallSideEffect : ~m2461_20 -# 2461| m2461_25(unknown) = Chi : total:m2461_20, partial:m2461_24 -# 2461| v2461_26(void) = ^IndirectReadSideEffect[-1] : &:r2461_21, m2461_14 -# 2461| m2461_27(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2461_21 -# 2461| m2461_28(ClassWithDestructor) = Chi : total:m2461_14, partial:m2461_27 -# 2461| m2461_29(ByValueConstructor *) = Store[b] : &:r2461_1, r2461_9 -# 2462| v2462_1(void) = NoOp : -# 2459| v2459_7(void) = ReturnVoid : -# 2459| v2459_8(void) = AliasedUse : ~m2461_25 -# 2459| v2459_9(void) = ExitFunction : +# 2460| void new_with_destructor(ClassWithDestructor) +# 2460| Block 0 +# 2460| v2460_1(void) = EnterFunction : +# 2460| m2460_2(unknown) = AliasedDefinition : +# 2460| m2460_3(unknown) = InitializeNonLocal : +# 2460| m2460_4(unknown) = Chi : total:m2460_2, partial:m2460_3 +# 2460| r2460_5(glval) = VariableAddress[a] : +# 2460| m2460_6(ClassWithDestructor) = InitializeParameter[a] : &:r2460_5 +# 2462| r2462_1(glval) = VariableAddress[b] : +# 2462| r2462_2(glval) = FunctionAddress[operator new] : +# 2462| r2462_3(unsigned long) = Constant[1] : +# 2462| r2462_4(void *) = Call[operator new] : func:r2462_2, 0:r2462_3 +# 2462| m2462_5(unknown) = ^CallSideEffect : ~m2460_4 +# 2462| m2462_6(unknown) = Chi : total:m2460_4, partial:m2462_5 +# 2462| m2462_7(unknown) = ^InitializeDynamicAllocation : &:r2462_4 +# 2462| m2462_8(unknown) = Chi : total:m2462_6, partial:m2462_7 +# 2462| r2462_9(ByValueConstructor *) = Convert : r2462_4 +# 2462| r2462_10(glval) = FunctionAddress[ByValueConstructor] : +# 2462| r2462_11(glval) = VariableAddress[#temp2462:52] : +# 2462| r2462_12(glval) = VariableAddress[a] : +# 2462| r2462_13(ClassWithDestructor) = Load[a] : &:r2462_12, m2460_6 +# 2462| m2462_14(ClassWithDestructor) = Store[#temp2462:52] : &:r2462_11, r2462_13 +# 2462| r2462_15(ClassWithDestructor) = Load[#temp2462:52] : &:r2462_11, m2462_14 +# 2462| v2462_16(void) = Call[ByValueConstructor] : func:r2462_10, this:r2462_9, 0:r2462_15 +# 2462| m2462_17(unknown) = ^CallSideEffect : ~m2462_8 +# 2462| m2462_18(unknown) = Chi : total:m2462_8, partial:m2462_17 +# 2462| m2462_19(ByValueConstructor) = ^IndirectMayWriteSideEffect[-1] : &:r2462_9 +# 2462| m2462_20(unknown) = Chi : total:m2462_18, partial:m2462_19 +# 2462| r2462_21(glval) = CopyValue : r2462_11 +# 2462| r2462_22(glval) = FunctionAddress[~ClassWithDestructor] : +# 2462| v2462_23(void) = Call[~ClassWithDestructor] : func:r2462_22, this:r2462_21 +# 2462| m2462_24(unknown) = ^CallSideEffect : ~m2462_20 +# 2462| m2462_25(unknown) = Chi : total:m2462_20, partial:m2462_24 +# 2462| v2462_26(void) = ^IndirectReadSideEffect[-1] : &:r2462_21, m2462_14 +# 2462| m2462_27(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2462_21 +# 2462| m2462_28(ClassWithDestructor) = Chi : total:m2462_14, partial:m2462_27 +# 2462| m2462_29(ByValueConstructor *) = Store[b] : &:r2462_1, r2462_9 +# 2463| v2463_1(void) = NoOp : +# 2460| v2460_7(void) = ReturnVoid : +# 2460| v2460_8(void) = AliasedUse : ~m2462_25 +# 2460| v2460_9(void) = ExitFunction : -# 2478| void rvalue_conversion_with_destructor::test() -# 2478| Block 0 -# 2478| v2478_1(void) = EnterFunction : -# 2478| m2478_2(unknown) = AliasedDefinition : -# 2478| m2478_3(unknown) = InitializeNonLocal : -# 2478| m2478_4(unknown) = Chi : total:m2478_2, partial:m2478_3 -# 2480| r2480_1(glval) = VariableAddress[a] : -# 2480| r2480_2(glval) = VariableAddress[#temp2480:18] : -# 2480| r2480_3(glval) = FunctionAddress[get] : -# 2480| r2480_4(B) = Call[get] : func:r2480_3 -# 2480| m2480_5(unknown) = ^CallSideEffect : ~m2478_4 -# 2480| m2480_6(unknown) = Chi : total:m2478_4, partial:m2480_5 -# 2480| m2480_7(B) = Store[#temp2480:18] : &:r2480_2, r2480_4 -# 2480| m2480_8(unknown) = Chi : total:m2480_6, partial:m2480_7 -# 2480| r2480_9(glval) = Convert : r2480_2 -# 2480| r2480_10(glval) = FunctionAddress[operator->] : -# 2480| r2480_11(A *) = Call[operator->] : func:r2480_10, this:r2480_9 -# 2480| m2480_12(unknown) = ^CallSideEffect : ~m2480_8 -# 2480| m2480_13(unknown) = Chi : total:m2480_8, partial:m2480_12 -# 2480| v2480_14(void) = ^IndirectReadSideEffect[-1] : &:r2480_9, ~m2480_13 -# 2480| r2480_15(glval) = FieldAddress[a] : r2480_11 -# 2480| r2480_16(glval) = CopyValue : r2480_2 -# 2480| r2480_17(glval) = FunctionAddress[~B] : -# 2480| v2480_18(void) = Call[~B] : func:r2480_17, this:r2480_16 -# 2480| m2480_19(unknown) = ^CallSideEffect : ~m2480_13 -# 2480| m2480_20(unknown) = Chi : total:m2480_13, partial:m2480_19 -# 2480| v2480_21(void) = ^IndirectReadSideEffect[-1] : &:r2480_16, ~m2480_20 -# 2480| m2480_22(B) = ^IndirectMayWriteSideEffect[-1] : &:r2480_16 -# 2480| m2480_23(unknown) = Chi : total:m2480_20, partial:m2480_22 -# 2480| r2480_24(unsigned int) = Load[?] : &:r2480_15, ~m2480_23 -# 2480| m2480_25(unsigned int) = Store[a] : &:r2480_1, r2480_24 -# 2481| v2481_1(void) = NoOp : -# 2478| v2478_5(void) = ReturnVoid : -# 2478| v2478_6(void) = AliasedUse : ~m2480_20 -# 2478| v2478_7(void) = ExitFunction : +# 2479| void rvalue_conversion_with_destructor::test() +# 2479| Block 0 +# 2479| v2479_1(void) = EnterFunction : +# 2479| m2479_2(unknown) = AliasedDefinition : +# 2479| m2479_3(unknown) = InitializeNonLocal : +# 2479| m2479_4(unknown) = Chi : total:m2479_2, partial:m2479_3 +# 2481| r2481_1(glval) = VariableAddress[a] : +# 2481| r2481_2(glval) = VariableAddress[#temp2481:18] : +# 2481| r2481_3(glval) = FunctionAddress[get] : +# 2481| r2481_4(B) = Call[get] : func:r2481_3 +# 2481| m2481_5(unknown) = ^CallSideEffect : ~m2479_4 +# 2481| m2481_6(unknown) = Chi : total:m2479_4, partial:m2481_5 +# 2481| m2481_7(B) = Store[#temp2481:18] : &:r2481_2, r2481_4 +# 2481| m2481_8(unknown) = Chi : total:m2481_6, partial:m2481_7 +# 2481| r2481_9(glval) = Convert : r2481_2 +# 2481| r2481_10(glval) = FunctionAddress[operator->] : +# 2481| r2481_11(A *) = Call[operator->] : func:r2481_10, this:r2481_9 +# 2481| m2481_12(unknown) = ^CallSideEffect : ~m2481_8 +# 2481| m2481_13(unknown) = Chi : total:m2481_8, partial:m2481_12 +# 2481| v2481_14(void) = ^IndirectReadSideEffect[-1] : &:r2481_9, ~m2481_13 +# 2481| r2481_15(glval) = FieldAddress[a] : r2481_11 +# 2481| r2481_16(glval) = CopyValue : r2481_2 +# 2481| r2481_17(glval) = FunctionAddress[~B] : +# 2481| v2481_18(void) = Call[~B] : func:r2481_17, this:r2481_16 +# 2481| m2481_19(unknown) = ^CallSideEffect : ~m2481_13 +# 2481| m2481_20(unknown) = Chi : total:m2481_13, partial:m2481_19 +# 2481| v2481_21(void) = ^IndirectReadSideEffect[-1] : &:r2481_16, ~m2481_20 +# 2481| m2481_22(B) = ^IndirectMayWriteSideEffect[-1] : &:r2481_16 +# 2481| m2481_23(unknown) = Chi : total:m2481_20, partial:m2481_22 +# 2481| r2481_24(unsigned int) = Load[?] : &:r2481_15, ~m2481_23 +# 2481| m2481_25(unsigned int) = Store[a] : &:r2481_1, r2481_24 +# 2482| v2482_1(void) = NoOp : +# 2479| v2479_5(void) = ReturnVoid : +# 2479| v2479_6(void) = AliasedUse : ~m2481_20 +# 2479| v2479_7(void) = ExitFunction : -# 2484| void destructor_without_block(bool) -# 2484| Block 0 -# 2484| v2484_1(void) = EnterFunction : -# 2484| m2484_2(unknown) = AliasedDefinition : -# 2484| m2484_3(unknown) = InitializeNonLocal : -# 2484| m2484_4(unknown) = Chi : total:m2484_2, partial:m2484_3 -# 2484| r2484_5(glval) = VariableAddress[b] : -# 2484| m2484_6(bool) = InitializeParameter[b] : &:r2484_5 -# 2486| r2486_1(glval) = VariableAddress[b] : -# 2486| r2486_2(bool) = Load[b] : &:r2486_1, m2484_6 -# 2486| v2486_3(void) = ConditionalBranch : r2486_2 +# 2485| void destructor_without_block(bool) +# 2485| Block 0 +# 2485| v2485_1(void) = EnterFunction : +# 2485| m2485_2(unknown) = AliasedDefinition : +# 2485| m2485_3(unknown) = InitializeNonLocal : +# 2485| m2485_4(unknown) = Chi : total:m2485_2, partial:m2485_3 +# 2485| r2485_5(glval) = VariableAddress[b] : +# 2485| m2485_6(bool) = InitializeParameter[b] : &:r2485_5 +# 2487| r2487_1(glval) = VariableAddress[b] : +# 2487| r2487_2(bool) = Load[b] : &:r2487_1, m2485_6 +# 2487| v2487_3(void) = ConditionalBranch : r2487_2 #-----| False -> Block 2 #-----| True -> Block 1 -# 2487| Block 1 -# 2487| r2487_1(glval) = VariableAddress[c] : -# 2487| m2487_2(ClassWithDestructor) = Uninitialized[c] : &:r2487_1 -# 2487| r2487_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2487| v2487_4(void) = Call[ClassWithDestructor] : func:r2487_3, this:r2487_1 -# 2487| m2487_5(unknown) = ^CallSideEffect : ~m2484_4 -# 2487| m2487_6(unknown) = Chi : total:m2484_4, partial:m2487_5 -# 2487| m2487_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2487_1 -# 2487| m2487_8(ClassWithDestructor) = Chi : total:m2487_2, partial:m2487_7 +# 2488| Block 1 +# 2488| r2488_1(glval) = VariableAddress[c] : +# 2488| m2488_2(ClassWithDestructor) = Uninitialized[c] : &:r2488_1 +# 2488| r2488_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2488| v2488_4(void) = Call[ClassWithDestructor] : func:r2488_3, this:r2488_1 +# 2488| m2488_5(unknown) = ^CallSideEffect : ~m2485_4 +# 2488| m2488_6(unknown) = Chi : total:m2485_4, partial:m2488_5 +# 2488| m2488_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2488_1 +# 2488| m2488_8(ClassWithDestructor) = Chi : total:m2488_2, partial:m2488_7 #-----| r0_1(glval) = VariableAddress[c] : #-----| r0_2(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_3(void) = Call[~ClassWithDestructor] : func:r0_2, this:r0_1 -#-----| m0_4(unknown) = ^CallSideEffect : ~m2487_6 -#-----| m0_5(unknown) = Chi : total:m2487_6, partial:m0_4 -#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_1, m2487_8 +#-----| m0_4(unknown) = ^CallSideEffect : ~m2488_6 +#-----| m0_5(unknown) = Chi : total:m2488_6, partial:m0_4 +#-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_1, m2488_8 #-----| m0_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_1 -#-----| m0_8(ClassWithDestructor) = Chi : total:m2487_8, partial:m0_7 +#-----| m0_8(ClassWithDestructor) = Chi : total:m2488_8, partial:m0_7 #-----| Goto -> Block 2 -# 2489| Block 2 -# 2489| m2489_1(unknown) = Phi : from 0:~m2484_4, from 1:~m0_5 -# 2489| r2489_2(glval) = VariableAddress[b] : -# 2489| r2489_3(bool) = Load[b] : &:r2489_2, m2484_6 -# 2489| v2489_4(void) = ConditionalBranch : r2489_3 +# 2490| Block 2 +# 2490| m2490_1(unknown) = Phi : from 0:~m2485_4, from 1:~m0_5 +# 2490| r2490_2(glval) = VariableAddress[b] : +# 2490| r2490_3(bool) = Load[b] : &:r2490_2, m2485_6 +# 2490| v2490_4(void) = ConditionalBranch : r2490_3 #-----| False -> Block 4 #-----| True -> Block 3 -# 2490| Block 3 -# 2490| r2490_1(glval) = VariableAddress[d] : -# 2490| m2490_2(ClassWithDestructor) = Uninitialized[d] : &:r2490_1 -# 2490| r2490_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2490| v2490_4(void) = Call[ClassWithDestructor] : func:r2490_3, this:r2490_1 -# 2490| m2490_5(unknown) = ^CallSideEffect : ~m2489_1 -# 2490| m2490_6(unknown) = Chi : total:m2489_1, partial:m2490_5 -# 2490| m2490_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2490_1 -# 2490| m2490_8(ClassWithDestructor) = Chi : total:m2490_2, partial:m2490_7 +# 2491| Block 3 +# 2491| r2491_1(glval) = VariableAddress[d] : +# 2491| m2491_2(ClassWithDestructor) = Uninitialized[d] : &:r2491_1 +# 2491| r2491_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2491| v2491_4(void) = Call[ClassWithDestructor] : func:r2491_3, this:r2491_1 +# 2491| m2491_5(unknown) = ^CallSideEffect : ~m2490_1 +# 2491| m2491_6(unknown) = Chi : total:m2490_1, partial:m2491_5 +# 2491| m2491_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2491_1 +# 2491| m2491_8(ClassWithDestructor) = Chi : total:m2491_2, partial:m2491_7 #-----| r0_9(glval) = VariableAddress[d] : #-----| r0_10(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_11(void) = Call[~ClassWithDestructor] : func:r0_10, this:r0_9 -#-----| m0_12(unknown) = ^CallSideEffect : ~m2490_6 -#-----| m0_13(unknown) = Chi : total:m2490_6, partial:m0_12 -#-----| v0_14(void) = ^IndirectReadSideEffect[-1] : &:r0_9, m2490_8 +#-----| m0_12(unknown) = ^CallSideEffect : ~m2491_6 +#-----| m0_13(unknown) = Chi : total:m2491_6, partial:m0_12 +#-----| v0_14(void) = ^IndirectReadSideEffect[-1] : &:r0_9, m2491_8 #-----| m0_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_9 -#-----| m0_16(ClassWithDestructor) = Chi : total:m2490_8, partial:m0_15 +#-----| m0_16(ClassWithDestructor) = Chi : total:m2491_8, partial:m0_15 #-----| Goto -> Block 5 -# 2492| Block 4 -# 2492| r2492_1(glval) = VariableAddress[e] : -# 2492| m2492_2(ClassWithDestructor) = Uninitialized[e] : &:r2492_1 -# 2492| r2492_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2492| v2492_4(void) = Call[ClassWithDestructor] : func:r2492_3, this:r2492_1 -# 2492| m2492_5(unknown) = ^CallSideEffect : ~m2489_1 -# 2492| m2492_6(unknown) = Chi : total:m2489_1, partial:m2492_5 -# 2492| m2492_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2492_1 -# 2492| m2492_8(ClassWithDestructor) = Chi : total:m2492_2, partial:m2492_7 +# 2493| Block 4 +# 2493| r2493_1(glval) = VariableAddress[e] : +# 2493| m2493_2(ClassWithDestructor) = Uninitialized[e] : &:r2493_1 +# 2493| r2493_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2493| v2493_4(void) = Call[ClassWithDestructor] : func:r2493_3, this:r2493_1 +# 2493| m2493_5(unknown) = ^CallSideEffect : ~m2490_1 +# 2493| m2493_6(unknown) = Chi : total:m2490_1, partial:m2493_5 +# 2493| m2493_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2493_1 +# 2493| m2493_8(ClassWithDestructor) = Chi : total:m2493_2, partial:m2493_7 #-----| r0_17(glval) = VariableAddress[e] : #-----| r0_18(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_19(void) = Call[~ClassWithDestructor] : func:r0_18, this:r0_17 -#-----| m0_20(unknown) = ^CallSideEffect : ~m2492_6 -#-----| m0_21(unknown) = Chi : total:m2492_6, partial:m0_20 -#-----| v0_22(void) = ^IndirectReadSideEffect[-1] : &:r0_17, m2492_8 +#-----| m0_20(unknown) = ^CallSideEffect : ~m2493_6 +#-----| m0_21(unknown) = Chi : total:m2493_6, partial:m0_20 +#-----| v0_22(void) = ^IndirectReadSideEffect[-1] : &:r0_17, m2493_8 #-----| m0_23(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_17 -#-----| m0_24(ClassWithDestructor) = Chi : total:m2492_8, partial:m0_23 +#-----| m0_24(ClassWithDestructor) = Chi : total:m2493_8, partial:m0_23 #-----| Goto -> Block 5 -# 2494| Block 5 -# 2494| m2494_1(unknown) = Phi : from 3:~m0_13, from 4:~m0_21, from 6:~m0_29 -# 2494| r2494_2(glval) = VariableAddress[b] : -# 2494| r2494_3(bool) = Load[b] : &:r2494_2, m2484_6 -# 2494| v2494_4(void) = ConditionalBranch : r2494_3 +# 2495| Block 5 +# 2495| m2495_1(unknown) = Phi : from 3:~m0_13, from 4:~m0_21, from 6:~m0_29 +# 2495| r2495_2(glval) = VariableAddress[b] : +# 2495| r2495_3(bool) = Load[b] : &:r2495_2, m2485_6 +# 2495| v2495_4(void) = ConditionalBranch : r2495_3 #-----| False -> Block 7 #-----| True -> Block 6 -# 2495| Block 6 -# 2495| r2495_1(glval) = VariableAddress[f] : -# 2495| m2495_2(ClassWithDestructor) = Uninitialized[f] : &:r2495_1 -# 2495| r2495_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2495| v2495_4(void) = Call[ClassWithDestructor] : func:r2495_3, this:r2495_1 -# 2495| m2495_5(unknown) = ^CallSideEffect : ~m2494_1 -# 2495| m2495_6(unknown) = Chi : total:m2494_1, partial:m2495_5 -# 2495| m2495_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2495_1 -# 2495| m2495_8(ClassWithDestructor) = Chi : total:m2495_2, partial:m2495_7 +# 2496| Block 6 +# 2496| r2496_1(glval) = VariableAddress[f] : +# 2496| m2496_2(ClassWithDestructor) = Uninitialized[f] : &:r2496_1 +# 2496| r2496_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2496| v2496_4(void) = Call[ClassWithDestructor] : func:r2496_3, this:r2496_1 +# 2496| m2496_5(unknown) = ^CallSideEffect : ~m2495_1 +# 2496| m2496_6(unknown) = Chi : total:m2495_1, partial:m2496_5 +# 2496| m2496_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2496_1 +# 2496| m2496_8(ClassWithDestructor) = Chi : total:m2496_2, partial:m2496_7 #-----| r0_25(glval) = VariableAddress[f] : #-----| r0_26(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_27(void) = Call[~ClassWithDestructor] : func:r0_26, this:r0_25 -#-----| m0_28(unknown) = ^CallSideEffect : ~m2495_6 -#-----| m0_29(unknown) = Chi : total:m2495_6, partial:m0_28 -#-----| v0_30(void) = ^IndirectReadSideEffect[-1] : &:r0_25, m2495_8 +#-----| m0_28(unknown) = ^CallSideEffect : ~m2496_6 +#-----| m0_29(unknown) = Chi : total:m2496_6, partial:m0_28 +#-----| v0_30(void) = ^IndirectReadSideEffect[-1] : &:r0_25, m2496_8 #-----| m0_31(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_25 -#-----| m0_32(ClassWithDestructor) = Chi : total:m2495_8, partial:m0_31 +#-----| m0_32(ClassWithDestructor) = Chi : total:m2496_8, partial:m0_31 #-----| Goto (back edge) -> Block 5 -# 2497| Block 7 -# 2497| r2497_1(glval) = VariableAddress[i] : -# 2497| r2497_2(int) = Constant[0] : -# 2497| m2497_3(int) = Store[i] : &:r2497_1, r2497_2 +# 2498| Block 7 +# 2498| r2498_1(glval) = VariableAddress[i] : +# 2498| r2498_2(int) = Constant[0] : +# 2498| m2498_3(int) = Store[i] : &:r2498_1, r2498_2 #-----| Goto -> Block 8 -# 2497| Block 8 -# 2497| m2497_4(unknown) = Phi : from 7:~m2494_1, from 9:~m0_37 -# 2497| m2497_5(int) = Phi : from 7:m2497_3, from 9:m2497_15 -# 2497| r2497_6(glval) = VariableAddress[i] : -# 2497| r2497_7(int) = Load[i] : &:r2497_6, m2497_5 -# 2497| r2497_8(int) = Constant[42] : -# 2497| r2497_9(bool) = CompareLT : r2497_7, r2497_8 -# 2497| v2497_10(void) = ConditionalBranch : r2497_9 +# 2498| Block 8 +# 2498| m2498_4(unknown) = Phi : from 7:~m2495_1, from 9:~m0_37 +# 2498| m2498_5(int) = Phi : from 7:m2498_3, from 9:m2498_15 +# 2498| r2498_6(glval) = VariableAddress[i] : +# 2498| r2498_7(int) = Load[i] : &:r2498_6, m2498_5 +# 2498| r2498_8(int) = Constant[42] : +# 2498| r2498_9(bool) = CompareLT : r2498_7, r2498_8 +# 2498| v2498_10(void) = ConditionalBranch : r2498_9 #-----| False -> Block 10 #-----| True -> Block 9 -# 2498| Block 9 -# 2498| r2498_1(glval) = VariableAddress[g] : -# 2498| m2498_2(ClassWithDestructor) = Uninitialized[g] : &:r2498_1 -# 2498| r2498_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2498| v2498_4(void) = Call[ClassWithDestructor] : func:r2498_3, this:r2498_1 -# 2498| m2498_5(unknown) = ^CallSideEffect : ~m2497_4 -# 2498| m2498_6(unknown) = Chi : total:m2497_4, partial:m2498_5 -# 2498| m2498_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2498_1 -# 2498| m2498_8(ClassWithDestructor) = Chi : total:m2498_2, partial:m2498_7 +# 2499| Block 9 +# 2499| r2499_1(glval) = VariableAddress[g] : +# 2499| m2499_2(ClassWithDestructor) = Uninitialized[g] : &:r2499_1 +# 2499| r2499_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2499| v2499_4(void) = Call[ClassWithDestructor] : func:r2499_3, this:r2499_1 +# 2499| m2499_5(unknown) = ^CallSideEffect : ~m2498_4 +# 2499| m2499_6(unknown) = Chi : total:m2498_4, partial:m2499_5 +# 2499| m2499_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2499_1 +# 2499| m2499_8(ClassWithDestructor) = Chi : total:m2499_2, partial:m2499_7 #-----| r0_33(glval) = VariableAddress[g] : #-----| r0_34(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_35(void) = Call[~ClassWithDestructor] : func:r0_34, this:r0_33 -#-----| m0_36(unknown) = ^CallSideEffect : ~m2498_6 -#-----| m0_37(unknown) = Chi : total:m2498_6, partial:m0_36 -#-----| v0_38(void) = ^IndirectReadSideEffect[-1] : &:r0_33, m2498_8 +#-----| m0_36(unknown) = ^CallSideEffect : ~m2499_6 +#-----| m0_37(unknown) = Chi : total:m2499_6, partial:m0_36 +#-----| v0_38(void) = ^IndirectReadSideEffect[-1] : &:r0_33, m2499_8 #-----| m0_39(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_33 -#-----| m0_40(ClassWithDestructor) = Chi : total:m2498_8, partial:m0_39 -# 2497| r2497_11(glval) = VariableAddress[i] : -# 2497| r2497_12(int) = Load[i] : &:r2497_11, m2497_5 -# 2497| r2497_13(int) = Constant[1] : -# 2497| r2497_14(int) = Add : r2497_12, r2497_13 -# 2497| m2497_15(int) = Store[i] : &:r2497_11, r2497_14 +#-----| m0_40(ClassWithDestructor) = Chi : total:m2499_8, partial:m0_39 +# 2498| r2498_11(glval) = VariableAddress[i] : +# 2498| r2498_12(int) = Load[i] : &:r2498_11, m2498_5 +# 2498| r2498_13(int) = Constant[1] : +# 2498| r2498_14(int) = Add : r2498_12, r2498_13 +# 2498| m2498_15(int) = Store[i] : &:r2498_11, r2498_14 #-----| Goto (back edge) -> Block 8 -# 2499| Block 10 -# 2499| v2499_1(void) = NoOp : -# 2484| v2484_7(void) = ReturnVoid : -# 2484| v2484_8(void) = AliasedUse : ~m2497_4 -# 2484| v2484_9(void) = ExitFunction : +# 2500| Block 10 +# 2500| v2500_1(void) = NoOp : +# 2485| v2485_7(void) = ReturnVoid : +# 2485| v2485_8(void) = AliasedUse : ~m2498_4 +# 2485| v2485_9(void) = ExitFunction : -# 2501| void destruction_in_switch_1(int) -# 2501| Block 0 -# 2501| v2501_1(void) = EnterFunction : -# 2501| m2501_2(unknown) = AliasedDefinition : -# 2501| m2501_3(unknown) = InitializeNonLocal : -# 2501| m2501_4(unknown) = Chi : total:m2501_2, partial:m2501_3 -# 2501| r2501_5(glval) = VariableAddress[c] : -# 2501| m2501_6(int) = InitializeParameter[c] : &:r2501_5 -# 2502| r2502_1(glval) = VariableAddress[c] : -# 2502| r2502_2(int) = Load[c] : &:r2502_1, m2501_6 -# 2502| v2502_3(void) = Switch : r2502_2 +# 2502| void destruction_in_switch_1(int) +# 2502| Block 0 +# 2502| v2502_1(void) = EnterFunction : +# 2502| m2502_2(unknown) = AliasedDefinition : +# 2502| m2502_3(unknown) = InitializeNonLocal : +# 2502| m2502_4(unknown) = Chi : total:m2502_2, partial:m2502_3 +# 2502| r2502_5(glval) = VariableAddress[c] : +# 2502| m2502_6(int) = InitializeParameter[c] : &:r2502_5 +# 2503| r2503_1(glval) = VariableAddress[c] : +# 2503| r2503_2(int) = Load[c] : &:r2503_1, m2502_6 +# 2503| v2503_3(void) = Switch : r2503_2 #-----| Case[0] -> Block 1 #-----| Default -> Block 2 -# 2503| Block 1 -# 2503| v2503_1(void) = NoOp : -# 2504| r2504_1(glval) = VariableAddress[x] : -# 2504| m2504_2(ClassWithDestructor) = Uninitialized[x] : &:r2504_1 -# 2504| r2504_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2504| v2504_4(void) = Call[ClassWithDestructor] : func:r2504_3, this:r2504_1 -# 2504| m2504_5(unknown) = ^CallSideEffect : ~m2501_4 -# 2504| m2504_6(unknown) = Chi : total:m2501_4, partial:m2504_5 -# 2504| m2504_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2504_1 -# 2504| m2504_8(ClassWithDestructor) = Chi : total:m2504_2, partial:m2504_7 -# 2506| r2506_1(glval) = VariableAddress[x] : -# 2506| r2506_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2506| v2506_3(void) = Call[~ClassWithDestructor] : func:r2506_2, this:r2506_1 -# 2506| m2506_4(unknown) = ^CallSideEffect : ~m2504_6 -# 2506| m2506_5(unknown) = Chi : total:m2504_6, partial:m2506_4 -# 2506| v2506_6(void) = ^IndirectReadSideEffect[-1] : &:r2506_1, m2504_8 -# 2506| m2506_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2506_1 -# 2506| m2506_8(ClassWithDestructor) = Chi : total:m2504_8, partial:m2506_7 -# 2505| v2505_1(void) = NoOp : +# 2504| Block 1 +# 2504| v2504_1(void) = NoOp : +# 2505| r2505_1(glval) = VariableAddress[x] : +# 2505| m2505_2(ClassWithDestructor) = Uninitialized[x] : &:r2505_1 +# 2505| r2505_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2505| v2505_4(void) = Call[ClassWithDestructor] : func:r2505_3, this:r2505_1 +# 2505| m2505_5(unknown) = ^CallSideEffect : ~m2502_4 +# 2505| m2505_6(unknown) = Chi : total:m2502_4, partial:m2505_5 +# 2505| m2505_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2505_1 +# 2505| m2505_8(ClassWithDestructor) = Chi : total:m2505_2, partial:m2505_7 +# 2507| r2507_1(glval) = VariableAddress[x] : +# 2507| r2507_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2507| v2507_3(void) = Call[~ClassWithDestructor] : func:r2507_2, this:r2507_1 +# 2507| m2507_4(unknown) = ^CallSideEffect : ~m2505_6 +# 2507| m2507_5(unknown) = Chi : total:m2505_6, partial:m2507_4 +# 2507| v2507_6(void) = ^IndirectReadSideEffect[-1] : &:r2507_1, m2505_8 +# 2507| m2507_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2507_1 +# 2507| m2507_8(ClassWithDestructor) = Chi : total:m2505_8, partial:m2507_7 +# 2506| v2506_1(void) = NoOp : #-----| Goto -> Block 2 -# 2507| Block 2 -# 2507| m2507_1(unknown) = Phi : from 0:~m2501_4, from 1:~m2506_5 -# 2507| v2507_2(void) = NoOp : -# 2508| v2508_1(void) = NoOp : -# 2501| v2501_7(void) = ReturnVoid : -# 2501| v2501_8(void) = AliasedUse : ~m2507_1 -# 2501| v2501_9(void) = ExitFunction : +# 2508| Block 2 +# 2508| m2508_1(unknown) = Phi : from 0:~m2502_4, from 1:~m2507_5 +# 2508| v2508_2(void) = NoOp : +# 2509| v2509_1(void) = NoOp : +# 2502| v2502_7(void) = ReturnVoid : +# 2502| v2502_8(void) = AliasedUse : ~m2508_1 +# 2502| v2502_9(void) = ExitFunction : -# 2510| void destruction_in_switch_2(int) -# 2510| Block 0 -# 2510| v2510_1(void) = EnterFunction : -# 2510| m2510_2(unknown) = AliasedDefinition : -# 2510| m2510_3(unknown) = InitializeNonLocal : -# 2510| m2510_4(unknown) = Chi : total:m2510_2, partial:m2510_3 -# 2510| r2510_5(glval) = VariableAddress[c] : -# 2510| m2510_6(int) = InitializeParameter[c] : &:r2510_5 -# 2511| r2511_1(glval) = VariableAddress[y] : -# 2511| m2511_2(ClassWithDestructor) = Uninitialized[y] : &:r2511_1 -# 2511| r2511_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2511| v2511_4(void) = Call[ClassWithDestructor] : func:r2511_3, this:r2511_1 -# 2511| m2511_5(unknown) = ^CallSideEffect : ~m2510_4 -# 2511| m2511_6(unknown) = Chi : total:m2510_4, partial:m2511_5 -# 2511| m2511_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2511_1 -# 2511| m2511_8(ClassWithDestructor) = Chi : total:m2511_2, partial:m2511_7 -# 2511| r2511_9(glval) = VariableAddress[c] : -# 2511| r2511_10(int) = Load[c] : &:r2511_9, m2510_6 -# 2511| v2511_11(void) = Switch : r2511_10 +# 2511| void destruction_in_switch_2(int) +# 2511| Block 0 +# 2511| v2511_1(void) = EnterFunction : +# 2511| m2511_2(unknown) = AliasedDefinition : +# 2511| m2511_3(unknown) = InitializeNonLocal : +# 2511| m2511_4(unknown) = Chi : total:m2511_2, partial:m2511_3 +# 2511| r2511_5(glval) = VariableAddress[c] : +# 2511| m2511_6(int) = InitializeParameter[c] : &:r2511_5 +# 2512| r2512_1(glval) = VariableAddress[y] : +# 2512| m2512_2(ClassWithDestructor) = Uninitialized[y] : &:r2512_1 +# 2512| r2512_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2512| v2512_4(void) = Call[ClassWithDestructor] : func:r2512_3, this:r2512_1 +# 2512| m2512_5(unknown) = ^CallSideEffect : ~m2511_4 +# 2512| m2512_6(unknown) = Chi : total:m2511_4, partial:m2512_5 +# 2512| m2512_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2512_1 +# 2512| m2512_8(ClassWithDestructor) = Chi : total:m2512_2, partial:m2512_7 +# 2512| r2512_9(glval) = VariableAddress[c] : +# 2512| r2512_10(int) = Load[c] : &:r2512_9, m2511_6 +# 2512| v2512_11(void) = Switch : r2512_10 #-----| Case[0] -> Block 1 #-----| Default -> Block 2 -# 2512| Block 1 -# 2512| v2512_1(void) = NoOp : -# 2518| r2518_1(glval) = VariableAddress[y] : -# 2518| r2518_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2518| v2518_3(void) = Call[~ClassWithDestructor] : func:r2518_2, this:r2518_1 -# 2518| m2518_4(unknown) = ^CallSideEffect : ~m2511_6 -# 2518| m2518_5(unknown) = Chi : total:m2511_6, partial:m2518_4 -# 2518| v2518_6(void) = ^IndirectReadSideEffect[-1] : &:r2518_1, m2511_8 -# 2518| m2518_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2518_1 -# 2518| m2518_8(ClassWithDestructor) = Chi : total:m2511_8, partial:m2518_7 +# 2513| Block 1 # 2513| v2513_1(void) = NoOp : +# 2519| r2519_1(glval) = VariableAddress[y] : +# 2519| r2519_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2519| v2519_3(void) = Call[~ClassWithDestructor] : func:r2519_2, this:r2519_1 +# 2519| m2519_4(unknown) = ^CallSideEffect : ~m2512_6 +# 2519| m2519_5(unknown) = Chi : total:m2512_6, partial:m2519_4 +# 2519| v2519_6(void) = ^IndirectReadSideEffect[-1] : &:r2519_1, m2512_8 +# 2519| m2519_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2519_1 +# 2519| m2519_8(ClassWithDestructor) = Chi : total:m2512_8, partial:m2519_7 +# 2514| v2514_1(void) = NoOp : #-----| Goto -> Block 3 -# 2515| Block 2 -# 2515| v2515_1(void) = NoOp : -# 2518| r2518_9(glval) = VariableAddress[y] : -# 2518| r2518_10(glval) = FunctionAddress[~ClassWithDestructor] : -# 2518| v2518_11(void) = Call[~ClassWithDestructor] : func:r2518_10, this:r2518_9 -# 2518| m2518_12(unknown) = ^CallSideEffect : ~m2511_6 -# 2518| m2518_13(unknown) = Chi : total:m2511_6, partial:m2518_12 -# 2518| v2518_14(void) = ^IndirectReadSideEffect[-1] : &:r2518_9, m2511_8 -# 2518| m2518_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2518_9 -# 2518| m2518_16(ClassWithDestructor) = Chi : total:m2511_8, partial:m2518_15 +# 2516| Block 2 # 2516| v2516_1(void) = NoOp : +# 2519| r2519_9(glval) = VariableAddress[y] : +# 2519| r2519_10(glval) = FunctionAddress[~ClassWithDestructor] : +# 2519| v2519_11(void) = Call[~ClassWithDestructor] : func:r2519_10, this:r2519_9 +# 2519| m2519_12(unknown) = ^CallSideEffect : ~m2512_6 +# 2519| m2519_13(unknown) = Chi : total:m2512_6, partial:m2519_12 +# 2519| v2519_14(void) = ^IndirectReadSideEffect[-1] : &:r2519_9, m2512_8 +# 2519| m2519_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2519_9 +# 2519| m2519_16(ClassWithDestructor) = Chi : total:m2512_8, partial:m2519_15 +# 2517| v2517_1(void) = NoOp : #-----| Goto -> Block 3 -# 2518| Block 3 -# 2518| m2518_17(unknown) = Phi : from 1:~m2518_5, from 2:~m2518_13 -# 2518| v2518_18(void) = NoOp : -# 2519| v2519_1(void) = NoOp : -# 2510| v2510_7(void) = ReturnVoid : -# 2510| v2510_8(void) = AliasedUse : ~m2518_17 -# 2510| v2510_9(void) = ExitFunction : +# 2519| Block 3 +# 2519| m2519_17(unknown) = Phi : from 1:~m2519_5, from 2:~m2519_13 +# 2519| v2519_18(void) = NoOp : +# 2520| v2520_1(void) = NoOp : +# 2511| v2511_7(void) = ReturnVoid : +# 2511| v2511_8(void) = AliasedUse : ~m2519_17 +# 2511| v2511_9(void) = ExitFunction : -# 2521| void destruction_in_switch_3(int) -# 2521| Block 0 -# 2521| v2521_1(void) = EnterFunction : -# 2521| m2521_2(unknown) = AliasedDefinition : -# 2521| m2521_3(unknown) = InitializeNonLocal : -# 2521| m2521_4(unknown) = Chi : total:m2521_2, partial:m2521_3 -# 2521| r2521_5(glval) = VariableAddress[c] : -# 2521| m2521_6(int) = InitializeParameter[c] : &:r2521_5 -# 2522| r2522_1(glval) = VariableAddress[y] : -# 2522| m2522_2(ClassWithDestructor) = Uninitialized[y] : &:r2522_1 -# 2522| r2522_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2522| v2522_4(void) = Call[ClassWithDestructor] : func:r2522_3, this:r2522_1 -# 2522| m2522_5(unknown) = ^CallSideEffect : ~m2521_4 -# 2522| m2522_6(unknown) = Chi : total:m2521_4, partial:m2522_5 -# 2522| m2522_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2522_1 -# 2522| m2522_8(ClassWithDestructor) = Chi : total:m2522_2, partial:m2522_7 -# 2522| r2522_9(glval) = VariableAddress[c] : -# 2522| r2522_10(int) = Load[c] : &:r2522_9, m2521_6 -# 2522| v2522_11(void) = Switch : r2522_10 +# 2522| void destruction_in_switch_3(int) +# 2522| Block 0 +# 2522| v2522_1(void) = EnterFunction : +# 2522| m2522_2(unknown) = AliasedDefinition : +# 2522| m2522_3(unknown) = InitializeNonLocal : +# 2522| m2522_4(unknown) = Chi : total:m2522_2, partial:m2522_3 +# 2522| r2522_5(glval) = VariableAddress[c] : +# 2522| m2522_6(int) = InitializeParameter[c] : &:r2522_5 +# 2523| r2523_1(glval) = VariableAddress[y] : +# 2523| m2523_2(ClassWithDestructor) = Uninitialized[y] : &:r2523_1 +# 2523| r2523_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2523| v2523_4(void) = Call[ClassWithDestructor] : func:r2523_3, this:r2523_1 +# 2523| m2523_5(unknown) = ^CallSideEffect : ~m2522_4 +# 2523| m2523_6(unknown) = Chi : total:m2522_4, partial:m2523_5 +# 2523| m2523_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2523_1 +# 2523| m2523_8(ClassWithDestructor) = Chi : total:m2523_2, partial:m2523_7 +# 2523| r2523_9(glval) = VariableAddress[c] : +# 2523| r2523_10(int) = Load[c] : &:r2523_9, m2522_6 +# 2523| v2523_11(void) = Switch : r2523_10 #-----| Case[0] -> Block 1 #-----| Default -> Block 2 -# 2523| Block 1 -# 2523| v2523_1(void) = NoOp : -# 2524| r2524_1(glval) = VariableAddress[x] : -# 2524| m2524_2(ClassWithDestructor) = Uninitialized[x] : &:r2524_1 -# 2524| r2524_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2524| v2524_4(void) = Call[ClassWithDestructor] : func:r2524_3, this:r2524_1 -# 2524| m2524_5(unknown) = ^CallSideEffect : ~m2522_6 -# 2524| m2524_6(unknown) = Chi : total:m2522_6, partial:m2524_5 -# 2524| m2524_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2524_1 -# 2524| m2524_8(ClassWithDestructor) = Chi : total:m2524_2, partial:m2524_7 -# 2526| r2526_1(glval) = VariableAddress[x] : -# 2526| r2526_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2526| v2526_3(void) = Call[~ClassWithDestructor] : func:r2526_2, this:r2526_1 -# 2526| m2526_4(unknown) = ^CallSideEffect : ~m2524_6 -# 2526| m2526_5(unknown) = Chi : total:m2524_6, partial:m2526_4 -# 2526| v2526_6(void) = ^IndirectReadSideEffect[-1] : &:r2526_1, m2524_8 -# 2526| m2526_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2526_1 -# 2526| m2526_8(ClassWithDestructor) = Chi : total:m2524_8, partial:m2526_7 -# 2530| r2530_1(glval) = VariableAddress[y] : -# 2530| r2530_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2530| v2530_3(void) = Call[~ClassWithDestructor] : func:r2530_2, this:r2530_1 -# 2530| m2530_4(unknown) = ^CallSideEffect : ~m2526_5 -# 2530| m2530_5(unknown) = Chi : total:m2526_5, partial:m2530_4 -# 2530| v2530_6(void) = ^IndirectReadSideEffect[-1] : &:r2530_1, m2522_8 -# 2530| m2530_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2530_1 -# 2530| m2530_8(ClassWithDestructor) = Chi : total:m2522_8, partial:m2530_7 -# 2525| v2525_1(void) = NoOp : +# 2524| Block 1 +# 2524| v2524_1(void) = NoOp : +# 2525| r2525_1(glval) = VariableAddress[x] : +# 2525| m2525_2(ClassWithDestructor) = Uninitialized[x] : &:r2525_1 +# 2525| r2525_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2525| v2525_4(void) = Call[ClassWithDestructor] : func:r2525_3, this:r2525_1 +# 2525| m2525_5(unknown) = ^CallSideEffect : ~m2523_6 +# 2525| m2525_6(unknown) = Chi : total:m2523_6, partial:m2525_5 +# 2525| m2525_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2525_1 +# 2525| m2525_8(ClassWithDestructor) = Chi : total:m2525_2, partial:m2525_7 +# 2527| r2527_1(glval) = VariableAddress[x] : +# 2527| r2527_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2527| v2527_3(void) = Call[~ClassWithDestructor] : func:r2527_2, this:r2527_1 +# 2527| m2527_4(unknown) = ^CallSideEffect : ~m2525_6 +# 2527| m2527_5(unknown) = Chi : total:m2525_6, partial:m2527_4 +# 2527| v2527_6(void) = ^IndirectReadSideEffect[-1] : &:r2527_1, m2525_8 +# 2527| m2527_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2527_1 +# 2527| m2527_8(ClassWithDestructor) = Chi : total:m2525_8, partial:m2527_7 +# 2531| r2531_1(glval) = VariableAddress[y] : +# 2531| r2531_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2531| v2531_3(void) = Call[~ClassWithDestructor] : func:r2531_2, this:r2531_1 +# 2531| m2531_4(unknown) = ^CallSideEffect : ~m2527_5 +# 2531| m2531_5(unknown) = Chi : total:m2527_5, partial:m2531_4 +# 2531| v2531_6(void) = ^IndirectReadSideEffect[-1] : &:r2531_1, m2523_8 +# 2531| m2531_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2531_1 +# 2531| m2531_8(ClassWithDestructor) = Chi : total:m2523_8, partial:m2531_7 +# 2526| v2526_1(void) = NoOp : #-----| Goto -> Block 3 -# 2527| Block 2 -# 2527| v2527_1(void) = NoOp : -# 2530| r2530_9(glval) = VariableAddress[y] : -# 2530| r2530_10(glval) = FunctionAddress[~ClassWithDestructor] : -# 2530| v2530_11(void) = Call[~ClassWithDestructor] : func:r2530_10, this:r2530_9 -# 2530| m2530_12(unknown) = ^CallSideEffect : ~m2522_6 -# 2530| m2530_13(unknown) = Chi : total:m2522_6, partial:m2530_12 -# 2530| v2530_14(void) = ^IndirectReadSideEffect[-1] : &:r2530_9, m2522_8 -# 2530| m2530_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2530_9 -# 2530| m2530_16(ClassWithDestructor) = Chi : total:m2522_8, partial:m2530_15 +# 2528| Block 2 # 2528| v2528_1(void) = NoOp : +# 2531| r2531_9(glval) = VariableAddress[y] : +# 2531| r2531_10(glval) = FunctionAddress[~ClassWithDestructor] : +# 2531| v2531_11(void) = Call[~ClassWithDestructor] : func:r2531_10, this:r2531_9 +# 2531| m2531_12(unknown) = ^CallSideEffect : ~m2523_6 +# 2531| m2531_13(unknown) = Chi : total:m2523_6, partial:m2531_12 +# 2531| v2531_14(void) = ^IndirectReadSideEffect[-1] : &:r2531_9, m2523_8 +# 2531| m2531_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2531_9 +# 2531| m2531_16(ClassWithDestructor) = Chi : total:m2523_8, partial:m2531_15 +# 2529| v2529_1(void) = NoOp : #-----| Goto -> Block 3 -# 2530| Block 3 -# 2530| m2530_17(unknown) = Phi : from 1:~m2530_5, from 2:~m2530_13 -# 2530| v2530_18(void) = NoOp : -# 2531| v2531_1(void) = NoOp : -# 2521| v2521_7(void) = ReturnVoid : -# 2521| v2521_8(void) = AliasedUse : ~m2530_17 -# 2521| v2521_9(void) = ExitFunction : +# 2531| Block 3 +# 2531| m2531_17(unknown) = Phi : from 1:~m2531_5, from 2:~m2531_13 +# 2531| v2531_18(void) = NoOp : +# 2532| v2532_1(void) = NoOp : +# 2522| v2522_7(void) = ReturnVoid : +# 2522| v2522_8(void) = AliasedUse : ~m2531_17 +# 2522| v2522_9(void) = ExitFunction : -# 2533| void destructor_possibly_not_handled() -# 2533| Block 0 -# 2533| v2533_1(void) = EnterFunction : -# 2533| m2533_2(unknown) = AliasedDefinition : -# 2533| m2533_3(unknown) = InitializeNonLocal : -# 2533| m2533_4(unknown) = Chi : total:m2533_2, partial:m2533_3 -# 2534| r2534_1(glval) = VariableAddress[x] : -# 2534| m2534_2(ClassWithDestructor) = Uninitialized[x] : &:r2534_1 -# 2534| r2534_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2534| v2534_4(void) = Call[ClassWithDestructor] : func:r2534_3, this:r2534_1 -# 2534| m2534_5(unknown) = ^CallSideEffect : ~m2533_4 -# 2534| m2534_6(unknown) = Chi : total:m2533_4, partial:m2534_5 -# 2534| m2534_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2534_1 -# 2534| m2534_8(ClassWithDestructor) = Chi : total:m2534_2, partial:m2534_7 -# 2536| r2536_1(glval) = VariableAddress[#throw2536:5] : -# 2536| r2536_2(int) = Constant[42] : -# 2536| m2536_3(int) = Store[#throw2536:5] : &:r2536_1, r2536_2 -# 2536| v2536_4(void) = ThrowValue : &:r2536_1, m2536_3 +# 2534| void destructor_possibly_not_handled() +# 2534| Block 0 +# 2534| v2534_1(void) = EnterFunction : +# 2534| m2534_2(unknown) = AliasedDefinition : +# 2534| m2534_3(unknown) = InitializeNonLocal : +# 2534| m2534_4(unknown) = Chi : total:m2534_2, partial:m2534_3 +# 2535| r2535_1(glval) = VariableAddress[x] : +# 2535| m2535_2(ClassWithDestructor) = Uninitialized[x] : &:r2535_1 +# 2535| r2535_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2535| v2535_4(void) = Call[ClassWithDestructor] : func:r2535_3, this:r2535_1 +# 2535| m2535_5(unknown) = ^CallSideEffect : ~m2534_4 +# 2535| m2535_6(unknown) = Chi : total:m2534_4, partial:m2535_5 +# 2535| m2535_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2535_1 +# 2535| m2535_8(ClassWithDestructor) = Chi : total:m2535_2, partial:m2535_7 +# 2537| r2537_1(glval) = VariableAddress[#throw2537:5] : +# 2537| r2537_2(int) = Constant[42] : +# 2537| m2537_3(int) = Store[#throw2537:5] : &:r2537_1, r2537_2 +# 2537| v2537_4(void) = ThrowValue : &:r2537_1, m2537_3 #-----| Exception -> Block 3 -# 2533| Block 1 -# 2533| m2533_5(unknown) = Phi : from 2:~m2534_6, from 4:~m2540_14 -# 2533| v2533_6(void) = AliasedUse : ~m2533_5 -# 2533| v2533_7(void) = ExitFunction : +# 2534| Block 1 +# 2534| m2534_5(unknown) = Phi : from 2:~m2535_6, from 4:~m2541_14 +# 2534| v2534_6(void) = AliasedUse : ~m2534_5 +# 2534| v2534_7(void) = ExitFunction : -# 2533| Block 2 -# 2533| v2533_8(void) = Unwind : +# 2534| Block 2 +# 2534| v2534_8(void) = Unwind : #-----| Goto -> Block 1 -# 2538| Block 3 -# 2538| v2538_1(void) = CatchByType[char] : +# 2539| Block 3 +# 2539| v2539_1(void) = CatchByType[char] : #-----| Exception -> Block 2 #-----| Goto -> Block 4 -# 2538| Block 4 -# 2538| r2538_2(glval) = VariableAddress[(unnamed parameter 0)] : -# 2538| m2538_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2538_2 -# 2538| v2538_4(void) = NoOp : -# 2540| r2540_1(glval) = VariableAddress[x] : -# 2540| r2540_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2540| v2540_3(void) = Call[~ClassWithDestructor] : func:r2540_2, this:r2540_1 -# 2540| m2540_4(unknown) = ^CallSideEffect : ~m2534_6 -# 2540| m2540_5(unknown) = Chi : total:m2534_6, partial:m2540_4 -# 2540| v2540_6(void) = ^IndirectReadSideEffect[-1] : &:r2540_1, m2534_8 -# 2540| m2540_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_1 -# 2540| m2540_8(ClassWithDestructor) = Chi : total:m2534_8, partial:m2540_7 -# 2540| v2540_9(void) = NoOp : -# 2540| r2540_10(glval) = VariableAddress[x] : -# 2540| r2540_11(glval) = FunctionAddress[~ClassWithDestructor] : -# 2540| v2540_12(void) = Call[~ClassWithDestructor] : func:r2540_11, this:r2540_10 -# 2540| m2540_13(unknown) = ^CallSideEffect : ~m2540_5 -# 2540| m2540_14(unknown) = Chi : total:m2540_5, partial:m2540_13 -# 2540| v2540_15(void) = ^IndirectReadSideEffect[-1] : &:r2540_10, m2540_8 -# 2540| m2540_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_10 -# 2540| m2540_17(ClassWithDestructor) = Chi : total:m2540_8, partial:m2540_16 -# 2533| v2533_9(void) = ReturnVoid : +# 2539| Block 4 +# 2539| r2539_2(glval) = VariableAddress[(unnamed parameter 0)] : +# 2539| m2539_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2539_2 +# 2539| v2539_4(void) = NoOp : +# 2541| r2541_1(glval) = VariableAddress[x] : +# 2541| r2541_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_3(void) = Call[~ClassWithDestructor] : func:r2541_2, this:r2541_1 +# 2541| m2541_4(unknown) = ^CallSideEffect : ~m2535_6 +# 2541| m2541_5(unknown) = Chi : total:m2535_6, partial:m2541_4 +# 2541| v2541_6(void) = ^IndirectReadSideEffect[-1] : &:r2541_1, m2535_8 +# 2541| m2541_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_1 +# 2541| m2541_8(ClassWithDestructor) = Chi : total:m2535_8, partial:m2541_7 +# 2541| v2541_9(void) = NoOp : +# 2541| r2541_10(glval) = VariableAddress[x] : +# 2541| r2541_11(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_12(void) = Call[~ClassWithDestructor] : func:r2541_11, this:r2541_10 +# 2541| m2541_13(unknown) = ^CallSideEffect : ~m2541_5 +# 2541| m2541_14(unknown) = Chi : total:m2541_5, partial:m2541_13 +# 2541| v2541_15(void) = ^IndirectReadSideEffect[-1] : &:r2541_10, m2541_8 +# 2541| m2541_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_10 +# 2541| m2541_17(ClassWithDestructor) = Chi : total:m2541_8, partial:m2541_16 +# 2534| v2534_9(void) = ReturnVoid : #-----| Goto -> Block 1 perf-regression.cpp: diff --git a/cpp/ql/test/library-tests/ir/ir/ir.cpp b/cpp/ql/test/library-tests/ir/ir/ir.cpp index 35ea60715cc..159c7173310 100644 --- a/cpp/ql/test/library-tests/ir/ir/ir.cpp +++ b/cpp/ql/test/library-tests/ir/ir/ir.cpp @@ -2191,6 +2191,7 @@ public: void set_x(char y) { *x = y; } char get_x() { return *x; } + operator bool() const; }; constexpr bool initialization_with_destructor_bool = true; @@ -2539,4 +2540,18 @@ void destructor_possibly_not_handled() { } } +// ClassWithDestructor getClassWithDestructor(); + +// void this_inconsistency(bool b) { +// if (const ClassWithDestructor& a = getClassWithDestructor()) +// ; +// } + +// constexpr bool initialization_with_destructor_bool = true; + +// void constexpr_inconsistency(bool b) { +// if constexpr (const ClassWithDestructor& a = getClassWithDestructor(); initialization_with_destructor_bool) +// ; +// } + // semmle-extractor-options: -std=c++20 --clang diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 404d48758b8..eabbc4c3064 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -14108,2174 +14108,2174 @@ ir.cpp: # 2193| v2193_18(void) = AliasedUse : ~m? # 2193| v2193_19(void) = ExitFunction : -# 2196| bool initialization_with_destructor_bool -# 2196| Block 0 -# 2196| v2196_1(void) = EnterFunction : -# 2196| mu2196_2(unknown) = AliasedDefinition : -# 2196| r2196_3(glval) = VariableAddress[initialization_with_destructor_bool] : -# 2196| r2196_4(bool) = Constant[1] : -# 2196| mu2196_5(bool) = Store[initialization_with_destructor_bool] : &:r2196_3, r2196_4 -# 2196| v2196_6(void) = ReturnVoid : -# 2196| v2196_7(void) = AliasedUse : ~m? -# 2196| v2196_8(void) = ExitFunction : +# 2197| bool initialization_with_destructor_bool +# 2197| Block 0 +# 2197| v2197_1(void) = EnterFunction : +# 2197| mu2197_2(unknown) = AliasedDefinition : +# 2197| r2197_3(glval) = VariableAddress[initialization_with_destructor_bool] : +# 2197| r2197_4(bool) = Constant[1] : +# 2197| mu2197_5(bool) = Store[initialization_with_destructor_bool] : &:r2197_3, r2197_4 +# 2197| v2197_6(void) = ReturnVoid : +# 2197| v2197_7(void) = AliasedUse : ~m? +# 2197| v2197_8(void) = ExitFunction : -# 2198| void initialization_with_destructor(bool, char) -# 2198| Block 0 -# 2198| v2198_1(void) = EnterFunction : -# 2198| mu2198_2(unknown) = AliasedDefinition : -# 2198| mu2198_3(unknown) = InitializeNonLocal : -# 2198| r2198_4(glval) = VariableAddress[b] : -# 2198| mu2198_5(bool) = InitializeParameter[b] : &:r2198_4 -# 2198| r2198_6(glval) = VariableAddress[c] : -# 2198| mu2198_7(char) = InitializeParameter[c] : &:r2198_6 -# 2199| r2199_1(glval) = VariableAddress[x] : -# 2199| mu2199_2(ClassWithDestructor) = Uninitialized[x] : &:r2199_1 -# 2199| r2199_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2199| v2199_4(void) = Call[ClassWithDestructor] : func:r2199_3, this:r2199_1 -# 2199| mu2199_5(unknown) = ^CallSideEffect : ~m? -# 2199| mu2199_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2199_1 -# 2199| r2199_7(glval) = VariableAddress[b] : -# 2199| r2199_8(bool) = Load[b] : &:r2199_7, ~m? -# 2199| v2199_9(void) = ConditionalBranch : r2199_8 +# 2199| void initialization_with_destructor(bool, char) +# 2199| Block 0 +# 2199| v2199_1(void) = EnterFunction : +# 2199| mu2199_2(unknown) = AliasedDefinition : +# 2199| mu2199_3(unknown) = InitializeNonLocal : +# 2199| r2199_4(glval) = VariableAddress[b] : +# 2199| mu2199_5(bool) = InitializeParameter[b] : &:r2199_4 +# 2199| r2199_6(glval) = VariableAddress[c] : +# 2199| mu2199_7(char) = InitializeParameter[c] : &:r2199_6 +# 2200| r2200_1(glval) = VariableAddress[x] : +# 2200| mu2200_2(ClassWithDestructor) = Uninitialized[x] : &:r2200_1 +# 2200| r2200_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2200| v2200_4(void) = Call[ClassWithDestructor] : func:r2200_3, this:r2200_1 +# 2200| mu2200_5(unknown) = ^CallSideEffect : ~m? +# 2200| mu2200_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2200_1 +# 2200| r2200_7(glval) = VariableAddress[b] : +# 2200| r2200_8(bool) = Load[b] : &:r2200_7, ~m? +# 2200| v2200_9(void) = ConditionalBranch : r2200_8 #-----| False -> Block 3 #-----| True -> Block 2 -# 2198| Block 1 -# 2198| v2198_8(void) = ReturnVoid : -# 2198| v2198_9(void) = AliasedUse : ~m? -# 2198| v2198_10(void) = ExitFunction : +# 2199| Block 1 +# 2199| v2199_8(void) = ReturnVoid : +# 2199| v2199_9(void) = AliasedUse : ~m? +# 2199| v2199_10(void) = ExitFunction : -# 2200| Block 2 -# 2200| r2200_1(glval) = VariableAddress[x] : -# 2200| r2200_2(glval) = FunctionAddress[set_x] : -# 2200| r2200_3(char) = Constant[97] : -# 2200| v2200_4(void) = Call[set_x] : func:r2200_2, this:r2200_1, 0:r2200_3 -# 2200| mu2200_5(unknown) = ^CallSideEffect : ~m? -# 2200| v2200_6(void) = ^IndirectReadSideEffect[-1] : &:r2200_1, ~m? -# 2200| mu2200_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2200_1 -# 2200| r2200_8(glval) = VariableAddress[x] : -# 2200| r2200_9(glval) = FunctionAddress[~ClassWithDestructor] : -# 2200| v2200_10(void) = Call[~ClassWithDestructor] : func:r2200_9, this:r2200_8 -# 2200| mu2200_11(unknown) = ^CallSideEffect : ~m? -# 2200| v2200_12(void) = ^IndirectReadSideEffect[-1] : &:r2200_8, ~m? -# 2200| mu2200_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2200_8 +# 2201| Block 2 +# 2201| r2201_1(glval) = VariableAddress[x] : +# 2201| r2201_2(glval) = FunctionAddress[set_x] : +# 2201| r2201_3(char) = Constant[97] : +# 2201| v2201_4(void) = Call[set_x] : func:r2201_2, this:r2201_1, 0:r2201_3 +# 2201| mu2201_5(unknown) = ^CallSideEffect : ~m? +# 2201| v2201_6(void) = ^IndirectReadSideEffect[-1] : &:r2201_1, ~m? +# 2201| mu2201_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_1 +# 2201| r2201_8(glval) = VariableAddress[x] : +# 2201| r2201_9(glval) = FunctionAddress[~ClassWithDestructor] : +# 2201| v2201_10(void) = Call[~ClassWithDestructor] : func:r2201_9, this:r2201_8 +# 2201| mu2201_11(unknown) = ^CallSideEffect : ~m? +# 2201| v2201_12(void) = ^IndirectReadSideEffect[-1] : &:r2201_8, ~m? +# 2201| mu2201_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_8 #-----| Goto -> Block 3 -# 2202| Block 3 -# 2202| r2202_1(glval) = VariableAddress[x] : -# 2202| mu2202_2(ClassWithDestructor) = Uninitialized[x] : &:r2202_1 -# 2202| r2202_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2202| v2202_4(void) = Call[ClassWithDestructor] : func:r2202_3, this:r2202_1 -# 2202| mu2202_5(unknown) = ^CallSideEffect : ~m? -# 2202| mu2202_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2202_1 -# 2202| r2202_7(bool) = Constant[1] : -# 2202| v2202_8(void) = ConditionalBranch : r2202_7 +# 2203| Block 3 +# 2203| r2203_1(glval) = VariableAddress[x] : +# 2203| mu2203_2(ClassWithDestructor) = Uninitialized[x] : &:r2203_1 +# 2203| r2203_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2203| v2203_4(void) = Call[ClassWithDestructor] : func:r2203_3, this:r2203_1 +# 2203| mu2203_5(unknown) = ^CallSideEffect : ~m? +# 2203| mu2203_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 +# 2203| r2203_7(bool) = Constant[1] : +# 2203| v2203_8(void) = ConditionalBranch : r2203_7 #-----| False -> Block 6 #-----| True -> Block 4 -# 2203| Block 4 -# 2203| r2203_1(glval) = VariableAddress[x] : -# 2203| r2203_2(glval) = FunctionAddress[set_x] : -# 2203| r2203_3(char) = Constant[97] : -# 2203| v2203_4(void) = Call[set_x] : func:r2203_2, this:r2203_1, 0:r2203_3 -# 2203| mu2203_5(unknown) = ^CallSideEffect : ~m? -# 2203| v2203_6(void) = ^IndirectReadSideEffect[-1] : &:r2203_1, ~m? -# 2203| mu2203_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 +# 2204| Block 4 +# 2204| r2204_1(glval) = VariableAddress[x] : +# 2204| r2204_2(glval) = FunctionAddress[set_x] : +# 2204| r2204_3(char) = Constant[97] : +# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 +# 2204| mu2204_5(unknown) = ^CallSideEffect : ~m? +# 2204| v2204_6(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, ~m? +# 2204| mu2204_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 #-----| Goto -> Block 6 -# 2203| Block 5 -# 2203| r2203_8(glval) = VariableAddress[x] : -# 2203| r2203_9(glval) = FunctionAddress[~ClassWithDestructor] : -# 2203| v2203_10(void) = Call[~ClassWithDestructor] : func:r2203_9, this:r2203_8 -# 2203| mu2203_11(unknown) = ^CallSideEffect : ~m? -# 2203| v2203_12(void) = ^IndirectReadSideEffect[-1] : &:r2203_8, ~m? -# 2203| mu2203_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_8 +# 2204| Block 5 +# 2204| r2204_8(glval) = VariableAddress[x] : +# 2204| r2204_9(glval) = FunctionAddress[~ClassWithDestructor] : +# 2204| v2204_10(void) = Call[~ClassWithDestructor] : func:r2204_9, this:r2204_8 +# 2204| mu2204_11(unknown) = ^CallSideEffect : ~m? +# 2204| v2204_12(void) = ^IndirectReadSideEffect[-1] : &:r2204_8, ~m? +# 2204| mu2204_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_8 #-----| Goto -> Block 6 -# 2205| Block 6 -# 2205| r2205_1(glval) = VariableAddress[x] : -# 2205| mu2205_2(ClassWithDestructor) = Uninitialized[x] : &:r2205_1 -# 2205| r2205_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2205| v2205_4(void) = Call[ClassWithDestructor] : func:r2205_3, this:r2205_1 -# 2205| mu2205_5(unknown) = ^CallSideEffect : ~m? -# 2205| mu2205_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2205_1 -# 2205| r2205_7(glval) = VariableAddress[c] : -# 2205| r2205_8(char) = Load[c] : &:r2205_7, ~m? -# 2205| r2205_9(int) = Convert : r2205_8 -# 2205| v2205_10(void) = Switch : r2205_9 +# 2206| Block 6 +# 2206| r2206_1(glval) = VariableAddress[x] : +# 2206| mu2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 +# 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2206| v2206_4(void) = Call[ClassWithDestructor] : func:r2206_3, this:r2206_1 +# 2206| mu2206_5(unknown) = ^CallSideEffect : ~m? +# 2206| mu2206_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2206_1 +# 2206| r2206_7(glval) = VariableAddress[c] : +# 2206| r2206_8(char) = Load[c] : &:r2206_7, ~m? +# 2206| r2206_9(int) = Convert : r2206_8 +# 2206| v2206_10(void) = Switch : r2206_9 #-----| Case[97] -> Block 7 #-----| Default -> Block 8 -# 2206| Block 7 -# 2206| v2206_1(void) = NoOp : -# 2207| r2207_1(glval) = VariableAddress[x] : -# 2207| r2207_2(glval) = FunctionAddress[set_x] : -# 2207| r2207_3(char) = Constant[97] : -# 2207| v2207_4(void) = Call[set_x] : func:r2207_2, this:r2207_1, 0:r2207_3 -# 2207| mu2207_5(unknown) = ^CallSideEffect : ~m? -# 2207| v2207_6(void) = ^IndirectReadSideEffect[-1] : &:r2207_1, ~m? -# 2207| mu2207_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2207_1 -# 2212| r2212_1(glval) = VariableAddress[x] : -# 2212| r2212_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2212| v2212_3(void) = Call[~ClassWithDestructor] : func:r2212_2, this:r2212_1 -# 2212| mu2212_4(unknown) = ^CallSideEffect : ~m? -# 2212| v2212_5(void) = ^IndirectReadSideEffect[-1] : &:r2212_1, ~m? -# 2212| mu2212_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2212_1 -# 2208| v2208_1(void) = NoOp : -#-----| Goto -> Block 10 - -# 2209| Block 8 +# 2207| Block 7 +# 2207| v2207_1(void) = NoOp : +# 2208| r2208_1(glval) = VariableAddress[x] : +# 2208| r2208_2(glval) = FunctionAddress[set_x] : +# 2208| r2208_3(char) = Constant[97] : +# 2208| v2208_4(void) = Call[set_x] : func:r2208_2, this:r2208_1, 0:r2208_3 +# 2208| mu2208_5(unknown) = ^CallSideEffect : ~m? +# 2208| v2208_6(void) = ^IndirectReadSideEffect[-1] : &:r2208_1, ~m? +# 2208| mu2208_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2208_1 +# 2213| r2213_1(glval) = VariableAddress[x] : +# 2213| r2213_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2213| v2213_3(void) = Call[~ClassWithDestructor] : func:r2213_2, this:r2213_1 +# 2213| mu2213_4(unknown) = ^CallSideEffect : ~m? +# 2213| v2213_5(void) = ^IndirectReadSideEffect[-1] : &:r2213_1, ~m? +# 2213| mu2213_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_1 # 2209| v2209_1(void) = NoOp : -# 2210| r2210_1(glval) = VariableAddress[x] : -# 2210| r2210_2(glval) = FunctionAddress[set_x] : -# 2210| r2210_3(char) = Constant[98] : -# 2210| v2210_4(void) = Call[set_x] : func:r2210_2, this:r2210_1, 0:r2210_3 -# 2210| mu2210_5(unknown) = ^CallSideEffect : ~m? -# 2210| v2210_6(void) = ^IndirectReadSideEffect[-1] : &:r2210_1, ~m? -# 2210| mu2210_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2210_1 -# 2212| r2212_7(glval) = VariableAddress[x] : -# 2212| r2212_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2212| v2212_9(void) = Call[~ClassWithDestructor] : func:r2212_8, this:r2212_7 -# 2212| mu2212_10(unknown) = ^CallSideEffect : ~m? -# 2212| v2212_11(void) = ^IndirectReadSideEffect[-1] : &:r2212_7, ~m? -# 2212| mu2212_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2212_7 -# 2211| v2211_1(void) = NoOp : #-----| Goto -> Block 10 -# 2212| Block 9 -# 2212| r2212_13(glval) = VariableAddress[x] : -# 2212| r2212_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2212| v2212_15(void) = Call[~ClassWithDestructor] : func:r2212_14, this:r2212_13 -# 2212| mu2212_16(unknown) = ^CallSideEffect : ~m? -# 2212| v2212_17(void) = ^IndirectReadSideEffect[-1] : &:r2212_13, ~m? -# 2212| mu2212_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2212_13 +# 2210| Block 8 +# 2210| v2210_1(void) = NoOp : +# 2211| r2211_1(glval) = VariableAddress[x] : +# 2211| r2211_2(glval) = FunctionAddress[set_x] : +# 2211| r2211_3(char) = Constant[98] : +# 2211| v2211_4(void) = Call[set_x] : func:r2211_2, this:r2211_1, 0:r2211_3 +# 2211| mu2211_5(unknown) = ^CallSideEffect : ~m? +# 2211| v2211_6(void) = ^IndirectReadSideEffect[-1] : &:r2211_1, ~m? +# 2211| mu2211_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2211_1 +# 2213| r2213_7(glval) = VariableAddress[x] : +# 2213| r2213_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2213| v2213_9(void) = Call[~ClassWithDestructor] : func:r2213_8, this:r2213_7 +# 2213| mu2213_10(unknown) = ^CallSideEffect : ~m? +# 2213| v2213_11(void) = ^IndirectReadSideEffect[-1] : &:r2213_7, ~m? +# 2213| mu2213_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_7 +# 2212| v2212_1(void) = NoOp : #-----| Goto -> Block 10 -# 2212| Block 10 -# 2212| v2212_19(void) = NoOp : -# 2214| r2214_1(glval) = VariableAddress[x] : -# 2214| mu2214_2(ClassWithDestructor) = Uninitialized[x] : &:r2214_1 -# 2214| r2214_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2214| v2214_4(void) = Call[ClassWithDestructor] : func:r2214_3, this:r2214_1 -# 2214| mu2214_5(unknown) = ^CallSideEffect : ~m? -# 2214| mu2214_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2214_1 -# 2215| r2215_1(glval>) = VariableAddress[ys] : -# 2215| mu2215_2(vector) = Uninitialized[ys] : &:r2215_1 -# 2215| r2215_3(glval) = FunctionAddress[vector] : -# 2215| r2215_4(glval) = VariableAddress[#temp2215:45] : -# 2215| r2215_5(glval) = VariableAddress[x] : -# 2215| r2215_6(ClassWithDestructor) = Load[x] : &:r2215_5, ~m? -# 2215| mu2215_7(ClassWithDestructor) = Store[#temp2215:45] : &:r2215_4, r2215_6 -# 2215| r2215_8(ClassWithDestructor) = Load[#temp2215:45] : &:r2215_4, ~m? -# 2215| v2215_9(void) = Call[vector] : func:r2215_3, this:r2215_1, 0:r2215_8 -# 2215| mu2215_10(unknown) = ^CallSideEffect : ~m? -# 2215| mu2215_11(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2215_1 -# 2215| r2215_12(glval) = CopyValue : r2215_4 -# 2215| r2215_13(glval) = FunctionAddress[~ClassWithDestructor] : -# 2215| v2215_14(void) = Call[~ClassWithDestructor] : func:r2215_13, this:r2215_12 -# 2215| mu2215_15(unknown) = ^CallSideEffect : ~m? -# 2215| v2215_16(void) = ^IndirectReadSideEffect[-1] : &:r2215_12, ~m? -# 2215| mu2215_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2215_12 -# 2215| r2215_18(glval &>) = VariableAddress[(__range)] : -# 2215| r2215_19(glval>) = VariableAddress[ys] : -# 2215| r2215_20(vector &) = CopyValue : r2215_19 -# 2215| mu2215_21(vector &) = Store[(__range)] : &:r2215_18, r2215_20 -# 2215| r2215_22(glval>) = VariableAddress[(__begin)] : -# 2215| r2215_23(glval &>) = VariableAddress[(__range)] : -# 2215| r2215_24(vector &) = Load[(__range)] : &:r2215_23, ~m? -#-----| r0_1(glval>) = CopyValue : r2215_24 +# 2213| Block 9 +# 2213| r2213_13(glval) = VariableAddress[x] : +# 2213| r2213_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2213| v2213_15(void) = Call[~ClassWithDestructor] : func:r2213_14, this:r2213_13 +# 2213| mu2213_16(unknown) = ^CallSideEffect : ~m? +# 2213| v2213_17(void) = ^IndirectReadSideEffect[-1] : &:r2213_13, ~m? +# 2213| mu2213_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_13 +#-----| Goto -> Block 10 + +# 2213| Block 10 +# 2213| v2213_19(void) = NoOp : +# 2215| r2215_1(glval) = VariableAddress[x] : +# 2215| mu2215_2(ClassWithDestructor) = Uninitialized[x] : &:r2215_1 +# 2215| r2215_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2215| v2215_4(void) = Call[ClassWithDestructor] : func:r2215_3, this:r2215_1 +# 2215| mu2215_5(unknown) = ^CallSideEffect : ~m? +# 2215| mu2215_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2215_1 +# 2216| r2216_1(glval>) = VariableAddress[ys] : +# 2216| mu2216_2(vector) = Uninitialized[ys] : &:r2216_1 +# 2216| r2216_3(glval) = FunctionAddress[vector] : +# 2216| r2216_4(glval) = VariableAddress[#temp2216:45] : +# 2216| r2216_5(glval) = VariableAddress[x] : +# 2216| r2216_6(ClassWithDestructor) = Load[x] : &:r2216_5, ~m? +# 2216| mu2216_7(ClassWithDestructor) = Store[#temp2216:45] : &:r2216_4, r2216_6 +# 2216| r2216_8(ClassWithDestructor) = Load[#temp2216:45] : &:r2216_4, ~m? +# 2216| v2216_9(void) = Call[vector] : func:r2216_3, this:r2216_1, 0:r2216_8 +# 2216| mu2216_10(unknown) = ^CallSideEffect : ~m? +# 2216| mu2216_11(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2216_1 +# 2216| r2216_12(glval) = CopyValue : r2216_4 +# 2216| r2216_13(glval) = FunctionAddress[~ClassWithDestructor] : +# 2216| v2216_14(void) = Call[~ClassWithDestructor] : func:r2216_13, this:r2216_12 +# 2216| mu2216_15(unknown) = ^CallSideEffect : ~m? +# 2216| v2216_16(void) = ^IndirectReadSideEffect[-1] : &:r2216_12, ~m? +# 2216| mu2216_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_12 +# 2216| r2216_18(glval &>) = VariableAddress[(__range)] : +# 2216| r2216_19(glval>) = VariableAddress[ys] : +# 2216| r2216_20(vector &) = CopyValue : r2216_19 +# 2216| mu2216_21(vector &) = Store[(__range)] : &:r2216_18, r2216_20 +# 2216| r2216_22(glval>) = VariableAddress[(__begin)] : +# 2216| r2216_23(glval &>) = VariableAddress[(__range)] : +# 2216| r2216_24(vector &) = Load[(__range)] : &:r2216_23, ~m? +#-----| r0_1(glval>) = CopyValue : r2216_24 #-----| r0_2(glval>) = Convert : r0_1 -# 2215| r2215_25(glval) = FunctionAddress[begin] : -# 2215| r2215_26(iterator) = Call[begin] : func:r2215_25, this:r0_2 +# 2216| r2216_25(glval) = FunctionAddress[begin] : +# 2216| r2216_26(iterator) = Call[begin] : func:r2216_25, this:r0_2 #-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m? -# 2215| mu2215_27(iterator) = Store[(__begin)] : &:r2215_22, r2215_26 -# 2215| r2215_28(glval>) = VariableAddress[(__end)] : -# 2215| r2215_29(glval &>) = VariableAddress[(__range)] : -# 2215| r2215_30(vector &) = Load[(__range)] : &:r2215_29, ~m? -#-----| r0_4(glval>) = CopyValue : r2215_30 +# 2216| mu2216_27(iterator) = Store[(__begin)] : &:r2216_22, r2216_26 +# 2216| r2216_28(glval>) = VariableAddress[(__end)] : +# 2216| r2216_29(glval &>) = VariableAddress[(__range)] : +# 2216| r2216_30(vector &) = Load[(__range)] : &:r2216_29, ~m? +#-----| r0_4(glval>) = CopyValue : r2216_30 #-----| r0_5(glval>) = Convert : r0_4 -# 2215| r2215_31(glval) = FunctionAddress[end] : -# 2215| r2215_32(iterator) = Call[end] : func:r2215_31, this:r0_5 +# 2216| r2216_31(glval) = FunctionAddress[end] : +# 2216| r2216_32(iterator) = Call[end] : func:r2216_31, this:r0_5 #-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m? -# 2215| mu2215_33(iterator) = Store[(__end)] : &:r2215_28, r2215_32 +# 2216| mu2216_33(iterator) = Store[(__end)] : &:r2216_28, r2216_32 #-----| Goto -> Block 11 -# 2215| Block 11 -# 2215| r2215_34(glval>) = VariableAddress[(__begin)] : -#-----| r0_7(glval>) = Convert : r2215_34 -# 2215| r2215_35(glval) = FunctionAddress[operator!=] : +# 2216| Block 11 +# 2216| r2216_34(glval>) = VariableAddress[(__begin)] : +#-----| r0_7(glval>) = Convert : r2216_34 +# 2216| r2216_35(glval) = FunctionAddress[operator!=] : #-----| r0_8(glval>) = VariableAddress[#temp0:0] : #-----| mu0_9(iterator) = Uninitialized[#temp0:0] : &:r0_8 -# 2215| r2215_36(glval) = FunctionAddress[iterator] : -# 2215| r2215_37(glval>) = VariableAddress[(__end)] : -#-----| r0_10(glval>) = Convert : r2215_37 +# 2216| r2216_36(glval) = FunctionAddress[iterator] : +# 2216| r2216_37(glval>) = VariableAddress[(__end)] : +#-----| r0_10(glval>) = Convert : r2216_37 #-----| r0_11(iterator &) = CopyValue : r0_10 -# 2215| v2215_38(void) = Call[iterator] : func:r2215_36, this:r0_8, 0:r0_11 -# 2215| mu2215_39(unknown) = ^CallSideEffect : ~m? +# 2216| v2216_38(void) = Call[iterator] : func:r2216_36, this:r0_8, 0:r0_11 +# 2216| mu2216_39(unknown) = ^CallSideEffect : ~m? #-----| v0_12(void) = ^BufferReadSideEffect[0] : &:r0_11, ~m? -# 2215| mu2215_40(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 +# 2216| mu2216_40(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 #-----| r0_13(iterator) = Load[#temp0:0] : &:r0_8, ~m? -# 2215| r2215_41(bool) = Call[operator!=] : func:r2215_35, this:r0_7, 0:r0_13 +# 2216| r2216_41(bool) = Call[operator!=] : func:r2216_35, this:r0_7, 0:r0_13 #-----| v0_14(void) = ^IndirectReadSideEffect[-1] : &:r0_7, ~m? -# 2215| v2215_42(void) = ConditionalBranch : r2215_41 +# 2216| v2216_42(void) = ConditionalBranch : r2216_41 #-----| False -> Block 13 #-----| True -> Block 12 -# 2215| Block 12 -# 2215| r2215_43(glval) = VariableAddress[y] : -# 2215| r2215_44(glval>) = VariableAddress[(__begin)] : -#-----| r0_15(glval>) = Convert : r2215_44 -# 2215| r2215_45(glval) = FunctionAddress[operator*] : -# 2215| r2215_46(ClassWithDestructor &) = Call[operator*] : func:r2215_45, this:r0_15 +# 2216| Block 12 +# 2216| r2216_43(glval) = VariableAddress[y] : +# 2216| r2216_44(glval>) = VariableAddress[(__begin)] : +#-----| r0_15(glval>) = Convert : r2216_44 +# 2216| r2216_45(glval) = FunctionAddress[operator*] : +# 2216| r2216_46(ClassWithDestructor &) = Call[operator*] : func:r2216_45, this:r0_15 #-----| v0_16(void) = ^IndirectReadSideEffect[-1] : &:r0_15, ~m? -# 2215| r2215_47(ClassWithDestructor) = Load[?] : &:r2215_46, ~m? -# 2215| mu2215_48(ClassWithDestructor) = Store[y] : &:r2215_43, r2215_47 -# 2216| r2216_1(glval) = VariableAddress[y] : -# 2216| r2216_2(glval) = FunctionAddress[set_x] : -# 2216| r2216_3(char) = Constant[97] : -# 2216| v2216_4(void) = Call[set_x] : func:r2216_2, this:r2216_1, 0:r2216_3 -# 2216| mu2216_5(unknown) = ^CallSideEffect : ~m? -# 2216| v2216_6(void) = ^IndirectReadSideEffect[-1] : &:r2216_1, ~m? -# 2216| mu2216_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_1 -# 2215| r2215_49(glval>) = VariableAddress[(__begin)] : -# 2215| r2215_50(glval) = FunctionAddress[operator++] : -# 2215| r2215_51(iterator &) = Call[operator++] : func:r2215_50, this:r2215_49 -# 2215| v2215_52(void) = ^IndirectReadSideEffect[-1] : &:r2215_49, ~m? -# 2215| mu2215_53(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2215_49 -# 2215| r2215_54(glval) = VariableAddress[y] : -# 2215| r2215_55(glval) = FunctionAddress[~ClassWithDestructor] : -# 2215| v2215_56(void) = Call[~ClassWithDestructor] : func:r2215_55, this:r2215_54 -# 2215| mu2215_57(unknown) = ^CallSideEffect : ~m? -# 2215| v2215_58(void) = ^IndirectReadSideEffect[-1] : &:r2215_54, ~m? -# 2215| mu2215_59(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2215_54 -# 2215| r2215_60(glval>) = CopyValue : r2215_51 +# 2216| r2216_47(ClassWithDestructor) = Load[?] : &:r2216_46, ~m? +# 2216| mu2216_48(ClassWithDestructor) = Store[y] : &:r2216_43, r2216_47 +# 2217| r2217_1(glval) = VariableAddress[y] : +# 2217| r2217_2(glval) = FunctionAddress[set_x] : +# 2217| r2217_3(char) = Constant[97] : +# 2217| v2217_4(void) = Call[set_x] : func:r2217_2, this:r2217_1, 0:r2217_3 +# 2217| mu2217_5(unknown) = ^CallSideEffect : ~m? +# 2217| v2217_6(void) = ^IndirectReadSideEffect[-1] : &:r2217_1, ~m? +# 2217| mu2217_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2217_1 +# 2216| r2216_49(glval>) = VariableAddress[(__begin)] : +# 2216| r2216_50(glval) = FunctionAddress[operator++] : +# 2216| r2216_51(iterator &) = Call[operator++] : func:r2216_50, this:r2216_49 +# 2216| v2216_52(void) = ^IndirectReadSideEffect[-1] : &:r2216_49, ~m? +# 2216| mu2216_53(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2216_49 +# 2216| r2216_54(glval) = VariableAddress[y] : +# 2216| r2216_55(glval) = FunctionAddress[~ClassWithDestructor] : +# 2216| v2216_56(void) = Call[~ClassWithDestructor] : func:r2216_55, this:r2216_54 +# 2216| mu2216_57(unknown) = ^CallSideEffect : ~m? +# 2216| v2216_58(void) = ^IndirectReadSideEffect[-1] : &:r2216_54, ~m? +# 2216| mu2216_59(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_54 +# 2216| r2216_60(glval>) = CopyValue : r2216_51 #-----| Goto (back edge) -> Block 11 -# 2215| Block 13 -# 2215| r2215_61(glval>) = VariableAddress[ys] : -# 2215| r2215_62(glval) = FunctionAddress[~vector] : -# 2215| v2215_63(void) = Call[~vector] : func:r2215_62, this:r2215_61 -# 2215| mu2215_64(unknown) = ^CallSideEffect : ~m? -# 2215| v2215_65(void) = ^IndirectReadSideEffect[-1] : &:r2215_61, ~m? -# 2215| mu2215_66(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2215_61 -# 2218| r2218_1(glval>) = VariableAddress[ys] : -# 2218| mu2218_2(vector) = Uninitialized[ys] : &:r2218_1 -# 2218| r2218_3(glval) = FunctionAddress[vector] : -# 2218| r2218_4(glval) = VariableAddress[#temp2218:45] : -# 2218| r2218_5(glval) = VariableAddress[x] : -# 2218| r2218_6(ClassWithDestructor) = Load[x] : &:r2218_5, ~m? -# 2218| mu2218_7(ClassWithDestructor) = Store[#temp2218:45] : &:r2218_4, r2218_6 -# 2218| r2218_8(ClassWithDestructor) = Load[#temp2218:45] : &:r2218_4, ~m? -# 2218| v2218_9(void) = Call[vector] : func:r2218_3, this:r2218_1, 0:r2218_8 -# 2218| mu2218_10(unknown) = ^CallSideEffect : ~m? -# 2218| mu2218_11(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2218_1 -# 2218| r2218_12(glval) = CopyValue : r2218_4 -# 2218| r2218_13(glval) = FunctionAddress[~ClassWithDestructor] : -# 2218| v2218_14(void) = Call[~ClassWithDestructor] : func:r2218_13, this:r2218_12 -# 2218| mu2218_15(unknown) = ^CallSideEffect : ~m? -# 2218| v2218_16(void) = ^IndirectReadSideEffect[-1] : &:r2218_12, ~m? -# 2218| mu2218_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2218_12 -# 2218| r2218_18(glval &>) = VariableAddress[(__range)] : -# 2218| r2218_19(glval>) = VariableAddress[ys] : -# 2218| r2218_20(vector &) = CopyValue : r2218_19 -# 2218| mu2218_21(vector &) = Store[(__range)] : &:r2218_18, r2218_20 -# 2218| r2218_22(glval>) = VariableAddress[(__begin)] : -# 2218| r2218_23(glval &>) = VariableAddress[(__range)] : -# 2218| r2218_24(vector &) = Load[(__range)] : &:r2218_23, ~m? -#-----| r0_17(glval>) = CopyValue : r2218_24 +# 2216| Block 13 +# 2216| r2216_61(glval>) = VariableAddress[ys] : +# 2216| r2216_62(glval) = FunctionAddress[~vector] : +# 2216| v2216_63(void) = Call[~vector] : func:r2216_62, this:r2216_61 +# 2216| mu2216_64(unknown) = ^CallSideEffect : ~m? +# 2216| v2216_65(void) = ^IndirectReadSideEffect[-1] : &:r2216_61, ~m? +# 2216| mu2216_66(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2216_61 +# 2219| r2219_1(glval>) = VariableAddress[ys] : +# 2219| mu2219_2(vector) = Uninitialized[ys] : &:r2219_1 +# 2219| r2219_3(glval) = FunctionAddress[vector] : +# 2219| r2219_4(glval) = VariableAddress[#temp2219:45] : +# 2219| r2219_5(glval) = VariableAddress[x] : +# 2219| r2219_6(ClassWithDestructor) = Load[x] : &:r2219_5, ~m? +# 2219| mu2219_7(ClassWithDestructor) = Store[#temp2219:45] : &:r2219_4, r2219_6 +# 2219| r2219_8(ClassWithDestructor) = Load[#temp2219:45] : &:r2219_4, ~m? +# 2219| v2219_9(void) = Call[vector] : func:r2219_3, this:r2219_1, 0:r2219_8 +# 2219| mu2219_10(unknown) = ^CallSideEffect : ~m? +# 2219| mu2219_11(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2219_1 +# 2219| r2219_12(glval) = CopyValue : r2219_4 +# 2219| r2219_13(glval) = FunctionAddress[~ClassWithDestructor] : +# 2219| v2219_14(void) = Call[~ClassWithDestructor] : func:r2219_13, this:r2219_12 +# 2219| mu2219_15(unknown) = ^CallSideEffect : ~m? +# 2219| v2219_16(void) = ^IndirectReadSideEffect[-1] : &:r2219_12, ~m? +# 2219| mu2219_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_12 +# 2219| r2219_18(glval &>) = VariableAddress[(__range)] : +# 2219| r2219_19(glval>) = VariableAddress[ys] : +# 2219| r2219_20(vector &) = CopyValue : r2219_19 +# 2219| mu2219_21(vector &) = Store[(__range)] : &:r2219_18, r2219_20 +# 2219| r2219_22(glval>) = VariableAddress[(__begin)] : +# 2219| r2219_23(glval &>) = VariableAddress[(__range)] : +# 2219| r2219_24(vector &) = Load[(__range)] : &:r2219_23, ~m? +#-----| r0_17(glval>) = CopyValue : r2219_24 #-----| r0_18(glval>) = Convert : r0_17 -# 2218| r2218_25(glval) = FunctionAddress[begin] : -# 2218| r2218_26(iterator) = Call[begin] : func:r2218_25, this:r0_18 +# 2219| r2219_25(glval) = FunctionAddress[begin] : +# 2219| r2219_26(iterator) = Call[begin] : func:r2219_25, this:r0_18 #-----| v0_19(void) = ^IndirectReadSideEffect[-1] : &:r0_18, ~m? -# 2218| mu2218_27(iterator) = Store[(__begin)] : &:r2218_22, r2218_26 -# 2218| r2218_28(glval>) = VariableAddress[(__end)] : -# 2218| r2218_29(glval &>) = VariableAddress[(__range)] : -# 2218| r2218_30(vector &) = Load[(__range)] : &:r2218_29, ~m? -#-----| r0_20(glval>) = CopyValue : r2218_30 +# 2219| mu2219_27(iterator) = Store[(__begin)] : &:r2219_22, r2219_26 +# 2219| r2219_28(glval>) = VariableAddress[(__end)] : +# 2219| r2219_29(glval &>) = VariableAddress[(__range)] : +# 2219| r2219_30(vector &) = Load[(__range)] : &:r2219_29, ~m? +#-----| r0_20(glval>) = CopyValue : r2219_30 #-----| r0_21(glval>) = Convert : r0_20 -# 2218| r2218_31(glval) = FunctionAddress[end] : -# 2218| r2218_32(iterator) = Call[end] : func:r2218_31, this:r0_21 +# 2219| r2219_31(glval) = FunctionAddress[end] : +# 2219| r2219_32(iterator) = Call[end] : func:r2219_31, this:r0_21 #-----| v0_22(void) = ^IndirectReadSideEffect[-1] : &:r0_21, ~m? -# 2218| mu2218_33(iterator) = Store[(__end)] : &:r2218_28, r2218_32 +# 2219| mu2219_33(iterator) = Store[(__end)] : &:r2219_28, r2219_32 #-----| Goto -> Block 14 -# 2218| Block 14 -# 2218| r2218_34(glval>) = VariableAddress[(__begin)] : -#-----| r0_23(glval>) = Convert : r2218_34 -# 2218| r2218_35(glval) = FunctionAddress[operator!=] : +# 2219| Block 14 +# 2219| r2219_34(glval>) = VariableAddress[(__begin)] : +#-----| r0_23(glval>) = Convert : r2219_34 +# 2219| r2219_35(glval) = FunctionAddress[operator!=] : #-----| r0_24(glval>) = VariableAddress[#temp0:0] : #-----| mu0_25(iterator) = Uninitialized[#temp0:0] : &:r0_24 -# 2218| r2218_36(glval) = FunctionAddress[iterator] : -# 2218| r2218_37(glval>) = VariableAddress[(__end)] : -#-----| r0_26(glval>) = Convert : r2218_37 +# 2219| r2219_36(glval) = FunctionAddress[iterator] : +# 2219| r2219_37(glval>) = VariableAddress[(__end)] : +#-----| r0_26(glval>) = Convert : r2219_37 #-----| r0_27(iterator &) = CopyValue : r0_26 -# 2218| v2218_38(void) = Call[iterator] : func:r2218_36, this:r0_24, 0:r0_27 -# 2218| mu2218_39(unknown) = ^CallSideEffect : ~m? +# 2219| v2219_38(void) = Call[iterator] : func:r2219_36, this:r0_24, 0:r0_27 +# 2219| mu2219_39(unknown) = ^CallSideEffect : ~m? #-----| v0_28(void) = ^BufferReadSideEffect[0] : &:r0_27, ~m? -# 2218| mu2218_40(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_24 +# 2219| mu2219_40(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_24 #-----| r0_29(iterator) = Load[#temp0:0] : &:r0_24, ~m? -# 2218| r2218_41(bool) = Call[operator!=] : func:r2218_35, this:r0_23, 0:r0_29 +# 2219| r2219_41(bool) = Call[operator!=] : func:r2219_35, this:r0_23, 0:r0_29 #-----| v0_30(void) = ^IndirectReadSideEffect[-1] : &:r0_23, ~m? -# 2218| v2218_42(void) = ConditionalBranch : r2218_41 +# 2219| v2219_42(void) = ConditionalBranch : r2219_41 #-----| False -> Block 18 #-----| True -> Block 16 -# 2218| Block 15 -# 2218| r2218_43(glval>) = VariableAddress[(__begin)] : -# 2218| r2218_44(glval) = FunctionAddress[operator++] : -# 2218| r2218_45(iterator &) = Call[operator++] : func:r2218_44, this:r2218_43 -# 2218| v2218_46(void) = ^IndirectReadSideEffect[-1] : &:r2218_43, ~m? -# 2218| mu2218_47(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2218_43 -# 2218| r2218_48(glval) = VariableAddress[y] : -# 2218| r2218_49(glval) = FunctionAddress[~ClassWithDestructor] : -# 2218| v2218_50(void) = Call[~ClassWithDestructor] : func:r2218_49, this:r2218_48 -# 2218| mu2218_51(unknown) = ^CallSideEffect : ~m? -# 2218| v2218_52(void) = ^IndirectReadSideEffect[-1] : &:r2218_48, ~m? -# 2218| mu2218_53(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2218_48 -# 2218| r2218_54(glval>) = CopyValue : r2218_45 +# 2219| Block 15 +# 2219| r2219_43(glval>) = VariableAddress[(__begin)] : +# 2219| r2219_44(glval) = FunctionAddress[operator++] : +# 2219| r2219_45(iterator &) = Call[operator++] : func:r2219_44, this:r2219_43 +# 2219| v2219_46(void) = ^IndirectReadSideEffect[-1] : &:r2219_43, ~m? +# 2219| mu2219_47(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2219_43 +# 2219| r2219_48(glval) = VariableAddress[y] : +# 2219| r2219_49(glval) = FunctionAddress[~ClassWithDestructor] : +# 2219| v2219_50(void) = Call[~ClassWithDestructor] : func:r2219_49, this:r2219_48 +# 2219| mu2219_51(unknown) = ^CallSideEffect : ~m? +# 2219| v2219_52(void) = ^IndirectReadSideEffect[-1] : &:r2219_48, ~m? +# 2219| mu2219_53(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_48 +# 2219| r2219_54(glval>) = CopyValue : r2219_45 #-----| Goto (back edge) -> Block 14 -# 2218| Block 16 -# 2218| r2218_55(glval) = VariableAddress[y] : -# 2218| r2218_56(glval>) = VariableAddress[(__begin)] : -#-----| r0_31(glval>) = Convert : r2218_56 -# 2218| r2218_57(glval) = FunctionAddress[operator*] : -# 2218| r2218_58(ClassWithDestructor &) = Call[operator*] : func:r2218_57, this:r0_31 +# 2219| Block 16 +# 2219| r2219_55(glval) = VariableAddress[y] : +# 2219| r2219_56(glval>) = VariableAddress[(__begin)] : +#-----| r0_31(glval>) = Convert : r2219_56 +# 2219| r2219_57(glval) = FunctionAddress[operator*] : +# 2219| r2219_58(ClassWithDestructor &) = Call[operator*] : func:r2219_57, this:r0_31 #-----| v0_32(void) = ^IndirectReadSideEffect[-1] : &:r0_31, ~m? -# 2218| r2218_59(ClassWithDestructor) = Load[?] : &:r2218_58, ~m? -# 2218| mu2218_60(ClassWithDestructor) = Store[y] : &:r2218_55, r2218_59 -# 2219| r2219_1(glval) = VariableAddress[y] : -# 2219| r2219_2(glval) = FunctionAddress[set_x] : -# 2219| r2219_3(char) = Constant[97] : -# 2219| v2219_4(void) = Call[set_x] : func:r2219_2, this:r2219_1, 0:r2219_3 -# 2219| mu2219_5(unknown) = ^CallSideEffect : ~m? -# 2219| v2219_6(void) = ^IndirectReadSideEffect[-1] : &:r2219_1, ~m? -# 2219| mu2219_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_1 +# 2219| r2219_59(ClassWithDestructor) = Load[?] : &:r2219_58, ~m? +# 2219| mu2219_60(ClassWithDestructor) = Store[y] : &:r2219_55, r2219_59 # 2220| r2220_1(glval) = VariableAddress[y] : -# 2220| r2220_2(glval) = FunctionAddress[get_x] : -# 2220| r2220_3(char) = Call[get_x] : func:r2220_2, this:r2220_1 -# 2220| mu2220_4(unknown) = ^CallSideEffect : ~m? -# 2220| v2220_5(void) = ^IndirectReadSideEffect[-1] : &:r2220_1, ~m? -# 2220| mu2220_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2220_1 -# 2220| r2220_7(int) = Convert : r2220_3 -# 2220| r2220_8(int) = Constant[98] : -# 2220| r2220_9(bool) = CompareEQ : r2220_7, r2220_8 -# 2220| v2220_10(void) = ConditionalBranch : r2220_9 +# 2220| r2220_2(glval) = FunctionAddress[set_x] : +# 2220| r2220_3(char) = Constant[97] : +# 2220| v2220_4(void) = Call[set_x] : func:r2220_2, this:r2220_1, 0:r2220_3 +# 2220| mu2220_5(unknown) = ^CallSideEffect : ~m? +# 2220| v2220_6(void) = ^IndirectReadSideEffect[-1] : &:r2220_1, ~m? +# 2220| mu2220_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2220_1 +# 2221| r2221_1(glval) = VariableAddress[y] : +# 2221| r2221_2(glval) = FunctionAddress[get_x] : +# 2221| r2221_3(char) = Call[get_x] : func:r2221_2, this:r2221_1 +# 2221| mu2221_4(unknown) = ^CallSideEffect : ~m? +# 2221| v2221_5(void) = ^IndirectReadSideEffect[-1] : &:r2221_1, ~m? +# 2221| mu2221_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2221_1 +# 2221| r2221_7(int) = Convert : r2221_3 +# 2221| r2221_8(int) = Constant[98] : +# 2221| r2221_9(bool) = CompareEQ : r2221_7, r2221_8 +# 2221| v2221_10(void) = ConditionalBranch : r2221_9 #-----| False -> Block 15 #-----| True -> Block 17 -# 2221| Block 17 -# 2221| v2221_1(void) = NoOp : -# 2218| r2218_61(glval) = VariableAddress[y] : -# 2218| r2218_62(glval) = FunctionAddress[~ClassWithDestructor] : -# 2218| v2218_63(void) = Call[~ClassWithDestructor] : func:r2218_62, this:r2218_61 -# 2218| mu2218_64(unknown) = ^CallSideEffect : ~m? -# 2218| v2218_65(void) = ^IndirectReadSideEffect[-1] : &:r2218_61, ~m? -# 2218| mu2218_66(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2218_61 -# 2218| r2218_67(glval>) = VariableAddress[ys] : -# 2218| r2218_68(glval) = FunctionAddress[~vector] : -# 2218| v2218_69(void) = Call[~vector] : func:r2218_68, this:r2218_67 -# 2218| mu2218_70(unknown) = ^CallSideEffect : ~m? -# 2218| v2218_71(void) = ^IndirectReadSideEffect[-1] : &:r2218_67, ~m? -# 2218| mu2218_72(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2218_67 -# 2233| r2233_1(glval) = VariableAddress[x] : -# 2233| r2233_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2233| v2233_3(void) = Call[~ClassWithDestructor] : func:r2233_2, this:r2233_1 -# 2233| mu2233_4(unknown) = ^CallSideEffect : ~m? -# 2233| v2233_5(void) = ^IndirectReadSideEffect[-1] : &:r2233_1, ~m? -# 2233| mu2233_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_1 +# 2222| Block 17 +# 2222| v2222_1(void) = NoOp : +# 2219| r2219_61(glval) = VariableAddress[y] : +# 2219| r2219_62(glval) = FunctionAddress[~ClassWithDestructor] : +# 2219| v2219_63(void) = Call[~ClassWithDestructor] : func:r2219_62, this:r2219_61 +# 2219| mu2219_64(unknown) = ^CallSideEffect : ~m? +# 2219| v2219_65(void) = ^IndirectReadSideEffect[-1] : &:r2219_61, ~m? +# 2219| mu2219_66(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_61 +# 2219| r2219_67(glval>) = VariableAddress[ys] : +# 2219| r2219_68(glval) = FunctionAddress[~vector] : +# 2219| v2219_69(void) = Call[~vector] : func:r2219_68, this:r2219_67 +# 2219| mu2219_70(unknown) = ^CallSideEffect : ~m? +# 2219| v2219_71(void) = ^IndirectReadSideEffect[-1] : &:r2219_67, ~m? +# 2219| mu2219_72(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2219_67 +# 2234| r2234_1(glval) = VariableAddress[x] : +# 2234| r2234_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2234| v2234_3(void) = Call[~ClassWithDestructor] : func:r2234_2, this:r2234_1 +# 2234| mu2234_4(unknown) = ^CallSideEffect : ~m? +# 2234| v2234_5(void) = ^IndirectReadSideEffect[-1] : &:r2234_1, ~m? +# 2234| mu2234_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_1 #-----| Goto -> Block 1 -# 2218| Block 18 -# 2218| r2218_73(glval>) = VariableAddress[ys] : -# 2218| r2218_74(glval) = FunctionAddress[~vector] : -# 2218| v2218_75(void) = Call[~vector] : func:r2218_74, this:r2218_73 -# 2218| mu2218_76(unknown) = ^CallSideEffect : ~m? -# 2218| v2218_77(void) = ^IndirectReadSideEffect[-1] : &:r2218_73, ~m? -# 2218| mu2218_78(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2218_73 -# 2224| r2224_1(glval>) = VariableAddress[ys] : -# 2224| mu2224_2(vector) = Uninitialized[ys] : &:r2224_1 -# 2224| r2224_3(glval) = FunctionAddress[vector] : -# 2224| r2224_4(int) = Constant[1] : -# 2224| v2224_5(void) = Call[vector] : func:r2224_3, this:r2224_1, 0:r2224_4 -# 2224| mu2224_6(unknown) = ^CallSideEffect : ~m? -# 2224| mu2224_7(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2224_1 -# 2224| r2224_8(glval &>) = VariableAddress[(__range)] : -# 2224| r2224_9(glval>) = VariableAddress[ys] : -# 2224| r2224_10(vector &) = CopyValue : r2224_9 -# 2224| mu2224_11(vector &) = Store[(__range)] : &:r2224_8, r2224_10 -# 2224| r2224_12(glval>) = VariableAddress[(__begin)] : -# 2224| r2224_13(glval &>) = VariableAddress[(__range)] : -# 2224| r2224_14(vector &) = Load[(__range)] : &:r2224_13, ~m? -#-----| r0_33(glval>) = CopyValue : r2224_14 +# 2219| Block 18 +# 2219| r2219_73(glval>) = VariableAddress[ys] : +# 2219| r2219_74(glval) = FunctionAddress[~vector] : +# 2219| v2219_75(void) = Call[~vector] : func:r2219_74, this:r2219_73 +# 2219| mu2219_76(unknown) = ^CallSideEffect : ~m? +# 2219| v2219_77(void) = ^IndirectReadSideEffect[-1] : &:r2219_73, ~m? +# 2219| mu2219_78(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2219_73 +# 2225| r2225_1(glval>) = VariableAddress[ys] : +# 2225| mu2225_2(vector) = Uninitialized[ys] : &:r2225_1 +# 2225| r2225_3(glval) = FunctionAddress[vector] : +# 2225| r2225_4(int) = Constant[1] : +# 2225| v2225_5(void) = Call[vector] : func:r2225_3, this:r2225_1, 0:r2225_4 +# 2225| mu2225_6(unknown) = ^CallSideEffect : ~m? +# 2225| mu2225_7(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2225_1 +# 2225| r2225_8(glval &>) = VariableAddress[(__range)] : +# 2225| r2225_9(glval>) = VariableAddress[ys] : +# 2225| r2225_10(vector &) = CopyValue : r2225_9 +# 2225| mu2225_11(vector &) = Store[(__range)] : &:r2225_8, r2225_10 +# 2225| r2225_12(glval>) = VariableAddress[(__begin)] : +# 2225| r2225_13(glval &>) = VariableAddress[(__range)] : +# 2225| r2225_14(vector &) = Load[(__range)] : &:r2225_13, ~m? +#-----| r0_33(glval>) = CopyValue : r2225_14 #-----| r0_34(glval>) = Convert : r0_33 -# 2224| r2224_15(glval) = FunctionAddress[begin] : -# 2224| r2224_16(iterator) = Call[begin] : func:r2224_15, this:r0_34 +# 2225| r2225_15(glval) = FunctionAddress[begin] : +# 2225| r2225_16(iterator) = Call[begin] : func:r2225_15, this:r0_34 #-----| v0_35(void) = ^IndirectReadSideEffect[-1] : &:r0_34, ~m? -# 2224| mu2224_17(iterator) = Store[(__begin)] : &:r2224_12, r2224_16 -# 2224| r2224_18(glval>) = VariableAddress[(__end)] : -# 2224| r2224_19(glval &>) = VariableAddress[(__range)] : -# 2224| r2224_20(vector &) = Load[(__range)] : &:r2224_19, ~m? -#-----| r0_36(glval>) = CopyValue : r2224_20 +# 2225| mu2225_17(iterator) = Store[(__begin)] : &:r2225_12, r2225_16 +# 2225| r2225_18(glval>) = VariableAddress[(__end)] : +# 2225| r2225_19(glval &>) = VariableAddress[(__range)] : +# 2225| r2225_20(vector &) = Load[(__range)] : &:r2225_19, ~m? +#-----| r0_36(glval>) = CopyValue : r2225_20 #-----| r0_37(glval>) = Convert : r0_36 -# 2224| r2224_21(glval) = FunctionAddress[end] : -# 2224| r2224_22(iterator) = Call[end] : func:r2224_21, this:r0_37 +# 2225| r2225_21(glval) = FunctionAddress[end] : +# 2225| r2225_22(iterator) = Call[end] : func:r2225_21, this:r0_37 #-----| v0_38(void) = ^IndirectReadSideEffect[-1] : &:r0_37, ~m? -# 2224| mu2224_23(iterator) = Store[(__end)] : &:r2224_18, r2224_22 +# 2225| mu2225_23(iterator) = Store[(__end)] : &:r2225_18, r2225_22 #-----| Goto -> Block 19 -# 2224| Block 19 -# 2224| r2224_24(glval>) = VariableAddress[(__begin)] : -#-----| r0_39(glval>) = Convert : r2224_24 -# 2224| r2224_25(glval) = FunctionAddress[operator!=] : +# 2225| Block 19 +# 2225| r2225_24(glval>) = VariableAddress[(__begin)] : +#-----| r0_39(glval>) = Convert : r2225_24 +# 2225| r2225_25(glval) = FunctionAddress[operator!=] : #-----| r0_40(glval>) = VariableAddress[#temp0:0] : #-----| mu0_41(iterator) = Uninitialized[#temp0:0] : &:r0_40 -# 2224| r2224_26(glval) = FunctionAddress[iterator] : -# 2224| r2224_27(glval>) = VariableAddress[(__end)] : -#-----| r0_42(glval>) = Convert : r2224_27 +# 2225| r2225_26(glval) = FunctionAddress[iterator] : +# 2225| r2225_27(glval>) = VariableAddress[(__end)] : +#-----| r0_42(glval>) = Convert : r2225_27 #-----| r0_43(iterator &) = CopyValue : r0_42 -# 2224| v2224_28(void) = Call[iterator] : func:r2224_26, this:r0_40, 0:r0_43 -# 2224| mu2224_29(unknown) = ^CallSideEffect : ~m? +# 2225| v2225_28(void) = Call[iterator] : func:r2225_26, this:r0_40, 0:r0_43 +# 2225| mu2225_29(unknown) = ^CallSideEffect : ~m? #-----| v0_44(void) = ^BufferReadSideEffect[0] : &:r0_43, ~m? -# 2224| mu2224_30(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_40 +# 2225| mu2225_30(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_40 #-----| r0_45(iterator) = Load[#temp0:0] : &:r0_40, ~m? -# 2224| r2224_31(bool) = Call[operator!=] : func:r2224_25, this:r0_39, 0:r0_45 +# 2225| r2225_31(bool) = Call[operator!=] : func:r2225_25, this:r0_39, 0:r0_45 #-----| v0_46(void) = ^IndirectReadSideEffect[-1] : &:r0_39, ~m? -# 2224| v2224_32(void) = ConditionalBranch : r2224_31 +# 2225| v2225_32(void) = ConditionalBranch : r2225_31 #-----| False -> Block 23 #-----| True -> Block 21 -# 2224| Block 20 -# 2224| r2224_33(glval>) = VariableAddress[(__begin)] : -# 2224| r2224_34(glval) = FunctionAddress[operator++] : -# 2224| r2224_35(iterator &) = Call[operator++] : func:r2224_34, this:r2224_33 -# 2224| v2224_36(void) = ^IndirectReadSideEffect[-1] : &:r2224_33, ~m? -# 2224| mu2224_37(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2224_33 -# 2224| r2224_38(glval>) = CopyValue : r2224_35 +# 2225| Block 20 +# 2225| r2225_33(glval>) = VariableAddress[(__begin)] : +# 2225| r2225_34(glval) = FunctionAddress[operator++] : +# 2225| r2225_35(iterator &) = Call[operator++] : func:r2225_34, this:r2225_33 +# 2225| v2225_36(void) = ^IndirectReadSideEffect[-1] : &:r2225_33, ~m? +# 2225| mu2225_37(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2225_33 +# 2225| r2225_38(glval>) = CopyValue : r2225_35 #-----| Goto (back edge) -> Block 19 -# 2224| Block 21 -# 2224| r2224_39(glval) = VariableAddress[y] : -# 2224| r2224_40(glval>) = VariableAddress[(__begin)] : -#-----| r0_47(glval>) = Convert : r2224_40 -# 2224| r2224_41(glval) = FunctionAddress[operator*] : -# 2224| r2224_42(int &) = Call[operator*] : func:r2224_41, this:r0_47 +# 2225| Block 21 +# 2225| r2225_39(glval) = VariableAddress[y] : +# 2225| r2225_40(glval>) = VariableAddress[(__begin)] : +#-----| r0_47(glval>) = Convert : r2225_40 +# 2225| r2225_41(glval) = FunctionAddress[operator*] : +# 2225| r2225_42(int &) = Call[operator*] : func:r2225_41, this:r0_47 #-----| v0_48(void) = ^IndirectReadSideEffect[-1] : &:r0_47, ~m? -# 2224| r2224_43(int) = Load[?] : &:r2224_42, ~m? -# 2224| mu2224_44(int) = Store[y] : &:r2224_39, r2224_43 -# 2225| r2225_1(glval) = VariableAddress[y] : -# 2225| r2225_2(int) = Load[y] : &:r2225_1, ~m? -# 2225| r2225_3(int) = Constant[1] : -# 2225| r2225_4(bool) = CompareEQ : r2225_2, r2225_3 -# 2225| v2225_5(void) = ConditionalBranch : r2225_4 +# 2225| r2225_43(int) = Load[?] : &:r2225_42, ~m? +# 2225| mu2225_44(int) = Store[y] : &:r2225_39, r2225_43 +# 2226| r2226_1(glval) = VariableAddress[y] : +# 2226| r2226_2(int) = Load[y] : &:r2226_1, ~m? +# 2226| r2226_3(int) = Constant[1] : +# 2226| r2226_4(bool) = CompareEQ : r2226_2, r2226_3 +# 2226| v2226_5(void) = ConditionalBranch : r2226_4 #-----| False -> Block 20 #-----| True -> Block 22 -# 2226| Block 22 -# 2226| v2226_1(void) = NoOp : -# 2224| r2224_45(glval>) = VariableAddress[ys] : -# 2224| r2224_46(glval) = FunctionAddress[~vector] : -# 2224| v2224_47(void) = Call[~vector] : func:r2224_46, this:r2224_45 -# 2224| mu2224_48(unknown) = ^CallSideEffect : ~m? -# 2224| v2224_49(void) = ^IndirectReadSideEffect[-1] : &:r2224_45, ~m? -# 2224| mu2224_50(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2224_45 -# 2233| r2233_7(glval) = VariableAddress[x] : -# 2233| r2233_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2233| v2233_9(void) = Call[~ClassWithDestructor] : func:r2233_8, this:r2233_7 -# 2233| mu2233_10(unknown) = ^CallSideEffect : ~m? -# 2233| v2233_11(void) = ^IndirectReadSideEffect[-1] : &:r2233_7, ~m? -# 2233| mu2233_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_7 +# 2227| Block 22 +# 2227| v2227_1(void) = NoOp : +# 2225| r2225_45(glval>) = VariableAddress[ys] : +# 2225| r2225_46(glval) = FunctionAddress[~vector] : +# 2225| v2225_47(void) = Call[~vector] : func:r2225_46, this:r2225_45 +# 2225| mu2225_48(unknown) = ^CallSideEffect : ~m? +# 2225| v2225_49(void) = ^IndirectReadSideEffect[-1] : &:r2225_45, ~m? +# 2225| mu2225_50(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2225_45 +# 2234| r2234_7(glval) = VariableAddress[x] : +# 2234| r2234_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2234| v2234_9(void) = Call[~ClassWithDestructor] : func:r2234_8, this:r2234_7 +# 2234| mu2234_10(unknown) = ^CallSideEffect : ~m? +# 2234| v2234_11(void) = ^IndirectReadSideEffect[-1] : &:r2234_7, ~m? +# 2234| mu2234_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_7 #-----| Goto -> Block 1 -# 2224| Block 23 -# 2224| r2224_51(glval>) = VariableAddress[ys] : -# 2224| r2224_52(glval) = FunctionAddress[~vector] : -# 2224| v2224_53(void) = Call[~vector] : func:r2224_52, this:r2224_51 -# 2224| mu2224_54(unknown) = ^CallSideEffect : ~m? -# 2224| v2224_55(void) = ^IndirectReadSideEffect[-1] : &:r2224_51, ~m? -# 2224| mu2224_56(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2224_51 -# 2229| r2229_1(glval>) = VariableAddress[ys] : -# 2229| mu2229_2(vector) = Uninitialized[ys] : &:r2229_1 -# 2229| r2229_3(glval) = FunctionAddress[vector] : -# 2229| r2229_4(glval) = VariableAddress[#temp2229:45] : -# 2229| r2229_5(glval) = VariableAddress[x] : -# 2229| r2229_6(ClassWithDestructor) = Load[x] : &:r2229_5, ~m? -# 2229| mu2229_7(ClassWithDestructor) = Store[#temp2229:45] : &:r2229_4, r2229_6 -# 2229| r2229_8(ClassWithDestructor) = Load[#temp2229:45] : &:r2229_4, ~m? -# 2229| v2229_9(void) = Call[vector] : func:r2229_3, this:r2229_1, 0:r2229_8 -# 2229| mu2229_10(unknown) = ^CallSideEffect : ~m? -# 2229| mu2229_11(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2229_1 -# 2229| r2229_12(glval) = CopyValue : r2229_4 -# 2229| r2229_13(glval) = FunctionAddress[~ClassWithDestructor] : -# 2229| v2229_14(void) = Call[~ClassWithDestructor] : func:r2229_13, this:r2229_12 -# 2229| mu2229_15(unknown) = ^CallSideEffect : ~m? -# 2229| v2229_16(void) = ^IndirectReadSideEffect[-1] : &:r2229_12, ~m? -# 2229| mu2229_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2229_12 -# 2229| r2229_18(glval &>) = VariableAddress[(__range)] : -# 2229| r2229_19(glval>) = VariableAddress[ys] : -# 2229| r2229_20(vector &) = CopyValue : r2229_19 -# 2229| mu2229_21(vector &) = Store[(__range)] : &:r2229_18, r2229_20 -# 2229| r2229_22(glval>) = VariableAddress[(__begin)] : -# 2229| r2229_23(glval &>) = VariableAddress[(__range)] : -# 2229| r2229_24(vector &) = Load[(__range)] : &:r2229_23, ~m? -#-----| r0_49(glval>) = CopyValue : r2229_24 +# 2225| Block 23 +# 2225| r2225_51(glval>) = VariableAddress[ys] : +# 2225| r2225_52(glval) = FunctionAddress[~vector] : +# 2225| v2225_53(void) = Call[~vector] : func:r2225_52, this:r2225_51 +# 2225| mu2225_54(unknown) = ^CallSideEffect : ~m? +# 2225| v2225_55(void) = ^IndirectReadSideEffect[-1] : &:r2225_51, ~m? +# 2225| mu2225_56(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2225_51 +# 2230| r2230_1(glval>) = VariableAddress[ys] : +# 2230| mu2230_2(vector) = Uninitialized[ys] : &:r2230_1 +# 2230| r2230_3(glval) = FunctionAddress[vector] : +# 2230| r2230_4(glval) = VariableAddress[#temp2230:45] : +# 2230| r2230_5(glval) = VariableAddress[x] : +# 2230| r2230_6(ClassWithDestructor) = Load[x] : &:r2230_5, ~m? +# 2230| mu2230_7(ClassWithDestructor) = Store[#temp2230:45] : &:r2230_4, r2230_6 +# 2230| r2230_8(ClassWithDestructor) = Load[#temp2230:45] : &:r2230_4, ~m? +# 2230| v2230_9(void) = Call[vector] : func:r2230_3, this:r2230_1, 0:r2230_8 +# 2230| mu2230_10(unknown) = ^CallSideEffect : ~m? +# 2230| mu2230_11(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2230_1 +# 2230| r2230_12(glval) = CopyValue : r2230_4 +# 2230| r2230_13(glval) = FunctionAddress[~ClassWithDestructor] : +# 2230| v2230_14(void) = Call[~ClassWithDestructor] : func:r2230_13, this:r2230_12 +# 2230| mu2230_15(unknown) = ^CallSideEffect : ~m? +# 2230| v2230_16(void) = ^IndirectReadSideEffect[-1] : &:r2230_12, ~m? +# 2230| mu2230_17(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_12 +# 2230| r2230_18(glval &>) = VariableAddress[(__range)] : +# 2230| r2230_19(glval>) = VariableAddress[ys] : +# 2230| r2230_20(vector &) = CopyValue : r2230_19 +# 2230| mu2230_21(vector &) = Store[(__range)] : &:r2230_18, r2230_20 +# 2230| r2230_22(glval>) = VariableAddress[(__begin)] : +# 2230| r2230_23(glval &>) = VariableAddress[(__range)] : +# 2230| r2230_24(vector &) = Load[(__range)] : &:r2230_23, ~m? +#-----| r0_49(glval>) = CopyValue : r2230_24 #-----| r0_50(glval>) = Convert : r0_49 -# 2229| r2229_25(glval) = FunctionAddress[begin] : -# 2229| r2229_26(iterator) = Call[begin] : func:r2229_25, this:r0_50 +# 2230| r2230_25(glval) = FunctionAddress[begin] : +# 2230| r2230_26(iterator) = Call[begin] : func:r2230_25, this:r0_50 #-----| v0_51(void) = ^IndirectReadSideEffect[-1] : &:r0_50, ~m? -# 2229| mu2229_27(iterator) = Store[(__begin)] : &:r2229_22, r2229_26 -# 2229| r2229_28(glval>) = VariableAddress[(__end)] : -# 2229| r2229_29(glval &>) = VariableAddress[(__range)] : -# 2229| r2229_30(vector &) = Load[(__range)] : &:r2229_29, ~m? -#-----| r0_52(glval>) = CopyValue : r2229_30 +# 2230| mu2230_27(iterator) = Store[(__begin)] : &:r2230_22, r2230_26 +# 2230| r2230_28(glval>) = VariableAddress[(__end)] : +# 2230| r2230_29(glval &>) = VariableAddress[(__range)] : +# 2230| r2230_30(vector &) = Load[(__range)] : &:r2230_29, ~m? +#-----| r0_52(glval>) = CopyValue : r2230_30 #-----| r0_53(glval>) = Convert : r0_52 -# 2229| r2229_31(glval) = FunctionAddress[end] : -# 2229| r2229_32(iterator) = Call[end] : func:r2229_31, this:r0_53 +# 2230| r2230_31(glval) = FunctionAddress[end] : +# 2230| r2230_32(iterator) = Call[end] : func:r2230_31, this:r0_53 #-----| v0_54(void) = ^IndirectReadSideEffect[-1] : &:r0_53, ~m? -# 2229| mu2229_33(iterator) = Store[(__end)] : &:r2229_28, r2229_32 +# 2230| mu2230_33(iterator) = Store[(__end)] : &:r2230_28, r2230_32 #-----| Goto -> Block 24 -# 2229| Block 24 -# 2229| r2229_34(glval>) = VariableAddress[(__begin)] : -#-----| r0_55(glval>) = Convert : r2229_34 -# 2229| r2229_35(glval) = FunctionAddress[operator!=] : +# 2230| Block 24 +# 2230| r2230_34(glval>) = VariableAddress[(__begin)] : +#-----| r0_55(glval>) = Convert : r2230_34 +# 2230| r2230_35(glval) = FunctionAddress[operator!=] : #-----| r0_56(glval>) = VariableAddress[#temp0:0] : #-----| mu0_57(iterator) = Uninitialized[#temp0:0] : &:r0_56 -# 2229| r2229_36(glval) = FunctionAddress[iterator] : -# 2229| r2229_37(glval>) = VariableAddress[(__end)] : -#-----| r0_58(glval>) = Convert : r2229_37 +# 2230| r2230_36(glval) = FunctionAddress[iterator] : +# 2230| r2230_37(glval>) = VariableAddress[(__end)] : +#-----| r0_58(glval>) = Convert : r2230_37 #-----| r0_59(iterator &) = CopyValue : r0_58 -# 2229| v2229_38(void) = Call[iterator] : func:r2229_36, this:r0_56, 0:r0_59 -# 2229| mu2229_39(unknown) = ^CallSideEffect : ~m? +# 2230| v2230_38(void) = Call[iterator] : func:r2230_36, this:r0_56, 0:r0_59 +# 2230| mu2230_39(unknown) = ^CallSideEffect : ~m? #-----| v0_60(void) = ^BufferReadSideEffect[0] : &:r0_59, ~m? -# 2229| mu2229_40(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_56 +# 2230| mu2230_40(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_56 #-----| r0_61(iterator) = Load[#temp0:0] : &:r0_56, ~m? -# 2229| r2229_41(bool) = Call[operator!=] : func:r2229_35, this:r0_55, 0:r0_61 +# 2230| r2230_41(bool) = Call[operator!=] : func:r2230_35, this:r0_55, 0:r0_61 #-----| v0_62(void) = ^IndirectReadSideEffect[-1] : &:r0_55, ~m? -# 2229| v2229_42(void) = ConditionalBranch : r2229_41 +# 2230| v2230_42(void) = ConditionalBranch : r2230_41 #-----| False -> Block 26 #-----| True -> Block 25 -# 2229| Block 25 -# 2229| r2229_43(glval) = VariableAddress[y] : -# 2229| r2229_44(glval>) = VariableAddress[(__begin)] : -#-----| r0_63(glval>) = Convert : r2229_44 -# 2229| r2229_45(glval) = FunctionAddress[operator*] : -# 2229| r2229_46(ClassWithDestructor &) = Call[operator*] : func:r2229_45, this:r0_63 +# 2230| Block 25 +# 2230| r2230_43(glval) = VariableAddress[y] : +# 2230| r2230_44(glval>) = VariableAddress[(__begin)] : +#-----| r0_63(glval>) = Convert : r2230_44 +# 2230| r2230_45(glval) = FunctionAddress[operator*] : +# 2230| r2230_46(ClassWithDestructor &) = Call[operator*] : func:r2230_45, this:r0_63 #-----| v0_64(void) = ^IndirectReadSideEffect[-1] : &:r0_63, ~m? -# 2229| r2229_47(ClassWithDestructor) = Load[?] : &:r2229_46, ~m? -# 2229| mu2229_48(ClassWithDestructor) = Store[y] : &:r2229_43, r2229_47 -# 2230| r2230_1(glval) = VariableAddress[z1] : -# 2230| mu2230_2(ClassWithDestructor) = Uninitialized[z1] : &:r2230_1 -# 2230| r2230_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2230| v2230_4(void) = Call[ClassWithDestructor] : func:r2230_3, this:r2230_1 -# 2230| mu2230_5(unknown) = ^CallSideEffect : ~m? -# 2230| mu2230_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_1 -# 2231| r2231_1(glval) = VariableAddress[z2] : -# 2231| mu2231_2(ClassWithDestructor) = Uninitialized[z2] : &:r2231_1 +# 2230| r2230_47(ClassWithDestructor) = Load[?] : &:r2230_46, ~m? +# 2230| mu2230_48(ClassWithDestructor) = Store[y] : &:r2230_43, r2230_47 +# 2231| r2231_1(glval) = VariableAddress[z1] : +# 2231| mu2231_2(ClassWithDestructor) = Uninitialized[z1] : &:r2231_1 # 2231| r2231_3(glval) = FunctionAddress[ClassWithDestructor] : # 2231| v2231_4(void) = Call[ClassWithDestructor] : func:r2231_3, this:r2231_1 # 2231| mu2231_5(unknown) = ^CallSideEffect : ~m? # 2231| mu2231_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2231_1 # 2232| r2232_1(glval) = VariableAddress[z2] : -# 2232| r2232_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2232| v2232_3(void) = Call[~ClassWithDestructor] : func:r2232_2, this:r2232_1 -# 2232| mu2232_4(unknown) = ^CallSideEffect : ~m? -# 2232| v2232_5(void) = ^IndirectReadSideEffect[-1] : &:r2232_1, ~m? +# 2232| mu2232_2(ClassWithDestructor) = Uninitialized[z2] : &:r2232_1 +# 2232| r2232_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2232| v2232_4(void) = Call[ClassWithDestructor] : func:r2232_3, this:r2232_1 +# 2232| mu2232_5(unknown) = ^CallSideEffect : ~m? # 2232| mu2232_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2232_1 -# 2232| r2232_7(glval) = VariableAddress[z1] : -# 2232| r2232_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2232| v2232_9(void) = Call[~ClassWithDestructor] : func:r2232_8, this:r2232_7 -# 2232| mu2232_10(unknown) = ^CallSideEffect : ~m? -# 2232| v2232_11(void) = ^IndirectReadSideEffect[-1] : &:r2232_7, ~m? -# 2232| mu2232_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2232_7 -# 2229| r2229_49(glval>) = VariableAddress[(__begin)] : -# 2229| r2229_50(glval) = FunctionAddress[operator++] : -# 2229| r2229_51(iterator &) = Call[operator++] : func:r2229_50, this:r2229_49 -# 2229| v2229_52(void) = ^IndirectReadSideEffect[-1] : &:r2229_49, ~m? -# 2229| mu2229_53(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2229_49 -# 2229| r2229_54(glval) = VariableAddress[y] : -# 2229| r2229_55(glval) = FunctionAddress[~ClassWithDestructor] : -# 2229| v2229_56(void) = Call[~ClassWithDestructor] : func:r2229_55, this:r2229_54 -# 2229| mu2229_57(unknown) = ^CallSideEffect : ~m? -# 2229| v2229_58(void) = ^IndirectReadSideEffect[-1] : &:r2229_54, ~m? -# 2229| mu2229_59(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2229_54 -# 2229| r2229_60(glval>) = CopyValue : r2229_51 +# 2233| r2233_1(glval) = VariableAddress[z2] : +# 2233| r2233_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2233| v2233_3(void) = Call[~ClassWithDestructor] : func:r2233_2, this:r2233_1 +# 2233| mu2233_4(unknown) = ^CallSideEffect : ~m? +# 2233| v2233_5(void) = ^IndirectReadSideEffect[-1] : &:r2233_1, ~m? +# 2233| mu2233_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_1 +# 2233| r2233_7(glval) = VariableAddress[z1] : +# 2233| r2233_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2233| v2233_9(void) = Call[~ClassWithDestructor] : func:r2233_8, this:r2233_7 +# 2233| mu2233_10(unknown) = ^CallSideEffect : ~m? +# 2233| v2233_11(void) = ^IndirectReadSideEffect[-1] : &:r2233_7, ~m? +# 2233| mu2233_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_7 +# 2230| r2230_49(glval>) = VariableAddress[(__begin)] : +# 2230| r2230_50(glval) = FunctionAddress[operator++] : +# 2230| r2230_51(iterator &) = Call[operator++] : func:r2230_50, this:r2230_49 +# 2230| v2230_52(void) = ^IndirectReadSideEffect[-1] : &:r2230_49, ~m? +# 2230| mu2230_53(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2230_49 +# 2230| r2230_54(glval) = VariableAddress[y] : +# 2230| r2230_55(glval) = FunctionAddress[~ClassWithDestructor] : +# 2230| v2230_56(void) = Call[~ClassWithDestructor] : func:r2230_55, this:r2230_54 +# 2230| mu2230_57(unknown) = ^CallSideEffect : ~m? +# 2230| v2230_58(void) = ^IndirectReadSideEffect[-1] : &:r2230_54, ~m? +# 2230| mu2230_59(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_54 +# 2230| r2230_60(glval>) = CopyValue : r2230_51 #-----| Goto (back edge) -> Block 24 -# 2229| Block 26 -# 2229| r2229_61(glval>) = VariableAddress[ys] : -# 2229| r2229_62(glval) = FunctionAddress[~vector] : -# 2229| v2229_63(void) = Call[~vector] : func:r2229_62, this:r2229_61 -# 2229| mu2229_64(unknown) = ^CallSideEffect : ~m? -# 2229| v2229_65(void) = ^IndirectReadSideEffect[-1] : &:r2229_61, ~m? -# 2229| mu2229_66(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2229_61 -# 2233| v2233_13(void) = NoOp : -# 2233| r2233_14(glval) = VariableAddress[x] : -# 2233| r2233_15(glval) = FunctionAddress[~ClassWithDestructor] : -# 2233| v2233_16(void) = Call[~ClassWithDestructor] : func:r2233_15, this:r2233_14 -# 2233| mu2233_17(unknown) = ^CallSideEffect : ~m? -# 2233| v2233_18(void) = ^IndirectReadSideEffect[-1] : &:r2233_14, ~m? -# 2233| mu2233_19(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2233_14 +# 2230| Block 26 +# 2230| r2230_61(glval>) = VariableAddress[ys] : +# 2230| r2230_62(glval) = FunctionAddress[~vector] : +# 2230| v2230_63(void) = Call[~vector] : func:r2230_62, this:r2230_61 +# 2230| mu2230_64(unknown) = ^CallSideEffect : ~m? +# 2230| v2230_65(void) = ^IndirectReadSideEffect[-1] : &:r2230_61, ~m? +# 2230| mu2230_66(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2230_61 +# 2234| v2234_13(void) = NoOp : +# 2234| r2234_14(glval) = VariableAddress[x] : +# 2234| r2234_15(glval) = FunctionAddress[~ClassWithDestructor] : +# 2234| v2234_16(void) = Call[~ClassWithDestructor] : func:r2234_15, this:r2234_14 +# 2234| mu2234_17(unknown) = ^CallSideEffect : ~m? +# 2234| v2234_18(void) = ^IndirectReadSideEffect[-1] : &:r2234_14, ~m? +# 2234| mu2234_19(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_14 #-----| Goto -> Block 1 -# 2235| void static_variable_with_destructor_1() -# 2235| Block 0 -# 2235| v2235_1(void) = EnterFunction : -# 2235| mu2235_2(unknown) = AliasedDefinition : -# 2235| mu2235_3(unknown) = InitializeNonLocal : -# 2236| r2236_1(glval) = VariableAddress[a] : -# 2236| mu2236_2(ClassWithDestructor) = Uninitialized[a] : &:r2236_1 -# 2236| r2236_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2236| v2236_4(void) = Call[ClassWithDestructor] : func:r2236_3, this:r2236_1 -# 2236| mu2236_5(unknown) = ^CallSideEffect : ~m? -# 2236| mu2236_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2236_1 -# 2237| r2237_1(glval) = VariableAddress[b#init] : -# 2237| r2237_2(bool) = Load[b#init] : &:r2237_1, ~m? -# 2237| v2237_3(void) = ConditionalBranch : r2237_2 +# 2236| void static_variable_with_destructor_1() +# 2236| Block 0 +# 2236| v2236_1(void) = EnterFunction : +# 2236| mu2236_2(unknown) = AliasedDefinition : +# 2236| mu2236_3(unknown) = InitializeNonLocal : +# 2237| r2237_1(glval) = VariableAddress[a] : +# 2237| mu2237_2(ClassWithDestructor) = Uninitialized[a] : &:r2237_1 +# 2237| r2237_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2237| v2237_4(void) = Call[ClassWithDestructor] : func:r2237_3, this:r2237_1 +# 2237| mu2237_5(unknown) = ^CallSideEffect : ~m? +# 2237| mu2237_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2237_1 +# 2238| r2238_1(glval) = VariableAddress[b#init] : +# 2238| r2238_2(bool) = Load[b#init] : &:r2238_1, ~m? +# 2238| v2238_3(void) = ConditionalBranch : r2238_2 #-----| False -> Block 1 #-----| True -> Block 2 -# 2237| Block 1 -# 2237| r2237_4(glval) = VariableAddress[b] : +# 2238| Block 1 +# 2238| r2238_4(glval) = VariableAddress[b] : #-----| r0_1(glval) = FunctionAddress[ClassWithDestructor] : -#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2237_4 +#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2238_4 #-----| mu0_3(unknown) = ^CallSideEffect : ~m? -#-----| mu0_4(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2237_4 -# 2237| r2237_5(bool) = Constant[1] : -# 2237| mu2237_6(bool) = Store[b#init] : &:r2237_1, r2237_5 +#-----| mu0_4(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2238_4 +# 2238| r2238_5(bool) = Constant[1] : +# 2238| mu2238_6(bool) = Store[b#init] : &:r2238_1, r2238_5 #-----| Goto -> Block 2 -# 2238| Block 2 -# 2238| v2238_1(void) = NoOp : -# 2238| r2238_2(glval) = VariableAddress[a] : -# 2238| r2238_3(glval) = FunctionAddress[~ClassWithDestructor] : -# 2238| v2238_4(void) = Call[~ClassWithDestructor] : func:r2238_3, this:r2238_2 -# 2238| mu2238_5(unknown) = ^CallSideEffect : ~m? -# 2238| v2238_6(void) = ^IndirectReadSideEffect[-1] : &:r2238_2, ~m? -# 2238| mu2238_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2238_2 -# 2235| v2235_4(void) = ReturnVoid : -# 2235| v2235_5(void) = AliasedUse : ~m? -# 2235| v2235_6(void) = ExitFunction : +# 2239| Block 2 +# 2239| v2239_1(void) = NoOp : +# 2239| r2239_2(glval) = VariableAddress[a] : +# 2239| r2239_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2239| v2239_4(void) = Call[~ClassWithDestructor] : func:r2239_3, this:r2239_2 +# 2239| mu2239_5(unknown) = ^CallSideEffect : ~m? +# 2239| v2239_6(void) = ^IndirectReadSideEffect[-1] : &:r2239_2, ~m? +# 2239| mu2239_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2239_2 +# 2236| v2236_4(void) = ReturnVoid : +# 2236| v2236_5(void) = AliasedUse : ~m? +# 2236| v2236_6(void) = ExitFunction : -# 2240| void static_variable_with_destructor_2() -# 2240| Block 0 -# 2240| v2240_1(void) = EnterFunction : -# 2240| mu2240_2(unknown) = AliasedDefinition : -# 2240| mu2240_3(unknown) = InitializeNonLocal : -# 2241| r2241_1(glval) = VariableAddress[a#init] : -# 2241| r2241_2(bool) = Load[a#init] : &:r2241_1, ~m? -# 2241| v2241_3(void) = ConditionalBranch : r2241_2 +# 2241| void static_variable_with_destructor_2() +# 2241| Block 0 +# 2241| v2241_1(void) = EnterFunction : +# 2241| mu2241_2(unknown) = AliasedDefinition : +# 2241| mu2241_3(unknown) = InitializeNonLocal : +# 2242| r2242_1(glval) = VariableAddress[a#init] : +# 2242| r2242_2(bool) = Load[a#init] : &:r2242_1, ~m? +# 2242| v2242_3(void) = ConditionalBranch : r2242_2 #-----| False -> Block 1 #-----| True -> Block 2 -# 2241| Block 1 -# 2241| r2241_4(glval) = VariableAddress[a] : +# 2242| Block 1 +# 2242| r2242_4(glval) = VariableAddress[a] : #-----| r0_1(glval) = FunctionAddress[ClassWithDestructor] : -#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2241_4 +#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2242_4 #-----| mu0_3(unknown) = ^CallSideEffect : ~m? -#-----| mu0_4(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2241_4 -# 2241| r2241_5(bool) = Constant[1] : -# 2241| mu2241_6(bool) = Store[a#init] : &:r2241_1, r2241_5 +#-----| mu0_4(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2242_4 +# 2242| r2242_5(bool) = Constant[1] : +# 2242| mu2242_6(bool) = Store[a#init] : &:r2242_1, r2242_5 #-----| Goto -> Block 2 -# 2242| Block 2 -# 2242| r2242_1(glval) = VariableAddress[b] : -# 2242| mu2242_2(ClassWithDestructor) = Uninitialized[b] : &:r2242_1 -# 2242| r2242_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2242| v2242_4(void) = Call[ClassWithDestructor] : func:r2242_3, this:r2242_1 -# 2242| mu2242_5(unknown) = ^CallSideEffect : ~m? -# 2242| mu2242_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2242_1 -# 2243| v2243_1(void) = NoOp : -# 2243| r2243_2(glval) = VariableAddress[b] : -# 2243| r2243_3(glval) = FunctionAddress[~ClassWithDestructor] : -# 2243| v2243_4(void) = Call[~ClassWithDestructor] : func:r2243_3, this:r2243_2 +# 2243| Block 2 +# 2243| r2243_1(glval) = VariableAddress[b] : +# 2243| mu2243_2(ClassWithDestructor) = Uninitialized[b] : &:r2243_1 +# 2243| r2243_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2243| v2243_4(void) = Call[ClassWithDestructor] : func:r2243_3, this:r2243_1 # 2243| mu2243_5(unknown) = ^CallSideEffect : ~m? -# 2243| v2243_6(void) = ^IndirectReadSideEffect[-1] : &:r2243_2, ~m? -# 2243| mu2243_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2243_2 -# 2240| v2240_4(void) = ReturnVoid : -# 2240| v2240_5(void) = AliasedUse : ~m? -# 2240| v2240_6(void) = ExitFunction : +# 2243| mu2243_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2243_1 +# 2244| v2244_1(void) = NoOp : +# 2244| r2244_2(glval) = VariableAddress[b] : +# 2244| r2244_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2244| v2244_4(void) = Call[~ClassWithDestructor] : func:r2244_3, this:r2244_2 +# 2244| mu2244_5(unknown) = ^CallSideEffect : ~m? +# 2244| v2244_6(void) = ^IndirectReadSideEffect[-1] : &:r2244_2, ~m? +# 2244| mu2244_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2244_2 +# 2241| v2241_4(void) = ReturnVoid : +# 2241| v2241_5(void) = AliasedUse : ~m? +# 2241| v2241_6(void) = ExitFunction : -# 2245| void static_variable_with_destructor_3() -# 2245| Block 0 -# 2245| v2245_1(void) = EnterFunction : -# 2245| mu2245_2(unknown) = AliasedDefinition : -# 2245| mu2245_3(unknown) = InitializeNonLocal : -# 2246| r2246_1(glval) = VariableAddress[a] : -# 2246| mu2246_2(ClassWithDestructor) = Uninitialized[a] : &:r2246_1 -# 2246| r2246_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2246| v2246_4(void) = Call[ClassWithDestructor] : func:r2246_3, this:r2246_1 -# 2246| mu2246_5(unknown) = ^CallSideEffect : ~m? -# 2246| mu2246_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2246_1 -# 2247| r2247_1(glval) = VariableAddress[b] : -# 2247| mu2247_2(ClassWithDestructor) = Uninitialized[b] : &:r2247_1 +# 2246| void static_variable_with_destructor_3() +# 2246| Block 0 +# 2246| v2246_1(void) = EnterFunction : +# 2246| mu2246_2(unknown) = AliasedDefinition : +# 2246| mu2246_3(unknown) = InitializeNonLocal : +# 2247| r2247_1(glval) = VariableAddress[a] : +# 2247| mu2247_2(ClassWithDestructor) = Uninitialized[a] : &:r2247_1 # 2247| r2247_3(glval) = FunctionAddress[ClassWithDestructor] : # 2247| v2247_4(void) = Call[ClassWithDestructor] : func:r2247_3, this:r2247_1 # 2247| mu2247_5(unknown) = ^CallSideEffect : ~m? # 2247| mu2247_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2247_1 -# 2248| r2248_1(glval) = VariableAddress[c#init] : -# 2248| r2248_2(bool) = Load[c#init] : &:r2248_1, ~m? -# 2248| v2248_3(void) = ConditionalBranch : r2248_2 +# 2248| r2248_1(glval) = VariableAddress[b] : +# 2248| mu2248_2(ClassWithDestructor) = Uninitialized[b] : &:r2248_1 +# 2248| r2248_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2248| v2248_4(void) = Call[ClassWithDestructor] : func:r2248_3, this:r2248_1 +# 2248| mu2248_5(unknown) = ^CallSideEffect : ~m? +# 2248| mu2248_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2248_1 +# 2249| r2249_1(glval) = VariableAddress[c#init] : +# 2249| r2249_2(bool) = Load[c#init] : &:r2249_1, ~m? +# 2249| v2249_3(void) = ConditionalBranch : r2249_2 #-----| False -> Block 1 #-----| True -> Block 2 -# 2248| Block 1 -# 2248| r2248_4(glval) = VariableAddress[c] : +# 2249| Block 1 +# 2249| r2249_4(glval) = VariableAddress[c] : #-----| r0_1(glval) = FunctionAddress[ClassWithDestructor] : -#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2248_4 +#-----| v0_2(void) = Call[ClassWithDestructor] : func:r0_1, this:r2249_4 #-----| mu0_3(unknown) = ^CallSideEffect : ~m? -#-----| mu0_4(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2248_4 -# 2248| r2248_5(bool) = Constant[1] : -# 2248| mu2248_6(bool) = Store[c#init] : &:r2248_1, r2248_5 +#-----| mu0_4(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2249_4 +# 2249| r2249_5(bool) = Constant[1] : +# 2249| mu2249_6(bool) = Store[c#init] : &:r2249_1, r2249_5 #-----| Goto -> Block 2 -# 2249| Block 2 -# 2249| v2249_1(void) = NoOp : -# 2249| r2249_2(glval) = VariableAddress[b] : -# 2249| r2249_3(glval) = FunctionAddress[~ClassWithDestructor] : -# 2249| v2249_4(void) = Call[~ClassWithDestructor] : func:r2249_3, this:r2249_2 -# 2249| mu2249_5(unknown) = ^CallSideEffect : ~m? -# 2249| v2249_6(void) = ^IndirectReadSideEffect[-1] : &:r2249_2, ~m? -# 2249| mu2249_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2249_2 -# 2249| r2249_8(glval) = VariableAddress[a] : -# 2249| r2249_9(glval) = FunctionAddress[~ClassWithDestructor] : -# 2249| v2249_10(void) = Call[~ClassWithDestructor] : func:r2249_9, this:r2249_8 -# 2249| mu2249_11(unknown) = ^CallSideEffect : ~m? -# 2249| v2249_12(void) = ^IndirectReadSideEffect[-1] : &:r2249_8, ~m? -# 2249| mu2249_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2249_8 -# 2245| v2245_4(void) = ReturnVoid : -# 2245| v2245_5(void) = AliasedUse : ~m? -# 2245| v2245_6(void) = ExitFunction : +# 2250| Block 2 +# 2250| v2250_1(void) = NoOp : +# 2250| r2250_2(glval) = VariableAddress[b] : +# 2250| r2250_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2250| v2250_4(void) = Call[~ClassWithDestructor] : func:r2250_3, this:r2250_2 +# 2250| mu2250_5(unknown) = ^CallSideEffect : ~m? +# 2250| v2250_6(void) = ^IndirectReadSideEffect[-1] : &:r2250_2, ~m? +# 2250| mu2250_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2250_2 +# 2250| r2250_8(glval) = VariableAddress[a] : +# 2250| r2250_9(glval) = FunctionAddress[~ClassWithDestructor] : +# 2250| v2250_10(void) = Call[~ClassWithDestructor] : func:r2250_9, this:r2250_8 +# 2250| mu2250_11(unknown) = ^CallSideEffect : ~m? +# 2250| v2250_12(void) = ^IndirectReadSideEffect[-1] : &:r2250_8, ~m? +# 2250| mu2250_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2250_8 +# 2246| v2246_4(void) = ReturnVoid : +# 2246| v2246_5(void) = AliasedUse : ~m? +# 2246| v2246_6(void) = ExitFunction : -# 2251| ClassWithDestructor global_class_with_destructor -# 2251| Block 0 -# 2251| v2251_1(void) = EnterFunction : -# 2251| mu2251_2(unknown) = AliasedDefinition : -# 2251| r2251_3(glval) = VariableAddress[global_class_with_destructor] : -# 2251| r2251_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2251| v2251_5(void) = Call[ClassWithDestructor] : func:r2251_4, this:r2251_3 -# 2251| mu2251_6(unknown) = ^CallSideEffect : ~m? -# 2251| mu2251_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2251_3 -# 2251| v2251_8(void) = ReturnVoid : -# 2251| v2251_9(void) = AliasedUse : ~m? -# 2251| v2251_10(void) = ExitFunction : +# 2252| ClassWithDestructor global_class_with_destructor +# 2252| Block 0 +# 2252| v2252_1(void) = EnterFunction : +# 2252| mu2252_2(unknown) = AliasedDefinition : +# 2252| r2252_3(glval) = VariableAddress[global_class_with_destructor] : +# 2252| r2252_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2252| v2252_5(void) = Call[ClassWithDestructor] : func:r2252_4, this:r2252_3 +# 2252| mu2252_6(unknown) = ^CallSideEffect : ~m? +# 2252| mu2252_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2252_3 +# 2252| v2252_8(void) = ReturnVoid : +# 2252| v2252_9(void) = AliasedUse : ~m? +# 2252| v2252_10(void) = ExitFunction : -# 2255| ClassWithDestructor& vacuous_destructor_call::get(ClassWithDestructor&) -# 2255| Block 0 -# 2255| v2255_1(void) = EnterFunction : -# 2255| mu2255_2(unknown) = AliasedDefinition : -# 2255| mu2255_3(unknown) = InitializeNonLocal : -# 2255| r2255_4(glval) = VariableAddress[t] : -# 2255| mu2255_5(ClassWithDestructor &) = InitializeParameter[t] : &:r2255_4 -# 2255| r2255_6(ClassWithDestructor &) = Load[t] : &:r2255_4, ~m? -# 2255| mu2255_7(unknown) = InitializeIndirection[t] : &:r2255_6 -# 2255| r2255_8(glval) = VariableAddress[#return] : -# 2255| r2255_9(glval) = VariableAddress[t] : -# 2255| r2255_10(ClassWithDestructor &) = Load[t] : &:r2255_9, ~m? -# 2255| r2255_11(glval) = CopyValue : r2255_10 -# 2255| r2255_12(ClassWithDestructor &) = CopyValue : r2255_11 -# 2255| mu2255_13(ClassWithDestructor &) = Store[#return] : &:r2255_8, r2255_12 -# 2255| v2255_14(void) = ReturnIndirection[t] : &:r2255_6, ~m? -# 2255| r2255_15(glval) = VariableAddress[#return] : -# 2255| v2255_16(void) = ReturnValue : &:r2255_15, ~m? -# 2255| v2255_17(void) = AliasedUse : ~m? -# 2255| v2255_18(void) = ExitFunction : +# 2256| ClassWithDestructor& vacuous_destructor_call::get(ClassWithDestructor&) +# 2256| Block 0 +# 2256| v2256_1(void) = EnterFunction : +# 2256| mu2256_2(unknown) = AliasedDefinition : +# 2256| mu2256_3(unknown) = InitializeNonLocal : +# 2256| r2256_4(glval) = VariableAddress[t] : +# 2256| mu2256_5(ClassWithDestructor &) = InitializeParameter[t] : &:r2256_4 +# 2256| r2256_6(ClassWithDestructor &) = Load[t] : &:r2256_4, ~m? +# 2256| mu2256_7(unknown) = InitializeIndirection[t] : &:r2256_6 +# 2256| r2256_8(glval) = VariableAddress[#return] : +# 2256| r2256_9(glval) = VariableAddress[t] : +# 2256| r2256_10(ClassWithDestructor &) = Load[t] : &:r2256_9, ~m? +# 2256| r2256_11(glval) = CopyValue : r2256_10 +# 2256| r2256_12(ClassWithDestructor &) = CopyValue : r2256_11 +# 2256| mu2256_13(ClassWithDestructor &) = Store[#return] : &:r2256_8, r2256_12 +# 2256| v2256_14(void) = ReturnIndirection[t] : &:r2256_6, ~m? +# 2256| r2256_15(glval) = VariableAddress[#return] : +# 2256| v2256_16(void) = ReturnValue : &:r2256_15, ~m? +# 2256| v2256_17(void) = AliasedUse : ~m? +# 2256| v2256_18(void) = ExitFunction : -# 2255| int& vacuous_destructor_call::get(int&) -# 2255| Block 0 -# 2255| v2255_1(void) = EnterFunction : -# 2255| mu2255_2(unknown) = AliasedDefinition : -# 2255| mu2255_3(unknown) = InitializeNonLocal : -# 2255| r2255_4(glval) = VariableAddress[t] : -# 2255| mu2255_5(int &) = InitializeParameter[t] : &:r2255_4 -# 2255| r2255_6(int &) = Load[t] : &:r2255_4, ~m? -# 2255| mu2255_7(unknown) = InitializeIndirection[t] : &:r2255_6 -# 2255| r2255_8(glval) = VariableAddress[#return] : -# 2255| r2255_9(glval) = VariableAddress[t] : -# 2255| r2255_10(int &) = Load[t] : &:r2255_9, ~m? -# 2255| r2255_11(glval) = CopyValue : r2255_10 -# 2255| r2255_12(int &) = CopyValue : r2255_11 -# 2255| mu2255_13(int &) = Store[#return] : &:r2255_8, r2255_12 -# 2255| v2255_14(void) = ReturnIndirection[t] : &:r2255_6, ~m? -# 2255| r2255_15(glval) = VariableAddress[#return] : -# 2255| v2255_16(void) = ReturnValue : &:r2255_15, ~m? -# 2255| v2255_17(void) = AliasedUse : ~m? -# 2255| v2255_18(void) = ExitFunction : +# 2256| int& vacuous_destructor_call::get(int&) +# 2256| Block 0 +# 2256| v2256_1(void) = EnterFunction : +# 2256| mu2256_2(unknown) = AliasedDefinition : +# 2256| mu2256_3(unknown) = InitializeNonLocal : +# 2256| r2256_4(glval) = VariableAddress[t] : +# 2256| mu2256_5(int &) = InitializeParameter[t] : &:r2256_4 +# 2256| r2256_6(int &) = Load[t] : &:r2256_4, ~m? +# 2256| mu2256_7(unknown) = InitializeIndirection[t] : &:r2256_6 +# 2256| r2256_8(glval) = VariableAddress[#return] : +# 2256| r2256_9(glval) = VariableAddress[t] : +# 2256| r2256_10(int &) = Load[t] : &:r2256_9, ~m? +# 2256| r2256_11(glval) = CopyValue : r2256_10 +# 2256| r2256_12(int &) = CopyValue : r2256_11 +# 2256| mu2256_13(int &) = Store[#return] : &:r2256_8, r2256_12 +# 2256| v2256_14(void) = ReturnIndirection[t] : &:r2256_6, ~m? +# 2256| r2256_15(glval) = VariableAddress[#return] : +# 2256| v2256_16(void) = ReturnValue : &:r2256_15, ~m? +# 2256| v2256_17(void) = AliasedUse : ~m? +# 2256| v2256_18(void) = ExitFunction : -# 2258| void vacuous_destructor_call::call_destructor(ClassWithDestructor&) -# 2258| Block 0 -# 2258| v2258_1(void) = EnterFunction : -# 2258| mu2258_2(unknown) = AliasedDefinition : -# 2258| mu2258_3(unknown) = InitializeNonLocal : -# 2258| r2258_4(glval) = VariableAddress[t] : -# 2258| mu2258_5(ClassWithDestructor &) = InitializeParameter[t] : &:r2258_4 -# 2258| r2258_6(ClassWithDestructor &) = Load[t] : &:r2258_4, ~m? -# 2258| mu2258_7(unknown) = InitializeIndirection[t] : &:r2258_6 -# 2259| r2259_1(glval) = FunctionAddress[get] : -# 2259| r2259_2(glval) = VariableAddress[t] : -# 2259| r2259_3(ClassWithDestructor &) = Load[t] : &:r2259_2, ~m? -# 2259| r2259_4(glval) = CopyValue : r2259_3 -# 2259| r2259_5(ClassWithDestructor &) = CopyValue : r2259_4 -# 2259| r2259_6(ClassWithDestructor &) = Call[get] : func:r2259_1, 0:r2259_5 -# 2259| mu2259_7(unknown) = ^CallSideEffect : ~m? -# 2259| v2259_8(void) = ^BufferReadSideEffect[0] : &:r2259_5, ~m? -# 2259| mu2259_9(unknown) = ^BufferMayWriteSideEffect[0] : &:r2259_5 -# 2259| r2259_10(glval) = CopyValue : r2259_6 -# 2259| r2259_11(glval) = FunctionAddress[~ClassWithDestructor] : -# 2259| v2259_12(void) = Call[~ClassWithDestructor] : func:r2259_11 -# 2259| mu2259_13(unknown) = ^CallSideEffect : ~m? -# 2259| v2259_14(void) = ^IndirectReadSideEffect[-1] : &:r2259_10, ~m? -# 2259| mu2259_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2259_10 -# 2260| v2260_1(void) = NoOp : -# 2258| v2258_8(void) = ReturnIndirection[t] : &:r2258_6, ~m? -# 2258| v2258_9(void) = ReturnVoid : -# 2258| v2258_10(void) = AliasedUse : ~m? -# 2258| v2258_11(void) = ExitFunction : +# 2259| void vacuous_destructor_call::call_destructor(ClassWithDestructor&) +# 2259| Block 0 +# 2259| v2259_1(void) = EnterFunction : +# 2259| mu2259_2(unknown) = AliasedDefinition : +# 2259| mu2259_3(unknown) = InitializeNonLocal : +# 2259| r2259_4(glval) = VariableAddress[t] : +# 2259| mu2259_5(ClassWithDestructor &) = InitializeParameter[t] : &:r2259_4 +# 2259| r2259_6(ClassWithDestructor &) = Load[t] : &:r2259_4, ~m? +# 2259| mu2259_7(unknown) = InitializeIndirection[t] : &:r2259_6 +# 2260| r2260_1(glval) = FunctionAddress[get] : +# 2260| r2260_2(glval) = VariableAddress[t] : +# 2260| r2260_3(ClassWithDestructor &) = Load[t] : &:r2260_2, ~m? +# 2260| r2260_4(glval) = CopyValue : r2260_3 +# 2260| r2260_5(ClassWithDestructor &) = CopyValue : r2260_4 +# 2260| r2260_6(ClassWithDestructor &) = Call[get] : func:r2260_1, 0:r2260_5 +# 2260| mu2260_7(unknown) = ^CallSideEffect : ~m? +# 2260| v2260_8(void) = ^BufferReadSideEffect[0] : &:r2260_5, ~m? +# 2260| mu2260_9(unknown) = ^BufferMayWriteSideEffect[0] : &:r2260_5 +# 2260| r2260_10(glval) = CopyValue : r2260_6 +# 2260| r2260_11(glval) = FunctionAddress[~ClassWithDestructor] : +# 2260| v2260_12(void) = Call[~ClassWithDestructor] : func:r2260_11 +# 2260| mu2260_13(unknown) = ^CallSideEffect : ~m? +# 2260| v2260_14(void) = ^IndirectReadSideEffect[-1] : &:r2260_10, ~m? +# 2260| mu2260_15(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2260_10 +# 2261| v2261_1(void) = NoOp : +# 2259| v2259_8(void) = ReturnIndirection[t] : &:r2259_6, ~m? +# 2259| v2259_9(void) = ReturnVoid : +# 2259| v2259_10(void) = AliasedUse : ~m? +# 2259| v2259_11(void) = ExitFunction : -# 2258| void vacuous_destructor_call::call_destructor(int&) -# 2258| Block 0 -# 2258| v2258_1(void) = EnterFunction : -# 2258| mu2258_2(unknown) = AliasedDefinition : -# 2258| mu2258_3(unknown) = InitializeNonLocal : -# 2258| r2258_4(glval) = VariableAddress[t] : -# 2258| mu2258_5(int &) = InitializeParameter[t] : &:r2258_4 -# 2258| r2258_6(int &) = Load[t] : &:r2258_4, ~m? -# 2258| mu2258_7(unknown) = InitializeIndirection[t] : &:r2258_6 -# 2259| r2259_1(glval) = FunctionAddress[get] : -# 2259| r2259_2(glval) = VariableAddress[t] : -# 2259| r2259_3(int &) = Load[t] : &:r2259_2, ~m? -# 2259| r2259_4(glval) = CopyValue : r2259_3 -# 2259| r2259_5(int &) = CopyValue : r2259_4 -# 2259| r2259_6(int &) = Call[get] : func:r2259_1, 0:r2259_5 -# 2259| mu2259_7(unknown) = ^CallSideEffect : ~m? -# 2259| v2259_8(void) = ^BufferReadSideEffect[0] : &:r2259_5, ~m? -# 2259| mu2259_9(unknown) = ^BufferMayWriteSideEffect[0] : &:r2259_5 -# 2259| r2259_10(glval) = CopyValue : r2259_6 -# 2260| v2260_1(void) = NoOp : -# 2258| v2258_8(void) = ReturnIndirection[t] : &:r2258_6, ~m? -# 2258| v2258_9(void) = ReturnVoid : -# 2258| v2258_10(void) = AliasedUse : ~m? -# 2258| v2258_11(void) = ExitFunction : +# 2259| void vacuous_destructor_call::call_destructor(int&) +# 2259| Block 0 +# 2259| v2259_1(void) = EnterFunction : +# 2259| mu2259_2(unknown) = AliasedDefinition : +# 2259| mu2259_3(unknown) = InitializeNonLocal : +# 2259| r2259_4(glval) = VariableAddress[t] : +# 2259| mu2259_5(int &) = InitializeParameter[t] : &:r2259_4 +# 2259| r2259_6(int &) = Load[t] : &:r2259_4, ~m? +# 2259| mu2259_7(unknown) = InitializeIndirection[t] : &:r2259_6 +# 2260| r2260_1(glval) = FunctionAddress[get] : +# 2260| r2260_2(glval) = VariableAddress[t] : +# 2260| r2260_3(int &) = Load[t] : &:r2260_2, ~m? +# 2260| r2260_4(glval) = CopyValue : r2260_3 +# 2260| r2260_5(int &) = CopyValue : r2260_4 +# 2260| r2260_6(int &) = Call[get] : func:r2260_1, 0:r2260_5 +# 2260| mu2260_7(unknown) = ^CallSideEffect : ~m? +# 2260| v2260_8(void) = ^BufferReadSideEffect[0] : &:r2260_5, ~m? +# 2260| mu2260_9(unknown) = ^BufferMayWriteSideEffect[0] : &:r2260_5 +# 2260| r2260_10(glval) = CopyValue : r2260_6 +# 2261| v2261_1(void) = NoOp : +# 2259| v2259_8(void) = ReturnIndirection[t] : &:r2259_6, ~m? +# 2259| v2259_9(void) = ReturnVoid : +# 2259| v2259_10(void) = AliasedUse : ~m? +# 2259| v2259_11(void) = ExitFunction : -# 2262| void vacuous_destructor_call::non_vacuous_destructor_call() -# 2262| Block 0 -# 2262| v2262_1(void) = EnterFunction : -# 2262| mu2262_2(unknown) = AliasedDefinition : -# 2262| mu2262_3(unknown) = InitializeNonLocal : -# 2263| r2263_1(glval) = VariableAddress[c] : -# 2263| mu2263_2(ClassWithDestructor) = Uninitialized[c] : &:r2263_1 -# 2263| r2263_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2263| v2263_4(void) = Call[ClassWithDestructor] : func:r2263_3, this:r2263_1 -# 2263| mu2263_5(unknown) = ^CallSideEffect : ~m? -# 2263| mu2263_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2263_1 -# 2264| r2264_1(glval) = FunctionAddress[call_destructor] : -# 2264| r2264_2(glval) = VariableAddress[c] : -# 2264| r2264_3(ClassWithDestructor &) = CopyValue : r2264_2 -# 2264| v2264_4(void) = Call[call_destructor] : func:r2264_1, 0:r2264_3 +# 2263| void vacuous_destructor_call::non_vacuous_destructor_call() +# 2263| Block 0 +# 2263| v2263_1(void) = EnterFunction : +# 2263| mu2263_2(unknown) = AliasedDefinition : +# 2263| mu2263_3(unknown) = InitializeNonLocal : +# 2264| r2264_1(glval) = VariableAddress[c] : +# 2264| mu2264_2(ClassWithDestructor) = Uninitialized[c] : &:r2264_1 +# 2264| r2264_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2264| v2264_4(void) = Call[ClassWithDestructor] : func:r2264_3, this:r2264_1 # 2264| mu2264_5(unknown) = ^CallSideEffect : ~m? -# 2264| v2264_6(void) = ^BufferReadSideEffect[0] : &:r2264_3, ~m? -# 2264| mu2264_7(unknown) = ^BufferMayWriteSideEffect[0] : &:r2264_3 -# 2265| v2265_1(void) = NoOp : +# 2264| mu2264_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2264_1 +# 2265| r2265_1(glval) = FunctionAddress[call_destructor] : # 2265| r2265_2(glval) = VariableAddress[c] : -# 2265| r2265_3(glval) = FunctionAddress[~ClassWithDestructor] : -# 2265| v2265_4(void) = Call[~ClassWithDestructor] : func:r2265_3, this:r2265_2 +# 2265| r2265_3(ClassWithDestructor &) = CopyValue : r2265_2 +# 2265| v2265_4(void) = Call[call_destructor] : func:r2265_1, 0:r2265_3 # 2265| mu2265_5(unknown) = ^CallSideEffect : ~m? -# 2265| v2265_6(void) = ^IndirectReadSideEffect[-1] : &:r2265_2, ~m? -# 2265| mu2265_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2265_2 -# 2262| v2262_4(void) = ReturnVoid : -# 2262| v2262_5(void) = AliasedUse : ~m? -# 2262| v2262_6(void) = ExitFunction : +# 2265| v2265_6(void) = ^BufferReadSideEffect[0] : &:r2265_3, ~m? +# 2265| mu2265_7(unknown) = ^BufferMayWriteSideEffect[0] : &:r2265_3 +# 2266| v2266_1(void) = NoOp : +# 2266| r2266_2(glval) = VariableAddress[c] : +# 2266| r2266_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2266| v2266_4(void) = Call[~ClassWithDestructor] : func:r2266_3, this:r2266_2 +# 2266| mu2266_5(unknown) = ^CallSideEffect : ~m? +# 2266| v2266_6(void) = ^IndirectReadSideEffect[-1] : &:r2266_2, ~m? +# 2266| mu2266_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2266_2 +# 2263| v2263_4(void) = ReturnVoid : +# 2263| v2263_5(void) = AliasedUse : ~m? +# 2263| v2263_6(void) = ExitFunction : -# 2267| void vacuous_destructor_call::vacuous_destructor_call() -# 2267| Block 0 -# 2267| v2267_1(void) = EnterFunction : -# 2267| mu2267_2(unknown) = AliasedDefinition : -# 2267| mu2267_3(unknown) = InitializeNonLocal : -# 2268| r2268_1(glval) = VariableAddress[i] : -# 2268| mu2268_2(int) = Uninitialized[i] : &:r2268_1 -# 2269| r2269_1(glval) = FunctionAddress[call_destructor] : -# 2269| r2269_2(glval) = VariableAddress[i] : -# 2269| r2269_3(int &) = CopyValue : r2269_2 -# 2269| v2269_4(void) = Call[call_destructor] : func:r2269_1, 0:r2269_3 -# 2269| mu2269_5(unknown) = ^CallSideEffect : ~m? -# 2269| v2269_6(void) = ^BufferReadSideEffect[0] : &:r2269_3, ~m? -# 2269| mu2269_7(unknown) = ^BufferMayWriteSideEffect[0] : &:r2269_3 -# 2270| v2270_1(void) = NoOp : -# 2267| v2267_4(void) = ReturnVoid : -# 2267| v2267_5(void) = AliasedUse : ~m? -# 2267| v2267_6(void) = ExitFunction : +# 2268| void vacuous_destructor_call::vacuous_destructor_call() +# 2268| Block 0 +# 2268| v2268_1(void) = EnterFunction : +# 2268| mu2268_2(unknown) = AliasedDefinition : +# 2268| mu2268_3(unknown) = InitializeNonLocal : +# 2269| r2269_1(glval) = VariableAddress[i] : +# 2269| mu2269_2(int) = Uninitialized[i] : &:r2269_1 +# 2270| r2270_1(glval) = FunctionAddress[call_destructor] : +# 2270| r2270_2(glval) = VariableAddress[i] : +# 2270| r2270_3(int &) = CopyValue : r2270_2 +# 2270| v2270_4(void) = Call[call_destructor] : func:r2270_1, 0:r2270_3 +# 2270| mu2270_5(unknown) = ^CallSideEffect : ~m? +# 2270| v2270_6(void) = ^BufferReadSideEffect[0] : &:r2270_3, ~m? +# 2270| mu2270_7(unknown) = ^BufferMayWriteSideEffect[0] : &:r2270_3 +# 2271| v2271_1(void) = NoOp : +# 2268| v2268_4(void) = ReturnVoid : +# 2268| v2268_5(void) = AliasedUse : ~m? +# 2268| v2268_6(void) = ExitFunction : -# 2273| void TryCatchDestructors(bool) -# 2273| Block 0 -# 2273| v2273_1(void) = EnterFunction : -# 2273| mu2273_2(unknown) = AliasedDefinition : -# 2273| mu2273_3(unknown) = InitializeNonLocal : -# 2273| r2273_4(glval) = VariableAddress[b] : -# 2273| mu2273_5(bool) = InitializeParameter[b] : &:r2273_4 -# 2275| r2275_1(glval) = VariableAddress[s] : -# 2275| mu2275_2(String) = Uninitialized[s] : &:r2275_1 -# 2275| r2275_3(glval) = FunctionAddress[String] : -# 2275| v2275_4(void) = Call[String] : func:r2275_3, this:r2275_1 -# 2275| mu2275_5(unknown) = ^CallSideEffect : ~m? -# 2275| mu2275_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2275_1 -# 2276| r2276_1(glval) = VariableAddress[b] : -# 2276| r2276_2(bool) = Load[b] : &:r2276_1, ~m? -# 2276| v2276_3(void) = ConditionalBranch : r2276_2 +# 2274| void TryCatchDestructors(bool) +# 2274| Block 0 +# 2274| v2274_1(void) = EnterFunction : +# 2274| mu2274_2(unknown) = AliasedDefinition : +# 2274| mu2274_3(unknown) = InitializeNonLocal : +# 2274| r2274_4(glval) = VariableAddress[b] : +# 2274| mu2274_5(bool) = InitializeParameter[b] : &:r2274_4 +# 2276| r2276_1(glval) = VariableAddress[s] : +# 2276| mu2276_2(String) = Uninitialized[s] : &:r2276_1 +# 2276| r2276_3(glval) = FunctionAddress[String] : +# 2276| v2276_4(void) = Call[String] : func:r2276_3, this:r2276_1 +# 2276| mu2276_5(unknown) = ^CallSideEffect : ~m? +# 2276| mu2276_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2276_1 +# 2277| r2277_1(glval) = VariableAddress[b] : +# 2277| r2277_2(bool) = Load[b] : &:r2277_1, ~m? +# 2277| v2277_3(void) = ConditionalBranch : r2277_2 #-----| False -> Block 4 #-----| True -> Block 3 -# 2273| Block 1 -# 2273| v2273_6(void) = AliasedUse : ~m? -# 2273| v2273_7(void) = ExitFunction : +# 2274| Block 1 +# 2274| v2274_6(void) = AliasedUse : ~m? +# 2274| v2274_7(void) = ExitFunction : -# 2273| Block 2 -# 2273| v2273_8(void) = Unwind : +# 2274| Block 2 +# 2274| v2274_8(void) = Unwind : #-----| Goto -> Block 1 -# 2277| Block 3 -# 2277| r2277_1(glval) = VariableAddress[#throw2277:7] : -# 2277| r2277_2(glval) = StringConstant["string literal"] : -# 2277| r2277_3(char *) = Convert : r2277_2 -# 2277| mu2277_4(char *) = Store[#throw2277:7] : &:r2277_1, r2277_3 -# 2277| v2277_5(void) = ThrowValue : &:r2277_1, ~m? -# 2280| r2280_1(glval) = VariableAddress[s] : -# 2280| r2280_2(glval) = FunctionAddress[~String] : -# 2280| v2280_3(void) = Call[~String] : func:r2280_2, this:r2280_1 -# 2280| mu2280_4(unknown) = ^CallSideEffect : ~m? -# 2280| v2280_5(void) = ^IndirectReadSideEffect[-1] : &:r2280_1, ~m? -# 2280| mu2280_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_1 +# 2278| Block 3 +# 2278| r2278_1(glval) = VariableAddress[#throw2278:7] : +# 2278| r2278_2(glval) = StringConstant["string literal"] : +# 2278| r2278_3(char *) = Convert : r2278_2 +# 2278| mu2278_4(char *) = Store[#throw2278:7] : &:r2278_1, r2278_3 +# 2278| v2278_5(void) = ThrowValue : &:r2278_1, ~m? +# 2281| r2281_1(glval) = VariableAddress[s] : +# 2281| r2281_2(glval) = FunctionAddress[~String] : +# 2281| v2281_3(void) = Call[~String] : func:r2281_2, this:r2281_1 +# 2281| mu2281_4(unknown) = ^CallSideEffect : ~m? +# 2281| v2281_5(void) = ^IndirectReadSideEffect[-1] : &:r2281_1, ~m? +# 2281| mu2281_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2281_1 #-----| Exception -> Block 5 -# 2279| Block 4 -# 2279| r2279_1(glval) = VariableAddress[s2] : -# 2279| mu2279_2(String) = Uninitialized[s2] : &:r2279_1 -# 2279| r2279_3(glval) = FunctionAddress[String] : -# 2279| v2279_4(void) = Call[String] : func:r2279_3, this:r2279_1 -# 2279| mu2279_5(unknown) = ^CallSideEffect : ~m? -# 2279| mu2279_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2279_1 -# 2280| r2280_7(glval) = VariableAddress[s2] : -# 2280| r2280_8(glval) = FunctionAddress[~String] : -# 2280| v2280_9(void) = Call[~String] : func:r2280_8, this:r2280_7 -# 2280| mu2280_10(unknown) = ^CallSideEffect : ~m? -# 2280| v2280_11(void) = ^IndirectReadSideEffect[-1] : &:r2280_7, ~m? -# 2280| mu2280_12(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_7 -# 2280| r2280_13(glval) = VariableAddress[s] : -# 2280| r2280_14(glval) = FunctionAddress[~String] : -# 2280| v2280_15(void) = Call[~String] : func:r2280_14, this:r2280_13 -# 2280| mu2280_16(unknown) = ^CallSideEffect : ~m? -# 2280| v2280_17(void) = ^IndirectReadSideEffect[-1] : &:r2280_13, ~m? -# 2280| mu2280_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_13 +# 2280| Block 4 +# 2280| r2280_1(glval) = VariableAddress[s2] : +# 2280| mu2280_2(String) = Uninitialized[s2] : &:r2280_1 +# 2280| r2280_3(glval) = FunctionAddress[String] : +# 2280| v2280_4(void) = Call[String] : func:r2280_3, this:r2280_1 +# 2280| mu2280_5(unknown) = ^CallSideEffect : ~m? +# 2280| mu2280_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2280_1 +# 2281| r2281_7(glval) = VariableAddress[s2] : +# 2281| r2281_8(glval) = FunctionAddress[~String] : +# 2281| v2281_9(void) = Call[~String] : func:r2281_8, this:r2281_7 +# 2281| mu2281_10(unknown) = ^CallSideEffect : ~m? +# 2281| v2281_11(void) = ^IndirectReadSideEffect[-1] : &:r2281_7, ~m? +# 2281| mu2281_12(String) = ^IndirectMayWriteSideEffect[-1] : &:r2281_7 +# 2281| r2281_13(glval) = VariableAddress[s] : +# 2281| r2281_14(glval) = FunctionAddress[~String] : +# 2281| v2281_15(void) = Call[~String] : func:r2281_14, this:r2281_13 +# 2281| mu2281_16(unknown) = ^CallSideEffect : ~m? +# 2281| v2281_17(void) = ^IndirectReadSideEffect[-1] : &:r2281_13, ~m? +# 2281| mu2281_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2281_13 #-----| Goto -> Block 10 -# 2281| Block 5 -# 2281| v2281_1(void) = CatchByType[const char *] : +# 2282| Block 5 +# 2282| v2282_1(void) = CatchByType[const char *] : #-----| Exception -> Block 7 #-----| Goto -> Block 6 -# 2281| Block 6 -# 2281| r2281_2(glval) = VariableAddress[s] : -# 2281| mu2281_3(char *) = InitializeParameter[s] : &:r2281_2 -# 2281| r2281_4(char *) = Load[s] : &:r2281_2, ~m? -# 2281| mu2281_5(unknown) = InitializeIndirection[s] : &:r2281_4 -# 2282| r2282_1(glval) = VariableAddress[#throw2282:5] : -# 2282| mu2282_2(String) = Uninitialized[#throw2282:5] : &:r2282_1 -# 2282| r2282_3(glval) = FunctionAddress[String] : -# 2282| r2282_4(glval) = VariableAddress[s] : -# 2282| r2282_5(char *) = Load[s] : &:r2282_4, ~m? -# 2282| v2282_6(void) = Call[String] : func:r2282_3, this:r2282_1, 0:r2282_5 -# 2282| mu2282_7(unknown) = ^CallSideEffect : ~m? -# 2282| v2282_8(void) = ^BufferReadSideEffect[0] : &:r2282_5, ~m? -# 2282| mu2282_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2282_1 -# 2282| v2282_10(void) = ThrowValue : &:r2282_1, ~m? +# 2282| Block 6 +# 2282| r2282_2(glval) = VariableAddress[s] : +# 2282| mu2282_3(char *) = InitializeParameter[s] : &:r2282_2 +# 2282| r2282_4(char *) = Load[s] : &:r2282_2, ~m? +# 2282| mu2282_5(unknown) = InitializeIndirection[s] : &:r2282_4 +# 2283| r2283_1(glval) = VariableAddress[#throw2283:5] : +# 2283| mu2283_2(String) = Uninitialized[#throw2283:5] : &:r2283_1 +# 2283| r2283_3(glval) = FunctionAddress[String] : +# 2283| r2283_4(glval) = VariableAddress[s] : +# 2283| r2283_5(char *) = Load[s] : &:r2283_4, ~m? +# 2283| v2283_6(void) = Call[String] : func:r2283_3, this:r2283_1, 0:r2283_5 +# 2283| mu2283_7(unknown) = ^CallSideEffect : ~m? +# 2283| v2283_8(void) = ^BufferReadSideEffect[0] : &:r2283_5, ~m? +# 2283| mu2283_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2283_1 +# 2283| v2283_10(void) = ThrowValue : &:r2283_1, ~m? #-----| Exception -> Block 2 -# 2284| Block 7 -# 2284| v2284_1(void) = CatchByType[const String &] : +# 2285| Block 7 +# 2285| v2285_1(void) = CatchByType[const String &] : #-----| Exception -> Block 9 #-----| Goto -> Block 8 -# 2284| Block 8 -# 2284| r2284_2(glval) = VariableAddress[e] : -# 2284| mu2284_3(String &) = InitializeParameter[e] : &:r2284_2 -# 2284| r2284_4(String &) = Load[e] : &:r2284_2, ~m? -# 2284| mu2284_5(unknown) = InitializeIndirection[e] : &:r2284_4 -# 2284| v2284_6(void) = NoOp : +# 2285| Block 8 +# 2285| r2285_2(glval) = VariableAddress[e] : +# 2285| mu2285_3(String &) = InitializeParameter[e] : &:r2285_2 +# 2285| r2285_4(String &) = Load[e] : &:r2285_2, ~m? +# 2285| mu2285_5(unknown) = InitializeIndirection[e] : &:r2285_4 +# 2285| v2285_6(void) = NoOp : #-----| Goto -> Block 10 -# 2286| Block 9 -# 2286| v2286_1(void) = CatchAny : -# 2287| v2287_1(void) = ReThrow : +# 2287| Block 9 +# 2287| v2287_1(void) = CatchAny : +# 2288| v2288_1(void) = ReThrow : #-----| Exception -> Block 2 -# 2289| Block 10 -# 2289| v2289_1(void) = NoOp : -# 2273| v2273_9(void) = ReturnVoid : +# 2290| Block 10 +# 2290| v2290_1(void) = NoOp : +# 2274| v2274_9(void) = ReturnVoid : #-----| Goto -> Block 1 -# 2291| void IfDestructors(bool) -# 2291| Block 0 -# 2291| v2291_1(void) = EnterFunction : -# 2291| mu2291_2(unknown) = AliasedDefinition : -# 2291| mu2291_3(unknown) = InitializeNonLocal : -# 2291| r2291_4(glval) = VariableAddress[b] : -# 2291| mu2291_5(bool) = InitializeParameter[b] : &:r2291_4 -# 2292| r2292_1(glval) = VariableAddress[s1] : -# 2292| mu2292_2(String) = Uninitialized[s1] : &:r2292_1 -# 2292| r2292_3(glval) = FunctionAddress[String] : -# 2292| v2292_4(void) = Call[String] : func:r2292_3, this:r2292_1 -# 2292| mu2292_5(unknown) = ^CallSideEffect : ~m? -# 2292| mu2292_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2292_1 -# 2293| r2293_1(glval) = VariableAddress[b] : -# 2293| r2293_2(bool) = Load[b] : &:r2293_1, ~m? -# 2293| v2293_3(void) = ConditionalBranch : r2293_2 +# 2292| void IfDestructors(bool) +# 2292| Block 0 +# 2292| v2292_1(void) = EnterFunction : +# 2292| mu2292_2(unknown) = AliasedDefinition : +# 2292| mu2292_3(unknown) = InitializeNonLocal : +# 2292| r2292_4(glval) = VariableAddress[b] : +# 2292| mu2292_5(bool) = InitializeParameter[b] : &:r2292_4 +# 2293| r2293_1(glval) = VariableAddress[s1] : +# 2293| mu2293_2(String) = Uninitialized[s1] : &:r2293_1 +# 2293| r2293_3(glval) = FunctionAddress[String] : +# 2293| v2293_4(void) = Call[String] : func:r2293_3, this:r2293_1 +# 2293| mu2293_5(unknown) = ^CallSideEffect : ~m? +# 2293| mu2293_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2293_1 +# 2294| r2294_1(glval) = VariableAddress[b] : +# 2294| r2294_2(bool) = Load[b] : &:r2294_1, ~m? +# 2294| v2294_3(void) = ConditionalBranch : r2294_2 #-----| False -> Block 2 #-----| True -> Block 1 -# 2294| Block 1 -# 2294| r2294_1(glval) = VariableAddress[s2] : -# 2294| mu2294_2(String) = Uninitialized[s2] : &:r2294_1 -# 2294| r2294_3(glval) = FunctionAddress[String] : -# 2294| v2294_4(void) = Call[String] : func:r2294_3, this:r2294_1 -# 2294| mu2294_5(unknown) = ^CallSideEffect : ~m? -# 2294| mu2294_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2294_1 +# 2295| Block 1 # 2295| r2295_1(glval) = VariableAddress[s2] : -# 2295| r2295_2(glval) = FunctionAddress[~String] : -# 2295| v2295_3(void) = Call[~String] : func:r2295_2, this:r2295_1 -# 2295| mu2295_4(unknown) = ^CallSideEffect : ~m? -# 2295| v2295_5(void) = ^IndirectReadSideEffect[-1] : &:r2295_1, ~m? +# 2295| mu2295_2(String) = Uninitialized[s2] : &:r2295_1 +# 2295| r2295_3(glval) = FunctionAddress[String] : +# 2295| v2295_4(void) = Call[String] : func:r2295_3, this:r2295_1 +# 2295| mu2295_5(unknown) = ^CallSideEffect : ~m? # 2295| mu2295_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2295_1 -#-----| Goto -> Block 3 - -# 2296| Block 2 -# 2296| r2296_1(glval) = VariableAddress[s3] : -# 2296| mu2296_2(String) = Uninitialized[s3] : &:r2296_1 -# 2296| r2296_3(glval) = FunctionAddress[String] : -# 2296| v2296_4(void) = Call[String] : func:r2296_3, this:r2296_1 -# 2296| mu2296_5(unknown) = ^CallSideEffect : ~m? +# 2296| r2296_1(glval) = VariableAddress[s2] : +# 2296| r2296_2(glval) = FunctionAddress[~String] : +# 2296| v2296_3(void) = Call[~String] : func:r2296_2, this:r2296_1 +# 2296| mu2296_4(unknown) = ^CallSideEffect : ~m? +# 2296| v2296_5(void) = ^IndirectReadSideEffect[-1] : &:r2296_1, ~m? # 2296| mu2296_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2296_1 -# 2297| r2297_1(glval) = VariableAddress[s3] : -# 2297| r2297_2(glval) = FunctionAddress[~String] : -# 2297| v2297_3(void) = Call[~String] : func:r2297_2, this:r2297_1 -# 2297| mu2297_4(unknown) = ^CallSideEffect : ~m? -# 2297| v2297_5(void) = ^IndirectReadSideEffect[-1] : &:r2297_1, ~m? -# 2297| mu2297_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2297_1 #-----| Goto -> Block 3 -# 2298| Block 3 -# 2298| r2298_1(glval) = VariableAddress[s4] : -# 2298| mu2298_2(String) = Uninitialized[s4] : &:r2298_1 -# 2298| r2298_3(glval) = FunctionAddress[String] : -# 2298| v2298_4(void) = Call[String] : func:r2298_3, this:r2298_1 -# 2298| mu2298_5(unknown) = ^CallSideEffect : ~m? +# 2297| Block 2 +# 2297| r2297_1(glval) = VariableAddress[s3] : +# 2297| mu2297_2(String) = Uninitialized[s3] : &:r2297_1 +# 2297| r2297_3(glval) = FunctionAddress[String] : +# 2297| v2297_4(void) = Call[String] : func:r2297_3, this:r2297_1 +# 2297| mu2297_5(unknown) = ^CallSideEffect : ~m? +# 2297| mu2297_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2297_1 +# 2298| r2298_1(glval) = VariableAddress[s3] : +# 2298| r2298_2(glval) = FunctionAddress[~String] : +# 2298| v2298_3(void) = Call[~String] : func:r2298_2, this:r2298_1 +# 2298| mu2298_4(unknown) = ^CallSideEffect : ~m? +# 2298| v2298_5(void) = ^IndirectReadSideEffect[-1] : &:r2298_1, ~m? # 2298| mu2298_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2298_1 -# 2299| v2299_1(void) = NoOp : -# 2299| r2299_2(glval) = VariableAddress[s4] : -# 2299| r2299_3(glval) = FunctionAddress[~String] : -# 2299| v2299_4(void) = Call[~String] : func:r2299_3, this:r2299_2 -# 2299| mu2299_5(unknown) = ^CallSideEffect : ~m? -# 2299| v2299_6(void) = ^IndirectReadSideEffect[-1] : &:r2299_2, ~m? -# 2299| mu2299_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2299_2 -# 2299| r2299_8(glval) = VariableAddress[s1] : -# 2299| r2299_9(glval) = FunctionAddress[~String] : -# 2299| v2299_10(void) = Call[~String] : func:r2299_9, this:r2299_8 -# 2299| mu2299_11(unknown) = ^CallSideEffect : ~m? -# 2299| v2299_12(void) = ^IndirectReadSideEffect[-1] : &:r2299_8, ~m? -# 2299| mu2299_13(String) = ^IndirectMayWriteSideEffect[-1] : &:r2299_8 -# 2291| v2291_6(void) = ReturnVoid : -# 2291| v2291_7(void) = AliasedUse : ~m? -# 2291| v2291_8(void) = ExitFunction : +#-----| Goto -> Block 3 -# 2301| void ForDestructors() -# 2301| Block 0 -# 2301| v2301_1(void) = EnterFunction : -# 2301| mu2301_2(unknown) = AliasedDefinition : -# 2301| mu2301_3(unknown) = InitializeNonLocal : -# 2302| r2302_1(glval) = VariableAddress[c] : -# 2302| r2302_2(char) = Constant[97] : -# 2302| mu2302_3(char) = Store[c] : &:r2302_1, r2302_2 -# 2303| r2303_1(glval) = VariableAddress[s] : -# 2303| mu2303_2(String) = Uninitialized[s] : &:r2303_1 -# 2303| r2303_3(glval) = FunctionAddress[String] : -# 2303| r2303_4(glval) = StringConstant["hello"] : -# 2303| r2303_5(char *) = Convert : r2303_4 -# 2303| v2303_6(void) = Call[String] : func:r2303_3, this:r2303_1, 0:r2303_5 -# 2303| mu2303_7(unknown) = ^CallSideEffect : ~m? -# 2303| v2303_8(void) = ^BufferReadSideEffect[0] : &:r2303_5, ~m? -# 2303| mu2303_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2303_1 +# 2299| Block 3 +# 2299| r2299_1(glval) = VariableAddress[s4] : +# 2299| mu2299_2(String) = Uninitialized[s4] : &:r2299_1 +# 2299| r2299_3(glval) = FunctionAddress[String] : +# 2299| v2299_4(void) = Call[String] : func:r2299_3, this:r2299_1 +# 2299| mu2299_5(unknown) = ^CallSideEffect : ~m? +# 2299| mu2299_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2299_1 +# 2300| v2300_1(void) = NoOp : +# 2300| r2300_2(glval) = VariableAddress[s4] : +# 2300| r2300_3(glval) = FunctionAddress[~String] : +# 2300| v2300_4(void) = Call[~String] : func:r2300_3, this:r2300_2 +# 2300| mu2300_5(unknown) = ^CallSideEffect : ~m? +# 2300| v2300_6(void) = ^IndirectReadSideEffect[-1] : &:r2300_2, ~m? +# 2300| mu2300_7(String) = ^IndirectMayWriteSideEffect[-1] : &:r2300_2 +# 2300| r2300_8(glval) = VariableAddress[s1] : +# 2300| r2300_9(glval) = FunctionAddress[~String] : +# 2300| v2300_10(void) = Call[~String] : func:r2300_9, this:r2300_8 +# 2300| mu2300_11(unknown) = ^CallSideEffect : ~m? +# 2300| v2300_12(void) = ^IndirectReadSideEffect[-1] : &:r2300_8, ~m? +# 2300| mu2300_13(String) = ^IndirectMayWriteSideEffect[-1] : &:r2300_8 +# 2292| v2292_6(void) = ReturnVoid : +# 2292| v2292_7(void) = AliasedUse : ~m? +# 2292| v2292_8(void) = ExitFunction : + +# 2302| void ForDestructors() +# 2302| Block 0 +# 2302| v2302_1(void) = EnterFunction : +# 2302| mu2302_2(unknown) = AliasedDefinition : +# 2302| mu2302_3(unknown) = InitializeNonLocal : +# 2303| r2303_1(glval) = VariableAddress[c] : +# 2303| r2303_2(char) = Constant[97] : +# 2303| mu2303_3(char) = Store[c] : &:r2303_1, r2303_2 +# 2304| r2304_1(glval) = VariableAddress[s] : +# 2304| mu2304_2(String) = Uninitialized[s] : &:r2304_1 +# 2304| r2304_3(glval) = FunctionAddress[String] : +# 2304| r2304_4(glval) = StringConstant["hello"] : +# 2304| r2304_5(char *) = Convert : r2304_4 +# 2304| v2304_6(void) = Call[String] : func:r2304_3, this:r2304_1, 0:r2304_5 +# 2304| mu2304_7(unknown) = ^CallSideEffect : ~m? +# 2304| v2304_8(void) = ^BufferReadSideEffect[0] : &:r2304_5, ~m? +# 2304| mu2304_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_1 #-----| Goto -> Block 1 -# 2303| Block 1 -# 2303| r2303_10(glval) = VariableAddress[c] : -# 2303| r2303_11(char) = Load[c] : &:r2303_10, ~m? -# 2303| r2303_12(int) = Convert : r2303_11 -# 2303| r2303_13(int) = Constant[0] : -# 2303| r2303_14(bool) = CompareNE : r2303_12, r2303_13 -# 2303| v2303_15(void) = ConditionalBranch : r2303_14 +# 2304| Block 1 +# 2304| r2304_10(glval) = VariableAddress[c] : +# 2304| r2304_11(char) = Load[c] : &:r2304_10, ~m? +# 2304| r2304_12(int) = Convert : r2304_11 +# 2304| r2304_13(int) = Constant[0] : +# 2304| r2304_14(bool) = CompareNE : r2304_12, r2304_13 +# 2304| v2304_15(void) = ConditionalBranch : r2304_14 #-----| False -> Block 3 #-----| True -> Block 2 -# 2304| Block 2 -# 2304| r2304_1(glval) = VariableAddress[s2] : -# 2304| mu2304_2(String) = Uninitialized[s2] : &:r2304_1 -# 2304| r2304_3(glval) = FunctionAddress[String] : -# 2304| v2304_4(void) = Call[String] : func:r2304_3, this:r2304_1 -# 2304| mu2304_5(unknown) = ^CallSideEffect : ~m? -# 2304| mu2304_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_1 +# 2305| Block 2 # 2305| r2305_1(glval) = VariableAddress[s2] : -# 2305| r2305_2(glval) = FunctionAddress[~String] : -# 2305| v2305_3(void) = Call[~String] : func:r2305_2, this:r2305_1 -# 2305| mu2305_4(unknown) = ^CallSideEffect : ~m? -# 2305| v2305_5(void) = ^IndirectReadSideEffect[-1] : &:r2305_1, ~m? +# 2305| mu2305_2(String) = Uninitialized[s2] : &:r2305_1 +# 2305| r2305_3(glval) = FunctionAddress[String] : +# 2305| v2305_4(void) = Call[String] : func:r2305_3, this:r2305_1 +# 2305| mu2305_5(unknown) = ^CallSideEffect : ~m? # 2305| mu2305_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2305_1 -# 2303| r2303_16(glval) = VariableAddress[s] : -# 2303| r2303_17(glval) = FunctionAddress[pop_back] : -# 2303| r2303_18(char) = Call[pop_back] : func:r2303_17, this:r2303_16 -# 2303| mu2303_19(unknown) = ^CallSideEffect : ~m? -# 2303| v2303_20(void) = ^IndirectReadSideEffect[-1] : &:r2303_16, ~m? -# 2303| mu2303_21(String) = ^IndirectMayWriteSideEffect[-1] : &:r2303_16 -# 2303| r2303_22(glval) = VariableAddress[c] : -# 2303| mu2303_23(char) = Store[c] : &:r2303_22, r2303_18 +# 2306| r2306_1(glval) = VariableAddress[s2] : +# 2306| r2306_2(glval) = FunctionAddress[~String] : +# 2306| v2306_3(void) = Call[~String] : func:r2306_2, this:r2306_1 +# 2306| mu2306_4(unknown) = ^CallSideEffect : ~m? +# 2306| v2306_5(void) = ^IndirectReadSideEffect[-1] : &:r2306_1, ~m? +# 2306| mu2306_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2306_1 +# 2304| r2304_16(glval) = VariableAddress[s] : +# 2304| r2304_17(glval) = FunctionAddress[pop_back] : +# 2304| r2304_18(char) = Call[pop_back] : func:r2304_17, this:r2304_16 +# 2304| mu2304_19(unknown) = ^CallSideEffect : ~m? +# 2304| v2304_20(void) = ^IndirectReadSideEffect[-1] : &:r2304_16, ~m? +# 2304| mu2304_21(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_16 +# 2304| r2304_22(glval) = VariableAddress[c] : +# 2304| mu2304_23(char) = Store[c] : &:r2304_22, r2304_18 #-----| Goto (back edge) -> Block 1 -# 2303| Block 3 -# 2303| r2303_24(glval) = VariableAddress[s] : -# 2303| r2303_25(glval) = FunctionAddress[~String] : -# 2303| v2303_26(void) = Call[~String] : func:r2303_25, this:r2303_24 -# 2303| mu2303_27(unknown) = ^CallSideEffect : ~m? -# 2303| v2303_28(void) = ^IndirectReadSideEffect[-1] : &:r2303_24, ~m? -# 2303| mu2303_29(String) = ^IndirectMayWriteSideEffect[-1] : &:r2303_24 -# 2307| r2307_1(glval &&>) = VariableAddress[(__range)] : -# 2307| r2307_2(glval>) = VariableAddress[#temp2307:20] : -# 2307| mu2307_3(vector) = Uninitialized[#temp2307:20] : &:r2307_2 -# 2307| r2307_4(glval) = FunctionAddress[vector] : -# 2307| r2307_5(glval) = VariableAddress[#temp2307:40] : -# 2307| mu2307_6(String) = Uninitialized[#temp2307:40] : &:r2307_5 -# 2307| r2307_7(glval) = FunctionAddress[String] : -# 2307| r2307_8(glval) = StringConstant["hello"] : -# 2307| r2307_9(char *) = Convert : r2307_8 -# 2307| v2307_10(void) = Call[String] : func:r2307_7, this:r2307_5, 0:r2307_9 -# 2307| mu2307_11(unknown) = ^CallSideEffect : ~m? -# 2307| v2307_12(void) = ^BufferReadSideEffect[0] : &:r2307_9, ~m? -# 2307| mu2307_13(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_5 -# 2307| r2307_14(String) = Load[#temp2307:40] : &:r2307_5, ~m? -# 2307| v2307_15(void) = Call[vector] : func:r2307_4, this:r2307_2, 0:r2307_14 -# 2307| mu2307_16(unknown) = ^CallSideEffect : ~m? -# 2307| mu2307_17(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2307_2 -# 2307| r2307_18(glval) = CopyValue : r2307_5 -# 2307| r2307_19(glval) = FunctionAddress[~String] : -# 2307| v2307_20(void) = Call[~String] : func:r2307_19, this:r2307_18 -# 2307| mu2307_21(unknown) = ^CallSideEffect : ~m? -# 2307| v2307_22(void) = ^IndirectReadSideEffect[-1] : &:r2307_18, ~m? -# 2307| mu2307_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_18 -# 2307| r2307_24(vector &) = CopyValue : r2307_2 -# 2307| mu2307_25(vector &&) = Store[(__range)] : &:r2307_1, r2307_24 -# 2307| r2307_26(glval>) = VariableAddress[(__begin)] : -# 2307| r2307_27(glval &&>) = VariableAddress[(__range)] : -# 2307| r2307_28(vector &&) = Load[(__range)] : &:r2307_27, ~m? -#-----| r0_1(glval>) = CopyValue : r2307_28 +# 2304| Block 3 +# 2304| r2304_24(glval) = VariableAddress[s] : +# 2304| r2304_25(glval) = FunctionAddress[~String] : +# 2304| v2304_26(void) = Call[~String] : func:r2304_25, this:r2304_24 +# 2304| mu2304_27(unknown) = ^CallSideEffect : ~m? +# 2304| v2304_28(void) = ^IndirectReadSideEffect[-1] : &:r2304_24, ~m? +# 2304| mu2304_29(String) = ^IndirectMayWriteSideEffect[-1] : &:r2304_24 +# 2308| r2308_1(glval &&>) = VariableAddress[(__range)] : +# 2308| r2308_2(glval>) = VariableAddress[#temp2308:20] : +# 2308| mu2308_3(vector) = Uninitialized[#temp2308:20] : &:r2308_2 +# 2308| r2308_4(glval) = FunctionAddress[vector] : +# 2308| r2308_5(glval) = VariableAddress[#temp2308:40] : +# 2308| mu2308_6(String) = Uninitialized[#temp2308:40] : &:r2308_5 +# 2308| r2308_7(glval) = FunctionAddress[String] : +# 2308| r2308_8(glval) = StringConstant["hello"] : +# 2308| r2308_9(char *) = Convert : r2308_8 +# 2308| v2308_10(void) = Call[String] : func:r2308_7, this:r2308_5, 0:r2308_9 +# 2308| mu2308_11(unknown) = ^CallSideEffect : ~m? +# 2308| v2308_12(void) = ^BufferReadSideEffect[0] : &:r2308_9, ~m? +# 2308| mu2308_13(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_5 +# 2308| r2308_14(String) = Load[#temp2308:40] : &:r2308_5, ~m? +# 2308| v2308_15(void) = Call[vector] : func:r2308_4, this:r2308_2, 0:r2308_14 +# 2308| mu2308_16(unknown) = ^CallSideEffect : ~m? +# 2308| mu2308_17(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2308_2 +# 2308| r2308_18(glval) = CopyValue : r2308_5 +# 2308| r2308_19(glval) = FunctionAddress[~String] : +# 2308| v2308_20(void) = Call[~String] : func:r2308_19, this:r2308_18 +# 2308| mu2308_21(unknown) = ^CallSideEffect : ~m? +# 2308| v2308_22(void) = ^IndirectReadSideEffect[-1] : &:r2308_18, ~m? +# 2308| mu2308_23(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_18 +# 2308| r2308_24(vector &) = CopyValue : r2308_2 +# 2308| mu2308_25(vector &&) = Store[(__range)] : &:r2308_1, r2308_24 +# 2308| r2308_26(glval>) = VariableAddress[(__begin)] : +# 2308| r2308_27(glval &&>) = VariableAddress[(__range)] : +# 2308| r2308_28(vector &&) = Load[(__range)] : &:r2308_27, ~m? +#-----| r0_1(glval>) = CopyValue : r2308_28 #-----| r0_2(glval>) = Convert : r0_1 -# 2307| r2307_29(glval) = FunctionAddress[begin] : -# 2307| r2307_30(iterator) = Call[begin] : func:r2307_29, this:r0_2 +# 2308| r2308_29(glval) = FunctionAddress[begin] : +# 2308| r2308_30(iterator) = Call[begin] : func:r2308_29, this:r0_2 #-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m? -# 2307| mu2307_31(iterator) = Store[(__begin)] : &:r2307_26, r2307_30 -# 2307| r2307_32(glval>) = VariableAddress[(__end)] : -# 2307| r2307_33(glval &&>) = VariableAddress[(__range)] : -# 2307| r2307_34(vector &&) = Load[(__range)] : &:r2307_33, ~m? -#-----| r0_4(glval>) = CopyValue : r2307_34 +# 2308| mu2308_31(iterator) = Store[(__begin)] : &:r2308_26, r2308_30 +# 2308| r2308_32(glval>) = VariableAddress[(__end)] : +# 2308| r2308_33(glval &&>) = VariableAddress[(__range)] : +# 2308| r2308_34(vector &&) = Load[(__range)] : &:r2308_33, ~m? +#-----| r0_4(glval>) = CopyValue : r2308_34 #-----| r0_5(glval>) = Convert : r0_4 -# 2307| r2307_35(glval) = FunctionAddress[end] : -# 2307| r2307_36(iterator) = Call[end] : func:r2307_35, this:r0_5 +# 2308| r2308_35(glval) = FunctionAddress[end] : +# 2308| r2308_36(iterator) = Call[end] : func:r2308_35, this:r0_5 #-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m? -# 2307| mu2307_37(iterator) = Store[(__end)] : &:r2307_32, r2307_36 +# 2308| mu2308_37(iterator) = Store[(__end)] : &:r2308_32, r2308_36 #-----| Goto -> Block 4 -# 2307| Block 4 -# 2307| r2307_38(glval>) = VariableAddress[(__begin)] : -#-----| r0_7(glval>) = Convert : r2307_38 -# 2307| r2307_39(glval) = FunctionAddress[operator!=] : +# 2308| Block 4 +# 2308| r2308_38(glval>) = VariableAddress[(__begin)] : +#-----| r0_7(glval>) = Convert : r2308_38 +# 2308| r2308_39(glval) = FunctionAddress[operator!=] : #-----| r0_8(glval>) = VariableAddress[#temp0:0] : #-----| mu0_9(iterator) = Uninitialized[#temp0:0] : &:r0_8 -# 2307| r2307_40(glval) = FunctionAddress[iterator] : -# 2307| r2307_41(glval>) = VariableAddress[(__end)] : -#-----| r0_10(glval>) = Convert : r2307_41 +# 2308| r2308_40(glval) = FunctionAddress[iterator] : +# 2308| r2308_41(glval>) = VariableAddress[(__end)] : +#-----| r0_10(glval>) = Convert : r2308_41 #-----| r0_11(iterator &) = CopyValue : r0_10 -# 2307| v2307_42(void) = Call[iterator] : func:r2307_40, this:r0_8, 0:r0_11 -# 2307| mu2307_43(unknown) = ^CallSideEffect : ~m? +# 2308| v2308_42(void) = Call[iterator] : func:r2308_40, this:r0_8, 0:r0_11 +# 2308| mu2308_43(unknown) = ^CallSideEffect : ~m? #-----| v0_12(void) = ^BufferReadSideEffect[0] : &:r0_11, ~m? -# 2307| mu2307_44(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 +# 2308| mu2308_44(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 #-----| r0_13(iterator) = Load[#temp0:0] : &:r0_8, ~m? -# 2307| r2307_45(bool) = Call[operator!=] : func:r2307_39, this:r0_7, 0:r0_13 +# 2308| r2308_45(bool) = Call[operator!=] : func:r2308_39, this:r0_7, 0:r0_13 #-----| v0_14(void) = ^IndirectReadSideEffect[-1] : &:r0_7, ~m? -# 2307| v2307_46(void) = ConditionalBranch : r2307_45 +# 2308| v2308_46(void) = ConditionalBranch : r2308_45 #-----| False -> Block 6 #-----| True -> Block 5 -# 2307| Block 5 -# 2307| r2307_47(glval) = VariableAddress[s] : -# 2307| mu2307_48(String) = Uninitialized[s] : &:r2307_47 -# 2307| r2307_49(glval) = FunctionAddress[String] : -# 2307| r2307_50(glval>) = VariableAddress[(__begin)] : -#-----| r0_15(glval>) = Convert : r2307_50 -# 2307| r2307_51(glval) = FunctionAddress[operator*] : -# 2307| r2307_52(String &) = Call[operator*] : func:r2307_51, this:r0_15 +# 2308| Block 5 +# 2308| r2308_47(glval) = VariableAddress[s] : +# 2308| mu2308_48(String) = Uninitialized[s] : &:r2308_47 +# 2308| r2308_49(glval) = FunctionAddress[String] : +# 2308| r2308_50(glval>) = VariableAddress[(__begin)] : +#-----| r0_15(glval>) = Convert : r2308_50 +# 2308| r2308_51(glval) = FunctionAddress[operator*] : +# 2308| r2308_52(String &) = Call[operator*] : func:r2308_51, this:r0_15 #-----| v0_16(void) = ^IndirectReadSideEffect[-1] : &:r0_15, ~m? -# 2307| r2307_53(glval) = CopyValue : r2307_52 -# 2307| r2307_54(glval) = Convert : r2307_53 -# 2307| r2307_55(String &) = CopyValue : r2307_54 -# 2307| v2307_56(void) = Call[String] : func:r2307_49, this:r2307_47, 0:r2307_55 -# 2307| mu2307_57(unknown) = ^CallSideEffect : ~m? -# 2307| v2307_58(void) = ^BufferReadSideEffect[0] : &:r2307_55, ~m? -# 2307| mu2307_59(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_47 -# 2308| r2308_1(glval) = VariableAddress[s2] : -# 2308| mu2308_2(String) = Uninitialized[s2] : &:r2308_1 -# 2308| r2308_3(glval) = FunctionAddress[String] : -# 2308| v2308_4(void) = Call[String] : func:r2308_3, this:r2308_1 -# 2308| mu2308_5(unknown) = ^CallSideEffect : ~m? -# 2308| mu2308_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_1 +# 2308| r2308_53(glval) = CopyValue : r2308_52 +# 2308| r2308_54(glval) = Convert : r2308_53 +# 2308| r2308_55(String &) = CopyValue : r2308_54 +# 2308| v2308_56(void) = Call[String] : func:r2308_49, this:r2308_47, 0:r2308_55 +# 2308| mu2308_57(unknown) = ^CallSideEffect : ~m? +# 2308| v2308_58(void) = ^BufferReadSideEffect[0] : &:r2308_55, ~m? +# 2308| mu2308_59(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_47 # 2309| r2309_1(glval) = VariableAddress[s2] : -# 2309| r2309_2(glval) = FunctionAddress[~String] : -# 2309| v2309_3(void) = Call[~String] : func:r2309_2, this:r2309_1 -# 2309| mu2309_4(unknown) = ^CallSideEffect : ~m? -# 2309| v2309_5(void) = ^IndirectReadSideEffect[-1] : &:r2309_1, ~m? +# 2309| mu2309_2(String) = Uninitialized[s2] : &:r2309_1 +# 2309| r2309_3(glval) = FunctionAddress[String] : +# 2309| v2309_4(void) = Call[String] : func:r2309_3, this:r2309_1 +# 2309| mu2309_5(unknown) = ^CallSideEffect : ~m? # 2309| mu2309_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2309_1 -# 2307| r2307_60(glval>) = VariableAddress[(__begin)] : -# 2307| r2307_61(glval) = FunctionAddress[operator++] : -# 2307| r2307_62(iterator &) = Call[operator++] : func:r2307_61, this:r2307_60 -# 2307| v2307_63(void) = ^IndirectReadSideEffect[-1] : &:r2307_60, ~m? -# 2307| mu2307_64(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2307_60 -# 2307| r2307_65(glval) = VariableAddress[s] : -# 2307| r2307_66(glval) = FunctionAddress[~String] : -# 2307| v2307_67(void) = Call[~String] : func:r2307_66, this:r2307_65 -# 2307| mu2307_68(unknown) = ^CallSideEffect : ~m? -# 2307| v2307_69(void) = ^IndirectReadSideEffect[-1] : &:r2307_65, ~m? -# 2307| mu2307_70(String) = ^IndirectMayWriteSideEffect[-1] : &:r2307_65 -# 2307| r2307_71(glval>) = CopyValue : r2307_62 +# 2310| r2310_1(glval) = VariableAddress[s2] : +# 2310| r2310_2(glval) = FunctionAddress[~String] : +# 2310| v2310_3(void) = Call[~String] : func:r2310_2, this:r2310_1 +# 2310| mu2310_4(unknown) = ^CallSideEffect : ~m? +# 2310| v2310_5(void) = ^IndirectReadSideEffect[-1] : &:r2310_1, ~m? +# 2310| mu2310_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2310_1 +# 2308| r2308_60(glval>) = VariableAddress[(__begin)] : +# 2308| r2308_61(glval) = FunctionAddress[operator++] : +# 2308| r2308_62(iterator &) = Call[operator++] : func:r2308_61, this:r2308_60 +# 2308| v2308_63(void) = ^IndirectReadSideEffect[-1] : &:r2308_60, ~m? +# 2308| mu2308_64(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2308_60 +# 2308| r2308_65(glval) = VariableAddress[s] : +# 2308| r2308_66(glval) = FunctionAddress[~String] : +# 2308| v2308_67(void) = Call[~String] : func:r2308_66, this:r2308_65 +# 2308| mu2308_68(unknown) = ^CallSideEffect : ~m? +# 2308| v2308_69(void) = ^IndirectReadSideEffect[-1] : &:r2308_65, ~m? +# 2308| mu2308_70(String) = ^IndirectMayWriteSideEffect[-1] : &:r2308_65 +# 2308| r2308_71(glval>) = CopyValue : r2308_62 #-----| Goto (back edge) -> Block 4 -# 2307| Block 6 -# 2307| r2307_72(glval>) = CopyValue : r2307_2 -# 2307| r2307_73(glval) = FunctionAddress[~vector] : -# 2307| v2307_74(void) = Call[~vector] : func:r2307_73, this:r2307_72 -# 2307| mu2307_75(unknown) = ^CallSideEffect : ~m? -# 2307| v2307_76(void) = ^IndirectReadSideEffect[-1] : &:r2307_72, ~m? -# 2307| mu2307_77(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2307_72 -# 2311| r2311_1(glval) = VariableAddress[s] : -# 2311| mu2311_2(String) = Uninitialized[s] : &:r2311_1 -# 2311| r2311_3(glval) = FunctionAddress[String] : -# 2311| r2311_4(glval) = StringConstant["hello"] : -# 2311| r2311_5(char *) = Convert : r2311_4 -# 2311| v2311_6(void) = Call[String] : func:r2311_3, this:r2311_1, 0:r2311_5 -# 2311| mu2311_7(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_8(void) = ^BufferReadSideEffect[0] : &:r2311_5, ~m? -# 2311| mu2311_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_1 -# 2311| r2311_10(glval) = VariableAddress[s2] : -# 2311| mu2311_11(String) = Uninitialized[s2] : &:r2311_10 -# 2311| r2311_12(glval) = FunctionAddress[String] : -# 2311| r2311_13(glval) = StringConstant["world"] : -# 2311| r2311_14(char *) = Convert : r2311_13 -# 2311| v2311_15(void) = Call[String] : func:r2311_12, this:r2311_10, 0:r2311_14 -# 2311| mu2311_16(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_17(void) = ^BufferReadSideEffect[0] : &:r2311_14, ~m? -# 2311| mu2311_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_10 +# 2308| Block 6 +# 2308| r2308_72(glval>) = CopyValue : r2308_2 +# 2308| r2308_73(glval) = FunctionAddress[~vector] : +# 2308| v2308_74(void) = Call[~vector] : func:r2308_73, this:r2308_72 +# 2308| mu2308_75(unknown) = ^CallSideEffect : ~m? +# 2308| v2308_76(void) = ^IndirectReadSideEffect[-1] : &:r2308_72, ~m? +# 2308| mu2308_77(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2308_72 +# 2312| r2312_1(glval) = VariableAddress[s] : +# 2312| mu2312_2(String) = Uninitialized[s] : &:r2312_1 +# 2312| r2312_3(glval) = FunctionAddress[String] : +# 2312| r2312_4(glval) = StringConstant["hello"] : +# 2312| r2312_5(char *) = Convert : r2312_4 +# 2312| v2312_6(void) = Call[String] : func:r2312_3, this:r2312_1, 0:r2312_5 +# 2312| mu2312_7(unknown) = ^CallSideEffect : ~m? +# 2312| v2312_8(void) = ^BufferReadSideEffect[0] : &:r2312_5, ~m? +# 2312| mu2312_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_1 +# 2312| r2312_10(glval) = VariableAddress[s2] : +# 2312| mu2312_11(String) = Uninitialized[s2] : &:r2312_10 +# 2312| r2312_12(glval) = FunctionAddress[String] : +# 2312| r2312_13(glval) = StringConstant["world"] : +# 2312| r2312_14(char *) = Convert : r2312_13 +# 2312| v2312_15(void) = Call[String] : func:r2312_12, this:r2312_10, 0:r2312_14 +# 2312| mu2312_16(unknown) = ^CallSideEffect : ~m? +# 2312| v2312_17(void) = ^BufferReadSideEffect[0] : &:r2312_14, ~m? +# 2312| mu2312_18(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_10 #-----| Goto -> Block 7 -# 2311| Block 7 -# 2311| r2311_19(glval) = VariableAddress[c] : -# 2311| r2311_20(char) = Load[c] : &:r2311_19, ~m? -# 2311| r2311_21(int) = Convert : r2311_20 -# 2311| r2311_22(int) = Constant[0] : -# 2311| r2311_23(bool) = CompareNE : r2311_21, r2311_22 -# 2311| v2311_24(void) = ConditionalBranch : r2311_23 +# 2312| Block 7 +# 2312| r2312_19(glval) = VariableAddress[c] : +# 2312| r2312_20(char) = Load[c] : &:r2312_19, ~m? +# 2312| r2312_21(int) = Convert : r2312_20 +# 2312| r2312_22(int) = Constant[0] : +# 2312| r2312_23(bool) = CompareNE : r2312_21, r2312_22 +# 2312| v2312_24(void) = ConditionalBranch : r2312_23 #-----| False -> Block 9 #-----| True -> Block 8 -# 2312| Block 8 -# 2312| r2312_1(char) = Constant[0] : -# 2312| r2312_2(glval) = VariableAddress[c] : -# 2312| mu2312_3(char) = Store[c] : &:r2312_2, r2312_1 -# 2311| r2311_25(glval) = VariableAddress[s] : -# 2311| r2311_26(glval) = FunctionAddress[pop_back] : -# 2311| r2311_27(char) = Call[pop_back] : func:r2311_26, this:r2311_25 -# 2311| mu2311_28(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_29(void) = ^IndirectReadSideEffect[-1] : &:r2311_25, ~m? -# 2311| mu2311_30(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_25 -# 2311| r2311_31(glval) = VariableAddress[c] : -# 2311| mu2311_32(char) = Store[c] : &:r2311_31, r2311_27 +# 2313| Block 8 +# 2313| r2313_1(char) = Constant[0] : +# 2313| r2313_2(glval) = VariableAddress[c] : +# 2313| mu2313_3(char) = Store[c] : &:r2313_2, r2313_1 +# 2312| r2312_25(glval) = VariableAddress[s] : +# 2312| r2312_26(glval) = FunctionAddress[pop_back] : +# 2312| r2312_27(char) = Call[pop_back] : func:r2312_26, this:r2312_25 +# 2312| mu2312_28(unknown) = ^CallSideEffect : ~m? +# 2312| v2312_29(void) = ^IndirectReadSideEffect[-1] : &:r2312_25, ~m? +# 2312| mu2312_30(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_25 +# 2312| r2312_31(glval) = VariableAddress[c] : +# 2312| mu2312_32(char) = Store[c] : &:r2312_31, r2312_27 #-----| Goto (back edge) -> Block 7 -# 2311| Block 9 -# 2311| r2311_33(glval) = VariableAddress[s2] : -# 2311| r2311_34(glval) = FunctionAddress[~String] : -# 2311| v2311_35(void) = Call[~String] : func:r2311_34, this:r2311_33 -# 2311| mu2311_36(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_37(void) = ^IndirectReadSideEffect[-1] : &:r2311_33, ~m? -# 2311| mu2311_38(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_33 -# 2311| r2311_39(glval) = VariableAddress[s] : -# 2311| r2311_40(glval) = FunctionAddress[~String] : -# 2311| v2311_41(void) = Call[~String] : func:r2311_40, this:r2311_39 -# 2311| mu2311_42(unknown) = ^CallSideEffect : ~m? -# 2311| v2311_43(void) = ^IndirectReadSideEffect[-1] : &:r2311_39, ~m? -# 2311| mu2311_44(String) = ^IndirectMayWriteSideEffect[-1] : &:r2311_39 -# 2314| v2314_1(void) = NoOp : -# 2301| v2301_4(void) = ReturnVoid : -# 2301| v2301_5(void) = AliasedUse : ~m? -# 2301| v2301_6(void) = ExitFunction : +# 2312| Block 9 +# 2312| r2312_33(glval) = VariableAddress[s2] : +# 2312| r2312_34(glval) = FunctionAddress[~String] : +# 2312| v2312_35(void) = Call[~String] : func:r2312_34, this:r2312_33 +# 2312| mu2312_36(unknown) = ^CallSideEffect : ~m? +# 2312| v2312_37(void) = ^IndirectReadSideEffect[-1] : &:r2312_33, ~m? +# 2312| mu2312_38(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_33 +# 2312| r2312_39(glval) = VariableAddress[s] : +# 2312| r2312_40(glval) = FunctionAddress[~String] : +# 2312| v2312_41(void) = Call[~String] : func:r2312_40, this:r2312_39 +# 2312| mu2312_42(unknown) = ^CallSideEffect : ~m? +# 2312| v2312_43(void) = ^IndirectReadSideEffect[-1] : &:r2312_39, ~m? +# 2312| mu2312_44(String) = ^IndirectMayWriteSideEffect[-1] : &:r2312_39 +# 2315| v2315_1(void) = NoOp : +# 2302| v2302_4(void) = ReturnVoid : +# 2302| v2302_5(void) = AliasedUse : ~m? +# 2302| v2302_6(void) = ExitFunction : -# 2316| void IfDestructors2(bool) -# 2316| Block 0 -# 2316| v2316_1(void) = EnterFunction : -# 2316| mu2316_2(unknown) = AliasedDefinition : -# 2316| mu2316_3(unknown) = InitializeNonLocal : -# 2316| r2316_4(glval) = VariableAddress[b] : -# 2316| mu2316_5(bool) = InitializeParameter[b] : &:r2316_4 -# 2317| r2317_1(glval) = VariableAddress[s] : -# 2317| mu2317_2(String) = Uninitialized[s] : &:r2317_1 -# 2317| r2317_3(glval) = FunctionAddress[String] : -# 2317| r2317_4(glval) = StringConstant["hello"] : -# 2317| r2317_5(char *) = Convert : r2317_4 -# 2317| v2317_6(void) = Call[String] : func:r2317_3, this:r2317_1, 0:r2317_5 -# 2317| mu2317_7(unknown) = ^CallSideEffect : ~m? -# 2317| v2317_8(void) = ^BufferReadSideEffect[0] : &:r2317_5, ~m? -# 2317| mu2317_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2317_1 -# 2317| r2317_10(glval) = VariableAddress[b] : -# 2317| r2317_11(bool) = Load[b] : &:r2317_10, ~m? -# 2317| v2317_12(void) = ConditionalBranch : r2317_11 +# 2317| void IfDestructors2(bool) +# 2317| Block 0 +# 2317| v2317_1(void) = EnterFunction : +# 2317| mu2317_2(unknown) = AliasedDefinition : +# 2317| mu2317_3(unknown) = InitializeNonLocal : +# 2317| r2317_4(glval) = VariableAddress[b] : +# 2317| mu2317_5(bool) = InitializeParameter[b] : &:r2317_4 +# 2318| r2318_1(glval) = VariableAddress[s] : +# 2318| mu2318_2(String) = Uninitialized[s] : &:r2318_1 +# 2318| r2318_3(glval) = FunctionAddress[String] : +# 2318| r2318_4(glval) = StringConstant["hello"] : +# 2318| r2318_5(char *) = Convert : r2318_4 +# 2318| v2318_6(void) = Call[String] : func:r2318_3, this:r2318_1, 0:r2318_5 +# 2318| mu2318_7(unknown) = ^CallSideEffect : ~m? +# 2318| v2318_8(void) = ^BufferReadSideEffect[0] : &:r2318_5, ~m? +# 2318| mu2318_9(String) = ^IndirectMayWriteSideEffect[-1] : &:r2318_1 +# 2318| r2318_10(glval) = VariableAddress[b] : +# 2318| r2318_11(bool) = Load[b] : &:r2318_10, ~m? +# 2318| v2318_12(void) = ConditionalBranch : r2318_11 #-----| False -> Block 2 #-----| True -> Block 1 -# 2318| Block 1 -# 2318| r2318_1(glval) = VariableAddress[x] : -# 2318| r2318_2(int) = Constant[0] : -# 2318| mu2318_3(int) = Store[x] : &:r2318_1, r2318_2 +# 2319| Block 1 +# 2319| r2319_1(glval) = VariableAddress[x] : +# 2319| r2319_2(int) = Constant[0] : +# 2319| mu2319_3(int) = Store[x] : &:r2319_1, r2319_2 #-----| Goto -> Block 3 -# 2320| Block 2 -# 2320| r2320_1(glval) = VariableAddress[y] : -# 2320| r2320_2(int) = Constant[0] : -# 2320| mu2320_3(int) = Store[y] : &:r2320_1, r2320_2 +# 2321| Block 2 +# 2321| r2321_1(glval) = VariableAddress[y] : +# 2321| r2321_2(int) = Constant[0] : +# 2321| mu2321_3(int) = Store[y] : &:r2321_1, r2321_2 #-----| Goto -> Block 3 -# 2321| Block 3 -# 2321| r2321_1(glval) = VariableAddress[s] : -# 2321| r2321_2(glval) = FunctionAddress[~String] : -# 2321| v2321_3(void) = Call[~String] : func:r2321_2, this:r2321_1 -# 2321| mu2321_4(unknown) = ^CallSideEffect : ~m? -# 2321| v2321_5(void) = ^IndirectReadSideEffect[-1] : &:r2321_1, ~m? -# 2321| mu2321_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2321_1 -# 2322| v2322_1(void) = NoOp : -# 2316| v2316_6(void) = ReturnVoid : -# 2316| v2316_7(void) = AliasedUse : ~m? -# 2316| v2316_8(void) = ExitFunction : +# 2322| Block 3 +# 2322| r2322_1(glval) = VariableAddress[s] : +# 2322| r2322_2(glval) = FunctionAddress[~String] : +# 2322| v2322_3(void) = Call[~String] : func:r2322_2, this:r2322_1 +# 2322| mu2322_4(unknown) = ^CallSideEffect : ~m? +# 2322| v2322_5(void) = ^IndirectReadSideEffect[-1] : &:r2322_1, ~m? +# 2322| mu2322_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2322_1 +# 2323| v2323_1(void) = NoOp : +# 2317| v2317_6(void) = ReturnVoid : +# 2317| v2317_7(void) = AliasedUse : ~m? +# 2317| v2317_8(void) = ExitFunction : -# 2331| void IfDestructors3(bool) -# 2331| Block 0 -# 2331| v2331_1(void) = EnterFunction : -# 2331| mu2331_2(unknown) = AliasedDefinition : -# 2331| mu2331_3(unknown) = InitializeNonLocal : -# 2331| r2331_4(glval) = VariableAddress[b] : -# 2331| mu2331_5(bool) = InitializeParameter[b] : &:r2331_4 -# 2332| r2332_1(glval) = VariableAddress[B] : -# 2332| mu2332_2(Bool) = Uninitialized[B] : &:r2332_1 -# 2332| r2332_3(glval) = FunctionAddress[Bool] : +# 2332| void IfDestructors3(bool) +# 2332| Block 0 +# 2332| v2332_1(void) = EnterFunction : +# 2332| mu2332_2(unknown) = AliasedDefinition : +# 2332| mu2332_3(unknown) = InitializeNonLocal : # 2332| r2332_4(glval) = VariableAddress[b] : -# 2332| r2332_5(bool) = Load[b] : &:r2332_4, ~m? -# 2332| v2332_6(void) = Call[Bool] : func:r2332_3, this:r2332_1, 0:r2332_5 -# 2332| mu2332_7(unknown) = ^CallSideEffect : ~m? -# 2332| mu2332_8(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2332_1 -# 2332| r2332_9(glval) = VariableAddress[B] : -# 2332| r2332_10(glval) = FunctionAddress[operator bool] : -# 2332| r2332_11(bool) = Call[operator bool] : func:r2332_10, this:r2332_9 -# 2332| mu2332_12(unknown) = ^CallSideEffect : ~m? -# 2332| v2332_13(void) = ^IndirectReadSideEffect[-1] : &:r2332_9, ~m? -# 2332| mu2332_14(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2332_9 -# 2332| r2332_15(bool) = CopyValue : r2332_11 -# 2332| v2332_16(void) = ConditionalBranch : r2332_15 +# 2332| mu2332_5(bool) = InitializeParameter[b] : &:r2332_4 +# 2333| r2333_1(glval) = VariableAddress[B] : +# 2333| mu2333_2(Bool) = Uninitialized[B] : &:r2333_1 +# 2333| r2333_3(glval) = FunctionAddress[Bool] : +# 2333| r2333_4(glval) = VariableAddress[b] : +# 2333| r2333_5(bool) = Load[b] : &:r2333_4, ~m? +# 2333| v2333_6(void) = Call[Bool] : func:r2333_3, this:r2333_1, 0:r2333_5 +# 2333| mu2333_7(unknown) = ^CallSideEffect : ~m? +# 2333| mu2333_8(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2333_1 +# 2333| r2333_9(glval) = VariableAddress[B] : +# 2333| r2333_10(glval) = FunctionAddress[operator bool] : +# 2333| r2333_11(bool) = Call[operator bool] : func:r2333_10, this:r2333_9 +# 2333| mu2333_12(unknown) = ^CallSideEffect : ~m? +# 2333| v2333_13(void) = ^IndirectReadSideEffect[-1] : &:r2333_9, ~m? +# 2333| mu2333_14(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2333_9 +# 2333| r2333_15(bool) = CopyValue : r2333_11 +# 2333| v2333_16(void) = ConditionalBranch : r2333_15 #-----| False -> Block 2 #-----| True -> Block 1 -# 2333| Block 1 -# 2333| r2333_1(glval) = VariableAddress[s1] : -# 2333| mu2333_2(String) = Uninitialized[s1] : &:r2333_1 -# 2333| r2333_3(glval) = FunctionAddress[String] : -# 2333| v2333_4(void) = Call[String] : func:r2333_3, this:r2333_1 -# 2333| mu2333_5(unknown) = ^CallSideEffect : ~m? -# 2333| mu2333_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2333_1 +# 2334| Block 1 # 2334| r2334_1(glval) = VariableAddress[s1] : -# 2334| r2334_2(glval) = FunctionAddress[~String] : -# 2334| v2334_3(void) = Call[~String] : func:r2334_2, this:r2334_1 -# 2334| mu2334_4(unknown) = ^CallSideEffect : ~m? -# 2334| v2334_5(void) = ^IndirectReadSideEffect[-1] : &:r2334_1, ~m? +# 2334| mu2334_2(String) = Uninitialized[s1] : &:r2334_1 +# 2334| r2334_3(glval) = FunctionAddress[String] : +# 2334| v2334_4(void) = Call[String] : func:r2334_3, this:r2334_1 +# 2334| mu2334_5(unknown) = ^CallSideEffect : ~m? # 2334| mu2334_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2334_1 -#-----| Goto -> Block 3 - -# 2335| Block 2 -# 2335| r2335_1(glval) = VariableAddress[s2] : -# 2335| mu2335_2(String) = Uninitialized[s2] : &:r2335_1 -# 2335| r2335_3(glval) = FunctionAddress[String] : -# 2335| v2335_4(void) = Call[String] : func:r2335_3, this:r2335_1 -# 2335| mu2335_5(unknown) = ^CallSideEffect : ~m? +# 2335| r2335_1(glval) = VariableAddress[s1] : +# 2335| r2335_2(glval) = FunctionAddress[~String] : +# 2335| v2335_3(void) = Call[~String] : func:r2335_2, this:r2335_1 +# 2335| mu2335_4(unknown) = ^CallSideEffect : ~m? +# 2335| v2335_5(void) = ^IndirectReadSideEffect[-1] : &:r2335_1, ~m? # 2335| mu2335_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2335_1 -# 2336| r2336_1(glval) = VariableAddress[s2] : -# 2336| r2336_2(glval) = FunctionAddress[~String] : -# 2336| v2336_3(void) = Call[~String] : func:r2336_2, this:r2336_1 -# 2336| mu2336_4(unknown) = ^CallSideEffect : ~m? -# 2336| v2336_5(void) = ^IndirectReadSideEffect[-1] : &:r2336_1, ~m? -# 2336| mu2336_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2336_1 #-----| Goto -> Block 3 -# 2336| Block 3 -# 2336| r2336_7(glval) = VariableAddress[B] : -# 2336| r2336_8(glval) = FunctionAddress[~Bool] : -# 2336| v2336_9(void) = Call[~Bool] : func:r2336_8, this:r2336_7 -# 2336| mu2336_10(unknown) = ^CallSideEffect : ~m? -# 2336| v2336_11(void) = ^IndirectReadSideEffect[-1] : &:r2336_7, ~m? -# 2336| mu2336_12(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2336_7 -# 2337| v2337_1(void) = NoOp : -# 2331| v2331_6(void) = ReturnVoid : -# 2331| v2331_7(void) = AliasedUse : ~m? -# 2331| v2331_8(void) = ExitFunction : +# 2336| Block 2 +# 2336| r2336_1(glval) = VariableAddress[s2] : +# 2336| mu2336_2(String) = Uninitialized[s2] : &:r2336_1 +# 2336| r2336_3(glval) = FunctionAddress[String] : +# 2336| v2336_4(void) = Call[String] : func:r2336_3, this:r2336_1 +# 2336| mu2336_5(unknown) = ^CallSideEffect : ~m? +# 2336| mu2336_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2336_1 +# 2337| r2337_1(glval) = VariableAddress[s2] : +# 2337| r2337_2(glval) = FunctionAddress[~String] : +# 2337| v2337_3(void) = Call[~String] : func:r2337_2, this:r2337_1 +# 2337| mu2337_4(unknown) = ^CallSideEffect : ~m? +# 2337| v2337_5(void) = ^IndirectReadSideEffect[-1] : &:r2337_1, ~m? +# 2337| mu2337_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2337_1 +#-----| Goto -> Block 3 -# 2339| void WhileLoopDestructors(bool) -# 2339| Block 0 -# 2339| v2339_1(void) = EnterFunction : -# 2339| mu2339_2(unknown) = AliasedDefinition : -# 2339| mu2339_3(unknown) = InitializeNonLocal : -# 2339| r2339_4(glval) = VariableAddress[b] : -# 2339| mu2339_5(bool) = InitializeParameter[b] : &:r2339_4 -# 2341| r2341_1(glval) = VariableAddress[s] : -# 2341| mu2341_2(String) = Uninitialized[s] : &:r2341_1 -# 2341| r2341_3(glval) = FunctionAddress[String] : -# 2341| v2341_4(void) = Call[String] : func:r2341_3, this:r2341_1 -# 2341| mu2341_5(unknown) = ^CallSideEffect : ~m? -# 2341| mu2341_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2341_1 +# 2337| Block 3 +# 2337| r2337_7(glval) = VariableAddress[B] : +# 2337| r2337_8(glval) = FunctionAddress[~Bool] : +# 2337| v2337_9(void) = Call[~Bool] : func:r2337_8, this:r2337_7 +# 2337| mu2337_10(unknown) = ^CallSideEffect : ~m? +# 2337| v2337_11(void) = ^IndirectReadSideEffect[-1] : &:r2337_7, ~m? +# 2337| mu2337_12(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2337_7 +# 2338| v2338_1(void) = NoOp : +# 2332| v2332_6(void) = ReturnVoid : +# 2332| v2332_7(void) = AliasedUse : ~m? +# 2332| v2332_8(void) = ExitFunction : + +# 2340| void WhileLoopDestructors(bool) +# 2340| Block 0 +# 2340| v2340_1(void) = EnterFunction : +# 2340| mu2340_2(unknown) = AliasedDefinition : +# 2340| mu2340_3(unknown) = InitializeNonLocal : +# 2340| r2340_4(glval) = VariableAddress[b] : +# 2340| mu2340_5(bool) = InitializeParameter[b] : &:r2340_4 +# 2342| r2342_1(glval) = VariableAddress[s] : +# 2342| mu2342_2(String) = Uninitialized[s] : &:r2342_1 +# 2342| r2342_3(glval) = FunctionAddress[String] : +# 2342| v2342_4(void) = Call[String] : func:r2342_3, this:r2342_1 +# 2342| mu2342_5(unknown) = ^CallSideEffect : ~m? +# 2342| mu2342_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2342_1 #-----| Goto -> Block 1 -# 2342| Block 1 -# 2342| r2342_1(glval) = VariableAddress[b] : -# 2342| r2342_2(bool) = Load[b] : &:r2342_1, ~m? -# 2342| v2342_3(void) = ConditionalBranch : r2342_2 +# 2343| Block 1 +# 2343| r2343_1(glval) = VariableAddress[b] : +# 2343| r2343_2(bool) = Load[b] : &:r2343_1, ~m? +# 2343| v2343_3(void) = ConditionalBranch : r2343_2 #-----| False -> Block 3 #-----| True -> Block 2 -# 2343| Block 2 -# 2343| r2343_1(bool) = Constant[0] : -# 2343| r2343_2(glval) = VariableAddress[b] : -# 2343| mu2343_3(bool) = Store[b] : &:r2343_2, r2343_1 +# 2344| Block 2 +# 2344| r2344_1(bool) = Constant[0] : +# 2344| r2344_2(glval) = VariableAddress[b] : +# 2344| mu2344_3(bool) = Store[b] : &:r2344_2, r2344_1 #-----| Goto (back edge) -> Block 1 -# 2345| Block 3 -# 2345| r2345_1(glval) = VariableAddress[s] : -# 2345| r2345_2(glval) = FunctionAddress[~String] : -# 2345| v2345_3(void) = Call[~String] : func:r2345_2, this:r2345_1 -# 2345| mu2345_4(unknown) = ^CallSideEffect : ~m? -# 2345| v2345_5(void) = ^IndirectReadSideEffect[-1] : &:r2345_1, ~m? -# 2345| mu2345_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2345_1 +# 2346| Block 3 +# 2346| r2346_1(glval) = VariableAddress[s] : +# 2346| r2346_2(glval) = FunctionAddress[~String] : +# 2346| v2346_3(void) = Call[~String] : func:r2346_2, this:r2346_1 +# 2346| mu2346_4(unknown) = ^CallSideEffect : ~m? +# 2346| v2346_5(void) = ^IndirectReadSideEffect[-1] : &:r2346_1, ~m? +# 2346| mu2346_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2346_1 #-----| Goto -> Block 4 -# 2348| Block 4 -# 2348| r2348_1(glval) = VariableAddress[B] : -# 2348| mu2348_2(Bool) = Uninitialized[B] : &:r2348_1 -# 2348| r2348_3(glval) = FunctionAddress[Bool] : -# 2348| r2348_4(glval) = VariableAddress[b] : -# 2348| r2348_5(bool) = Load[b] : &:r2348_4, ~m? -# 2348| v2348_6(void) = Call[Bool] : func:r2348_3, this:r2348_1, 0:r2348_5 -# 2348| mu2348_7(unknown) = ^CallSideEffect : ~m? -# 2348| mu2348_8(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2348_1 -# 2348| r2348_9(glval) = VariableAddress[B] : -# 2348| r2348_10(glval) = FunctionAddress[operator bool] : -# 2348| r2348_11(bool) = Call[operator bool] : func:r2348_10, this:r2348_9 -# 2348| mu2348_12(unknown) = ^CallSideEffect : ~m? -# 2348| v2348_13(void) = ^IndirectReadSideEffect[-1] : &:r2348_9, ~m? -# 2348| mu2348_14(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2348_9 -# 2348| r2348_15(bool) = CopyValue : r2348_11 -# 2348| v2348_16(void) = ConditionalBranch : r2348_15 +# 2349| Block 4 +# 2349| r2349_1(glval) = VariableAddress[B] : +# 2349| mu2349_2(Bool) = Uninitialized[B] : &:r2349_1 +# 2349| r2349_3(glval) = FunctionAddress[Bool] : +# 2349| r2349_4(glval) = VariableAddress[b] : +# 2349| r2349_5(bool) = Load[b] : &:r2349_4, ~m? +# 2349| v2349_6(void) = Call[Bool] : func:r2349_3, this:r2349_1, 0:r2349_5 +# 2349| mu2349_7(unknown) = ^CallSideEffect : ~m? +# 2349| mu2349_8(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2349_1 +# 2349| r2349_9(glval) = VariableAddress[B] : +# 2349| r2349_10(glval) = FunctionAddress[operator bool] : +# 2349| r2349_11(bool) = Call[operator bool] : func:r2349_10, this:r2349_9 +# 2349| mu2349_12(unknown) = ^CallSideEffect : ~m? +# 2349| v2349_13(void) = ^IndirectReadSideEffect[-1] : &:r2349_9, ~m? +# 2349| mu2349_14(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2349_9 +# 2349| r2349_15(bool) = CopyValue : r2349_11 +# 2349| v2349_16(void) = ConditionalBranch : r2349_15 #-----| False -> Block 6 #-----| True -> Block 5 -# 2349| Block 5 -# 2349| r2349_1(bool) = Constant[0] : -# 2349| r2349_2(glval) = VariableAddress[b] : -# 2349| mu2349_3(bool) = Store[b] : &:r2349_2, r2349_1 -# 2350| r2350_1(glval) = VariableAddress[B] : -# 2350| r2350_2(glval) = FunctionAddress[~Bool] : -# 2350| v2350_3(void) = Call[~Bool] : func:r2350_2, this:r2350_1 -# 2350| mu2350_4(unknown) = ^CallSideEffect : ~m? -# 2350| v2350_5(void) = ^IndirectReadSideEffect[-1] : &:r2350_1, ~m? -# 2350| mu2350_6(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2350_1 +# 2350| Block 5 +# 2350| r2350_1(bool) = Constant[0] : +# 2350| r2350_2(glval) = VariableAddress[b] : +# 2350| mu2350_3(bool) = Store[b] : &:r2350_2, r2350_1 +# 2351| r2351_1(glval) = VariableAddress[B] : +# 2351| r2351_2(glval) = FunctionAddress[~Bool] : +# 2351| v2351_3(void) = Call[~Bool] : func:r2351_2, this:r2351_1 +# 2351| mu2351_4(unknown) = ^CallSideEffect : ~m? +# 2351| v2351_5(void) = ^IndirectReadSideEffect[-1] : &:r2351_1, ~m? +# 2351| mu2351_6(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2351_1 #-----| Goto (back edge) -> Block 4 -# 2350| Block 6 -# 2350| r2350_7(glval) = VariableAddress[B] : -# 2350| r2350_8(glval) = FunctionAddress[~Bool] : -# 2350| v2350_9(void) = Call[~Bool] : func:r2350_8, this:r2350_7 -# 2350| mu2350_10(unknown) = ^CallSideEffect : ~m? -# 2350| v2350_11(void) = ^IndirectReadSideEffect[-1] : &:r2350_7, ~m? -# 2350| mu2350_12(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2350_7 -# 2352| v2352_1(void) = NoOp : -# 2339| v2339_6(void) = ReturnVoid : -# 2339| v2339_7(void) = AliasedUse : ~m? -# 2339| v2339_8(void) = ExitFunction : +# 2351| Block 6 +# 2351| r2351_7(glval) = VariableAddress[B] : +# 2351| r2351_8(glval) = FunctionAddress[~Bool] : +# 2351| v2351_9(void) = Call[~Bool] : func:r2351_8, this:r2351_7 +# 2351| mu2351_10(unknown) = ^CallSideEffect : ~m? +# 2351| v2351_11(void) = ^IndirectReadSideEffect[-1] : &:r2351_7, ~m? +# 2351| mu2351_12(Bool) = ^IndirectMayWriteSideEffect[-1] : &:r2351_7 +# 2353| v2353_1(void) = NoOp : +# 2340| v2340_6(void) = ReturnVoid : +# 2340| v2340_7(void) = AliasedUse : ~m? +# 2340| v2340_8(void) = ExitFunction : -# 2354| void VoidFunc() -# 2354| Block 0 -# 2354| v2354_1(void) = EnterFunction : -# 2354| mu2354_2(unknown) = AliasedDefinition : -# 2354| mu2354_3(unknown) = InitializeNonLocal : -# 2354| v2354_4(void) = NoOp : -# 2354| v2354_5(void) = ReturnVoid : -# 2354| v2354_6(void) = AliasedUse : ~m? -# 2354| v2354_7(void) = ExitFunction : +# 2355| void VoidFunc() +# 2355| Block 0 +# 2355| v2355_1(void) = EnterFunction : +# 2355| mu2355_2(unknown) = AliasedDefinition : +# 2355| mu2355_3(unknown) = InitializeNonLocal : +# 2355| v2355_4(void) = NoOp : +# 2355| v2355_5(void) = ReturnVoid : +# 2355| v2355_6(void) = AliasedUse : ~m? +# 2355| v2355_7(void) = ExitFunction : -# 2356| void IfReturnDestructors(bool) -# 2356| Block 0 -# 2356| v2356_1(void) = EnterFunction : -# 2356| mu2356_2(unknown) = AliasedDefinition : -# 2356| mu2356_3(unknown) = InitializeNonLocal : -# 2356| r2356_4(glval) = VariableAddress[b] : -# 2356| mu2356_5(bool) = InitializeParameter[b] : &:r2356_4 -# 2357| r2357_1(glval) = VariableAddress[s] : -# 2357| mu2357_2(String) = Uninitialized[s] : &:r2357_1 -# 2357| r2357_3(glval) = FunctionAddress[String] : -# 2357| v2357_4(void) = Call[String] : func:r2357_3, this:r2357_1 -# 2357| mu2357_5(unknown) = ^CallSideEffect : ~m? -# 2357| mu2357_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2357_1 -# 2358| r2358_1(glval) = VariableAddress[b] : -# 2358| r2358_2(bool) = Load[b] : &:r2358_1, ~m? -# 2358| v2358_3(void) = ConditionalBranch : r2358_2 +# 2357| void IfReturnDestructors(bool) +# 2357| Block 0 +# 2357| v2357_1(void) = EnterFunction : +# 2357| mu2357_2(unknown) = AliasedDefinition : +# 2357| mu2357_3(unknown) = InitializeNonLocal : +# 2357| r2357_4(glval) = VariableAddress[b] : +# 2357| mu2357_5(bool) = InitializeParameter[b] : &:r2357_4 +# 2358| r2358_1(glval) = VariableAddress[s] : +# 2358| mu2358_2(String) = Uninitialized[s] : &:r2358_1 +# 2358| r2358_3(glval) = FunctionAddress[String] : +# 2358| v2358_4(void) = Call[String] : func:r2358_3, this:r2358_1 +# 2358| mu2358_5(unknown) = ^CallSideEffect : ~m? +# 2358| mu2358_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2358_1 +# 2359| r2359_1(glval) = VariableAddress[b] : +# 2359| r2359_2(bool) = Load[b] : &:r2359_1, ~m? +# 2359| v2359_3(void) = ConditionalBranch : r2359_2 #-----| False -> Block 3 #-----| True -> Block 2 -# 2356| Block 1 -# 2356| v2356_6(void) = ReturnVoid : -# 2356| v2356_7(void) = AliasedUse : ~m? -# 2356| v2356_8(void) = ExitFunction : +# 2357| Block 1 +# 2357| v2357_6(void) = ReturnVoid : +# 2357| v2357_7(void) = AliasedUse : ~m? +# 2357| v2357_8(void) = ExitFunction : -# 2359| Block 2 -# 2359| v2359_1(void) = NoOp : -# 2365| r2365_1(glval) = VariableAddress[s] : -# 2365| r2365_2(glval) = FunctionAddress[~String] : -# 2365| v2365_3(void) = Call[~String] : func:r2365_2, this:r2365_1 -# 2365| mu2365_4(unknown) = ^CallSideEffect : ~m? -# 2365| v2365_5(void) = ^IndirectReadSideEffect[-1] : &:r2365_1, ~m? -# 2365| mu2365_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2365_1 +# 2360| Block 2 +# 2360| v2360_1(void) = NoOp : +# 2366| r2366_1(glval) = VariableAddress[s] : +# 2366| r2366_2(glval) = FunctionAddress[~String] : +# 2366| v2366_3(void) = Call[~String] : func:r2366_2, this:r2366_1 +# 2366| mu2366_4(unknown) = ^CallSideEffect : ~m? +# 2366| v2366_5(void) = ^IndirectReadSideEffect[-1] : &:r2366_1, ~m? +# 2366| mu2366_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2366_1 #-----| Goto -> Block 1 -# 2361| Block 3 -# 2361| r2361_1(glval) = VariableAddress[b] : -# 2361| r2361_2(bool) = Load[b] : &:r2361_1, ~m? -# 2361| v2361_3(void) = ConditionalBranch : r2361_2 +# 2362| Block 3 +# 2362| r2362_1(glval) = VariableAddress[b] : +# 2362| r2362_2(bool) = Load[b] : &:r2362_1, ~m? +# 2362| v2362_3(void) = ConditionalBranch : r2362_2 #-----| False -> Block 5 #-----| True -> Block 4 -# 2362| Block 4 -# 2362| r2362_1(glval) = FunctionAddress[VoidFunc] : -# 2362| v2362_2(void) = Call[VoidFunc] : func:r2362_1 -# 2362| mu2362_3(unknown) = ^CallSideEffect : ~m? -# 2362| v2362_4(void) = NoOp : -# 2365| r2365_7(glval) = VariableAddress[s] : -# 2365| r2365_8(glval) = FunctionAddress[~String] : -# 2365| v2365_9(void) = Call[~String] : func:r2365_8, this:r2365_7 -# 2365| mu2365_10(unknown) = ^CallSideEffect : ~m? -# 2365| v2365_11(void) = ^IndirectReadSideEffect[-1] : &:r2365_7, ~m? -# 2365| mu2365_12(String) = ^IndirectMayWriteSideEffect[-1] : &:r2365_7 +# 2363| Block 4 +# 2363| r2363_1(glval) = FunctionAddress[VoidFunc] : +# 2363| v2363_2(void) = Call[VoidFunc] : func:r2363_1 +# 2363| mu2363_3(unknown) = ^CallSideEffect : ~m? +# 2363| v2363_4(void) = NoOp : +# 2366| r2366_7(glval) = VariableAddress[s] : +# 2366| r2366_8(glval) = FunctionAddress[~String] : +# 2366| v2366_9(void) = Call[~String] : func:r2366_8, this:r2366_7 +# 2366| mu2366_10(unknown) = ^CallSideEffect : ~m? +# 2366| v2366_11(void) = ^IndirectReadSideEffect[-1] : &:r2366_7, ~m? +# 2366| mu2366_12(String) = ^IndirectMayWriteSideEffect[-1] : &:r2366_7 #-----| Goto -> Block 1 -# 2364| Block 5 -# 2364| r2364_1(glval) = VariableAddress[s] : -# 2365| v2365_13(void) = NoOp : -# 2365| r2365_14(glval) = VariableAddress[s] : -# 2365| r2365_15(glval) = FunctionAddress[~String] : -# 2365| v2365_16(void) = Call[~String] : func:r2365_15, this:r2365_14 -# 2365| mu2365_17(unknown) = ^CallSideEffect : ~m? -# 2365| v2365_18(void) = ^IndirectReadSideEffect[-1] : &:r2365_14, ~m? -# 2365| mu2365_19(String) = ^IndirectMayWriteSideEffect[-1] : &:r2365_14 +# 2365| Block 5 +# 2365| r2365_1(glval) = VariableAddress[s] : +# 2366| v2366_13(void) = NoOp : +# 2366| r2366_14(glval) = VariableAddress[s] : +# 2366| r2366_15(glval) = FunctionAddress[~String] : +# 2366| v2366_16(void) = Call[~String] : func:r2366_15, this:r2366_14 +# 2366| mu2366_17(unknown) = ^CallSideEffect : ~m? +# 2366| v2366_18(void) = ^IndirectReadSideEffect[-1] : &:r2366_14, ~m? +# 2366| mu2366_19(String) = ^IndirectMayWriteSideEffect[-1] : &:r2366_14 #-----| Goto -> Block 1 -# 2367| int IfReturnDestructors3(bool) -# 2367| Block 0 -# 2367| v2367_1(void) = EnterFunction : -# 2367| mu2367_2(unknown) = AliasedDefinition : -# 2367| mu2367_3(unknown) = InitializeNonLocal : -# 2367| r2367_4(glval) = VariableAddress[b] : -# 2367| mu2367_5(bool) = InitializeParameter[b] : &:r2367_4 -# 2368| r2368_1(glval) = VariableAddress[s] : -# 2368| mu2368_2(String) = Uninitialized[s] : &:r2368_1 -# 2368| r2368_3(glval) = FunctionAddress[String] : -# 2368| v2368_4(void) = Call[String] : func:r2368_3, this:r2368_1 -# 2368| mu2368_5(unknown) = ^CallSideEffect : ~m? -# 2368| mu2368_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2368_1 -# 2369| r2369_1(glval) = VariableAddress[b] : -# 2369| r2369_2(bool) = Load[b] : &:r2369_1, ~m? -# 2369| v2369_3(void) = ConditionalBranch : r2369_2 +# 2368| int IfReturnDestructors3(bool) +# 2368| Block 0 +# 2368| v2368_1(void) = EnterFunction : +# 2368| mu2368_2(unknown) = AliasedDefinition : +# 2368| mu2368_3(unknown) = InitializeNonLocal : +# 2368| r2368_4(glval) = VariableAddress[b] : +# 2368| mu2368_5(bool) = InitializeParameter[b] : &:r2368_4 +# 2369| r2369_1(glval) = VariableAddress[s] : +# 2369| mu2369_2(String) = Uninitialized[s] : &:r2369_1 +# 2369| r2369_3(glval) = FunctionAddress[String] : +# 2369| v2369_4(void) = Call[String] : func:r2369_3, this:r2369_1 +# 2369| mu2369_5(unknown) = ^CallSideEffect : ~m? +# 2369| mu2369_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2369_1 +# 2370| r2370_1(glval) = VariableAddress[b] : +# 2370| r2370_2(bool) = Load[b] : &:r2370_1, ~m? +# 2370| v2370_3(void) = ConditionalBranch : r2370_2 #-----| False -> Block 3 #-----| True -> Block 2 -# 2367| Block 1 -# 2367| r2367_6(glval) = VariableAddress[#return] : -# 2367| v2367_7(void) = ReturnValue : &:r2367_6, ~m? -# 2367| v2367_8(void) = AliasedUse : ~m? -# 2367| v2367_9(void) = ExitFunction : +# 2368| Block 1 +# 2368| r2368_6(glval) = VariableAddress[#return] : +# 2368| v2368_7(void) = ReturnValue : &:r2368_6, ~m? +# 2368| v2368_8(void) = AliasedUse : ~m? +# 2368| v2368_9(void) = ExitFunction : -# 2370| Block 2 -# 2370| r2370_1(glval) = VariableAddress[#return] : -# 2370| r2370_2(int) = Constant[1] : -# 2370| mu2370_3(int) = Store[#return] : &:r2370_1, r2370_2 -# 2373| r2373_1(glval) = VariableAddress[s] : -# 2373| r2373_2(glval) = FunctionAddress[~String] : -# 2373| v2373_3(void) = Call[~String] : func:r2373_2, this:r2373_1 -# 2373| mu2373_4(unknown) = ^CallSideEffect : ~m? -# 2373| v2373_5(void) = ^IndirectReadSideEffect[-1] : &:r2373_1, ~m? -# 2373| mu2373_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2373_1 +# 2371| Block 2 +# 2371| r2371_1(glval) = VariableAddress[#return] : +# 2371| r2371_2(int) = Constant[1] : +# 2371| mu2371_3(int) = Store[#return] : &:r2371_1, r2371_2 +# 2374| r2374_1(glval) = VariableAddress[s] : +# 2374| r2374_2(glval) = FunctionAddress[~String] : +# 2374| v2374_3(void) = Call[~String] : func:r2374_2, this:r2374_1 +# 2374| mu2374_4(unknown) = ^CallSideEffect : ~m? +# 2374| v2374_5(void) = ^IndirectReadSideEffect[-1] : &:r2374_1, ~m? +# 2374| mu2374_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2374_1 #-----| Goto -> Block 1 -# 2372| Block 3 -# 2372| r2372_1(glval) = VariableAddress[#return] : -# 2372| r2372_2(int) = Constant[0] : -# 2372| mu2372_3(int) = Store[#return] : &:r2372_1, r2372_2 -# 2373| r2373_7(glval) = VariableAddress[s] : -# 2373| r2373_8(glval) = FunctionAddress[~String] : -# 2373| v2373_9(void) = Call[~String] : func:r2373_8, this:r2373_7 -# 2373| mu2373_10(unknown) = ^CallSideEffect : ~m? -# 2373| v2373_11(void) = ^IndirectReadSideEffect[-1] : &:r2373_7, ~m? -# 2373| mu2373_12(String) = ^IndirectMayWriteSideEffect[-1] : &:r2373_7 +# 2373| Block 3 +# 2373| r2373_1(glval) = VariableAddress[#return] : +# 2373| r2373_2(int) = Constant[0] : +# 2373| mu2373_3(int) = Store[#return] : &:r2373_1, r2373_2 +# 2374| r2374_7(glval) = VariableAddress[s] : +# 2374| r2374_8(glval) = FunctionAddress[~String] : +# 2374| v2374_9(void) = Call[~String] : func:r2374_8, this:r2374_7 +# 2374| mu2374_10(unknown) = ^CallSideEffect : ~m? +# 2374| v2374_11(void) = ^IndirectReadSideEffect[-1] : &:r2374_7, ~m? +# 2374| mu2374_12(String) = ^IndirectMayWriteSideEffect[-1] : &:r2374_7 #-----| Goto -> Block 1 -# 2375| void VoidReturnDestructors() -# 2375| Block 0 -# 2375| v2375_1(void) = EnterFunction : -# 2375| mu2375_2(unknown) = AliasedDefinition : -# 2375| mu2375_3(unknown) = InitializeNonLocal : -# 2376| r2376_1(glval) = VariableAddress[s] : -# 2376| mu2376_2(String) = Uninitialized[s] : &:r2376_1 -# 2376| r2376_3(glval) = FunctionAddress[String] : -# 2376| v2376_4(void) = Call[String] : func:r2376_3, this:r2376_1 -# 2376| mu2376_5(unknown) = ^CallSideEffect : ~m? -# 2376| mu2376_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2376_1 -# 2377| r2377_1(glval) = FunctionAddress[VoidFunc] : -# 2377| v2377_2(void) = Call[VoidFunc] : func:r2377_1 -# 2377| mu2377_3(unknown) = ^CallSideEffect : ~m? -# 2377| v2377_4(void) = NoOp : -# 2378| r2378_1(glval) = VariableAddress[s] : -# 2378| r2378_2(glval) = FunctionAddress[~String] : -# 2378| v2378_3(void) = Call[~String] : func:r2378_2, this:r2378_1 -# 2378| mu2378_4(unknown) = ^CallSideEffect : ~m? -# 2378| v2378_5(void) = ^IndirectReadSideEffect[-1] : &:r2378_1, ~m? -# 2378| mu2378_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2378_1 -# 2375| v2375_4(void) = ReturnVoid : -# 2375| v2375_5(void) = AliasedUse : ~m? -# 2375| v2375_6(void) = ExitFunction : +# 2376| void VoidReturnDestructors() +# 2376| Block 0 +# 2376| v2376_1(void) = EnterFunction : +# 2376| mu2376_2(unknown) = AliasedDefinition : +# 2376| mu2376_3(unknown) = InitializeNonLocal : +# 2377| r2377_1(glval) = VariableAddress[s] : +# 2377| mu2377_2(String) = Uninitialized[s] : &:r2377_1 +# 2377| r2377_3(glval) = FunctionAddress[String] : +# 2377| v2377_4(void) = Call[String] : func:r2377_3, this:r2377_1 +# 2377| mu2377_5(unknown) = ^CallSideEffect : ~m? +# 2377| mu2377_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2377_1 +# 2378| r2378_1(glval) = FunctionAddress[VoidFunc] : +# 2378| v2378_2(void) = Call[VoidFunc] : func:r2378_1 +# 2378| mu2378_3(unknown) = ^CallSideEffect : ~m? +# 2378| v2378_4(void) = NoOp : +# 2379| r2379_1(glval) = VariableAddress[s] : +# 2379| r2379_2(glval) = FunctionAddress[~String] : +# 2379| v2379_3(void) = Call[~String] : func:r2379_2, this:r2379_1 +# 2379| mu2379_4(unknown) = ^CallSideEffect : ~m? +# 2379| v2379_5(void) = ^IndirectReadSideEffect[-1] : &:r2379_1, ~m? +# 2379| mu2379_6(String) = ^IndirectMayWriteSideEffect[-1] : &:r2379_1 +# 2376| v2376_4(void) = ReturnVoid : +# 2376| v2376_5(void) = AliasedUse : ~m? +# 2376| v2376_6(void) = ExitFunction : -# 2388| return_routine_type::VoidToIntMemberFunc return_routine_type::GetVoidToIntFunc() -# 2388| Block 0 -# 2388| v2388_1(void) = EnterFunction : -# 2388| mu2388_2(unknown) = AliasedDefinition : -# 2388| mu2388_3(unknown) = InitializeNonLocal : -# 2390| r2390_1(glval<..:: *>) = VariableAddress[#return] : -# 2390| r2390_2(..()(..)) = FunctionAddress[VoidToInt] : -# 2390| mu2390_3(..:: *) = Store[#return] : &:r2390_1, r2390_2 -# 2388| r2388_4(glval<..:: *>) = VariableAddress[#return] : -# 2388| v2388_5(void) = ReturnValue : &:r2388_4, ~m? -# 2388| v2388_6(void) = AliasedUse : ~m? -# 2388| v2388_7(void) = ExitFunction : +# 2389| return_routine_type::VoidToIntMemberFunc return_routine_type::GetVoidToIntFunc() +# 2389| Block 0 +# 2389| v2389_1(void) = EnterFunction : +# 2389| mu2389_2(unknown) = AliasedDefinition : +# 2389| mu2389_3(unknown) = InitializeNonLocal : +# 2391| r2391_1(glval<..:: *>) = VariableAddress[#return] : +# 2391| r2391_2(..()(..)) = FunctionAddress[VoidToInt] : +# 2391| mu2391_3(..:: *) = Store[#return] : &:r2391_1, r2391_2 +# 2389| r2389_4(glval<..:: *>) = VariableAddress[#return] : +# 2389| v2389_5(void) = ReturnValue : &:r2389_4, ~m? +# 2389| v2389_6(void) = AliasedUse : ~m? +# 2389| v2389_7(void) = ExitFunction : -# 2395| int small_operation_should_not_be_constant_folded() -# 2395| Block 0 -# 2395| v2395_1(void) = EnterFunction : -# 2395| mu2395_2(unknown) = AliasedDefinition : -# 2395| mu2395_3(unknown) = InitializeNonLocal : -# 2396| r2396_1(glval) = VariableAddress[#return] : -# 2396| r2396_2(int) = Constant[1] : -# 2396| r2396_3(int) = Constant[2] : -# 2396| r2396_4(int) = BitXor : r2396_2, r2396_3 -# 2396| mu2396_5(int) = Store[#return] : &:r2396_1, r2396_4 -# 2395| r2395_4(glval) = VariableAddress[#return] : -# 2395| v2395_5(void) = ReturnValue : &:r2395_4, ~m? -# 2395| v2395_6(void) = AliasedUse : ~m? -# 2395| v2395_7(void) = ExitFunction : +# 2396| int small_operation_should_not_be_constant_folded() +# 2396| Block 0 +# 2396| v2396_1(void) = EnterFunction : +# 2396| mu2396_2(unknown) = AliasedDefinition : +# 2396| mu2396_3(unknown) = InitializeNonLocal : +# 2397| r2397_1(glval) = VariableAddress[#return] : +# 2397| r2397_2(int) = Constant[1] : +# 2397| r2397_3(int) = Constant[2] : +# 2397| r2397_4(int) = BitXor : r2397_2, r2397_3 +# 2397| mu2397_5(int) = Store[#return] : &:r2397_1, r2397_4 +# 2396| r2396_4(glval) = VariableAddress[#return] : +# 2396| v2396_5(void) = ReturnValue : &:r2396_4, ~m? +# 2396| v2396_6(void) = AliasedUse : ~m? +# 2396| v2396_7(void) = ExitFunction : -# 2406| int large_operation_should_be_constant_folded() -# 2406| Block 0 -# 2406| v2406_1(void) = EnterFunction : -# 2406| mu2406_2(unknown) = AliasedDefinition : -# 2406| mu2406_3(unknown) = InitializeNonLocal : -# 2407| r2407_1(glval) = VariableAddress[#return] : -# 2407| r2407_2(int) = Constant[0] : -# 2407| mu2407_3(int) = Store[#return] : &:r2407_1, r2407_2 -# 2406| r2406_4(glval) = VariableAddress[#return] : -# 2406| v2406_5(void) = ReturnValue : &:r2406_4, ~m? -# 2406| v2406_6(void) = AliasedUse : ~m? -# 2406| v2406_7(void) = ExitFunction : +# 2407| int large_operation_should_be_constant_folded() +# 2407| Block 0 +# 2407| v2407_1(void) = EnterFunction : +# 2407| mu2407_2(unknown) = AliasedDefinition : +# 2407| mu2407_3(unknown) = InitializeNonLocal : +# 2408| r2408_1(glval) = VariableAddress[#return] : +# 2408| r2408_2(int) = Constant[0] : +# 2408| mu2408_3(int) = Store[#return] : &:r2408_1, r2408_2 +# 2407| r2407_4(glval) = VariableAddress[#return] : +# 2407| v2407_5(void) = ReturnValue : &:r2407_4, ~m? +# 2407| v2407_6(void) = AliasedUse : ~m? +# 2407| v2407_7(void) = ExitFunction : -# 2410| void initialization_with_temp_destructor() -# 2410| Block 0 -# 2410| v2410_1(void) = EnterFunction : -# 2410| mu2410_2(unknown) = AliasedDefinition : -# 2410| mu2410_3(unknown) = InitializeNonLocal : -# 2411| r2411_1(glval) = VariableAddress[x] : -# 2411| r2411_2(glval) = VariableAddress[#temp2411:18] : -# 2411| mu2411_3(ClassWithDestructor) = Uninitialized[#temp2411:18] : &:r2411_2 -# 2411| r2411_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2411| v2411_5(void) = Call[ClassWithDestructor] : func:r2411_4, this:r2411_2 -# 2411| mu2411_6(unknown) = ^CallSideEffect : ~m? -# 2411| mu2411_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2411_2 -# 2411| r2411_8(glval) = FunctionAddress[get_x] : -# 2411| r2411_9(char) = Call[get_x] : func:r2411_8, this:r2411_2 -# 2411| mu2411_10(unknown) = ^CallSideEffect : ~m? -# 2411| v2411_11(void) = ^IndirectReadSideEffect[-1] : &:r2411_2, ~m? -# 2411| mu2411_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2411_2 -# 2411| r2411_13(glval) = CopyValue : r2411_2 -# 2411| r2411_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2411| v2411_15(void) = Call[~ClassWithDestructor] : func:r2411_14, this:r2411_13 -# 2411| mu2411_16(unknown) = ^CallSideEffect : ~m? -# 2411| v2411_17(void) = ^IndirectReadSideEffect[-1] : &:r2411_13, ~m? -# 2411| mu2411_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2411_13 -# 2411| mu2411_19(char) = Store[x] : &:r2411_1, r2411_9 -# 2411| r2411_20(glval) = VariableAddress[x] : -# 2411| r2411_21(char) = Load[x] : &:r2411_20, ~m? -# 2411| r2411_22(char) = Constant[0] : -# 2411| r2411_23(bool) = CompareNE : r2411_21, r2411_22 -# 2411| r2411_24(bool) = CopyValue : r2411_23 -# 2411| v2411_25(void) = ConditionalBranch : r2411_24 +# 2411| void initialization_with_temp_destructor() +# 2411| Block 0 +# 2411| v2411_1(void) = EnterFunction : +# 2411| mu2411_2(unknown) = AliasedDefinition : +# 2411| mu2411_3(unknown) = InitializeNonLocal : +# 2412| r2412_1(glval) = VariableAddress[x] : +# 2412| r2412_2(glval) = VariableAddress[#temp2412:18] : +# 2412| mu2412_3(ClassWithDestructor) = Uninitialized[#temp2412:18] : &:r2412_2 +# 2412| r2412_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2412| v2412_5(void) = Call[ClassWithDestructor] : func:r2412_4, this:r2412_2 +# 2412| mu2412_6(unknown) = ^CallSideEffect : ~m? +# 2412| mu2412_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2412_2 +# 2412| r2412_8(glval) = FunctionAddress[get_x] : +# 2412| r2412_9(char) = Call[get_x] : func:r2412_8, this:r2412_2 +# 2412| mu2412_10(unknown) = ^CallSideEffect : ~m? +# 2412| v2412_11(void) = ^IndirectReadSideEffect[-1] : &:r2412_2, ~m? +# 2412| mu2412_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2412_2 +# 2412| r2412_13(glval) = CopyValue : r2412_2 +# 2412| r2412_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2412| v2412_15(void) = Call[~ClassWithDestructor] : func:r2412_14, this:r2412_13 +# 2412| mu2412_16(unknown) = ^CallSideEffect : ~m? +# 2412| v2412_17(void) = ^IndirectReadSideEffect[-1] : &:r2412_13, ~m? +# 2412| mu2412_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2412_13 +# 2412| mu2412_19(char) = Store[x] : &:r2412_1, r2412_9 +# 2412| r2412_20(glval) = VariableAddress[x] : +# 2412| r2412_21(char) = Load[x] : &:r2412_20, ~m? +# 2412| r2412_22(char) = Constant[0] : +# 2412| r2412_23(bool) = CompareNE : r2412_21, r2412_22 +# 2412| r2412_24(bool) = CopyValue : r2412_23 +# 2412| v2412_25(void) = ConditionalBranch : r2412_24 #-----| False -> Block 2 #-----| True -> Block 1 -# 2412| Block 1 -# 2412| r2412_1(glval) = VariableAddress[x] : -# 2412| r2412_2(char) = Load[x] : &:r2412_1, ~m? -# 2412| r2412_3(char) = Constant[1] : -# 2412| r2412_4(char) = Add : r2412_2, r2412_3 -# 2412| mu2412_5(char) = Store[x] : &:r2412_1, r2412_4 +# 2413| Block 1 +# 2413| r2413_1(glval) = VariableAddress[x] : +# 2413| r2413_2(char) = Load[x] : &:r2413_1, ~m? +# 2413| r2413_3(char) = Constant[1] : +# 2413| r2413_4(char) = Add : r2413_2, r2413_3 +# 2413| mu2413_5(char) = Store[x] : &:r2413_1, r2413_4 #-----| Goto -> Block 2 -# 2414| Block 2 -# 2414| r2414_1(glval) = VariableAddress[x] : -# 2414| r2414_2(glval) = VariableAddress[#temp2414:18] : -# 2414| mu2414_3(ClassWithDestructor) = Uninitialized[#temp2414:18] : &:r2414_2 -# 2414| r2414_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2414| v2414_5(void) = Call[ClassWithDestructor] : func:r2414_4, this:r2414_2 -# 2414| mu2414_6(unknown) = ^CallSideEffect : ~m? -# 2414| mu2414_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2414_2 -# 2414| r2414_8(glval) = FunctionAddress[get_x] : -# 2414| r2414_9(char) = Call[get_x] : func:r2414_8, this:r2414_2 -# 2414| mu2414_10(unknown) = ^CallSideEffect : ~m? -# 2414| v2414_11(void) = ^IndirectReadSideEffect[-1] : &:r2414_2, ~m? -# 2414| mu2414_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2414_2 -# 2414| r2414_13(glval) = CopyValue : r2414_2 -# 2414| r2414_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2414| v2414_15(void) = Call[~ClassWithDestructor] : func:r2414_14, this:r2414_13 -# 2414| mu2414_16(unknown) = ^CallSideEffect : ~m? -# 2414| v2414_17(void) = ^IndirectReadSideEffect[-1] : &:r2414_13, ~m? -# 2414| mu2414_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2414_13 -# 2414| mu2414_19(char) = Store[x] : &:r2414_1, r2414_9 -# 2414| r2414_20(glval) = VariableAddress[x] : -# 2414| r2414_21(char) = Load[x] : &:r2414_20, ~m? -# 2414| r2414_22(char) = Constant[0] : -# 2414| r2414_23(bool) = CompareNE : r2414_21, r2414_22 -# 2414| v2414_24(void) = ConditionalBranch : r2414_23 +# 2415| Block 2 +# 2415| r2415_1(glval) = VariableAddress[x] : +# 2415| r2415_2(glval) = VariableAddress[#temp2415:18] : +# 2415| mu2415_3(ClassWithDestructor) = Uninitialized[#temp2415:18] : &:r2415_2 +# 2415| r2415_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2415| v2415_5(void) = Call[ClassWithDestructor] : func:r2415_4, this:r2415_2 +# 2415| mu2415_6(unknown) = ^CallSideEffect : ~m? +# 2415| mu2415_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2415_2 +# 2415| r2415_8(glval) = FunctionAddress[get_x] : +# 2415| r2415_9(char) = Call[get_x] : func:r2415_8, this:r2415_2 +# 2415| mu2415_10(unknown) = ^CallSideEffect : ~m? +# 2415| v2415_11(void) = ^IndirectReadSideEffect[-1] : &:r2415_2, ~m? +# 2415| mu2415_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2415_2 +# 2415| r2415_13(glval) = CopyValue : r2415_2 +# 2415| r2415_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2415| v2415_15(void) = Call[~ClassWithDestructor] : func:r2415_14, this:r2415_13 +# 2415| mu2415_16(unknown) = ^CallSideEffect : ~m? +# 2415| v2415_17(void) = ^IndirectReadSideEffect[-1] : &:r2415_13, ~m? +# 2415| mu2415_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2415_13 +# 2415| mu2415_19(char) = Store[x] : &:r2415_1, r2415_9 +# 2415| r2415_20(glval) = VariableAddress[x] : +# 2415| r2415_21(char) = Load[x] : &:r2415_20, ~m? +# 2415| r2415_22(char) = Constant[0] : +# 2415| r2415_23(bool) = CompareNE : r2415_21, r2415_22 +# 2415| v2415_24(void) = ConditionalBranch : r2415_23 #-----| False -> Block 4 #-----| True -> Block 3 -# 2415| Block 3 -# 2415| r2415_1(glval) = VariableAddress[x] : -# 2415| r2415_2(char) = Load[x] : &:r2415_1, ~m? -# 2415| r2415_3(char) = Constant[1] : -# 2415| r2415_4(char) = Add : r2415_2, r2415_3 -# 2415| mu2415_5(char) = Store[x] : &:r2415_1, r2415_4 +# 2416| Block 3 +# 2416| r2416_1(glval) = VariableAddress[x] : +# 2416| r2416_2(char) = Load[x] : &:r2416_1, ~m? +# 2416| r2416_3(char) = Constant[1] : +# 2416| r2416_4(char) = Add : r2416_2, r2416_3 +# 2416| mu2416_5(char) = Store[x] : &:r2416_1, r2416_4 #-----| Goto -> Block 4 -# 2417| Block 4 -# 2417| r2417_1(glval) = VariableAddress[x] : -# 2417| r2417_2(glval) = VariableAddress[#temp2417:28] : -# 2417| mu2417_3(ClassWithDestructor) = Uninitialized[#temp2417:28] : &:r2417_2 -# 2417| r2417_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2417| v2417_5(void) = Call[ClassWithDestructor] : func:r2417_4, this:r2417_2 -# 2417| mu2417_6(unknown) = ^CallSideEffect : ~m? -# 2417| mu2417_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2417_2 -# 2417| r2417_8(glval) = FunctionAddress[get_x] : -# 2417| r2417_9(char) = Call[get_x] : func:r2417_8, this:r2417_2 -# 2417| mu2417_10(unknown) = ^CallSideEffect : ~m? -# 2417| v2417_11(void) = ^IndirectReadSideEffect[-1] : &:r2417_2, ~m? -# 2417| mu2417_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2417_2 -# 2417| r2417_13(glval) = CopyValue : r2417_2 -# 2417| r2417_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2417| v2417_15(void) = Call[~ClassWithDestructor] : func:r2417_14, this:r2417_13 -# 2417| mu2417_16(unknown) = ^CallSideEffect : ~m? -# 2417| v2417_17(void) = ^IndirectReadSideEffect[-1] : &:r2417_13, ~m? -# 2417| mu2417_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2417_13 -# 2417| mu2417_19(char) = Store[x] : &:r2417_1, r2417_9 -# 2417| r2417_20(bool) = Constant[1] : -# 2417| v2417_21(void) = ConditionalBranch : r2417_20 +# 2418| Block 4 +# 2418| r2418_1(glval) = VariableAddress[x] : +# 2418| r2418_2(glval) = VariableAddress[#temp2418:28] : +# 2418| mu2418_3(ClassWithDestructor) = Uninitialized[#temp2418:28] : &:r2418_2 +# 2418| r2418_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2418| v2418_5(void) = Call[ClassWithDestructor] : func:r2418_4, this:r2418_2 +# 2418| mu2418_6(unknown) = ^CallSideEffect : ~m? +# 2418| mu2418_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2418_2 +# 2418| r2418_8(glval) = FunctionAddress[get_x] : +# 2418| r2418_9(char) = Call[get_x] : func:r2418_8, this:r2418_2 +# 2418| mu2418_10(unknown) = ^CallSideEffect : ~m? +# 2418| v2418_11(void) = ^IndirectReadSideEffect[-1] : &:r2418_2, ~m? +# 2418| mu2418_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2418_2 +# 2418| r2418_13(glval) = CopyValue : r2418_2 +# 2418| r2418_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2418| v2418_15(void) = Call[~ClassWithDestructor] : func:r2418_14, this:r2418_13 +# 2418| mu2418_16(unknown) = ^CallSideEffect : ~m? +# 2418| v2418_17(void) = ^IndirectReadSideEffect[-1] : &:r2418_13, ~m? +# 2418| mu2418_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2418_13 +# 2418| mu2418_19(char) = Store[x] : &:r2418_1, r2418_9 +# 2418| r2418_20(bool) = Constant[1] : +# 2418| v2418_21(void) = ConditionalBranch : r2418_20 #-----| False -> Block 6 #-----| True -> Block 5 -# 2418| Block 5 -# 2418| r2418_1(glval) = VariableAddress[x] : -# 2418| r2418_2(char) = Load[x] : &:r2418_1, ~m? -# 2418| r2418_3(char) = Constant[1] : -# 2418| r2418_4(char) = Add : r2418_2, r2418_3 -# 2418| mu2418_5(char) = Store[x] : &:r2418_1, r2418_4 +# 2419| Block 5 +# 2419| r2419_1(glval) = VariableAddress[x] : +# 2419| r2419_2(char) = Load[x] : &:r2419_1, ~m? +# 2419| r2419_3(char) = Constant[1] : +# 2419| r2419_4(char) = Add : r2419_2, r2419_3 +# 2419| mu2419_5(char) = Store[x] : &:r2419_1, r2419_4 #-----| Goto -> Block 6 -# 2420| Block 6 -# 2420| r2420_1(glval) = VariableAddress[x] : -# 2420| r2420_2(glval) = VariableAddress[#temp2420:21] : -# 2420| mu2420_3(ClassWithDestructor) = Uninitialized[#temp2420:21] : &:r2420_2 -# 2420| r2420_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2420| v2420_5(void) = Call[ClassWithDestructor] : func:r2420_4, this:r2420_2 -# 2420| mu2420_6(unknown) = ^CallSideEffect : ~m? -# 2420| mu2420_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2420_2 -# 2420| r2420_8(glval) = FunctionAddress[get_x] : -# 2420| r2420_9(char) = Call[get_x] : func:r2420_8, this:r2420_2 -# 2420| mu2420_10(unknown) = ^CallSideEffect : ~m? -# 2420| v2420_11(void) = ^IndirectReadSideEffect[-1] : &:r2420_2, ~m? -# 2420| mu2420_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2420_2 -# 2420| r2420_13(glval) = CopyValue : r2420_2 -# 2420| r2420_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2420| v2420_15(void) = Call[~ClassWithDestructor] : func:r2420_14, this:r2420_13 -# 2420| mu2420_16(unknown) = ^CallSideEffect : ~m? -# 2420| v2420_17(void) = ^IndirectReadSideEffect[-1] : &:r2420_13, ~m? -# 2420| mu2420_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2420_13 -# 2420| mu2420_19(char) = Store[x] : &:r2420_1, r2420_9 -# 2420| r2420_20(glval) = VariableAddress[x] : -# 2420| r2420_21(char) = Load[x] : &:r2420_20, ~m? -# 2420| r2420_22(int) = Convert : r2420_21 -# 2420| r2420_23(int) = CopyValue : r2420_22 -# 2420| v2420_24(void) = Switch : r2420_23 +# 2421| Block 6 +# 2421| r2421_1(glval) = VariableAddress[x] : +# 2421| r2421_2(glval) = VariableAddress[#temp2421:21] : +# 2421| mu2421_3(ClassWithDestructor) = Uninitialized[#temp2421:21] : &:r2421_2 +# 2421| r2421_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2421| v2421_5(void) = Call[ClassWithDestructor] : func:r2421_4, this:r2421_2 +# 2421| mu2421_6(unknown) = ^CallSideEffect : ~m? +# 2421| mu2421_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2421_2 +# 2421| r2421_8(glval) = FunctionAddress[get_x] : +# 2421| r2421_9(char) = Call[get_x] : func:r2421_8, this:r2421_2 +# 2421| mu2421_10(unknown) = ^CallSideEffect : ~m? +# 2421| v2421_11(void) = ^IndirectReadSideEffect[-1] : &:r2421_2, ~m? +# 2421| mu2421_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2421_2 +# 2421| r2421_13(glval) = CopyValue : r2421_2 +# 2421| r2421_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2421| v2421_15(void) = Call[~ClassWithDestructor] : func:r2421_14, this:r2421_13 +# 2421| mu2421_16(unknown) = ^CallSideEffect : ~m? +# 2421| v2421_17(void) = ^IndirectReadSideEffect[-1] : &:r2421_13, ~m? +# 2421| mu2421_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2421_13 +# 2421| mu2421_19(char) = Store[x] : &:r2421_1, r2421_9 +# 2421| r2421_20(glval) = VariableAddress[x] : +# 2421| r2421_21(char) = Load[x] : &:r2421_20, ~m? +# 2421| r2421_22(int) = Convert : r2421_21 +# 2421| r2421_23(int) = CopyValue : r2421_22 +# 2421| v2421_24(void) = Switch : r2421_23 #-----| Case[97] -> Block 7 #-----| Default -> Block 8 -# 2421| Block 7 -# 2421| v2421_1(void) = NoOp : -# 2422| r2422_1(glval) = VariableAddress[x] : -# 2422| r2422_2(char) = Load[x] : &:r2422_1, ~m? -# 2422| r2422_3(char) = Constant[1] : -# 2422| r2422_4(char) = Add : r2422_2, r2422_3 -# 2422| mu2422_5(char) = Store[x] : &:r2422_1, r2422_4 +# 2422| Block 7 +# 2422| v2422_1(void) = NoOp : +# 2423| r2423_1(glval) = VariableAddress[x] : +# 2423| r2423_2(char) = Load[x] : &:r2423_1, ~m? +# 2423| r2423_3(char) = Constant[1] : +# 2423| r2423_4(char) = Add : r2423_2, r2423_3 +# 2423| mu2423_5(char) = Store[x] : &:r2423_1, r2423_4 #-----| Goto -> Block 8 -# 2425| Block 8 -# 2425| r2425_1(glval) = VariableAddress[x] : -# 2425| r2425_2(glval) = VariableAddress[#temp2425:21] : -# 2425| mu2425_3(ClassWithDestructor) = Uninitialized[#temp2425:21] : &:r2425_2 -# 2425| r2425_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2425| v2425_5(void) = Call[ClassWithDestructor] : func:r2425_4, this:r2425_2 -# 2425| mu2425_6(unknown) = ^CallSideEffect : ~m? -# 2425| mu2425_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2425_2 -# 2425| r2425_8(glval) = FunctionAddress[get_x] : -# 2425| r2425_9(char) = Call[get_x] : func:r2425_8, this:r2425_2 -# 2425| mu2425_10(unknown) = ^CallSideEffect : ~m? -# 2425| v2425_11(void) = ^IndirectReadSideEffect[-1] : &:r2425_2, ~m? -# 2425| mu2425_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2425_2 -# 2425| r2425_13(glval) = CopyValue : r2425_2 -# 2425| r2425_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2425| v2425_15(void) = Call[~ClassWithDestructor] : func:r2425_14, this:r2425_13 -# 2425| mu2425_16(unknown) = ^CallSideEffect : ~m? -# 2425| v2425_17(void) = ^IndirectReadSideEffect[-1] : &:r2425_13, ~m? -# 2425| mu2425_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2425_13 -# 2425| mu2425_19(char) = Store[x] : &:r2425_1, r2425_9 -# 2425| r2425_20(glval) = VariableAddress[x] : -# 2425| r2425_21(char) = Load[x] : &:r2425_20, ~m? -# 2425| r2425_22(int) = Convert : r2425_21 -# 2425| v2425_23(void) = Switch : r2425_22 +# 2426| Block 8 +# 2426| r2426_1(glval) = VariableAddress[x] : +# 2426| r2426_2(glval) = VariableAddress[#temp2426:21] : +# 2426| mu2426_3(ClassWithDestructor) = Uninitialized[#temp2426:21] : &:r2426_2 +# 2426| r2426_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2426| v2426_5(void) = Call[ClassWithDestructor] : func:r2426_4, this:r2426_2 +# 2426| mu2426_6(unknown) = ^CallSideEffect : ~m? +# 2426| mu2426_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2426_2 +# 2426| r2426_8(glval) = FunctionAddress[get_x] : +# 2426| r2426_9(char) = Call[get_x] : func:r2426_8, this:r2426_2 +# 2426| mu2426_10(unknown) = ^CallSideEffect : ~m? +# 2426| v2426_11(void) = ^IndirectReadSideEffect[-1] : &:r2426_2, ~m? +# 2426| mu2426_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2426_2 +# 2426| r2426_13(glval) = CopyValue : r2426_2 +# 2426| r2426_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2426| v2426_15(void) = Call[~ClassWithDestructor] : func:r2426_14, this:r2426_13 +# 2426| mu2426_16(unknown) = ^CallSideEffect : ~m? +# 2426| v2426_17(void) = ^IndirectReadSideEffect[-1] : &:r2426_13, ~m? +# 2426| mu2426_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2426_13 +# 2426| mu2426_19(char) = Store[x] : &:r2426_1, r2426_9 +# 2426| r2426_20(glval) = VariableAddress[x] : +# 2426| r2426_21(char) = Load[x] : &:r2426_20, ~m? +# 2426| r2426_22(int) = Convert : r2426_21 +# 2426| v2426_23(void) = Switch : r2426_22 #-----| Case[97] -> Block 9 #-----| Default -> Block 10 -# 2426| Block 9 -# 2426| v2426_1(void) = NoOp : -# 2427| r2427_1(glval) = VariableAddress[x] : -# 2427| r2427_2(char) = Load[x] : &:r2427_1, ~m? -# 2427| r2427_3(char) = Constant[1] : -# 2427| r2427_4(char) = Add : r2427_2, r2427_3 -# 2427| mu2427_5(char) = Store[x] : &:r2427_1, r2427_4 +# 2427| Block 9 +# 2427| v2427_1(void) = NoOp : +# 2428| r2428_1(glval) = VariableAddress[x] : +# 2428| r2428_2(char) = Load[x] : &:r2428_1, ~m? +# 2428| r2428_3(char) = Constant[1] : +# 2428| r2428_4(char) = Add : r2428_2, r2428_3 +# 2428| mu2428_5(char) = Store[x] : &:r2428_1, r2428_4 #-----| Goto -> Block 10 -# 2430| Block 10 -# 2430| r2430_1(glval) = VariableAddress[x] : -# 2430| r2430_2(glval) = VariableAddress[#temp2430:18] : -# 2430| mu2430_3(ClassWithDestructor) = Uninitialized[#temp2430:18] : &:r2430_2 -# 2430| r2430_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2430| v2430_5(void) = Call[ClassWithDestructor] : func:r2430_4, this:r2430_2 -# 2430| mu2430_6(unknown) = ^CallSideEffect : ~m? -# 2430| mu2430_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2430_2 -# 2430| r2430_8(glval) = FunctionAddress[get_x] : -# 2430| r2430_9(char) = Call[get_x] : func:r2430_8, this:r2430_2 -# 2430| mu2430_10(unknown) = ^CallSideEffect : ~m? -# 2430| v2430_11(void) = ^IndirectReadSideEffect[-1] : &:r2430_2, ~m? -# 2430| mu2430_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2430_2 -# 2430| r2430_13(glval) = CopyValue : r2430_2 -# 2430| r2430_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2430| v2430_15(void) = Call[~ClassWithDestructor] : func:r2430_14, this:r2430_13 -# 2430| mu2430_16(unknown) = ^CallSideEffect : ~m? -# 2430| v2430_17(void) = ^IndirectReadSideEffect[-1] : &:r2430_13, ~m? -# 2430| mu2430_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2430_13 -# 2430| mu2430_19(char) = Store[x] : &:r2430_1, r2430_9 -# 2430| r2430_20(glval &&>) = VariableAddress[(__range)] : -# 2430| r2430_21(glval>) = VariableAddress[#temp2430:58] : -# 2430| mu2430_22(vector) = Uninitialized[#temp2430:58] : &:r2430_21 -# 2430| r2430_23(glval) = FunctionAddress[vector] : -# 2430| r2430_24(glval) = VariableAddress[x] : -# 2430| r2430_25(char) = Load[x] : &:r2430_24, ~m? -# 2430| v2430_26(void) = Call[vector] : func:r2430_23, this:r2430_21, 0:r2430_25 -# 2430| mu2430_27(unknown) = ^CallSideEffect : ~m? -# 2430| mu2430_28(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2430_21 -# 2430| r2430_29(vector &) = CopyValue : r2430_21 -# 2430| mu2430_30(vector &&) = Store[(__range)] : &:r2430_20, r2430_29 -# 2430| r2430_31(glval>) = VariableAddress[(__begin)] : -# 2430| r2430_32(glval &&>) = VariableAddress[(__range)] : -# 2430| r2430_33(vector &&) = Load[(__range)] : &:r2430_32, ~m? -#-----| r0_1(glval>) = CopyValue : r2430_33 +# 2431| Block 10 +# 2431| r2431_1(glval) = VariableAddress[x] : +# 2431| r2431_2(glval) = VariableAddress[#temp2431:18] : +# 2431| mu2431_3(ClassWithDestructor) = Uninitialized[#temp2431:18] : &:r2431_2 +# 2431| r2431_4(glval) = FunctionAddress[ClassWithDestructor] : +# 2431| v2431_5(void) = Call[ClassWithDestructor] : func:r2431_4, this:r2431_2 +# 2431| mu2431_6(unknown) = ^CallSideEffect : ~m? +# 2431| mu2431_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2431_2 +# 2431| r2431_8(glval) = FunctionAddress[get_x] : +# 2431| r2431_9(char) = Call[get_x] : func:r2431_8, this:r2431_2 +# 2431| mu2431_10(unknown) = ^CallSideEffect : ~m? +# 2431| v2431_11(void) = ^IndirectReadSideEffect[-1] : &:r2431_2, ~m? +# 2431| mu2431_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2431_2 +# 2431| r2431_13(glval) = CopyValue : r2431_2 +# 2431| r2431_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2431| v2431_15(void) = Call[~ClassWithDestructor] : func:r2431_14, this:r2431_13 +# 2431| mu2431_16(unknown) = ^CallSideEffect : ~m? +# 2431| v2431_17(void) = ^IndirectReadSideEffect[-1] : &:r2431_13, ~m? +# 2431| mu2431_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2431_13 +# 2431| mu2431_19(char) = Store[x] : &:r2431_1, r2431_9 +# 2431| r2431_20(glval &&>) = VariableAddress[(__range)] : +# 2431| r2431_21(glval>) = VariableAddress[#temp2431:58] : +# 2431| mu2431_22(vector) = Uninitialized[#temp2431:58] : &:r2431_21 +# 2431| r2431_23(glval) = FunctionAddress[vector] : +# 2431| r2431_24(glval) = VariableAddress[x] : +# 2431| r2431_25(char) = Load[x] : &:r2431_24, ~m? +# 2431| v2431_26(void) = Call[vector] : func:r2431_23, this:r2431_21, 0:r2431_25 +# 2431| mu2431_27(unknown) = ^CallSideEffect : ~m? +# 2431| mu2431_28(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2431_21 +# 2431| r2431_29(vector &) = CopyValue : r2431_21 +# 2431| mu2431_30(vector &&) = Store[(__range)] : &:r2431_20, r2431_29 +# 2431| r2431_31(glval>) = VariableAddress[(__begin)] : +# 2431| r2431_32(glval &&>) = VariableAddress[(__range)] : +# 2431| r2431_33(vector &&) = Load[(__range)] : &:r2431_32, ~m? +#-----| r0_1(glval>) = CopyValue : r2431_33 #-----| r0_2(glval>) = Convert : r0_1 -# 2430| r2430_34(glval) = FunctionAddress[begin] : -# 2430| r2430_35(iterator) = Call[begin] : func:r2430_34, this:r0_2 +# 2431| r2431_34(glval) = FunctionAddress[begin] : +# 2431| r2431_35(iterator) = Call[begin] : func:r2431_34, this:r0_2 #-----| v0_3(void) = ^IndirectReadSideEffect[-1] : &:r0_2, ~m? -# 2430| mu2430_36(iterator) = Store[(__begin)] : &:r2430_31, r2430_35 -# 2430| r2430_37(glval>) = VariableAddress[(__end)] : -# 2430| r2430_38(glval &&>) = VariableAddress[(__range)] : -# 2430| r2430_39(vector &&) = Load[(__range)] : &:r2430_38, ~m? -#-----| r0_4(glval>) = CopyValue : r2430_39 +# 2431| mu2431_36(iterator) = Store[(__begin)] : &:r2431_31, r2431_35 +# 2431| r2431_37(glval>) = VariableAddress[(__end)] : +# 2431| r2431_38(glval &&>) = VariableAddress[(__range)] : +# 2431| r2431_39(vector &&) = Load[(__range)] : &:r2431_38, ~m? +#-----| r0_4(glval>) = CopyValue : r2431_39 #-----| r0_5(glval>) = Convert : r0_4 -# 2430| r2430_40(glval) = FunctionAddress[end] : -# 2430| r2430_41(iterator) = Call[end] : func:r2430_40, this:r0_5 +# 2431| r2431_40(glval) = FunctionAddress[end] : +# 2431| r2431_41(iterator) = Call[end] : func:r2431_40, this:r0_5 #-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m? -# 2430| mu2430_42(iterator) = Store[(__end)] : &:r2430_37, r2430_41 +# 2431| mu2431_42(iterator) = Store[(__end)] : &:r2431_37, r2431_41 #-----| Goto -> Block 11 -# 2430| Block 11 -# 2430| r2430_43(glval>) = VariableAddress[(__begin)] : -#-----| r0_7(glval>) = Convert : r2430_43 -# 2430| r2430_44(glval) = FunctionAddress[operator!=] : +# 2431| Block 11 +# 2431| r2431_43(glval>) = VariableAddress[(__begin)] : +#-----| r0_7(glval>) = Convert : r2431_43 +# 2431| r2431_44(glval) = FunctionAddress[operator!=] : #-----| r0_8(glval>) = VariableAddress[#temp0:0] : #-----| mu0_9(iterator) = Uninitialized[#temp0:0] : &:r0_8 -# 2430| r2430_45(glval) = FunctionAddress[iterator] : -# 2430| r2430_46(glval>) = VariableAddress[(__end)] : -#-----| r0_10(glval>) = Convert : r2430_46 +# 2431| r2431_45(glval) = FunctionAddress[iterator] : +# 2431| r2431_46(glval>) = VariableAddress[(__end)] : +#-----| r0_10(glval>) = Convert : r2431_46 #-----| r0_11(iterator &) = CopyValue : r0_10 -# 2430| v2430_47(void) = Call[iterator] : func:r2430_45, this:r0_8, 0:r0_11 -# 2430| mu2430_48(unknown) = ^CallSideEffect : ~m? +# 2431| v2431_47(void) = Call[iterator] : func:r2431_45, this:r0_8, 0:r0_11 +# 2431| mu2431_48(unknown) = ^CallSideEffect : ~m? #-----| v0_12(void) = ^BufferReadSideEffect[0] : &:r0_11, ~m? -# 2430| mu2430_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 +# 2431| mu2431_49(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r0_8 #-----| r0_13(iterator) = Load[#temp0:0] : &:r0_8, ~m? -# 2430| r2430_50(bool) = Call[operator!=] : func:r2430_44, this:r0_7, 0:r0_13 +# 2431| r2431_50(bool) = Call[operator!=] : func:r2431_44, this:r0_7, 0:r0_13 #-----| v0_14(void) = ^IndirectReadSideEffect[-1] : &:r0_7, ~m? -# 2430| v2430_51(void) = ConditionalBranch : r2430_50 +# 2431| v2431_51(void) = ConditionalBranch : r2431_50 #-----| False -> Block 13 #-----| True -> Block 12 -# 2430| Block 12 -# 2430| r2430_52(glval) = VariableAddress[y] : -# 2430| r2430_53(glval>) = VariableAddress[(__begin)] : -#-----| r0_15(glval>) = Convert : r2430_53 -# 2430| r2430_54(glval) = FunctionAddress[operator*] : -# 2430| r2430_55(char &) = Call[operator*] : func:r2430_54, this:r0_15 +# 2431| Block 12 +# 2431| r2431_52(glval) = VariableAddress[y] : +# 2431| r2431_53(glval>) = VariableAddress[(__begin)] : +#-----| r0_15(glval>) = Convert : r2431_53 +# 2431| r2431_54(glval) = FunctionAddress[operator*] : +# 2431| r2431_55(char &) = Call[operator*] : func:r2431_54, this:r0_15 #-----| v0_16(void) = ^IndirectReadSideEffect[-1] : &:r0_15, ~m? -# 2430| r2430_56(char) = Load[?] : &:r2430_55, ~m? -# 2430| mu2430_57(char) = Store[y] : &:r2430_52, r2430_56 -# 2431| r2431_1(glval) = VariableAddress[x] : -# 2431| r2431_2(char) = Load[x] : &:r2431_1, ~m? -# 2431| r2431_3(int) = Convert : r2431_2 -# 2431| r2431_4(glval) = VariableAddress[y] : -# 2431| r2431_5(char) = Load[y] : &:r2431_4, ~m? -# 2431| r2431_6(int) = Convert : r2431_5 -# 2431| r2431_7(int) = Add : r2431_6, r2431_3 -# 2431| r2431_8(char) = Convert : r2431_7 -# 2431| mu2431_9(char) = Store[y] : &:r2431_4, r2431_8 -# 2430| r2430_58(glval>) = VariableAddress[(__begin)] : -# 2430| r2430_59(glval) = FunctionAddress[operator++] : -# 2430| r2430_60(iterator &) = Call[operator++] : func:r2430_59, this:r2430_58 -# 2430| v2430_61(void) = ^IndirectReadSideEffect[-1] : &:r2430_58, ~m? -# 2430| mu2430_62(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2430_58 -# 2430| r2430_63(glval>) = CopyValue : r2430_60 +# 2431| r2431_56(char) = Load[?] : &:r2431_55, ~m? +# 2431| mu2431_57(char) = Store[y] : &:r2431_52, r2431_56 +# 2432| r2432_1(glval) = VariableAddress[x] : +# 2432| r2432_2(char) = Load[x] : &:r2432_1, ~m? +# 2432| r2432_3(int) = Convert : r2432_2 +# 2432| r2432_4(glval) = VariableAddress[y] : +# 2432| r2432_5(char) = Load[y] : &:r2432_4, ~m? +# 2432| r2432_6(int) = Convert : r2432_5 +# 2432| r2432_7(int) = Add : r2432_6, r2432_3 +# 2432| r2432_8(char) = Convert : r2432_7 +# 2432| mu2432_9(char) = Store[y] : &:r2432_4, r2432_8 +# 2431| r2431_58(glval>) = VariableAddress[(__begin)] : +# 2431| r2431_59(glval) = FunctionAddress[operator++] : +# 2431| r2431_60(iterator &) = Call[operator++] : func:r2431_59, this:r2431_58 +# 2431| v2431_61(void) = ^IndirectReadSideEffect[-1] : &:r2431_58, ~m? +# 2431| mu2431_62(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2431_58 +# 2431| r2431_63(glval>) = CopyValue : r2431_60 #-----| Goto (back edge) -> Block 11 -# 2430| Block 13 -# 2430| r2430_64(glval>) = CopyValue : r2430_21 -# 2430| r2430_65(glval) = FunctionAddress[~vector] : -# 2430| v2430_66(void) = Call[~vector] : func:r2430_65, this:r2430_64 -# 2430| mu2430_67(unknown) = ^CallSideEffect : ~m? -# 2430| v2430_68(void) = ^IndirectReadSideEffect[-1] : &:r2430_64, ~m? -# 2430| mu2430_69(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2430_64 -# 2432| v2432_1(void) = NoOp : -# 2410| v2410_4(void) = ReturnVoid : -# 2410| v2410_5(void) = AliasedUse : ~m? -# 2410| v2410_6(void) = ExitFunction : +# 2431| Block 13 +# 2431| r2431_64(glval>) = CopyValue : r2431_21 +# 2431| r2431_65(glval) = FunctionAddress[~vector] : +# 2431| v2431_66(void) = Call[~vector] : func:r2431_65, this:r2431_64 +# 2431| mu2431_67(unknown) = ^CallSideEffect : ~m? +# 2431| v2431_68(void) = ^IndirectReadSideEffect[-1] : &:r2431_64, ~m? +# 2431| mu2431_69(vector) = ^IndirectMayWriteSideEffect[-1] : &:r2431_64 +# 2433| v2433_1(void) = NoOp : +# 2411| v2411_4(void) = ReturnVoid : +# 2411| v2411_5(void) = AliasedUse : ~m? +# 2411| v2411_6(void) = ExitFunction : -# 2434| void param_with_destructor_by_value(ClassWithDestructor) -# 2434| Block 0 -# 2434| v2434_1(void) = EnterFunction : -# 2434| mu2434_2(unknown) = AliasedDefinition : -# 2434| mu2434_3(unknown) = InitializeNonLocal : -# 2434| r2434_4(glval) = VariableAddress[c] : -# 2434| mu2434_5(ClassWithDestructor) = InitializeParameter[c] : &:r2434_4 -# 2436| v2436_1(void) = NoOp : -# 2434| v2434_6(void) = ReturnVoid : -# 2434| v2434_7(void) = AliasedUse : ~m? -# 2434| v2434_8(void) = ExitFunction : +# 2435| void param_with_destructor_by_value(ClassWithDestructor) +# 2435| Block 0 +# 2435| v2435_1(void) = EnterFunction : +# 2435| mu2435_2(unknown) = AliasedDefinition : +# 2435| mu2435_3(unknown) = InitializeNonLocal : +# 2435| r2435_4(glval) = VariableAddress[c] : +# 2435| mu2435_5(ClassWithDestructor) = InitializeParameter[c] : &:r2435_4 +# 2437| v2437_1(void) = NoOp : +# 2435| v2435_6(void) = ReturnVoid : +# 2435| v2435_7(void) = AliasedUse : ~m? +# 2435| v2435_8(void) = ExitFunction : -# 2438| void param_with_destructor_by_pointer(ClassWithDestructor*) -# 2438| Block 0 -# 2438| v2438_1(void) = EnterFunction : -# 2438| mu2438_2(unknown) = AliasedDefinition : -# 2438| mu2438_3(unknown) = InitializeNonLocal : -# 2438| r2438_4(glval) = VariableAddress[c] : -# 2438| mu2438_5(ClassWithDestructor *) = InitializeParameter[c] : &:r2438_4 -# 2438| r2438_6(ClassWithDestructor *) = Load[c] : &:r2438_4, ~m? -# 2438| mu2438_7(unknown) = InitializeIndirection[c] : &:r2438_6 -# 2440| v2440_1(void) = NoOp : -# 2438| v2438_8(void) = ReturnIndirection[c] : &:r2438_6, ~m? -# 2438| v2438_9(void) = ReturnVoid : -# 2438| v2438_10(void) = AliasedUse : ~m? -# 2438| v2438_11(void) = ExitFunction : +# 2439| void param_with_destructor_by_pointer(ClassWithDestructor*) +# 2439| Block 0 +# 2439| v2439_1(void) = EnterFunction : +# 2439| mu2439_2(unknown) = AliasedDefinition : +# 2439| mu2439_3(unknown) = InitializeNonLocal : +# 2439| r2439_4(glval) = VariableAddress[c] : +# 2439| mu2439_5(ClassWithDestructor *) = InitializeParameter[c] : &:r2439_4 +# 2439| r2439_6(ClassWithDestructor *) = Load[c] : &:r2439_4, ~m? +# 2439| mu2439_7(unknown) = InitializeIndirection[c] : &:r2439_6 +# 2441| v2441_1(void) = NoOp : +# 2439| v2439_8(void) = ReturnIndirection[c] : &:r2439_6, ~m? +# 2439| v2439_9(void) = ReturnVoid : +# 2439| v2439_10(void) = AliasedUse : ~m? +# 2439| v2439_11(void) = ExitFunction : -# 2442| void param_with_destructor_by_ref(ClassWithDestructor&) -# 2442| Block 0 -# 2442| v2442_1(void) = EnterFunction : -# 2442| mu2442_2(unknown) = AliasedDefinition : -# 2442| mu2442_3(unknown) = InitializeNonLocal : -# 2442| r2442_4(glval) = VariableAddress[c] : -# 2442| mu2442_5(ClassWithDestructor &) = InitializeParameter[c] : &:r2442_4 -# 2442| r2442_6(ClassWithDestructor &) = Load[c] : &:r2442_4, ~m? -# 2442| mu2442_7(unknown) = InitializeIndirection[c] : &:r2442_6 -# 2444| v2444_1(void) = NoOp : -# 2442| v2442_8(void) = ReturnIndirection[c] : &:r2442_6, ~m? -# 2442| v2442_9(void) = ReturnVoid : -# 2442| v2442_10(void) = AliasedUse : ~m? -# 2442| v2442_11(void) = ExitFunction : +# 2443| void param_with_destructor_by_ref(ClassWithDestructor&) +# 2443| Block 0 +# 2443| v2443_1(void) = EnterFunction : +# 2443| mu2443_2(unknown) = AliasedDefinition : +# 2443| mu2443_3(unknown) = InitializeNonLocal : +# 2443| r2443_4(glval) = VariableAddress[c] : +# 2443| mu2443_5(ClassWithDestructor &) = InitializeParameter[c] : &:r2443_4 +# 2443| r2443_6(ClassWithDestructor &) = Load[c] : &:r2443_4, ~m? +# 2443| mu2443_7(unknown) = InitializeIndirection[c] : &:r2443_6 +# 2445| v2445_1(void) = NoOp : +# 2443| v2443_8(void) = ReturnIndirection[c] : &:r2443_6, ~m? +# 2443| v2443_9(void) = ReturnVoid : +# 2443| v2443_10(void) = AliasedUse : ~m? +# 2443| v2443_11(void) = ExitFunction : -# 2446| void param_with_destructor_by_rref(ClassWithDestructor&&) -# 2446| Block 0 -# 2446| v2446_1(void) = EnterFunction : -# 2446| mu2446_2(unknown) = AliasedDefinition : -# 2446| mu2446_3(unknown) = InitializeNonLocal : -# 2446| r2446_4(glval) = VariableAddress[c] : -# 2446| mu2446_5(ClassWithDestructor &&) = InitializeParameter[c] : &:r2446_4 -# 2446| r2446_6(ClassWithDestructor &&) = Load[c] : &:r2446_4, ~m? -# 2446| mu2446_7(unknown) = InitializeIndirection[c] : &:r2446_6 -# 2448| v2448_1(void) = NoOp : -# 2446| v2446_8(void) = ReturnIndirection[c] : &:r2446_6, ~m? -# 2446| v2446_9(void) = ReturnVoid : -# 2446| v2446_10(void) = AliasedUse : ~m? -# 2446| v2446_11(void) = ExitFunction : +# 2447| void param_with_destructor_by_rref(ClassWithDestructor&&) +# 2447| Block 0 +# 2447| v2447_1(void) = EnterFunction : +# 2447| mu2447_2(unknown) = AliasedDefinition : +# 2447| mu2447_3(unknown) = InitializeNonLocal : +# 2447| r2447_4(glval) = VariableAddress[c] : +# 2447| mu2447_5(ClassWithDestructor &&) = InitializeParameter[c] : &:r2447_4 +# 2447| r2447_6(ClassWithDestructor &&) = Load[c] : &:r2447_4, ~m? +# 2447| mu2447_7(unknown) = InitializeIndirection[c] : &:r2447_6 +# 2449| v2449_1(void) = NoOp : +# 2447| v2447_8(void) = ReturnIndirection[c] : &:r2447_6, ~m? +# 2447| v2447_9(void) = ReturnVoid : +# 2447| v2447_10(void) = AliasedUse : ~m? +# 2447| v2447_11(void) = ExitFunction : -# 2450| void rethrow_with_destruction(int) -# 2450| Block 0 -# 2450| v2450_1(void) = EnterFunction : -# 2450| mu2450_2(unknown) = AliasedDefinition : -# 2450| mu2450_3(unknown) = InitializeNonLocal : -# 2450| r2450_4(glval) = VariableAddress[x] : -# 2450| mu2450_5(int) = InitializeParameter[x] : &:r2450_4 -# 2451| r2451_1(glval) = VariableAddress[c] : -# 2451| mu2451_2(ClassWithDestructor) = Uninitialized[c] : &:r2451_1 -# 2451| r2451_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2451| v2451_4(void) = Call[ClassWithDestructor] : func:r2451_3, this:r2451_1 -# 2451| mu2451_5(unknown) = ^CallSideEffect : ~m? -# 2451| mu2451_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2451_1 -# 2452| v2452_1(void) = ReThrow : -# 2453| r2453_1(glval) = VariableAddress[c] : -# 2453| r2453_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2453| v2453_3(void) = Call[~ClassWithDestructor] : func:r2453_2, this:r2453_1 -# 2453| mu2453_4(unknown) = ^CallSideEffect : ~m? -# 2453| v2453_5(void) = ^IndirectReadSideEffect[-1] : &:r2453_1, ~m? -# 2453| mu2453_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2453_1 +# 2451| void rethrow_with_destruction(int) +# 2451| Block 0 +# 2451| v2451_1(void) = EnterFunction : +# 2451| mu2451_2(unknown) = AliasedDefinition : +# 2451| mu2451_3(unknown) = InitializeNonLocal : +# 2451| r2451_4(glval) = VariableAddress[x] : +# 2451| mu2451_5(int) = InitializeParameter[x] : &:r2451_4 +# 2452| r2452_1(glval) = VariableAddress[c] : +# 2452| mu2452_2(ClassWithDestructor) = Uninitialized[c] : &:r2452_1 +# 2452| r2452_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2452| v2452_4(void) = Call[ClassWithDestructor] : func:r2452_3, this:r2452_1 +# 2452| mu2452_5(unknown) = ^CallSideEffect : ~m? +# 2452| mu2452_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2452_1 +# 2453| v2453_1(void) = ReThrow : +# 2454| r2454_1(glval) = VariableAddress[c] : +# 2454| r2454_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2454| v2454_3(void) = Call[~ClassWithDestructor] : func:r2454_2, this:r2454_1 +# 2454| mu2454_4(unknown) = ^CallSideEffect : ~m? +# 2454| v2454_5(void) = ^IndirectReadSideEffect[-1] : &:r2454_1, ~m? +# 2454| mu2454_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2454_1 #-----| Exception -> Block 3 -# 2450| Block 1 -# 2450| v2450_6(void) = AliasedUse : ~m? -# 2450| v2450_7(void) = ExitFunction : +# 2451| Block 1 +# 2451| v2451_6(void) = AliasedUse : ~m? +# 2451| v2451_7(void) = ExitFunction : -# 2450| Block 2 -# 2450| v2450_8(void) = ReturnVoid : +# 2451| Block 2 +# 2451| v2451_8(void) = ReturnVoid : #-----| Goto -> Block 1 -# 2450| Block 3 -# 2450| v2450_9(void) = Unwind : +# 2451| Block 3 +# 2451| v2451_9(void) = Unwind : #-----| Goto -> Block 1 -# 2459| void new_with_destructor(ClassWithDestructor) -# 2459| Block 0 -# 2459| v2459_1(void) = EnterFunction : -# 2459| mu2459_2(unknown) = AliasedDefinition : -# 2459| mu2459_3(unknown) = InitializeNonLocal : -# 2459| r2459_4(glval) = VariableAddress[a] : -# 2459| mu2459_5(ClassWithDestructor) = InitializeParameter[a] : &:r2459_4 -# 2461| r2461_1(glval) = VariableAddress[b] : -# 2461| r2461_2(glval) = FunctionAddress[operator new] : -# 2461| r2461_3(unsigned long) = Constant[1] : -# 2461| r2461_4(void *) = Call[operator new] : func:r2461_2, 0:r2461_3 -# 2461| mu2461_5(unknown) = ^CallSideEffect : ~m? -# 2461| mu2461_6(unknown) = ^InitializeDynamicAllocation : &:r2461_4 -# 2461| r2461_7(ByValueConstructor *) = Convert : r2461_4 -# 2461| r2461_8(glval) = FunctionAddress[ByValueConstructor] : -# 2461| r2461_9(glval) = VariableAddress[#temp2461:52] : -# 2461| r2461_10(glval) = VariableAddress[a] : -# 2461| r2461_11(ClassWithDestructor) = Load[a] : &:r2461_10, ~m? -# 2461| mu2461_12(ClassWithDestructor) = Store[#temp2461:52] : &:r2461_9, r2461_11 -# 2461| r2461_13(ClassWithDestructor) = Load[#temp2461:52] : &:r2461_9, ~m? -# 2461| v2461_14(void) = Call[ByValueConstructor] : func:r2461_8, this:r2461_7, 0:r2461_13 -# 2461| mu2461_15(unknown) = ^CallSideEffect : ~m? -# 2461| mu2461_16(ByValueConstructor) = ^IndirectMayWriteSideEffect[-1] : &:r2461_7 -# 2461| r2461_17(glval) = CopyValue : r2461_9 -# 2461| r2461_18(glval) = FunctionAddress[~ClassWithDestructor] : -# 2461| v2461_19(void) = Call[~ClassWithDestructor] : func:r2461_18, this:r2461_17 -# 2461| mu2461_20(unknown) = ^CallSideEffect : ~m? -# 2461| v2461_21(void) = ^IndirectReadSideEffect[-1] : &:r2461_17, ~m? -# 2461| mu2461_22(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2461_17 -# 2461| mu2461_23(ByValueConstructor *) = Store[b] : &:r2461_1, r2461_7 -# 2462| v2462_1(void) = NoOp : -# 2459| v2459_6(void) = ReturnVoid : -# 2459| v2459_7(void) = AliasedUse : ~m? -# 2459| v2459_8(void) = ExitFunction : +# 2460| void new_with_destructor(ClassWithDestructor) +# 2460| Block 0 +# 2460| v2460_1(void) = EnterFunction : +# 2460| mu2460_2(unknown) = AliasedDefinition : +# 2460| mu2460_3(unknown) = InitializeNonLocal : +# 2460| r2460_4(glval) = VariableAddress[a] : +# 2460| mu2460_5(ClassWithDestructor) = InitializeParameter[a] : &:r2460_4 +# 2462| r2462_1(glval) = VariableAddress[b] : +# 2462| r2462_2(glval) = FunctionAddress[operator new] : +# 2462| r2462_3(unsigned long) = Constant[1] : +# 2462| r2462_4(void *) = Call[operator new] : func:r2462_2, 0:r2462_3 +# 2462| mu2462_5(unknown) = ^CallSideEffect : ~m? +# 2462| mu2462_6(unknown) = ^InitializeDynamicAllocation : &:r2462_4 +# 2462| r2462_7(ByValueConstructor *) = Convert : r2462_4 +# 2462| r2462_8(glval) = FunctionAddress[ByValueConstructor] : +# 2462| r2462_9(glval) = VariableAddress[#temp2462:52] : +# 2462| r2462_10(glval) = VariableAddress[a] : +# 2462| r2462_11(ClassWithDestructor) = Load[a] : &:r2462_10, ~m? +# 2462| mu2462_12(ClassWithDestructor) = Store[#temp2462:52] : &:r2462_9, r2462_11 +# 2462| r2462_13(ClassWithDestructor) = Load[#temp2462:52] : &:r2462_9, ~m? +# 2462| v2462_14(void) = Call[ByValueConstructor] : func:r2462_8, this:r2462_7, 0:r2462_13 +# 2462| mu2462_15(unknown) = ^CallSideEffect : ~m? +# 2462| mu2462_16(ByValueConstructor) = ^IndirectMayWriteSideEffect[-1] : &:r2462_7 +# 2462| r2462_17(glval) = CopyValue : r2462_9 +# 2462| r2462_18(glval) = FunctionAddress[~ClassWithDestructor] : +# 2462| v2462_19(void) = Call[~ClassWithDestructor] : func:r2462_18, this:r2462_17 +# 2462| mu2462_20(unknown) = ^CallSideEffect : ~m? +# 2462| v2462_21(void) = ^IndirectReadSideEffect[-1] : &:r2462_17, ~m? +# 2462| mu2462_22(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2462_17 +# 2462| mu2462_23(ByValueConstructor *) = Store[b] : &:r2462_1, r2462_7 +# 2463| v2463_1(void) = NoOp : +# 2460| v2460_6(void) = ReturnVoid : +# 2460| v2460_7(void) = AliasedUse : ~m? +# 2460| v2460_8(void) = ExitFunction : -# 2478| void rvalue_conversion_with_destructor::test() -# 2478| Block 0 -# 2478| v2478_1(void) = EnterFunction : -# 2478| mu2478_2(unknown) = AliasedDefinition : -# 2478| mu2478_3(unknown) = InitializeNonLocal : -# 2480| r2480_1(glval) = VariableAddress[a] : -# 2480| r2480_2(glval) = VariableAddress[#temp2480:18] : -# 2480| r2480_3(glval) = FunctionAddress[get] : -# 2480| r2480_4(B) = Call[get] : func:r2480_3 -# 2480| mu2480_5(unknown) = ^CallSideEffect : ~m? -# 2480| mu2480_6(B) = Store[#temp2480:18] : &:r2480_2, r2480_4 -# 2480| r2480_7(glval) = Convert : r2480_2 -# 2480| r2480_8(glval) = FunctionAddress[operator->] : -# 2480| r2480_9(A *) = Call[operator->] : func:r2480_8, this:r2480_7 -# 2480| mu2480_10(unknown) = ^CallSideEffect : ~m? -# 2480| v2480_11(void) = ^IndirectReadSideEffect[-1] : &:r2480_7, ~m? -# 2480| r2480_12(glval) = FieldAddress[a] : r2480_9 -# 2480| r2480_13(glval) = CopyValue : r2480_2 -# 2480| r2480_14(glval) = FunctionAddress[~B] : -# 2480| v2480_15(void) = Call[~B] : func:r2480_14, this:r2480_13 -# 2480| mu2480_16(unknown) = ^CallSideEffect : ~m? -# 2480| v2480_17(void) = ^IndirectReadSideEffect[-1] : &:r2480_13, ~m? -# 2480| mu2480_18(B) = ^IndirectMayWriteSideEffect[-1] : &:r2480_13 -# 2480| r2480_19(unsigned int) = Load[?] : &:r2480_12, ~m? -# 2480| mu2480_20(unsigned int) = Store[a] : &:r2480_1, r2480_19 -# 2481| v2481_1(void) = NoOp : -# 2478| v2478_4(void) = ReturnVoid : -# 2478| v2478_5(void) = AliasedUse : ~m? -# 2478| v2478_6(void) = ExitFunction : +# 2479| void rvalue_conversion_with_destructor::test() +# 2479| Block 0 +# 2479| v2479_1(void) = EnterFunction : +# 2479| mu2479_2(unknown) = AliasedDefinition : +# 2479| mu2479_3(unknown) = InitializeNonLocal : +# 2481| r2481_1(glval) = VariableAddress[a] : +# 2481| r2481_2(glval) = VariableAddress[#temp2481:18] : +# 2481| r2481_3(glval) = FunctionAddress[get] : +# 2481| r2481_4(B) = Call[get] : func:r2481_3 +# 2481| mu2481_5(unknown) = ^CallSideEffect : ~m? +# 2481| mu2481_6(B) = Store[#temp2481:18] : &:r2481_2, r2481_4 +# 2481| r2481_7(glval) = Convert : r2481_2 +# 2481| r2481_8(glval) = FunctionAddress[operator->] : +# 2481| r2481_9(A *) = Call[operator->] : func:r2481_8, this:r2481_7 +# 2481| mu2481_10(unknown) = ^CallSideEffect : ~m? +# 2481| v2481_11(void) = ^IndirectReadSideEffect[-1] : &:r2481_7, ~m? +# 2481| r2481_12(glval) = FieldAddress[a] : r2481_9 +# 2481| r2481_13(glval) = CopyValue : r2481_2 +# 2481| r2481_14(glval) = FunctionAddress[~B] : +# 2481| v2481_15(void) = Call[~B] : func:r2481_14, this:r2481_13 +# 2481| mu2481_16(unknown) = ^CallSideEffect : ~m? +# 2481| v2481_17(void) = ^IndirectReadSideEffect[-1] : &:r2481_13, ~m? +# 2481| mu2481_18(B) = ^IndirectMayWriteSideEffect[-1] : &:r2481_13 +# 2481| r2481_19(unsigned int) = Load[?] : &:r2481_12, ~m? +# 2481| mu2481_20(unsigned int) = Store[a] : &:r2481_1, r2481_19 +# 2482| v2482_1(void) = NoOp : +# 2479| v2479_4(void) = ReturnVoid : +# 2479| v2479_5(void) = AliasedUse : ~m? +# 2479| v2479_6(void) = ExitFunction : -# 2484| void destructor_without_block(bool) -# 2484| Block 0 -# 2484| v2484_1(void) = EnterFunction : -# 2484| mu2484_2(unknown) = AliasedDefinition : -# 2484| mu2484_3(unknown) = InitializeNonLocal : -# 2484| r2484_4(glval) = VariableAddress[b] : -# 2484| mu2484_5(bool) = InitializeParameter[b] : &:r2484_4 -# 2486| r2486_1(glval) = VariableAddress[b] : -# 2486| r2486_2(bool) = Load[b] : &:r2486_1, ~m? -# 2486| v2486_3(void) = ConditionalBranch : r2486_2 +# 2485| void destructor_without_block(bool) +# 2485| Block 0 +# 2485| v2485_1(void) = EnterFunction : +# 2485| mu2485_2(unknown) = AliasedDefinition : +# 2485| mu2485_3(unknown) = InitializeNonLocal : +# 2485| r2485_4(glval) = VariableAddress[b] : +# 2485| mu2485_5(bool) = InitializeParameter[b] : &:r2485_4 +# 2487| r2487_1(glval) = VariableAddress[b] : +# 2487| r2487_2(bool) = Load[b] : &:r2487_1, ~m? +# 2487| v2487_3(void) = ConditionalBranch : r2487_2 #-----| False -> Block 2 #-----| True -> Block 1 -# 2487| Block 1 -# 2487| r2487_1(glval) = VariableAddress[c] : -# 2487| mu2487_2(ClassWithDestructor) = Uninitialized[c] : &:r2487_1 -# 2487| r2487_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2487| v2487_4(void) = Call[ClassWithDestructor] : func:r2487_3, this:r2487_1 -# 2487| mu2487_5(unknown) = ^CallSideEffect : ~m? -# 2487| mu2487_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2487_1 +# 2488| Block 1 +# 2488| r2488_1(glval) = VariableAddress[c] : +# 2488| mu2488_2(ClassWithDestructor) = Uninitialized[c] : &:r2488_1 +# 2488| r2488_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2488| v2488_4(void) = Call[ClassWithDestructor] : func:r2488_3, this:r2488_1 +# 2488| mu2488_5(unknown) = ^CallSideEffect : ~m? +# 2488| mu2488_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2488_1 #-----| r0_1(glval) = VariableAddress[c] : #-----| r0_2(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_3(void) = Call[~ClassWithDestructor] : func:r0_2, this:r0_1 @@ -16284,20 +16284,20 @@ ir.cpp: #-----| mu0_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_1 #-----| Goto -> Block 2 -# 2489| Block 2 -# 2489| r2489_1(glval) = VariableAddress[b] : -# 2489| r2489_2(bool) = Load[b] : &:r2489_1, ~m? -# 2489| v2489_3(void) = ConditionalBranch : r2489_2 +# 2490| Block 2 +# 2490| r2490_1(glval) = VariableAddress[b] : +# 2490| r2490_2(bool) = Load[b] : &:r2490_1, ~m? +# 2490| v2490_3(void) = ConditionalBranch : r2490_2 #-----| False -> Block 4 #-----| True -> Block 3 -# 2490| Block 3 -# 2490| r2490_1(glval) = VariableAddress[d] : -# 2490| mu2490_2(ClassWithDestructor) = Uninitialized[d] : &:r2490_1 -# 2490| r2490_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2490| v2490_4(void) = Call[ClassWithDestructor] : func:r2490_3, this:r2490_1 -# 2490| mu2490_5(unknown) = ^CallSideEffect : ~m? -# 2490| mu2490_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2490_1 +# 2491| Block 3 +# 2491| r2491_1(glval) = VariableAddress[d] : +# 2491| mu2491_2(ClassWithDestructor) = Uninitialized[d] : &:r2491_1 +# 2491| r2491_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2491| v2491_4(void) = Call[ClassWithDestructor] : func:r2491_3, this:r2491_1 +# 2491| mu2491_5(unknown) = ^CallSideEffect : ~m? +# 2491| mu2491_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2491_1 #-----| r0_7(glval) = VariableAddress[d] : #-----| r0_8(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_9(void) = Call[~ClassWithDestructor] : func:r0_8, this:r0_7 @@ -16306,13 +16306,13 @@ ir.cpp: #-----| mu0_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_7 #-----| Goto -> Block 5 -# 2492| Block 4 -# 2492| r2492_1(glval) = VariableAddress[e] : -# 2492| mu2492_2(ClassWithDestructor) = Uninitialized[e] : &:r2492_1 -# 2492| r2492_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2492| v2492_4(void) = Call[ClassWithDestructor] : func:r2492_3, this:r2492_1 -# 2492| mu2492_5(unknown) = ^CallSideEffect : ~m? -# 2492| mu2492_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2492_1 +# 2493| Block 4 +# 2493| r2493_1(glval) = VariableAddress[e] : +# 2493| mu2493_2(ClassWithDestructor) = Uninitialized[e] : &:r2493_1 +# 2493| r2493_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2493| v2493_4(void) = Call[ClassWithDestructor] : func:r2493_3, this:r2493_1 +# 2493| mu2493_5(unknown) = ^CallSideEffect : ~m? +# 2493| mu2493_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2493_1 #-----| r0_13(glval) = VariableAddress[e] : #-----| r0_14(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_15(void) = Call[~ClassWithDestructor] : func:r0_14, this:r0_13 @@ -16321,20 +16321,20 @@ ir.cpp: #-----| mu0_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_13 #-----| Goto -> Block 5 -# 2494| Block 5 -# 2494| r2494_1(glval) = VariableAddress[b] : -# 2494| r2494_2(bool) = Load[b] : &:r2494_1, ~m? -# 2494| v2494_3(void) = ConditionalBranch : r2494_2 +# 2495| Block 5 +# 2495| r2495_1(glval) = VariableAddress[b] : +# 2495| r2495_2(bool) = Load[b] : &:r2495_1, ~m? +# 2495| v2495_3(void) = ConditionalBranch : r2495_2 #-----| False -> Block 7 #-----| True -> Block 6 -# 2495| Block 6 -# 2495| r2495_1(glval) = VariableAddress[f] : -# 2495| mu2495_2(ClassWithDestructor) = Uninitialized[f] : &:r2495_1 -# 2495| r2495_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2495| v2495_4(void) = Call[ClassWithDestructor] : func:r2495_3, this:r2495_1 -# 2495| mu2495_5(unknown) = ^CallSideEffect : ~m? -# 2495| mu2495_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2495_1 +# 2496| Block 6 +# 2496| r2496_1(glval) = VariableAddress[f] : +# 2496| mu2496_2(ClassWithDestructor) = Uninitialized[f] : &:r2496_1 +# 2496| r2496_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2496| v2496_4(void) = Call[ClassWithDestructor] : func:r2496_3, this:r2496_1 +# 2496| mu2496_5(unknown) = ^CallSideEffect : ~m? +# 2496| mu2496_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2496_1 #-----| r0_19(glval) = VariableAddress[f] : #-----| r0_20(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_21(void) = Call[~ClassWithDestructor] : func:r0_20, this:r0_19 @@ -16343,276 +16343,276 @@ ir.cpp: #-----| mu0_24(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_19 #-----| Goto (back edge) -> Block 5 -# 2497| Block 7 -# 2497| r2497_1(glval) = VariableAddress[i] : -# 2497| r2497_2(int) = Constant[0] : -# 2497| mu2497_3(int) = Store[i] : &:r2497_1, r2497_2 +# 2498| Block 7 +# 2498| r2498_1(glval) = VariableAddress[i] : +# 2498| r2498_2(int) = Constant[0] : +# 2498| mu2498_3(int) = Store[i] : &:r2498_1, r2498_2 #-----| Goto -> Block 8 -# 2497| Block 8 -# 2497| r2497_4(glval) = VariableAddress[i] : -# 2497| r2497_5(int) = Load[i] : &:r2497_4, ~m? -# 2497| r2497_6(int) = Constant[42] : -# 2497| r2497_7(bool) = CompareLT : r2497_5, r2497_6 -# 2497| v2497_8(void) = ConditionalBranch : r2497_7 +# 2498| Block 8 +# 2498| r2498_4(glval) = VariableAddress[i] : +# 2498| r2498_5(int) = Load[i] : &:r2498_4, ~m? +# 2498| r2498_6(int) = Constant[42] : +# 2498| r2498_7(bool) = CompareLT : r2498_5, r2498_6 +# 2498| v2498_8(void) = ConditionalBranch : r2498_7 #-----| False -> Block 10 #-----| True -> Block 9 -# 2498| Block 9 -# 2498| r2498_1(glval) = VariableAddress[g] : -# 2498| mu2498_2(ClassWithDestructor) = Uninitialized[g] : &:r2498_1 -# 2498| r2498_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2498| v2498_4(void) = Call[ClassWithDestructor] : func:r2498_3, this:r2498_1 -# 2498| mu2498_5(unknown) = ^CallSideEffect : ~m? -# 2498| mu2498_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2498_1 +# 2499| Block 9 +# 2499| r2499_1(glval) = VariableAddress[g] : +# 2499| mu2499_2(ClassWithDestructor) = Uninitialized[g] : &:r2499_1 +# 2499| r2499_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2499| v2499_4(void) = Call[ClassWithDestructor] : func:r2499_3, this:r2499_1 +# 2499| mu2499_5(unknown) = ^CallSideEffect : ~m? +# 2499| mu2499_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2499_1 #-----| r0_25(glval) = VariableAddress[g] : #-----| r0_26(glval) = FunctionAddress[~ClassWithDestructor] : #-----| v0_27(void) = Call[~ClassWithDestructor] : func:r0_26, this:r0_25 #-----| mu0_28(unknown) = ^CallSideEffect : ~m? #-----| v0_29(void) = ^IndirectReadSideEffect[-1] : &:r0_25, ~m? #-----| mu0_30(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r0_25 -# 2497| r2497_9(glval) = VariableAddress[i] : -# 2497| r2497_10(int) = Load[i] : &:r2497_9, ~m? -# 2497| r2497_11(int) = Constant[1] : -# 2497| r2497_12(int) = Add : r2497_10, r2497_11 -# 2497| mu2497_13(int) = Store[i] : &:r2497_9, r2497_12 +# 2498| r2498_9(glval) = VariableAddress[i] : +# 2498| r2498_10(int) = Load[i] : &:r2498_9, ~m? +# 2498| r2498_11(int) = Constant[1] : +# 2498| r2498_12(int) = Add : r2498_10, r2498_11 +# 2498| mu2498_13(int) = Store[i] : &:r2498_9, r2498_12 #-----| Goto (back edge) -> Block 8 -# 2499| Block 10 -# 2499| v2499_1(void) = NoOp : -# 2484| v2484_6(void) = ReturnVoid : -# 2484| v2484_7(void) = AliasedUse : ~m? -# 2484| v2484_8(void) = ExitFunction : +# 2500| Block 10 +# 2500| v2500_1(void) = NoOp : +# 2485| v2485_6(void) = ReturnVoid : +# 2485| v2485_7(void) = AliasedUse : ~m? +# 2485| v2485_8(void) = ExitFunction : -# 2501| void destruction_in_switch_1(int) -# 2501| Block 0 -# 2501| v2501_1(void) = EnterFunction : -# 2501| mu2501_2(unknown) = AliasedDefinition : -# 2501| mu2501_3(unknown) = InitializeNonLocal : -# 2501| r2501_4(glval) = VariableAddress[c] : -# 2501| mu2501_5(int) = InitializeParameter[c] : &:r2501_4 -# 2502| r2502_1(glval) = VariableAddress[c] : -# 2502| r2502_2(int) = Load[c] : &:r2502_1, ~m? -# 2502| v2502_3(void) = Switch : r2502_2 +# 2502| void destruction_in_switch_1(int) +# 2502| Block 0 +# 2502| v2502_1(void) = EnterFunction : +# 2502| mu2502_2(unknown) = AliasedDefinition : +# 2502| mu2502_3(unknown) = InitializeNonLocal : +# 2502| r2502_4(glval) = VariableAddress[c] : +# 2502| mu2502_5(int) = InitializeParameter[c] : &:r2502_4 +# 2503| r2503_1(glval) = VariableAddress[c] : +# 2503| r2503_2(int) = Load[c] : &:r2503_1, ~m? +# 2503| v2503_3(void) = Switch : r2503_2 #-----| Case[0] -> Block 1 #-----| Default -> Block 3 -# 2503| Block 1 -# 2503| v2503_1(void) = NoOp : -# 2504| r2504_1(glval) = VariableAddress[x] : -# 2504| mu2504_2(ClassWithDestructor) = Uninitialized[x] : &:r2504_1 -# 2504| r2504_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2504| v2504_4(void) = Call[ClassWithDestructor] : func:r2504_3, this:r2504_1 -# 2504| mu2504_5(unknown) = ^CallSideEffect : ~m? -# 2504| mu2504_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2504_1 -# 2506| r2506_1(glval) = VariableAddress[x] : -# 2506| r2506_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2506| v2506_3(void) = Call[~ClassWithDestructor] : func:r2506_2, this:r2506_1 -# 2506| mu2506_4(unknown) = ^CallSideEffect : ~m? -# 2506| v2506_5(void) = ^IndirectReadSideEffect[-1] : &:r2506_1, ~m? -# 2506| mu2506_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2506_1 -# 2505| v2505_1(void) = NoOp : +# 2504| Block 1 +# 2504| v2504_1(void) = NoOp : +# 2505| r2505_1(glval) = VariableAddress[x] : +# 2505| mu2505_2(ClassWithDestructor) = Uninitialized[x] : &:r2505_1 +# 2505| r2505_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2505| v2505_4(void) = Call[ClassWithDestructor] : func:r2505_3, this:r2505_1 +# 2505| mu2505_5(unknown) = ^CallSideEffect : ~m? +# 2505| mu2505_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2505_1 +# 2507| r2507_1(glval) = VariableAddress[x] : +# 2507| r2507_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2507| v2507_3(void) = Call[~ClassWithDestructor] : func:r2507_2, this:r2507_1 +# 2507| mu2507_4(unknown) = ^CallSideEffect : ~m? +# 2507| v2507_5(void) = ^IndirectReadSideEffect[-1] : &:r2507_1, ~m? +# 2507| mu2507_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2507_1 +# 2506| v2506_1(void) = NoOp : #-----| Goto -> Block 3 -# 2506| Block 2 -# 2506| r2506_7(glval) = VariableAddress[x] : -# 2506| r2506_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2506| v2506_9(void) = Call[~ClassWithDestructor] : func:r2506_8, this:r2506_7 -# 2506| mu2506_10(unknown) = ^CallSideEffect : ~m? -# 2506| v2506_11(void) = ^IndirectReadSideEffect[-1] : &:r2506_7, ~m? -# 2506| mu2506_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2506_7 +# 2507| Block 2 +# 2507| r2507_7(glval) = VariableAddress[x] : +# 2507| r2507_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2507| v2507_9(void) = Call[~ClassWithDestructor] : func:r2507_8, this:r2507_7 +# 2507| mu2507_10(unknown) = ^CallSideEffect : ~m? +# 2507| v2507_11(void) = ^IndirectReadSideEffect[-1] : &:r2507_7, ~m? +# 2507| mu2507_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2507_7 #-----| Goto -> Block 3 -# 2507| Block 3 -# 2507| v2507_1(void) = NoOp : +# 2508| Block 3 # 2508| v2508_1(void) = NoOp : -# 2501| v2501_6(void) = ReturnVoid : -# 2501| v2501_7(void) = AliasedUse : ~m? -# 2501| v2501_8(void) = ExitFunction : +# 2509| v2509_1(void) = NoOp : +# 2502| v2502_6(void) = ReturnVoid : +# 2502| v2502_7(void) = AliasedUse : ~m? +# 2502| v2502_8(void) = ExitFunction : -# 2510| void destruction_in_switch_2(int) -# 2510| Block 0 -# 2510| v2510_1(void) = EnterFunction : -# 2510| mu2510_2(unknown) = AliasedDefinition : -# 2510| mu2510_3(unknown) = InitializeNonLocal : -# 2510| r2510_4(glval) = VariableAddress[c] : -# 2510| mu2510_5(int) = InitializeParameter[c] : &:r2510_4 -# 2511| r2511_1(glval) = VariableAddress[y] : -# 2511| mu2511_2(ClassWithDestructor) = Uninitialized[y] : &:r2511_1 -# 2511| r2511_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2511| v2511_4(void) = Call[ClassWithDestructor] : func:r2511_3, this:r2511_1 -# 2511| mu2511_5(unknown) = ^CallSideEffect : ~m? -# 2511| mu2511_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2511_1 -# 2511| r2511_7(glval) = VariableAddress[c] : -# 2511| r2511_8(int) = Load[c] : &:r2511_7, ~m? -# 2511| v2511_9(void) = Switch : r2511_8 +# 2511| void destruction_in_switch_2(int) +# 2511| Block 0 +# 2511| v2511_1(void) = EnterFunction : +# 2511| mu2511_2(unknown) = AliasedDefinition : +# 2511| mu2511_3(unknown) = InitializeNonLocal : +# 2511| r2511_4(glval) = VariableAddress[c] : +# 2511| mu2511_5(int) = InitializeParameter[c] : &:r2511_4 +# 2512| r2512_1(glval) = VariableAddress[y] : +# 2512| mu2512_2(ClassWithDestructor) = Uninitialized[y] : &:r2512_1 +# 2512| r2512_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2512| v2512_4(void) = Call[ClassWithDestructor] : func:r2512_3, this:r2512_1 +# 2512| mu2512_5(unknown) = ^CallSideEffect : ~m? +# 2512| mu2512_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2512_1 +# 2512| r2512_7(glval) = VariableAddress[c] : +# 2512| r2512_8(int) = Load[c] : &:r2512_7, ~m? +# 2512| v2512_9(void) = Switch : r2512_8 #-----| Case[0] -> Block 1 #-----| Default -> Block 2 -# 2512| Block 1 -# 2512| v2512_1(void) = NoOp : -# 2518| r2518_1(glval) = VariableAddress[y] : -# 2518| r2518_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2518| v2518_3(void) = Call[~ClassWithDestructor] : func:r2518_2, this:r2518_1 -# 2518| mu2518_4(unknown) = ^CallSideEffect : ~m? -# 2518| v2518_5(void) = ^IndirectReadSideEffect[-1] : &:r2518_1, ~m? -# 2518| mu2518_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2518_1 +# 2513| Block 1 # 2513| v2513_1(void) = NoOp : +# 2519| r2519_1(glval) = VariableAddress[y] : +# 2519| r2519_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2519| v2519_3(void) = Call[~ClassWithDestructor] : func:r2519_2, this:r2519_1 +# 2519| mu2519_4(unknown) = ^CallSideEffect : ~m? +# 2519| v2519_5(void) = ^IndirectReadSideEffect[-1] : &:r2519_1, ~m? +# 2519| mu2519_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2519_1 +# 2514| v2514_1(void) = NoOp : #-----| Goto -> Block 4 -# 2515| Block 2 -# 2515| v2515_1(void) = NoOp : -# 2518| r2518_7(glval) = VariableAddress[y] : -# 2518| r2518_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2518| v2518_9(void) = Call[~ClassWithDestructor] : func:r2518_8, this:r2518_7 -# 2518| mu2518_10(unknown) = ^CallSideEffect : ~m? -# 2518| v2518_11(void) = ^IndirectReadSideEffect[-1] : &:r2518_7, ~m? -# 2518| mu2518_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2518_7 +# 2516| Block 2 # 2516| v2516_1(void) = NoOp : +# 2519| r2519_7(glval) = VariableAddress[y] : +# 2519| r2519_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2519| v2519_9(void) = Call[~ClassWithDestructor] : func:r2519_8, this:r2519_7 +# 2519| mu2519_10(unknown) = ^CallSideEffect : ~m? +# 2519| v2519_11(void) = ^IndirectReadSideEffect[-1] : &:r2519_7, ~m? +# 2519| mu2519_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2519_7 +# 2517| v2517_1(void) = NoOp : #-----| Goto -> Block 4 -# 2518| Block 3 -# 2518| r2518_13(glval) = VariableAddress[y] : -# 2518| r2518_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2518| v2518_15(void) = Call[~ClassWithDestructor] : func:r2518_14, this:r2518_13 -# 2518| mu2518_16(unknown) = ^CallSideEffect : ~m? -# 2518| v2518_17(void) = ^IndirectReadSideEffect[-1] : &:r2518_13, ~m? -# 2518| mu2518_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2518_13 +# 2519| Block 3 +# 2519| r2519_13(glval) = VariableAddress[y] : +# 2519| r2519_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2519| v2519_15(void) = Call[~ClassWithDestructor] : func:r2519_14, this:r2519_13 +# 2519| mu2519_16(unknown) = ^CallSideEffect : ~m? +# 2519| v2519_17(void) = ^IndirectReadSideEffect[-1] : &:r2519_13, ~m? +# 2519| mu2519_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2519_13 #-----| Goto -> Block 4 -# 2518| Block 4 -# 2518| v2518_19(void) = NoOp : -# 2519| v2519_1(void) = NoOp : -# 2510| v2510_6(void) = ReturnVoid : -# 2510| v2510_7(void) = AliasedUse : ~m? -# 2510| v2510_8(void) = ExitFunction : +# 2519| Block 4 +# 2519| v2519_19(void) = NoOp : +# 2520| v2520_1(void) = NoOp : +# 2511| v2511_6(void) = ReturnVoid : +# 2511| v2511_7(void) = AliasedUse : ~m? +# 2511| v2511_8(void) = ExitFunction : -# 2521| void destruction_in_switch_3(int) -# 2521| Block 0 -# 2521| v2521_1(void) = EnterFunction : -# 2521| mu2521_2(unknown) = AliasedDefinition : -# 2521| mu2521_3(unknown) = InitializeNonLocal : -# 2521| r2521_4(glval) = VariableAddress[c] : -# 2521| mu2521_5(int) = InitializeParameter[c] : &:r2521_4 -# 2522| r2522_1(glval) = VariableAddress[y] : -# 2522| mu2522_2(ClassWithDestructor) = Uninitialized[y] : &:r2522_1 -# 2522| r2522_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2522| v2522_4(void) = Call[ClassWithDestructor] : func:r2522_3, this:r2522_1 -# 2522| mu2522_5(unknown) = ^CallSideEffect : ~m? -# 2522| mu2522_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2522_1 -# 2522| r2522_7(glval) = VariableAddress[c] : -# 2522| r2522_8(int) = Load[c] : &:r2522_7, ~m? -# 2522| v2522_9(void) = Switch : r2522_8 +# 2522| void destruction_in_switch_3(int) +# 2522| Block 0 +# 2522| v2522_1(void) = EnterFunction : +# 2522| mu2522_2(unknown) = AliasedDefinition : +# 2522| mu2522_3(unknown) = InitializeNonLocal : +# 2522| r2522_4(glval) = VariableAddress[c] : +# 2522| mu2522_5(int) = InitializeParameter[c] : &:r2522_4 +# 2523| r2523_1(glval) = VariableAddress[y] : +# 2523| mu2523_2(ClassWithDestructor) = Uninitialized[y] : &:r2523_1 +# 2523| r2523_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2523| v2523_4(void) = Call[ClassWithDestructor] : func:r2523_3, this:r2523_1 +# 2523| mu2523_5(unknown) = ^CallSideEffect : ~m? +# 2523| mu2523_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2523_1 +# 2523| r2523_7(glval) = VariableAddress[c] : +# 2523| r2523_8(int) = Load[c] : &:r2523_7, ~m? +# 2523| v2523_9(void) = Switch : r2523_8 #-----| Case[0] -> Block 1 #-----| Default -> Block 3 -# 2523| Block 1 -# 2523| v2523_1(void) = NoOp : -# 2524| r2524_1(glval) = VariableAddress[x] : -# 2524| mu2524_2(ClassWithDestructor) = Uninitialized[x] : &:r2524_1 -# 2524| r2524_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2524| v2524_4(void) = Call[ClassWithDestructor] : func:r2524_3, this:r2524_1 -# 2524| mu2524_5(unknown) = ^CallSideEffect : ~m? -# 2524| mu2524_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2524_1 -# 2526| r2526_1(glval) = VariableAddress[x] : -# 2526| r2526_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2526| v2526_3(void) = Call[~ClassWithDestructor] : func:r2526_2, this:r2526_1 -# 2526| mu2526_4(unknown) = ^CallSideEffect : ~m? -# 2526| v2526_5(void) = ^IndirectReadSideEffect[-1] : &:r2526_1, ~m? -# 2526| mu2526_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2526_1 -# 2530| r2530_1(glval) = VariableAddress[y] : -# 2530| r2530_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2530| v2530_3(void) = Call[~ClassWithDestructor] : func:r2530_2, this:r2530_1 -# 2530| mu2530_4(unknown) = ^CallSideEffect : ~m? -# 2530| v2530_5(void) = ^IndirectReadSideEffect[-1] : &:r2530_1, ~m? -# 2530| mu2530_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2530_1 -# 2525| v2525_1(void) = NoOp : +# 2524| Block 1 +# 2524| v2524_1(void) = NoOp : +# 2525| r2525_1(glval) = VariableAddress[x] : +# 2525| mu2525_2(ClassWithDestructor) = Uninitialized[x] : &:r2525_1 +# 2525| r2525_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2525| v2525_4(void) = Call[ClassWithDestructor] : func:r2525_3, this:r2525_1 +# 2525| mu2525_5(unknown) = ^CallSideEffect : ~m? +# 2525| mu2525_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2525_1 +# 2527| r2527_1(glval) = VariableAddress[x] : +# 2527| r2527_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2527| v2527_3(void) = Call[~ClassWithDestructor] : func:r2527_2, this:r2527_1 +# 2527| mu2527_4(unknown) = ^CallSideEffect : ~m? +# 2527| v2527_5(void) = ^IndirectReadSideEffect[-1] : &:r2527_1, ~m? +# 2527| mu2527_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2527_1 +# 2531| r2531_1(glval) = VariableAddress[y] : +# 2531| r2531_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2531| v2531_3(void) = Call[~ClassWithDestructor] : func:r2531_2, this:r2531_1 +# 2531| mu2531_4(unknown) = ^CallSideEffect : ~m? +# 2531| v2531_5(void) = ^IndirectReadSideEffect[-1] : &:r2531_1, ~m? +# 2531| mu2531_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2531_1 +# 2526| v2526_1(void) = NoOp : #-----| Goto -> Block 5 -# 2526| Block 2 -# 2526| r2526_7(glval) = VariableAddress[x] : -# 2526| r2526_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2526| v2526_9(void) = Call[~ClassWithDestructor] : func:r2526_8, this:r2526_7 -# 2526| mu2526_10(unknown) = ^CallSideEffect : ~m? -# 2526| v2526_11(void) = ^IndirectReadSideEffect[-1] : &:r2526_7, ~m? -# 2526| mu2526_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2526_7 +# 2527| Block 2 +# 2527| r2527_7(glval) = VariableAddress[x] : +# 2527| r2527_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2527| v2527_9(void) = Call[~ClassWithDestructor] : func:r2527_8, this:r2527_7 +# 2527| mu2527_10(unknown) = ^CallSideEffect : ~m? +# 2527| v2527_11(void) = ^IndirectReadSideEffect[-1] : &:r2527_7, ~m? +# 2527| mu2527_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2527_7 #-----| Goto -> Block 3 -# 2527| Block 3 -# 2527| v2527_1(void) = NoOp : -# 2530| r2530_7(glval) = VariableAddress[y] : -# 2530| r2530_8(glval) = FunctionAddress[~ClassWithDestructor] : -# 2530| v2530_9(void) = Call[~ClassWithDestructor] : func:r2530_8, this:r2530_7 -# 2530| mu2530_10(unknown) = ^CallSideEffect : ~m? -# 2530| v2530_11(void) = ^IndirectReadSideEffect[-1] : &:r2530_7, ~m? -# 2530| mu2530_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2530_7 +# 2528| Block 3 # 2528| v2528_1(void) = NoOp : +# 2531| r2531_7(glval) = VariableAddress[y] : +# 2531| r2531_8(glval) = FunctionAddress[~ClassWithDestructor] : +# 2531| v2531_9(void) = Call[~ClassWithDestructor] : func:r2531_8, this:r2531_7 +# 2531| mu2531_10(unknown) = ^CallSideEffect : ~m? +# 2531| v2531_11(void) = ^IndirectReadSideEffect[-1] : &:r2531_7, ~m? +# 2531| mu2531_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2531_7 +# 2529| v2529_1(void) = NoOp : #-----| Goto -> Block 5 -# 2530| Block 4 -# 2530| r2530_13(glval) = VariableAddress[y] : -# 2530| r2530_14(glval) = FunctionAddress[~ClassWithDestructor] : -# 2530| v2530_15(void) = Call[~ClassWithDestructor] : func:r2530_14, this:r2530_13 -# 2530| mu2530_16(unknown) = ^CallSideEffect : ~m? -# 2530| v2530_17(void) = ^IndirectReadSideEffect[-1] : &:r2530_13, ~m? -# 2530| mu2530_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2530_13 +# 2531| Block 4 +# 2531| r2531_13(glval) = VariableAddress[y] : +# 2531| r2531_14(glval) = FunctionAddress[~ClassWithDestructor] : +# 2531| v2531_15(void) = Call[~ClassWithDestructor] : func:r2531_14, this:r2531_13 +# 2531| mu2531_16(unknown) = ^CallSideEffect : ~m? +# 2531| v2531_17(void) = ^IndirectReadSideEffect[-1] : &:r2531_13, ~m? +# 2531| mu2531_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2531_13 #-----| Goto -> Block 5 -# 2530| Block 5 -# 2530| v2530_19(void) = NoOp : -# 2531| v2531_1(void) = NoOp : -# 2521| v2521_6(void) = ReturnVoid : -# 2521| v2521_7(void) = AliasedUse : ~m? -# 2521| v2521_8(void) = ExitFunction : +# 2531| Block 5 +# 2531| v2531_19(void) = NoOp : +# 2532| v2532_1(void) = NoOp : +# 2522| v2522_6(void) = ReturnVoid : +# 2522| v2522_7(void) = AliasedUse : ~m? +# 2522| v2522_8(void) = ExitFunction : -# 2533| void destructor_possibly_not_handled() -# 2533| Block 0 -# 2533| v2533_1(void) = EnterFunction : -# 2533| mu2533_2(unknown) = AliasedDefinition : -# 2533| mu2533_3(unknown) = InitializeNonLocal : -# 2534| r2534_1(glval) = VariableAddress[x] : -# 2534| mu2534_2(ClassWithDestructor) = Uninitialized[x] : &:r2534_1 -# 2534| r2534_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2534| v2534_4(void) = Call[ClassWithDestructor] : func:r2534_3, this:r2534_1 -# 2534| mu2534_5(unknown) = ^CallSideEffect : ~m? -# 2534| mu2534_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2534_1 -# 2536| r2536_1(glval) = VariableAddress[#throw2536:5] : -# 2536| r2536_2(int) = Constant[42] : -# 2536| mu2536_3(int) = Store[#throw2536:5] : &:r2536_1, r2536_2 -# 2536| v2536_4(void) = ThrowValue : &:r2536_1, ~m? +# 2534| void destructor_possibly_not_handled() +# 2534| Block 0 +# 2534| v2534_1(void) = EnterFunction : +# 2534| mu2534_2(unknown) = AliasedDefinition : +# 2534| mu2534_3(unknown) = InitializeNonLocal : +# 2535| r2535_1(glval) = VariableAddress[x] : +# 2535| mu2535_2(ClassWithDestructor) = Uninitialized[x] : &:r2535_1 +# 2535| r2535_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2535| v2535_4(void) = Call[ClassWithDestructor] : func:r2535_3, this:r2535_1 +# 2535| mu2535_5(unknown) = ^CallSideEffect : ~m? +# 2535| mu2535_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2535_1 +# 2537| r2537_1(glval) = VariableAddress[#throw2537:5] : +# 2537| r2537_2(int) = Constant[42] : +# 2537| mu2537_3(int) = Store[#throw2537:5] : &:r2537_1, r2537_2 +# 2537| v2537_4(void) = ThrowValue : &:r2537_1, ~m? #-----| Exception -> Block 3 -# 2533| Block 1 -# 2533| v2533_4(void) = AliasedUse : ~m? -# 2533| v2533_5(void) = ExitFunction : +# 2534| Block 1 +# 2534| v2534_4(void) = AliasedUse : ~m? +# 2534| v2534_5(void) = ExitFunction : -# 2533| Block 2 -# 2533| v2533_6(void) = Unwind : +# 2534| Block 2 +# 2534| v2534_6(void) = Unwind : #-----| Goto -> Block 1 -# 2538| Block 3 -# 2538| v2538_1(void) = CatchByType[char] : +# 2539| Block 3 +# 2539| v2539_1(void) = CatchByType[char] : #-----| Exception -> Block 2 #-----| Goto -> Block 4 -# 2538| Block 4 -# 2538| r2538_2(glval) = VariableAddress[(unnamed parameter 0)] : -# 2538| mu2538_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2538_2 -# 2538| v2538_4(void) = NoOp : -# 2540| r2540_1(glval) = VariableAddress[x] : -# 2540| r2540_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2540| v2540_3(void) = Call[~ClassWithDestructor] : func:r2540_2, this:r2540_1 -# 2540| mu2540_4(unknown) = ^CallSideEffect : ~m? -# 2540| v2540_5(void) = ^IndirectReadSideEffect[-1] : &:r2540_1, ~m? -# 2540| mu2540_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_1 -# 2540| v2540_7(void) = NoOp : -# 2540| r2540_8(glval) = VariableAddress[x] : -# 2540| r2540_9(glval) = FunctionAddress[~ClassWithDestructor] : -# 2540| v2540_10(void) = Call[~ClassWithDestructor] : func:r2540_9, this:r2540_8 -# 2540| mu2540_11(unknown) = ^CallSideEffect : ~m? -# 2540| v2540_12(void) = ^IndirectReadSideEffect[-1] : &:r2540_8, ~m? -# 2540| mu2540_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2540_8 -# 2533| v2533_7(void) = ReturnVoid : +# 2539| Block 4 +# 2539| r2539_2(glval) = VariableAddress[(unnamed parameter 0)] : +# 2539| mu2539_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2539_2 +# 2539| v2539_4(void) = NoOp : +# 2541| r2541_1(glval) = VariableAddress[x] : +# 2541| r2541_2(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_3(void) = Call[~ClassWithDestructor] : func:r2541_2, this:r2541_1 +# 2541| mu2541_4(unknown) = ^CallSideEffect : ~m? +# 2541| v2541_5(void) = ^IndirectReadSideEffect[-1] : &:r2541_1, ~m? +# 2541| mu2541_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_1 +# 2541| v2541_7(void) = NoOp : +# 2541| r2541_8(glval) = VariableAddress[x] : +# 2541| r2541_9(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_10(void) = Call[~ClassWithDestructor] : func:r2541_9, this:r2541_8 +# 2541| mu2541_11(unknown) = ^CallSideEffect : ~m? +# 2541| v2541_12(void) = ^IndirectReadSideEffect[-1] : &:r2541_8, ~m? +# 2541| mu2541_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_8 +# 2534| v2534_7(void) = ReturnVoid : #-----| Goto -> Block 1 perf-regression.cpp: From 6575927630efc7e18f1a1eaeb68447a1053cbea0 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 11:43:58 +0200 Subject: [PATCH 097/118] C++: Add IR tests demonstrating some inconsistencies that may occur --- .../library-tests/ir/ir/PrintAST.expected | 76 +++++++++++++++++ .../library-tests/ir/ir/aliased_ir.expected | 84 +++++++++++++++++++ .../ir/ir/aliased_ssa_consistency.expected | 1 + .../aliased_ssa_consistency_unsound.expected | 1 + cpp/ql/test/library-tests/ir/ir/ir.cpp | 20 ++--- .../ir/ir/raw_consistency.expected | 2 + .../test/library-tests/ir/ir/raw_ir.expected | 84 +++++++++++++++++++ .../ir/ir/unaliased_ssa_consistency.expected | 1 + ...unaliased_ssa_consistency_unsound.expected | 1 + 9 files changed, 259 insertions(+), 11 deletions(-) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index 0d6ab9c6a4e..d7b240c8949 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -22658,6 +22658,82 @@ ir.cpp: # 2541| getQualifier(): [VariableAccess] x # 2541| Type = [Class] ClassWithDestructor # 2541| ValueCategory = lvalue +# 2543| [TopLevelFunction] ClassWithDestructor getClassWithDestructor() +# 2543| : +# 2545| [TopLevelFunction] void this_inconsistency(bool) +# 2545| : +# 2545| getParameter(0): [Parameter] b +# 2545| Type = [BoolType] bool +# 2545| getEntryPoint(): [BlockStmt] { ... } +# 2546| getStmt(0): [IfStmt] if (...) ... +# 2546| getCondition(): [ConditionDeclExpr] (condition decl) +# 2546| Type = [BoolType] bool +# 2546| ValueCategory = prvalue +# 2546| getChild(0): [FunctionCall] call to operator bool +# 2546| Type = [BoolType] bool +# 2546| ValueCategory = prvalue +# 2546| getQualifier(): [VariableAccess] a +# 2546| Type = [LValueReferenceType] const ClassWithDestructor & +# 2546| ValueCategory = prvalue(load) +# 2546| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference) +# 2546| Type = [SpecifiedType] const ClassWithDestructor +# 2546| ValueCategory = prvalue(load) +# 2546| getInitializingExpr(): [FunctionCall] call to getClassWithDestructor +# 2546| Type = [Class] ClassWithDestructor +# 2546| ValueCategory = prvalue +# 2546| getInitializingExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2546| Type = [LValueReferenceType] const ClassWithDestructor & +# 2546| ValueCategory = prvalue +# 2546| getExpr(): [CStyleCast] (const ClassWithDestructor)... +# 2546| Conversion = [GlvalueConversion] glvalue conversion +# 2546| Type = [SpecifiedType] const ClassWithDestructor +# 2546| ValueCategory = lvalue +# 2546| getExpr(): [TemporaryObjectExpr] temporary object +# 2546| Type = [Class] ClassWithDestructor +# 2546| ValueCategory = lvalue +# 2547| getThen(): [EmptyStmt] ; +# 2547| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2547| Type = [VoidType] void +# 2547| ValueCategory = prvalue +# 2547| getQualifier(): [ReuseExpr] reuse of temporary object +# 2547| Type = [Class] ClassWithDestructor +# 2547| ValueCategory = xvalue +# 2548| getStmt(1): [ReturnStmt] return ... +# 2550| [TopLevelFunction] void constexpr_inconsistency(bool) +# 2550| : +# 2550| getParameter(0): [Parameter] b +# 2550| Type = [BoolType] bool +# 2550| getEntryPoint(): [BlockStmt] { ... } +# 2551| getStmt(0): [ConstexprIfStmt] if constexpr (...) ... +# 2551| getInitialization(): [DeclStmt] declaration +# 2551| getDeclarationEntry(0): [VariableDeclarationEntry] definition of a +# 2551| Type = [LValueReferenceType] const ClassWithDestructor & +# 2551| getVariable().getInitializer(): [Initializer] initializer for a +# 2551| getExpr(): [FunctionCall] call to getClassWithDestructor +# 2551| Type = [Class] ClassWithDestructor +# 2551| ValueCategory = prvalue +# 2551| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to) +# 2551| Type = [LValueReferenceType] const ClassWithDestructor & +# 2551| ValueCategory = prvalue +# 2551| getExpr(): [CStyleCast] (const ClassWithDestructor)... +# 2551| Conversion = [GlvalueConversion] glvalue conversion +# 2551| Type = [SpecifiedType] const ClassWithDestructor +# 2551| ValueCategory = lvalue +# 2551| getExpr(): [TemporaryObjectExpr] temporary object +# 2551| Type = [Class] ClassWithDestructor +# 2551| ValueCategory = lvalue +# 2551| getCondition(): [VariableAccess] initialization_with_destructor_bool +# 2551| Type = [BoolType] bool +# 2551| Value = [VariableAccess] 1 +# 2551| ValueCategory = prvalue(load) +# 2552| getThen(): [EmptyStmt] ; +# 2552| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2552| Type = [VoidType] void +# 2552| ValueCategory = prvalue +# 2552| getQualifier(): [ReuseExpr] reuse of temporary object +# 2552| Type = [Class] ClassWithDestructor +# 2552| ValueCategory = xvalue +# 2553| getStmt(1): [ReturnStmt] return ... perf-regression.cpp: # 4| [CopyAssignmentOperator] Big& Big::operator=(Big const&) # 4| : diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index 2fc610f6d12..eef600513eb 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -18251,6 +18251,90 @@ ir.cpp: # 2534| v2534_9(void) = ReturnVoid : #-----| Goto -> Block 1 +# 2545| void this_inconsistency(bool) +# 2545| Block 0 +# 2545| v2545_1(void) = EnterFunction : +# 2545| m2545_2(unknown) = AliasedDefinition : +# 2545| m2545_3(unknown) = InitializeNonLocal : +# 2545| m2545_4(unknown) = Chi : total:m2545_2, partial:m2545_3 +# 2545| r2545_5(glval) = VariableAddress[b] : +# 2545| m2545_6(bool) = InitializeParameter[b] : &:r2545_5 +# 2546| r2546_1(glval) = VariableAddress[a] : +# 2546| r2546_2(glval) = VariableAddress[#temp2546:38] : +# 2546| r2546_3(glval) = FunctionAddress[getClassWithDestructor] : +# 2546| r2546_4(ClassWithDestructor) = Call[getClassWithDestructor] : func:r2546_3 +# 2546| m2546_5(unknown) = ^CallSideEffect : ~m2545_4 +# 2546| m2546_6(unknown) = Chi : total:m2545_4, partial:m2546_5 +# 2546| m2546_7(ClassWithDestructor) = Store[#temp2546:38] : &:r2546_2, r2546_4 +# 2546| m2546_8(unknown) = Chi : total:m2546_6, partial:m2546_7 +# 2546| r2546_9(glval) = Convert : r2546_2 +# 2546| r2546_10(ClassWithDestructor &) = CopyValue : r2546_9 +# 2546| m2546_11(ClassWithDestructor &) = Store[a] : &:r2546_1, r2546_10 +# 2546| r2546_12(glval) = VariableAddress[a] : +# 2546| r2546_13(ClassWithDestructor &) = Load[a] : &:r2546_12, m2546_11 +# 2546| r2546_14(ClassWithDestructor) = CopyValue : r2546_13 +# 2546| r2546_15(glval) = FunctionAddress[operator bool] : +# 2546| r2546_16(bool) = Call[operator bool] : func:r2546_15, this:r2546_14 +# 2546| m2546_17(unknown) = ^CallSideEffect : ~m2546_8 +# 2546| m2546_18(unknown) = Chi : total:m2546_8, partial:m2546_17 +# 2546| v2546_19(void) = ^IndirectReadSideEffect[-1] : &:r2546_14, ~m2546_18 +# 2546| r2546_20(bool) = CopyValue : r2546_16 +# 2546| v2546_21(void) = ConditionalBranch : r2546_20 +#-----| False -> Block 2 +#-----| True -> Block 1 + +# 2547| Block 1 +# 2547| v2547_1(void) = NoOp : +# 2547| r2547_2(glval) = CopyValue : r2546_2 +# 2547| r2547_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2547| v2547_4(void) = Call[~ClassWithDestructor] : func:r2547_3, this:r2547_2 +# 2547| m2547_5(unknown) = ^CallSideEffect : ~m2546_18 +# 2547| m2547_6(unknown) = Chi : total:m2546_18, partial:m2547_5 +# 2547| v2547_7(void) = ^IndirectReadSideEffect[-1] : &:r2547_2, ~m2547_6 +# 2547| m2547_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2547_2 +# 2547| m2547_9(unknown) = Chi : total:m2547_6, partial:m2547_8 +#-----| Goto -> Block 2 + +# 2548| Block 2 +# 2548| m2548_1(unknown) = Phi : from 0:~m2546_18, from 1:~m2547_9 +# 2548| v2548_2(void) = NoOp : +# 2545| v2545_7(void) = ReturnVoid : +# 2545| v2545_8(void) = AliasedUse : ~m2548_1 +# 2545| v2545_9(void) = ExitFunction : + +# 2550| void constexpr_inconsistency(bool) +# 2550| Block 0 +# 2550| v2550_1(void) = EnterFunction : +# 2550| m2550_2(unknown) = AliasedDefinition : +# 2550| m2550_3(unknown) = InitializeNonLocal : +# 2550| m2550_4(unknown) = Chi : total:m2550_2, partial:m2550_3 +# 2550| r2550_5(glval) = VariableAddress[b] : +# 2550| m2550_6(bool) = InitializeParameter[b] : &:r2550_5 +# 2551| r2551_1(glval) = VariableAddress[a] : +# 2551| r2551_2(glval) = VariableAddress[#temp2551:48] : +# 2551| r2551_3(glval) = FunctionAddress[getClassWithDestructor] : +# 2551| r2551_4(ClassWithDestructor) = Call[getClassWithDestructor] : func:r2551_3 +# 2551| m2551_5(unknown) = ^CallSideEffect : ~m2550_4 +# 2551| m2551_6(unknown) = Chi : total:m2550_4, partial:m2551_5 +# 2551| m2551_7(ClassWithDestructor) = Store[#temp2551:48] : &:r2551_2, r2551_4 +# 2551| r2551_8(glval) = Convert : r2551_2 +# 2551| r2551_9(ClassWithDestructor &) = CopyValue : r2551_8 +# 2551| m2551_10(ClassWithDestructor &) = Store[a] : &:r2551_1, r2551_9 +# 2551| r2551_11(bool) = Constant[1] : +# 2551| v2551_12(void) = ConditionalBranch : r2551_11 +#-----| False -> Block 2 +#-----| True -> Block 1 + +# 2552| Block 1 +# 2552| v2552_1(void) = NoOp : +# 2553| v2553_1(void) = NoOp : +# 2550| v2550_7(void) = ReturnVoid : +# 2550| v2550_8(void) = AliasedUse : ~m2551_6 +# 2550| v2550_9(void) = ExitFunction : + +# 2550| Block 2 +# 2550| v2550_10(void) = Unreached : + perf-regression.cpp: # 6| void Big::Big() # 6| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected index 8f472b49f27..5a0234a4cc4 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected @@ -27,6 +27,7 @@ invalidOverlap nonUniqueEnclosingIRFunction fieldAddressOnNonPointer thisArgumentIsNonPointer +| ir.cpp:2546:34:2546:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2545:6:2545:23 | void this_inconsistency(bool) | void this_inconsistency(bool) | nonUniqueIRVariable | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected index 8f472b49f27..5a0234a4cc4 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected @@ -27,6 +27,7 @@ invalidOverlap nonUniqueEnclosingIRFunction fieldAddressOnNonPointer thisArgumentIsNonPointer +| ir.cpp:2546:34:2546:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2545:6:2545:23 | void this_inconsistency(bool) | void this_inconsistency(bool) | nonUniqueIRVariable | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | diff --git a/cpp/ql/test/library-tests/ir/ir/ir.cpp b/cpp/ql/test/library-tests/ir/ir/ir.cpp index 159c7173310..3c6b1cdbbf0 100644 --- a/cpp/ql/test/library-tests/ir/ir/ir.cpp +++ b/cpp/ql/test/library-tests/ir/ir/ir.cpp @@ -2540,18 +2540,16 @@ void destructor_possibly_not_handled() { } } -// ClassWithDestructor getClassWithDestructor(); +ClassWithDestructor getClassWithDestructor(); -// void this_inconsistency(bool b) { -// if (const ClassWithDestructor& a = getClassWithDestructor()) -// ; -// } +void this_inconsistency(bool b) { + if (const ClassWithDestructor& a = getClassWithDestructor()) + ; +} -// constexpr bool initialization_with_destructor_bool = true; - -// void constexpr_inconsistency(bool b) { -// if constexpr (const ClassWithDestructor& a = getClassWithDestructor(); initialization_with_destructor_bool) -// ; -// } +void constexpr_inconsistency(bool b) { + if constexpr (const ClassWithDestructor& a = getClassWithDestructor(); initialization_with_destructor_bool) + ; +} // semmle-extractor-options: -std=c++20 --clang diff --git a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected index 11dd363ebc5..926444e1674 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected @@ -21,6 +21,7 @@ lostReachability backEdgeCountMismatch useNotDominatedByDefinition | ir.cpp:1535:8:1535:8 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | ir.cpp:1535:8:1535:8 | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() | +| ir.cpp:2551:48:2551:71 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | ir.cpp:2550:6:2550:28 | void constexpr_inconsistency(bool) | void constexpr_inconsistency(bool) | | try_except.c:13:13:13:13 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:6:6:6:6 | void f() | void f() | | try_except.c:13:13:13:13 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:6:6:6:6 | void f() | void f() | | try_except.c:39:15:39:15 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:32:6:32:6 | void h(int) | void h(int) | @@ -36,6 +37,7 @@ invalidOverlap nonUniqueEnclosingIRFunction fieldAddressOnNonPointer thisArgumentIsNonPointer +| ir.cpp:2546:34:2546:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2545:6:2545:23 | void this_inconsistency(bool) | void this_inconsistency(bool) | nonUniqueIRVariable | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index eabbc4c3064..434da18f6be 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -16615,6 +16615,90 @@ ir.cpp: # 2534| v2534_7(void) = ReturnVoid : #-----| Goto -> Block 1 +# 2545| void this_inconsistency(bool) +# 2545| Block 0 +# 2545| v2545_1(void) = EnterFunction : +# 2545| mu2545_2(unknown) = AliasedDefinition : +# 2545| mu2545_3(unknown) = InitializeNonLocal : +# 2545| r2545_4(glval) = VariableAddress[b] : +# 2545| mu2545_5(bool) = InitializeParameter[b] : &:r2545_4 +# 2546| r2546_1(glval) = VariableAddress[a] : +# 2546| r2546_2(glval) = VariableAddress[#temp2546:38] : +# 2546| r2546_3(glval) = FunctionAddress[getClassWithDestructor] : +# 2546| r2546_4(ClassWithDestructor) = Call[getClassWithDestructor] : func:r2546_3 +# 2546| mu2546_5(unknown) = ^CallSideEffect : ~m? +# 2546| mu2546_6(ClassWithDestructor) = Store[#temp2546:38] : &:r2546_2, r2546_4 +# 2546| r2546_7(glval) = Convert : r2546_2 +# 2546| r2546_8(ClassWithDestructor &) = CopyValue : r2546_7 +# 2546| mu2546_9(ClassWithDestructor &) = Store[a] : &:r2546_1, r2546_8 +# 2546| r2546_10(glval) = VariableAddress[a] : +# 2546| r2546_11(ClassWithDestructor &) = Load[a] : &:r2546_10, ~m? +# 2546| r2546_12(ClassWithDestructor) = CopyValue : r2546_11 +# 2546| r2546_13(glval) = FunctionAddress[operator bool] : +# 2546| r2546_14(bool) = Call[operator bool] : func:r2546_13, this:r2546_12 +# 2546| mu2546_15(unknown) = ^CallSideEffect : ~m? +# 2546| v2546_16(void) = ^IndirectReadSideEffect[-1] : &:r2546_12, ~m? +# 2546| r2546_17(bool) = CopyValue : r2546_14 +# 2546| v2546_18(void) = ConditionalBranch : r2546_17 +#-----| False -> Block 2 +#-----| True -> Block 1 + +# 2547| Block 1 +# 2547| v2547_1(void) = NoOp : +# 2547| r2547_2(glval) = CopyValue : r2546_2 +# 2547| r2547_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2547| v2547_4(void) = Call[~ClassWithDestructor] : func:r2547_3, this:r2547_2 +# 2547| mu2547_5(unknown) = ^CallSideEffect : ~m? +# 2547| v2547_6(void) = ^IndirectReadSideEffect[-1] : &:r2547_2, ~m? +# 2547| mu2547_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2547_2 +#-----| Goto -> Block 2 + +# 2548| Block 2 +# 2548| v2548_1(void) = NoOp : +# 2545| v2545_6(void) = ReturnVoid : +# 2545| v2545_7(void) = AliasedUse : ~m? +# 2545| v2545_8(void) = ExitFunction : + +# 2550| void constexpr_inconsistency(bool) +# 2550| Block 0 +# 2550| v2550_1(void) = EnterFunction : +# 2550| mu2550_2(unknown) = AliasedDefinition : +# 2550| mu2550_3(unknown) = InitializeNonLocal : +# 2550| r2550_4(glval) = VariableAddress[b] : +# 2550| mu2550_5(bool) = InitializeParameter[b] : &:r2550_4 +# 2551| r2551_1(glval) = VariableAddress[a] : +# 2551| r2551_2(glval) = VariableAddress[#temp2551:48] : +# 2551| r2551_3(glval) = FunctionAddress[getClassWithDestructor] : +# 2551| r2551_4(ClassWithDestructor) = Call[getClassWithDestructor] : func:r2551_3 +# 2551| mu2551_5(unknown) = ^CallSideEffect : ~m? +# 2551| mu2551_6(ClassWithDestructor) = Store[#temp2551:48] : &:r2551_2, r2551_4 +# 2551| r2551_7(glval) = Convert : r2551_2 +# 2551| r2551_8(ClassWithDestructor &) = CopyValue : r2551_7 +# 2551| mu2551_9(ClassWithDestructor &) = Store[a] : &:r2551_1, r2551_8 +# 2551| r2551_10(bool) = Constant[1] : +# 2551| v2551_11(void) = ConditionalBranch : r2551_10 +#-----| False -> Block 3 +#-----| True -> Block 1 + +# 2552| Block 1 +# 2552| v2552_1(void) = NoOp : +#-----| Goto -> Block 3 + +# 2552| Block 2 +# 2552| r2552_2(glval) = CopyValue : r2551_2 +# 2552| r2552_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2552| v2552_4(void) = Call[~ClassWithDestructor] : func:r2552_3, this:r2552_2 +# 2552| mu2552_5(unknown) = ^CallSideEffect : ~m? +# 2552| v2552_6(void) = ^IndirectReadSideEffect[-1] : &:r2552_2, ~m? +# 2552| mu2552_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2552_2 +#-----| Goto -> Block 3 + +# 2553| Block 3 +# 2553| v2553_1(void) = NoOp : +# 2550| v2550_6(void) = ReturnVoid : +# 2550| v2550_7(void) = AliasedUse : ~m? +# 2550| v2550_8(void) = ExitFunction : + perf-regression.cpp: # 6| void Big::Big() # 6| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected index 8f472b49f27..5a0234a4cc4 100644 --- a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected @@ -27,6 +27,7 @@ invalidOverlap nonUniqueEnclosingIRFunction fieldAddressOnNonPointer thisArgumentIsNonPointer +| ir.cpp:2546:34:2546:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2545:6:2545:23 | void this_inconsistency(bool) | void this_inconsistency(bool) | nonUniqueIRVariable | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | diff --git a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected index 8f472b49f27..5a0234a4cc4 100644 --- a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected +++ b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected @@ -27,6 +27,7 @@ invalidOverlap nonUniqueEnclosingIRFunction fieldAddressOnNonPointer thisArgumentIsNonPointer +| ir.cpp:2546:34:2546:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2545:6:2545:23 | void this_inconsistency(bool) | void this_inconsistency(bool) | nonUniqueIRVariable | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | | coroutines.cpp:87:20:87:20 | VariableAddress: (unnamed local variable) | Variable address instruction 'VariableAddress: (unnamed local variable)' has no associated variable, in function '$@'. | coroutines.cpp:87:20:87:33 | co_returnable_void co_return_void() | co_returnable_void co_return_void() | From 486226814a120013d7b858954b5de76229dabc6a Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 8 May 2024 11:25:42 +0100 Subject: [PATCH 098/118] C++: Add a second example. --- cpp/ql/src/Critical/DoubleFree.qhelp | 9 +++++++++ cpp/ql/src/Critical/DoubleFreeBad2.cpp | 16 ++++++++++++++++ cpp/ql/src/Critical/DoubleFreeGood2.cpp | 17 +++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 cpp/ql/src/Critical/DoubleFreeBad2.cpp create mode 100644 cpp/ql/src/Critical/DoubleFreeGood2.cpp diff --git a/cpp/ql/src/Critical/DoubleFree.qhelp b/cpp/ql/src/Critical/DoubleFree.qhelp index 08beb13f49a..33eb883ca28 100644 --- a/cpp/ql/src/Critical/DoubleFree.qhelp +++ b/cpp/ql/src/Critical/DoubleFree.qhelp @@ -31,6 +31,15 @@ Reviewing the code above, the issue can be fixed by simply deleting the additona not to free new_buffer as this pointer is returned by the function.

    +In the next example, task may be deleted twice, if an exception occurs inside the try +block after the first delete: +

    + +

    +The problem can be solved by assigning a null value to the pointer after the first delete, as +calling delete a second time on the null pointer is harmless. +

    + diff --git a/cpp/ql/src/Critical/DoubleFreeBad2.cpp b/cpp/ql/src/Critical/DoubleFreeBad2.cpp new file mode 100644 index 00000000000..e4e758dfa10 --- /dev/null +++ b/cpp/ql/src/Critical/DoubleFreeBad2.cpp @@ -0,0 +1,16 @@ +void g() { + MyTask *task = NULL; + + try + { + task = new MyTask; + + ... + + delete task; + + ... + } catch (...) { + delete task; // BAD: potential double-free + } +} diff --git a/cpp/ql/src/Critical/DoubleFreeGood2.cpp b/cpp/ql/src/Critical/DoubleFreeGood2.cpp new file mode 100644 index 00000000000..dbcac3d175c --- /dev/null +++ b/cpp/ql/src/Critical/DoubleFreeGood2.cpp @@ -0,0 +1,17 @@ +void g() { + MyTask *task = NULL; + + try + { + task = new MyTask; + + ... + + delete task; + task = NULL; + + ... + } catch (...) { + delete task; // GOOD: harmless if task is NULL + } +} From 3fd6bc9b5c92a0a96746deb4328846ec403074fd Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 8 May 2024 11:46:04 +0100 Subject: [PATCH 099/118] C++: Fix qhelp format. --- cpp/ql/src/Critical/DoubleFree.qhelp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/ql/src/Critical/DoubleFree.qhelp b/cpp/ql/src/Critical/DoubleFree.qhelp index 33eb883ca28..52d586caf1e 100644 --- a/cpp/ql/src/Critical/DoubleFree.qhelp +++ b/cpp/ql/src/Critical/DoubleFree.qhelp @@ -31,6 +31,7 @@ Reviewing the code above, the issue can be fixed by simply deleting the additona not to free new_buffer as this pointer is returned by the function.

    +

    In the next example, task may be deleted twice, if an exception occurs inside the try block after the first delete:

    From 24f8b5f203cfcbacc5e80338fd2818c03fc81cb6 Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Wed, 8 May 2024 13:56:11 +0200 Subject: [PATCH 100/118] misc: Fix docstring warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using a sufficiently new version of Python, it will give a warning about the escape sequence `\_` in `¯\_(ツ)_/¯` not being a valid escape :D fix is to make the docstring a raw string. Thanks @owen-mc --- misc/scripts/accept-expected-changes-from-ci.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/scripts/accept-expected-changes-from-ci.py b/misc/scripts/accept-expected-changes-from-ci.py index a8c86d8f3e4..26e31c1169e 100755 --- a/misc/scripts/accept-expected-changes-from-ci.py +++ b/misc/scripts/accept-expected-changes-from-ci.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -""" +r""" This script can be used to go over `codeql test run` expected/actual log output from github actions, and apply patches locally to make the tests pass. From fa06d88642e2bd292738d3653a1319e66ff84044 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 14:07:29 +0200 Subject: [PATCH 101/118] C++: Add forgotten `getLastChild` to `TranslatedConstExprIfStmt` --- .../raw/internal/TranslatedStmt.qll | 12 +- .../library-tests/ir/ir/aliased_ir.expected | 68 ++++++---- .../ir/ir/raw_consistency.expected | 1 - .../test/library-tests/ir/ir/raw_ir.expected | 124 +++++++++--------- 4 files changed, 107 insertions(+), 98 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll index 3f77a2b0b45..84b6c35fc3c 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll @@ -923,6 +923,12 @@ class TranslatedConstExprIfStmt extends TranslatedStmt, ConditionContext { else result = this.getFirstConditionInstruction(kind) } + override Instruction getALastInstructionInternal() { + result = this.getElse().getALastInstruction() or result = this.getThen().getALastInstruction() + } + + override TranslatedElement getLastChild() { result = this.getElse() or result = this.getThen() } + override TranslatedElement getChildInternal(int id) { id = 0 and result = this.getInitialization() or @@ -978,12 +984,6 @@ class TranslatedConstExprIfStmt extends TranslatedStmt, ConditionContext { override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType resultType) { none() } - - override Instruction getALastInstructionInternal() { - result = this.getThen().getALastInstruction() - or - result = this.getElse().getALastInstruction() - } } abstract class TranslatedLoop extends TranslatedStmt, ConditionContext { diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index eef600513eb..f6308583f17 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -15413,27 +15413,35 @@ ir.cpp: #-----| True -> Block 4 # 2204| Block 4 -# 2204| r2204_1(glval) = VariableAddress[x] : -# 2204| r2204_2(glval) = FunctionAddress[set_x] : -# 2204| r2204_3(char) = Constant[97] : -# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 -# 2204| m2204_5(unknown) = ^CallSideEffect : ~m2203_7 -# 2204| m2204_6(unknown) = Chi : total:m2203_7, partial:m2204_5 -# 2204| v2204_7(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, m2203_9 -# 2204| m2204_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 -# 2204| m2204_9(ClassWithDestructor) = Chi : total:m2203_9, partial:m2204_8 -# 2206| r2206_1(glval) = VariableAddress[x] : -# 2206| m2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 -# 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2206| v2206_4(void) = Call[ClassWithDestructor] : func:r2206_3, this:r2206_1 -# 2206| m2206_5(unknown) = ^CallSideEffect : ~m2204_6 -# 2206| m2206_6(unknown) = Chi : total:m2204_6, partial:m2206_5 -# 2206| m2206_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2206_1 -# 2206| m2206_8(ClassWithDestructor) = Chi : total:m2206_2, partial:m2206_7 -# 2206| r2206_9(glval) = VariableAddress[c] : -# 2206| r2206_10(char) = Load[c] : &:r2206_9, m2199_8 -# 2206| r2206_11(int) = Convert : r2206_10 -# 2206| v2206_12(void) = Switch : r2206_11 +# 2204| r2204_1(glval) = VariableAddress[x] : +# 2204| r2204_2(glval) = FunctionAddress[set_x] : +# 2204| r2204_3(char) = Constant[97] : +# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 +# 2204| m2204_5(unknown) = ^CallSideEffect : ~m2203_7 +# 2204| m2204_6(unknown) = Chi : total:m2203_7, partial:m2204_5 +# 2204| v2204_7(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, m2203_9 +# 2204| m2204_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 +# 2204| m2204_9(ClassWithDestructor) = Chi : total:m2203_9, partial:m2204_8 +# 2204| r2204_10(glval) = VariableAddress[x] : +# 2204| r2204_11(glval) = FunctionAddress[~ClassWithDestructor] : +# 2204| v2204_12(void) = Call[~ClassWithDestructor] : func:r2204_11, this:r2204_10 +# 2204| m2204_13(unknown) = ^CallSideEffect : ~m2204_6 +# 2204| m2204_14(unknown) = Chi : total:m2204_6, partial:m2204_13 +# 2204| v2204_15(void) = ^IndirectReadSideEffect[-1] : &:r2204_10, m2204_9 +# 2204| m2204_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_10 +# 2204| m2204_17(ClassWithDestructor) = Chi : total:m2204_9, partial:m2204_16 +# 2206| r2206_1(glval) = VariableAddress[x] : +# 2206| m2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 +# 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2206| v2206_4(void) = Call[ClassWithDestructor] : func:r2206_3, this:r2206_1 +# 2206| m2206_5(unknown) = ^CallSideEffect : ~m2204_14 +# 2206| m2206_6(unknown) = Chi : total:m2204_14, partial:m2206_5 +# 2206| m2206_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2206_1 +# 2206| m2206_8(ClassWithDestructor) = Chi : total:m2206_2, partial:m2206_7 +# 2206| r2206_9(glval) = VariableAddress[c] : +# 2206| r2206_10(char) = Load[c] : &:r2206_9, m2199_8 +# 2206| r2206_11(int) = Convert : r2206_10 +# 2206| v2206_12(void) = Switch : r2206_11 #-----| Case[97] -> Block 5 #-----| Default -> Block 6 @@ -18326,11 +18334,19 @@ ir.cpp: #-----| True -> Block 1 # 2552| Block 1 -# 2552| v2552_1(void) = NoOp : -# 2553| v2553_1(void) = NoOp : -# 2550| v2550_7(void) = ReturnVoid : -# 2550| v2550_8(void) = AliasedUse : ~m2551_6 -# 2550| v2550_9(void) = ExitFunction : +# 2552| v2552_1(void) = NoOp : +# 2552| r2552_2(glval) = CopyValue : r2551_2 +# 2552| r2552_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2552| v2552_4(void) = Call[~ClassWithDestructor] : func:r2552_3, this:r2552_2 +# 2552| m2552_5(unknown) = ^CallSideEffect : ~m2551_6 +# 2552| m2552_6(unknown) = Chi : total:m2551_6, partial:m2552_5 +# 2552| v2552_7(void) = ^IndirectReadSideEffect[-1] : &:r2552_2, m2551_7 +# 2552| m2552_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2552_2 +# 2552| m2552_9(ClassWithDestructor) = Chi : total:m2551_7, partial:m2552_8 +# 2553| v2553_1(void) = NoOp : +# 2550| v2550_7(void) = ReturnVoid : +# 2550| v2550_8(void) = AliasedUse : ~m2552_6 +# 2550| v2550_9(void) = ExitFunction : # 2550| Block 2 # 2550| v2550_10(void) = Unreached : diff --git a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected index 926444e1674..ac1034bfc6c 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected @@ -21,7 +21,6 @@ lostReachability backEdgeCountMismatch useNotDominatedByDefinition | ir.cpp:1535:8:1535:8 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | ir.cpp:1535:8:1535:8 | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() | -| ir.cpp:2551:48:2551:71 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | ir.cpp:2550:6:2550:28 | void constexpr_inconsistency(bool) | void constexpr_inconsistency(bool) | | try_except.c:13:13:13:13 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:6:6:6:6 | void f() | void f() | | try_except.c:13:13:13:13 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:6:6:6:6 | void f() | void f() | | try_except.c:39:15:39:15 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:32:6:32:6 | void h(int) | void h(int) | diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 434da18f6be..ffae8f0b83f 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -14170,29 +14170,26 @@ ir.cpp: # 2203| mu2203_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 # 2203| r2203_7(bool) = Constant[1] : # 2203| v2203_8(void) = ConditionalBranch : r2203_7 -#-----| False -> Block 6 +#-----| False -> Block 5 #-----| True -> Block 4 # 2204| Block 4 -# 2204| r2204_1(glval) = VariableAddress[x] : -# 2204| r2204_2(glval) = FunctionAddress[set_x] : -# 2204| r2204_3(char) = Constant[97] : -# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 -# 2204| mu2204_5(unknown) = ^CallSideEffect : ~m? -# 2204| v2204_6(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, ~m? -# 2204| mu2204_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 -#-----| Goto -> Block 6 - -# 2204| Block 5 +# 2204| r2204_1(glval) = VariableAddress[x] : +# 2204| r2204_2(glval) = FunctionAddress[set_x] : +# 2204| r2204_3(char) = Constant[97] : +# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 +# 2204| mu2204_5(unknown) = ^CallSideEffect : ~m? +# 2204| v2204_6(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, ~m? +# 2204| mu2204_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 # 2204| r2204_8(glval) = VariableAddress[x] : # 2204| r2204_9(glval) = FunctionAddress[~ClassWithDestructor] : # 2204| v2204_10(void) = Call[~ClassWithDestructor] : func:r2204_9, this:r2204_8 # 2204| mu2204_11(unknown) = ^CallSideEffect : ~m? # 2204| v2204_12(void) = ^IndirectReadSideEffect[-1] : &:r2204_8, ~m? # 2204| mu2204_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_8 -#-----| Goto -> Block 6 +#-----| Goto -> Block 5 -# 2206| Block 6 +# 2206| Block 5 # 2206| r2206_1(glval) = VariableAddress[x] : # 2206| mu2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 # 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : @@ -14203,10 +14200,10 @@ ir.cpp: # 2206| r2206_8(char) = Load[c] : &:r2206_7, ~m? # 2206| r2206_9(int) = Convert : r2206_8 # 2206| v2206_10(void) = Switch : r2206_9 -#-----| Case[97] -> Block 7 -#-----| Default -> Block 8 +#-----| Case[97] -> Block 6 +#-----| Default -> Block 7 -# 2207| Block 7 +# 2207| Block 6 # 2207| v2207_1(void) = NoOp : # 2208| r2208_1(glval) = VariableAddress[x] : # 2208| r2208_2(glval) = FunctionAddress[set_x] : @@ -14222,9 +14219,9 @@ ir.cpp: # 2213| v2213_5(void) = ^IndirectReadSideEffect[-1] : &:r2213_1, ~m? # 2213| mu2213_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_1 # 2209| v2209_1(void) = NoOp : -#-----| Goto -> Block 10 +#-----| Goto -> Block 9 -# 2210| Block 8 +# 2210| Block 7 # 2210| v2210_1(void) = NoOp : # 2211| r2211_1(glval) = VariableAddress[x] : # 2211| r2211_2(glval) = FunctionAddress[set_x] : @@ -14240,18 +14237,18 @@ ir.cpp: # 2213| v2213_11(void) = ^IndirectReadSideEffect[-1] : &:r2213_7, ~m? # 2213| mu2213_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_7 # 2212| v2212_1(void) = NoOp : -#-----| Goto -> Block 10 +#-----| Goto -> Block 9 -# 2213| Block 9 +# 2213| Block 8 # 2213| r2213_13(glval) = VariableAddress[x] : # 2213| r2213_14(glval) = FunctionAddress[~ClassWithDestructor] : # 2213| v2213_15(void) = Call[~ClassWithDestructor] : func:r2213_14, this:r2213_13 # 2213| mu2213_16(unknown) = ^CallSideEffect : ~m? # 2213| v2213_17(void) = ^IndirectReadSideEffect[-1] : &:r2213_13, ~m? # 2213| mu2213_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2213_13 -#-----| Goto -> Block 10 +#-----| Goto -> Block 9 -# 2213| Block 10 +# 2213| Block 9 # 2213| v2213_19(void) = NoOp : # 2215| r2215_1(glval) = VariableAddress[x] : # 2215| mu2215_2(ClassWithDestructor) = Uninitialized[x] : &:r2215_1 @@ -14298,9 +14295,9 @@ ir.cpp: # 2216| r2216_32(iterator) = Call[end] : func:r2216_31, this:r0_5 #-----| v0_6(void) = ^IndirectReadSideEffect[-1] : &:r0_5, ~m? # 2216| mu2216_33(iterator) = Store[(__end)] : &:r2216_28, r2216_32 -#-----| Goto -> Block 11 +#-----| Goto -> Block 10 -# 2216| Block 11 +# 2216| Block 10 # 2216| r2216_34(glval>) = VariableAddress[(__begin)] : #-----| r0_7(glval>) = Convert : r2216_34 # 2216| r2216_35(glval) = FunctionAddress[operator!=] : @@ -14318,10 +14315,10 @@ ir.cpp: # 2216| r2216_41(bool) = Call[operator!=] : func:r2216_35, this:r0_7, 0:r0_13 #-----| v0_14(void) = ^IndirectReadSideEffect[-1] : &:r0_7, ~m? # 2216| v2216_42(void) = ConditionalBranch : r2216_41 -#-----| False -> Block 13 -#-----| True -> Block 12 +#-----| False -> Block 12 +#-----| True -> Block 11 -# 2216| Block 12 +# 2216| Block 11 # 2216| r2216_43(glval) = VariableAddress[y] : # 2216| r2216_44(glval>) = VariableAddress[(__begin)] : #-----| r0_15(glval>) = Convert : r2216_44 @@ -14349,9 +14346,9 @@ ir.cpp: # 2216| v2216_58(void) = ^IndirectReadSideEffect[-1] : &:r2216_54, ~m? # 2216| mu2216_59(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2216_54 # 2216| r2216_60(glval>) = CopyValue : r2216_51 -#-----| Goto (back edge) -> Block 11 +#-----| Goto (back edge) -> Block 10 -# 2216| Block 13 +# 2216| Block 12 # 2216| r2216_61(glval>) = VariableAddress[ys] : # 2216| r2216_62(glval) = FunctionAddress[~vector] : # 2216| v2216_63(void) = Call[~vector] : func:r2216_62, this:r2216_61 @@ -14397,9 +14394,9 @@ ir.cpp: # 2219| r2219_32(iterator) = Call[end] : func:r2219_31, this:r0_21 #-----| v0_22(void) = ^IndirectReadSideEffect[-1] : &:r0_21, ~m? # 2219| mu2219_33(iterator) = Store[(__end)] : &:r2219_28, r2219_32 -#-----| Goto -> Block 14 +#-----| Goto -> Block 13 -# 2219| Block 14 +# 2219| Block 13 # 2219| r2219_34(glval>) = VariableAddress[(__begin)] : #-----| r0_23(glval>) = Convert : r2219_34 # 2219| r2219_35(glval) = FunctionAddress[operator!=] : @@ -14417,10 +14414,10 @@ ir.cpp: # 2219| r2219_41(bool) = Call[operator!=] : func:r2219_35, this:r0_23, 0:r0_29 #-----| v0_30(void) = ^IndirectReadSideEffect[-1] : &:r0_23, ~m? # 2219| v2219_42(void) = ConditionalBranch : r2219_41 -#-----| False -> Block 18 -#-----| True -> Block 16 +#-----| False -> Block 17 +#-----| True -> Block 15 -# 2219| Block 15 +# 2219| Block 14 # 2219| r2219_43(glval>) = VariableAddress[(__begin)] : # 2219| r2219_44(glval) = FunctionAddress[operator++] : # 2219| r2219_45(iterator &) = Call[operator++] : func:r2219_44, this:r2219_43 @@ -14433,9 +14430,9 @@ ir.cpp: # 2219| v2219_52(void) = ^IndirectReadSideEffect[-1] : &:r2219_48, ~m? # 2219| mu2219_53(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2219_48 # 2219| r2219_54(glval>) = CopyValue : r2219_45 -#-----| Goto (back edge) -> Block 14 +#-----| Goto (back edge) -> Block 13 -# 2219| Block 16 +# 2219| Block 15 # 2219| r2219_55(glval) = VariableAddress[y] : # 2219| r2219_56(glval>) = VariableAddress[(__begin)] : #-----| r0_31(glval>) = Convert : r2219_56 @@ -14461,10 +14458,10 @@ ir.cpp: # 2221| r2221_8(int) = Constant[98] : # 2221| r2221_9(bool) = CompareEQ : r2221_7, r2221_8 # 2221| v2221_10(void) = ConditionalBranch : r2221_9 -#-----| False -> Block 15 -#-----| True -> Block 17 +#-----| False -> Block 14 +#-----| True -> Block 16 -# 2222| Block 17 +# 2222| Block 16 # 2222| v2222_1(void) = NoOp : # 2219| r2219_61(glval) = VariableAddress[y] : # 2219| r2219_62(glval) = FunctionAddress[~ClassWithDestructor] : @@ -14486,7 +14483,7 @@ ir.cpp: # 2234| mu2234_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_1 #-----| Goto -> Block 1 -# 2219| Block 18 +# 2219| Block 17 # 2219| r2219_73(glval>) = VariableAddress[ys] : # 2219| r2219_74(glval) = FunctionAddress[~vector] : # 2219| v2219_75(void) = Call[~vector] : func:r2219_74, this:r2219_73 @@ -14522,9 +14519,9 @@ ir.cpp: # 2225| r2225_22(iterator) = Call[end] : func:r2225_21, this:r0_37 #-----| v0_38(void) = ^IndirectReadSideEffect[-1] : &:r0_37, ~m? # 2225| mu2225_23(iterator) = Store[(__end)] : &:r2225_18, r2225_22 -#-----| Goto -> Block 19 +#-----| Goto -> Block 18 -# 2225| Block 19 +# 2225| Block 18 # 2225| r2225_24(glval>) = VariableAddress[(__begin)] : #-----| r0_39(glval>) = Convert : r2225_24 # 2225| r2225_25(glval) = FunctionAddress[operator!=] : @@ -14542,19 +14539,19 @@ ir.cpp: # 2225| r2225_31(bool) = Call[operator!=] : func:r2225_25, this:r0_39, 0:r0_45 #-----| v0_46(void) = ^IndirectReadSideEffect[-1] : &:r0_39, ~m? # 2225| v2225_32(void) = ConditionalBranch : r2225_31 -#-----| False -> Block 23 -#-----| True -> Block 21 +#-----| False -> Block 22 +#-----| True -> Block 20 -# 2225| Block 20 +# 2225| Block 19 # 2225| r2225_33(glval>) = VariableAddress[(__begin)] : # 2225| r2225_34(glval) = FunctionAddress[operator++] : # 2225| r2225_35(iterator &) = Call[operator++] : func:r2225_34, this:r2225_33 # 2225| v2225_36(void) = ^IndirectReadSideEffect[-1] : &:r2225_33, ~m? # 2225| mu2225_37(iterator) = ^IndirectMayWriteSideEffect[-1] : &:r2225_33 # 2225| r2225_38(glval>) = CopyValue : r2225_35 -#-----| Goto (back edge) -> Block 19 +#-----| Goto (back edge) -> Block 18 -# 2225| Block 21 +# 2225| Block 20 # 2225| r2225_39(glval) = VariableAddress[y] : # 2225| r2225_40(glval>) = VariableAddress[(__begin)] : #-----| r0_47(glval>) = Convert : r2225_40 @@ -14568,10 +14565,10 @@ ir.cpp: # 2226| r2226_3(int) = Constant[1] : # 2226| r2226_4(bool) = CompareEQ : r2226_2, r2226_3 # 2226| v2226_5(void) = ConditionalBranch : r2226_4 -#-----| False -> Block 20 -#-----| True -> Block 22 +#-----| False -> Block 19 +#-----| True -> Block 21 -# 2227| Block 22 +# 2227| Block 21 # 2227| v2227_1(void) = NoOp : # 2225| r2225_45(glval>) = VariableAddress[ys] : # 2225| r2225_46(glval) = FunctionAddress[~vector] : @@ -14587,7 +14584,7 @@ ir.cpp: # 2234| mu2234_12(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2234_7 #-----| Goto -> Block 1 -# 2225| Block 23 +# 2225| Block 22 # 2225| r2225_51(glval>) = VariableAddress[ys] : # 2225| r2225_52(glval) = FunctionAddress[~vector] : # 2225| v2225_53(void) = Call[~vector] : func:r2225_52, this:r2225_51 @@ -14633,9 +14630,9 @@ ir.cpp: # 2230| r2230_32(iterator) = Call[end] : func:r2230_31, this:r0_53 #-----| v0_54(void) = ^IndirectReadSideEffect[-1] : &:r0_53, ~m? # 2230| mu2230_33(iterator) = Store[(__end)] : &:r2230_28, r2230_32 -#-----| Goto -> Block 24 +#-----| Goto -> Block 23 -# 2230| Block 24 +# 2230| Block 23 # 2230| r2230_34(glval>) = VariableAddress[(__begin)] : #-----| r0_55(glval>) = Convert : r2230_34 # 2230| r2230_35(glval) = FunctionAddress[operator!=] : @@ -14653,10 +14650,10 @@ ir.cpp: # 2230| r2230_41(bool) = Call[operator!=] : func:r2230_35, this:r0_55, 0:r0_61 #-----| v0_62(void) = ^IndirectReadSideEffect[-1] : &:r0_55, ~m? # 2230| v2230_42(void) = ConditionalBranch : r2230_41 -#-----| False -> Block 26 -#-----| True -> Block 25 +#-----| False -> Block 25 +#-----| True -> Block 24 -# 2230| Block 25 +# 2230| Block 24 # 2230| r2230_43(glval) = VariableAddress[y] : # 2230| r2230_44(glval>) = VariableAddress[(__begin)] : #-----| r0_63(glval>) = Convert : r2230_44 @@ -14701,9 +14698,9 @@ ir.cpp: # 2230| v2230_58(void) = ^IndirectReadSideEffect[-1] : &:r2230_54, ~m? # 2230| mu2230_59(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2230_54 # 2230| r2230_60(glval>) = CopyValue : r2230_51 -#-----| Goto (back edge) -> Block 24 +#-----| Goto (back edge) -> Block 23 -# 2230| Block 26 +# 2230| Block 25 # 2230| r2230_61(glval>) = VariableAddress[ys] : # 2230| r2230_62(glval) = FunctionAddress[~vector] : # 2230| v2230_63(void) = Call[~vector] : func:r2230_62, this:r2230_61 @@ -16677,23 +16674,20 @@ ir.cpp: # 2551| mu2551_9(ClassWithDestructor &) = Store[a] : &:r2551_1, r2551_8 # 2551| r2551_10(bool) = Constant[1] : # 2551| v2551_11(void) = ConditionalBranch : r2551_10 -#-----| False -> Block 3 +#-----| False -> Block 2 #-----| True -> Block 1 # 2552| Block 1 -# 2552| v2552_1(void) = NoOp : -#-----| Goto -> Block 3 - -# 2552| Block 2 +# 2552| v2552_1(void) = NoOp : # 2552| r2552_2(glval) = CopyValue : r2551_2 # 2552| r2552_3(glval) = FunctionAddress[~ClassWithDestructor] : # 2552| v2552_4(void) = Call[~ClassWithDestructor] : func:r2552_3, this:r2552_2 # 2552| mu2552_5(unknown) = ^CallSideEffect : ~m? # 2552| v2552_6(void) = ^IndirectReadSideEffect[-1] : &:r2552_2, ~m? # 2552| mu2552_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2552_2 -#-----| Goto -> Block 3 +#-----| Goto -> Block 2 -# 2553| Block 3 +# 2553| Block 2 # 2553| v2553_1(void) = NoOp : # 2550| v2550_6(void) = ReturnVoid : # 2550| v2550_7(void) = AliasedUse : ~m? From 52db1c1253de49a9107c31be75730ad6b66edacb Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 14:16:19 +0200 Subject: [PATCH 102/118] C++: Introduce abstract class to share code between if and constexpr if --- .../raw/internal/TranslatedStmt.qll | 100 ++++++------------ 1 file changed, 31 insertions(+), 69 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll index 84b6c35fc3c..ad2a4a5ea98 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll @@ -842,9 +842,7 @@ class TranslatedCatchAnyHandler extends TranslatedHandler { } } -class TranslatedIfStmt extends TranslatedStmt, ConditionContext { - override IfStmt stmt; - +abstract class TranslatedIfLikeStmt extends TranslatedStmt, ConditionContext { override Instruction getFirstInstruction(EdgeKind kind) { if this.hasInitialization() then result = this.getInitialization().getFirstInstruction(kind) @@ -867,25 +865,21 @@ class TranslatedIfStmt extends TranslatedStmt, ConditionContext { id = 3 and result = this.getElse() } - private predicate hasInitialization() { exists(stmt.getInitialization()) } + abstract predicate hasInitialization(); - private TranslatedStmt getInitialization() { - result = getTranslatedStmt(stmt.getInitialization()) - } + abstract TranslatedStmt getInitialization(); - private TranslatedCondition getCondition() { - result = getTranslatedCondition(stmt.getCondition().getFullyConverted()) - } + abstract TranslatedCondition getCondition(); private Instruction getFirstConditionInstruction(EdgeKind kind) { result = this.getCondition().getFirstInstruction(kind) } - private TranslatedStmt getThen() { result = getTranslatedStmt(stmt.getThen()) } + abstract TranslatedStmt getThen(); - private TranslatedStmt getElse() { result = getTranslatedStmt(stmt.getElse()) } + abstract TranslatedStmt getElse(); - private predicate hasElse() { exists(stmt.getElse()) } + abstract predicate hasElse(); override Instruction getInstructionSuccessorInternal(InstructionTag tag, EdgeKind kind) { none() } @@ -914,76 +908,44 @@ class TranslatedIfStmt extends TranslatedStmt, ConditionContext { } } -class TranslatedConstExprIfStmt extends TranslatedStmt, ConditionContext { - override ConstexprIfStmt stmt; +class TranslatedIfStmt extends TranslatedIfLikeStmt { + override IfStmt stmt; - override Instruction getFirstInstruction(EdgeKind kind) { - if this.hasInitialization() - then result = this.getInitialization().getFirstInstruction(kind) - else result = this.getFirstConditionInstruction(kind) - } + override predicate hasInitialization() { exists(stmt.getInitialization()) } - override Instruction getALastInstructionInternal() { - result = this.getElse().getALastInstruction() or result = this.getThen().getALastInstruction() - } - - override TranslatedElement getLastChild() { result = this.getElse() or result = this.getThen() } - - override TranslatedElement getChildInternal(int id) { - id = 0 and result = this.getInitialization() - or - id = 1 and result = this.getCondition() - or - id = 2 and result = this.getThen() - or - id = 3 and result = this.getElse() - } - - private predicate hasInitialization() { exists(stmt.getInitialization()) } - - private TranslatedStmt getInitialization() { + override TranslatedStmt getInitialization() { result = getTranslatedStmt(stmt.getInitialization()) } - private TranslatedCondition getCondition() { + override TranslatedCondition getCondition() { result = getTranslatedCondition(stmt.getCondition().getFullyConverted()) } - private Instruction getFirstConditionInstruction(EdgeKind kind) { - result = this.getCondition().getFirstInstruction(kind) + override TranslatedStmt getThen() { result = getTranslatedStmt(stmt.getThen()) } + + override TranslatedStmt getElse() { result = getTranslatedStmt(stmt.getElse()) } + + override predicate hasElse() { exists(stmt.getElse()) } +} + +class TranslatedConstExprIfStmt extends TranslatedIfLikeStmt { + override ConstexprIfStmt stmt; + + override predicate hasInitialization() { exists(stmt.getInitialization()) } + + override TranslatedStmt getInitialization() { + result = getTranslatedStmt(stmt.getInitialization()) } - private TranslatedStmt getThen() { result = getTranslatedStmt(stmt.getThen()) } - - private TranslatedStmt getElse() { result = getTranslatedStmt(stmt.getElse()) } - - private predicate hasElse() { exists(stmt.getElse()) } - - override Instruction getInstructionSuccessorInternal(InstructionTag tag, EdgeKind kind) { none() } - - override Instruction getChildTrueSuccessor(TranslatedCondition child, EdgeKind kind) { - child = this.getCondition() and - result = this.getThen().getFirstInstruction(kind) + override TranslatedCondition getCondition() { + result = getTranslatedCondition(stmt.getCondition().getFullyConverted()) } - override Instruction getChildFalseSuccessor(TranslatedCondition child, EdgeKind kind) { - child = this.getCondition() and - if this.hasElse() - then result = this.getElse().getFirstInstruction(kind) - else result = this.getParent().getChildSuccessor(this, kind) - } + override TranslatedStmt getThen() { result = getTranslatedStmt(stmt.getThen()) } - override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) { - child = this.getInitialization() and - result = this.getFirstConditionInstruction(kind) - or - (child = this.getThen() or child = this.getElse()) and - result = this.getParent().getChildSuccessor(this, kind) - } + override TranslatedStmt getElse() { result = getTranslatedStmt(stmt.getElse()) } - override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType resultType) { - none() - } + override predicate hasElse() { exists(stmt.getElse()) } } abstract class TranslatedLoop extends TranslatedStmt, ConditionContext { From 724d026238d4aca06cdda2546e835d83761efe9e Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 8 May 2024 10:33:22 +0100 Subject: [PATCH 103/118] Go: Move `go list` functions to `toolchain` package --- go/extractor/BUILD.bazel | 1 + .../cli/go-autobuilder/go-autobuilder.go | 2 +- go/extractor/extractor.go | 7 +- go/extractor/toolchain/toolchain.go | 150 ++++++++++++++++++ go/extractor/util/util.go | 150 ------------------ 5 files changed, 156 insertions(+), 154 deletions(-) diff --git a/go/extractor/BUILD.bazel b/go/extractor/BUILD.bazel index 7e576927f66..8c69d9cc01f 100644 --- a/go/extractor/BUILD.bazel +++ b/go/extractor/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//go/extractor/dbscheme", "//go/extractor/diagnostics", "//go/extractor/srcarchive", + "//go/extractor/toolchain", "//go/extractor/trap", "//go/extractor/util", "//go/extractor/vendor/golang.org/x/mod/modfile", diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index 2e9731c989b..a4d01b29c5d 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -333,7 +333,7 @@ func buildWithoutCustomCommands(modMode project.ModMode) bool { log.Println("Build failed, continuing to install dependencies.") shouldInstallDependencies = true - } else if util.DepErrors("./...", modMode.ArgsForGoVersion(toolchain.GetEnvGoSemVer())...) { + } else if toolchain.DepErrors("./...", modMode.ArgsForGoVersion(toolchain.GetEnvGoSemVer())...) { log.Println("Dependencies are still not resolving after the build, continuing to install dependencies.") shouldInstallDependencies = true diff --git a/go/extractor/extractor.go b/go/extractor/extractor.go index d7759326d57..090bd486c3a 100644 --- a/go/extractor/extractor.go +++ b/go/extractor/extractor.go @@ -23,6 +23,7 @@ import ( "github.com/github/codeql-go/extractor/dbscheme" "github.com/github/codeql-go/extractor/diagnostics" "github.com/github/codeql-go/extractor/srcarchive" + "github.com/github/codeql-go/extractor/toolchain" "github.com/github/codeql-go/extractor/trap" "github.com/github/codeql-go/extractor/util" "golang.org/x/tools/go/packages" @@ -115,14 +116,14 @@ func ExtractWithFlags(buildFlags []string, patterns []string) error { log.Println("Done extracting universe scope.") // a map of package path to source directory and module root directory - pkgInfos := make(map[string]util.PkgInfo) + pkgInfos := make(map[string]toolchain.PkgInfo) // root directories of packages that we want to extract wantedRoots := make(map[string]bool) if os.Getenv("CODEQL_EXTRACTOR_GO_FAST_PACKAGE_INFO") != "false" { log.Printf("Running go list to resolve package and module directories.") // get all packages information - pkgInfos, err = util.GetPkgsInfo(patterns, true, modFlags...) + pkgInfos, err = toolchain.GetPkgsInfo(patterns, true, modFlags...) if err != nil { log.Fatalf("Error getting dependency package or module directories: %v.", err) } @@ -136,7 +137,7 @@ func ExtractWithFlags(buildFlags []string, patterns []string) error { log.Printf("Processing package %s.", pkg.PkgPath) if _, ok := pkgInfos[pkg.PkgPath]; !ok { - pkgInfos[pkg.PkgPath] = util.GetPkgInfo(pkg.PkgPath, modFlags...) + pkgInfos[pkg.PkgPath] = toolchain.GetPkgInfo(pkg.PkgPath, modFlags...) } log.Printf("Extracting types for package %s.", pkg.PkgPath) diff --git a/go/extractor/toolchain/toolchain.go b/go/extractor/toolchain/toolchain.go index 01befa4384e..807c8852c63 100644 --- a/go/extractor/toolchain/toolchain.go +++ b/go/extractor/toolchain/toolchain.go @@ -2,6 +2,8 @@ package toolchain import ( "bufio" + "encoding/json" + "io" "log" "os" "os/exec" @@ -177,3 +179,151 @@ func Version() *exec.Cmd { version := exec.Command("go", "version") return version } + +// Runs `go list` with `format`, `patterns`, and `flags` for the respective inputs. +func RunList(format string, patterns []string, flags ...string) (string, error) { + return RunListWithEnv(format, patterns, nil, flags...) +} + +// Runs `go list`. +func RunListWithEnv(format string, patterns []string, additionalEnv []string, flags ...string) (string, error) { + args := append([]string{"list", "-e", "-f", format}, flags...) + args = append(args, patterns...) + cmd := exec.Command("go", args...) + cmd.Env = append(os.Environ(), additionalEnv...) + out, err := cmd.Output() + + if err != nil { + if err, ok := err.(*exec.ExitError); ok { + log.Printf("Warning: go list command failed, output below:\nstdout:\n%s\nstderr:\n%s\n", out, err.Stderr) + } else { + log.Printf("Warning: Failed to run go list: %s", err.Error()) + } + return "", err + } + + return strings.TrimSpace(string(out)), nil +} + +// PkgInfo holds package directory and module directory (if any) for a package +type PkgInfo struct { + PkgDir string // the directory directly containing source code of this package + ModDir string // the module directory containing this package, empty if not a module +} + +// GetPkgsInfo gets the absolute module and package root directories for the packages matched by the +// patterns `patterns`. It passes to `go list` the flags specified by `flags`. If `includingDeps` +// is true, all dependencies will also be included. +func GetPkgsInfo(patterns []string, includingDeps bool, flags ...string) (map[string]PkgInfo, error) { + // enable module mode so that we can find a module root if it exists, even if go module support is + // disabled by a build + if includingDeps { + // the flag `-deps` causes all dependencies to be retrieved + flags = append(flags, "-deps") + } + + // using -json overrides -f format + output, err := RunList("", patterns, append(flags, "-json")...) + if err != nil { + return nil, err + } + + // the output of `go list -json` is a stream of json object + type goListPkgInfo struct { + ImportPath string + Dir string + Module *struct { + Dir string + } + } + pkgInfoMapping := make(map[string]PkgInfo) + streamDecoder := json.NewDecoder(strings.NewReader(output)) + for { + var pkgInfo goListPkgInfo + decErr := streamDecoder.Decode(&pkgInfo) + if decErr == io.EOF { + break + } + if decErr != nil { + log.Printf("Error decoding output of go list -json: %s", err.Error()) + return nil, decErr + } + pkgAbsDir, err := filepath.Abs(pkgInfo.Dir) + if err != nil { + log.Printf("Unable to make package dir %s absolute: %s", pkgInfo.Dir, err.Error()) + } + var modAbsDir string + if pkgInfo.Module != nil { + modAbsDir, err = filepath.Abs(pkgInfo.Module.Dir) + if err != nil { + log.Printf("Unable to make module dir %s absolute: %s", pkgInfo.Module.Dir, err.Error()) + } + } + pkgInfoMapping[pkgInfo.ImportPath] = PkgInfo{ + PkgDir: pkgAbsDir, + ModDir: modAbsDir, + } + } + return pkgInfoMapping, nil +} + +// GetPkgInfo fills the package info structure for the specified package path. +// It passes the `go list` the flags specified by `flags`. +func GetPkgInfo(pkgpath string, flags ...string) PkgInfo { + return PkgInfo{ + PkgDir: GetPkgDir(pkgpath, flags...), + ModDir: GetModDir(pkgpath, flags...), + } +} + +// GetModDir gets the absolute directory of the module containing the package with path +// `pkgpath`. It passes the `go list` the flags specified by `flags`. +func GetModDir(pkgpath string, flags ...string) string { + // enable module mode so that we can find a module root if it exists, even if go module support is + // disabled by a build + mod, err := RunListWithEnv("{{.Module}}", []string{pkgpath}, []string{"GO111MODULE=on"}, flags...) + if err != nil || mod == "" { + // if the command errors or modules aren't being used, return the empty string + return "" + } + + modDir, err := RunListWithEnv("{{.Module.Dir}}", []string{pkgpath}, []string{"GO111MODULE=on"}, flags...) + if err != nil { + return "" + } + + abs, err := filepath.Abs(modDir) + if err != nil { + log.Printf("Warning: unable to make %s absolute: %s", modDir, err.Error()) + return "" + } + return abs +} + +// GetPkgDir gets the absolute directory containing the package with path `pkgpath`. It passes the +// `go list` command the flags specified by `flags`. +func GetPkgDir(pkgpath string, flags ...string) string { + pkgDir, err := RunList("{{.Dir}}", []string{pkgpath}, flags...) + if err != nil { + return "" + } + + abs, err := filepath.Abs(pkgDir) + if err != nil { + log.Printf("Warning: unable to make %s absolute: %s", pkgDir, err.Error()) + return "" + } + return abs +} + +// DepErrors checks there are any errors resolving dependencies for `pkgpath`. It passes the `go +// list` command the flags specified by `flags`. +func DepErrors(pkgpath string, flags ...string) bool { + out, err := RunList("{{if .DepsErrors}}error{{else}}{{end}}", []string{pkgpath}, flags...) + if err != nil { + // if go list failed, assume dependencies are broken + return false + } + + return out != "" +} diff --git a/go/extractor/util/util.go b/go/extractor/util/util.go index 2ae6a2b0cd2..efde5988193 100644 --- a/go/extractor/util/util.go +++ b/go/extractor/util/util.go @@ -1,9 +1,7 @@ package util import ( - "encoding/json" "errors" - "io" "io/fs" "log" "net/url" @@ -35,154 +33,6 @@ func Getenv(key string, aliases ...string) string { return "" } -// runGoList is a helper function for running go list with format `format` and flags `flags` on -// package `pkgpath`. -func runGoList(format string, patterns []string, flags ...string) (string, error) { - return runGoListWithEnv(format, patterns, nil, flags...) -} - -func runGoListWithEnv(format string, patterns []string, additionalEnv []string, flags ...string) (string, error) { - args := append([]string{"list", "-e", "-f", format}, flags...) - args = append(args, patterns...) - cmd := exec.Command("go", args...) - cmd.Env = append(os.Environ(), additionalEnv...) - out, err := cmd.Output() - - if err != nil { - if err, ok := err.(*exec.ExitError); ok { - log.Printf("Warning: go list command failed, output below:\nstdout:\n%s\nstderr:\n%s\n", out, err.Stderr) - } else { - log.Printf("Warning: Failed to run go list: %s", err.Error()) - } - return "", err - } - - return strings.TrimSpace(string(out)), nil -} - -// PkgInfo holds package directory and module directory (if any) for a package -type PkgInfo struct { - PkgDir string // the directory directly containing source code of this package - ModDir string // the module directory containing this package, empty if not a module -} - -// GetPkgsInfo gets the absolute module and package root directories for the packages matched by the -// patterns `patterns`. It passes to `go list` the flags specified by `flags`. If `includingDeps` -// is true, all dependencies will also be included. -func GetPkgsInfo(patterns []string, includingDeps bool, flags ...string) (map[string]PkgInfo, error) { - // enable module mode so that we can find a module root if it exists, even if go module support is - // disabled by a build - if includingDeps { - // the flag `-deps` causes all dependencies to be retrieved - flags = append(flags, "-deps") - } - - // using -json overrides -f format - output, err := runGoList("", patterns, append(flags, "-json")...) - if err != nil { - return nil, err - } - - // the output of `go list -json` is a stream of json object - type goListPkgInfo struct { - ImportPath string - Dir string - Module *struct { - Dir string - } - } - pkgInfoMapping := make(map[string]PkgInfo) - streamDecoder := json.NewDecoder(strings.NewReader(output)) - for { - var pkgInfo goListPkgInfo - decErr := streamDecoder.Decode(&pkgInfo) - if decErr == io.EOF { - break - } - if decErr != nil { - log.Printf("Error decoding output of go list -json: %s", err.Error()) - return nil, decErr - } - pkgAbsDir, err := filepath.Abs(pkgInfo.Dir) - if err != nil { - log.Printf("Unable to make package dir %s absolute: %s", pkgInfo.Dir, err.Error()) - } - var modAbsDir string - if pkgInfo.Module != nil { - modAbsDir, err = filepath.Abs(pkgInfo.Module.Dir) - if err != nil { - log.Printf("Unable to make module dir %s absolute: %s", pkgInfo.Module.Dir, err.Error()) - } - } - pkgInfoMapping[pkgInfo.ImportPath] = PkgInfo{ - PkgDir: pkgAbsDir, - ModDir: modAbsDir, - } - } - return pkgInfoMapping, nil -} - -// GetPkgInfo fills the package info structure for the specified package path. -// It passes the `go list` the flags specified by `flags`. -func GetPkgInfo(pkgpath string, flags ...string) PkgInfo { - return PkgInfo{ - PkgDir: GetPkgDir(pkgpath, flags...), - ModDir: GetModDir(pkgpath, flags...), - } -} - -// GetModDir gets the absolute directory of the module containing the package with path -// `pkgpath`. It passes the `go list` the flags specified by `flags`. -func GetModDir(pkgpath string, flags ...string) string { - // enable module mode so that we can find a module root if it exists, even if go module support is - // disabled by a build - mod, err := runGoListWithEnv("{{.Module}}", []string{pkgpath}, []string{"GO111MODULE=on"}, flags...) - if err != nil || mod == "" { - // if the command errors or modules aren't being used, return the empty string - return "" - } - - modDir, err := runGoListWithEnv("{{.Module.Dir}}", []string{pkgpath}, []string{"GO111MODULE=on"}, flags...) - if err != nil { - return "" - } - - abs, err := filepath.Abs(modDir) - if err != nil { - log.Printf("Warning: unable to make %s absolute: %s", modDir, err.Error()) - return "" - } - return abs -} - -// GetPkgDir gets the absolute directory containing the package with path `pkgpath`. It passes the -// `go list` command the flags specified by `flags`. -func GetPkgDir(pkgpath string, flags ...string) string { - pkgDir, err := runGoList("{{.Dir}}", []string{pkgpath}, flags...) - if err != nil { - return "" - } - - abs, err := filepath.Abs(pkgDir) - if err != nil { - log.Printf("Warning: unable to make %s absolute: %s", pkgDir, err.Error()) - return "" - } - return abs -} - -// DepErrors checks there are any errors resolving dependencies for `pkgpath`. It passes the `go -// list` command the flags specified by `flags`. -func DepErrors(pkgpath string, flags ...string) bool { - out, err := runGoList("{{if .DepsErrors}}error{{else}}{{end}}", []string{pkgpath}, flags...) - if err != nil { - // if go list failed, assume dependencies are broken - return false - } - - return out != "" -} - // FileExists tests whether the file at `filename` exists and is not a directory. func FileExists(filename string) bool { info, err := os.Stat(filename) From 896fb87d1d101654ae76bdad92ca0c1298c14f3e Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 8 May 2024 11:56:31 +0100 Subject: [PATCH 104/118] Go: Fix `err` being shadowed in `RunListWithEnv` --- go/extractor/toolchain/toolchain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/extractor/toolchain/toolchain.go b/go/extractor/toolchain/toolchain.go index 807c8852c63..89ad1e35ecc 100644 --- a/go/extractor/toolchain/toolchain.go +++ b/go/extractor/toolchain/toolchain.go @@ -194,8 +194,8 @@ func RunListWithEnv(format string, patterns []string, additionalEnv []string, fl out, err := cmd.Output() if err != nil { - if err, ok := err.(*exec.ExitError); ok { - log.Printf("Warning: go list command failed, output below:\nstdout:\n%s\nstderr:\n%s\n", out, err.Stderr) + if exitErr, ok := err.(*exec.ExitError); ok { + log.Printf("Warning: go list command failed, output below:\nstdout:\n%s\nstderr:\n%s\n", out, exitErr.Stderr) } else { log.Printf("Warning: Failed to run go list: %s", err.Error()) } From 1a53b923a63b3302b9469251c91a01d57a6a0f5c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 14:48:28 +0200 Subject: [PATCH 105/118] C++: Ensure destructors for ifs are called after both branches --- .../raw/internal/TranslatedStmt.qll | 27 ++++- .../library-tests/ir/ir/aliased_ir.expected | 84 +++++++------- .../test/library-tests/ir/ir/raw_ir.expected | 108 +++++++++--------- 3 files changed, 121 insertions(+), 98 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll index ad2a4a5ea98..4423a7c33c2 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll @@ -855,6 +855,8 @@ abstract class TranslatedIfLikeStmt extends TranslatedStmt, ConditionContext { override TranslatedElement getLastChild() { result = this.getElse() or result = this.getThen() } + override predicate handlesDestructorsExplicitly() { any() } + override TranslatedElement getChildInternal(int id) { id = 0 and result = this.getInitialization() or @@ -892,7 +894,11 @@ abstract class TranslatedIfLikeStmt extends TranslatedStmt, ConditionContext { child = this.getCondition() and if this.hasElse() then result = this.getElse().getFirstInstruction(kind) - else result = this.getParent().getChildSuccessor(this, kind) + else ( + if this.hasAnImplicitDestructorCall() + then result = this.getChild(this.getFirstDestructorCallIndex()).getFirstInstruction(kind) + else result = this.getParent().getChildSuccessor(this, kind) + ) } override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) { @@ -900,7 +906,24 @@ abstract class TranslatedIfLikeStmt extends TranslatedStmt, ConditionContext { result = this.getFirstConditionInstruction(kind) or (child = this.getThen() or child = this.getElse()) and - result = this.getParent().getChildSuccessor(this, kind) + ( + if this.hasAnImplicitDestructorCall() + then result = this.getChild(this.getFirstDestructorCallIndex()).getFirstInstruction(kind) + else result = this.getParent().getChildSuccessor(this, kind) + ) + or + exists(int destructorId | + destructorId >= this.getFirstDestructorCallIndex() and + child = this.getChild(destructorId) and + result = this.getChild(destructorId + 1).getFirstInstruction(kind) + ) + or + exists(int lastDestructorIndex | + lastDestructorIndex = + max(int n | exists(this.getChild(n)) and n >= this.getFirstDestructorCallIndex()) and + child = this.getChild(lastDestructorIndex) and + result = this.getParent().getChildSuccessor(this, kind) + ) } override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType resultType) { diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index f6308583f17..54b24b4875b 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -15378,37 +15378,38 @@ ir.cpp: # 2199| v2199_12(void) = ExitFunction : # 2201| Block 2 -# 2201| r2201_1(glval) = VariableAddress[x] : -# 2201| r2201_2(glval) = FunctionAddress[set_x] : -# 2201| r2201_3(char) = Constant[97] : -# 2201| v2201_4(void) = Call[set_x] : func:r2201_2, this:r2201_1, 0:r2201_3 -# 2201| m2201_5(unknown) = ^CallSideEffect : ~m2200_6 -# 2201| m2201_6(unknown) = Chi : total:m2200_6, partial:m2201_5 -# 2201| v2201_7(void) = ^IndirectReadSideEffect[-1] : &:r2201_1, m2200_8 -# 2201| m2201_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_1 -# 2201| m2201_9(ClassWithDestructor) = Chi : total:m2200_8, partial:m2201_8 -# 2201| r2201_10(glval) = VariableAddress[x] : -# 2201| r2201_11(glval) = FunctionAddress[~ClassWithDestructor] : -# 2201| v2201_12(void) = Call[~ClassWithDestructor] : func:r2201_11, this:r2201_10 -# 2201| m2201_13(unknown) = ^CallSideEffect : ~m2201_6 -# 2201| m2201_14(unknown) = Chi : total:m2201_6, partial:m2201_13 -# 2201| v2201_15(void) = ^IndirectReadSideEffect[-1] : &:r2201_10, m2201_9 -# 2201| m2201_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_10 -# 2201| m2201_17(ClassWithDestructor) = Chi : total:m2201_9, partial:m2201_16 +# 2201| r2201_1(glval) = VariableAddress[x] : +# 2201| r2201_2(glval) = FunctionAddress[set_x] : +# 2201| r2201_3(char) = Constant[97] : +# 2201| v2201_4(void) = Call[set_x] : func:r2201_2, this:r2201_1, 0:r2201_3 +# 2201| m2201_5(unknown) = ^CallSideEffect : ~m2200_6 +# 2201| m2201_6(unknown) = Chi : total:m2200_6, partial:m2201_5 +# 2201| v2201_7(void) = ^IndirectReadSideEffect[-1] : &:r2201_1, m2200_8 +# 2201| m2201_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_1 +# 2201| m2201_9(ClassWithDestructor) = Chi : total:m2200_8, partial:m2201_8 #-----| Goto -> Block 3 -# 2203| Block 3 -# 2203| m2203_1(unknown) = Phi : from 0:~m2200_6, from 2:~m2201_14 -# 2203| r2203_2(glval) = VariableAddress[x] : -# 2203| m2203_3(ClassWithDestructor) = Uninitialized[x] : &:r2203_2 -# 2203| r2203_4(glval) = FunctionAddress[ClassWithDestructor] : -# 2203| v2203_5(void) = Call[ClassWithDestructor] : func:r2203_4, this:r2203_2 -# 2203| m2203_6(unknown) = ^CallSideEffect : ~m2203_1 -# 2203| m2203_7(unknown) = Chi : total:m2203_1, partial:m2203_6 -# 2203| m2203_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_2 -# 2203| m2203_9(ClassWithDestructor) = Chi : total:m2203_3, partial:m2203_8 -# 2203| r2203_10(bool) = Constant[1] : -# 2203| v2203_11(void) = ConditionalBranch : r2203_10 +# 2201| Block 3 +# 2201| m2201_10(ClassWithDestructor) = Phi : from 0:m2200_8, from 2:m2201_9 +# 2201| m2201_11(unknown) = Phi : from 0:~m2200_6, from 2:~m2201_6 +# 2201| r2201_12(glval) = VariableAddress[x] : +# 2201| r2201_13(glval) = FunctionAddress[~ClassWithDestructor] : +# 2201| v2201_14(void) = Call[~ClassWithDestructor] : func:r2201_13, this:r2201_12 +# 2201| m2201_15(unknown) = ^CallSideEffect : ~m2201_11 +# 2201| m2201_16(unknown) = Chi : total:m2201_11, partial:m2201_15 +# 2201| v2201_17(void) = ^IndirectReadSideEffect[-1] : &:r2201_12, m2201_10 +# 2201| m2201_18(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_12 +# 2201| m2201_19(ClassWithDestructor) = Chi : total:m2201_10, partial:m2201_18 +# 2203| r2203_1(glval) = VariableAddress[x] : +# 2203| m2203_2(ClassWithDestructor) = Uninitialized[x] : &:r2203_1 +# 2203| r2203_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2203| v2203_4(void) = Call[ClassWithDestructor] : func:r2203_3, this:r2203_1 +# 2203| m2203_5(unknown) = ^CallSideEffect : ~m2201_16 +# 2203| m2203_6(unknown) = Chi : total:m2201_16, partial:m2203_5 +# 2203| m2203_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 +# 2203| m2203_8(ClassWithDestructor) = Chi : total:m2203_2, partial:m2203_7 +# 2203| r2203_9(bool) = Constant[1] : +# 2203| v2203_10(void) = ConditionalBranch : r2203_9 #-----| False -> Block 24 #-----| True -> Block 4 @@ -15417,11 +15418,11 @@ ir.cpp: # 2204| r2204_2(glval) = FunctionAddress[set_x] : # 2204| r2204_3(char) = Constant[97] : # 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 -# 2204| m2204_5(unknown) = ^CallSideEffect : ~m2203_7 -# 2204| m2204_6(unknown) = Chi : total:m2203_7, partial:m2204_5 -# 2204| v2204_7(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, m2203_9 +# 2204| m2204_5(unknown) = ^CallSideEffect : ~m2203_6 +# 2204| m2204_6(unknown) = Chi : total:m2203_6, partial:m2204_5 +# 2204| v2204_7(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, m2203_8 # 2204| m2204_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 -# 2204| m2204_9(ClassWithDestructor) = Chi : total:m2203_9, partial:m2204_8 +# 2204| m2204_9(ClassWithDestructor) = Chi : total:m2203_8, partial:m2204_8 # 2204| r2204_10(glval) = VariableAddress[x] : # 2204| r2204_11(glval) = FunctionAddress[~ClassWithDestructor] : # 2204| v2204_12(void) = Call[~ClassWithDestructor] : func:r2204_11, this:r2204_10 @@ -18292,7 +18293,10 @@ ir.cpp: #-----| True -> Block 1 # 2547| Block 1 -# 2547| v2547_1(void) = NoOp : +# 2547| v2547_1(void) = NoOp : +#-----| Goto -> Block 2 + +# 2547| Block 2 # 2547| r2547_2(glval) = CopyValue : r2546_2 # 2547| r2547_3(glval) = FunctionAddress[~ClassWithDestructor] : # 2547| v2547_4(void) = Call[~ClassWithDestructor] : func:r2547_3, this:r2547_2 @@ -18301,14 +18305,10 @@ ir.cpp: # 2547| v2547_7(void) = ^IndirectReadSideEffect[-1] : &:r2547_2, ~m2547_6 # 2547| m2547_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2547_2 # 2547| m2547_9(unknown) = Chi : total:m2547_6, partial:m2547_8 -#-----| Goto -> Block 2 - -# 2548| Block 2 -# 2548| m2548_1(unknown) = Phi : from 0:~m2546_18, from 1:~m2547_9 -# 2548| v2548_2(void) = NoOp : -# 2545| v2545_7(void) = ReturnVoid : -# 2545| v2545_8(void) = AliasedUse : ~m2548_1 -# 2545| v2545_9(void) = ExitFunction : +# 2548| v2548_1(void) = NoOp : +# 2545| v2545_7(void) = ReturnVoid : +# 2545| v2545_8(void) = AliasedUse : ~m2547_6 +# 2545| v2545_9(void) = ExitFunction : # 2550| void constexpr_inconsistency(bool) # 2550| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index ffae8f0b83f..8c48006a448 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -14146,60 +14146,60 @@ ir.cpp: # 2199| v2199_10(void) = ExitFunction : # 2201| Block 2 -# 2201| r2201_1(glval) = VariableAddress[x] : -# 2201| r2201_2(glval) = FunctionAddress[set_x] : -# 2201| r2201_3(char) = Constant[97] : -# 2201| v2201_4(void) = Call[set_x] : func:r2201_2, this:r2201_1, 0:r2201_3 -# 2201| mu2201_5(unknown) = ^CallSideEffect : ~m? -# 2201| v2201_6(void) = ^IndirectReadSideEffect[-1] : &:r2201_1, ~m? -# 2201| mu2201_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_1 +# 2201| r2201_1(glval) = VariableAddress[x] : +# 2201| r2201_2(glval) = FunctionAddress[set_x] : +# 2201| r2201_3(char) = Constant[97] : +# 2201| v2201_4(void) = Call[set_x] : func:r2201_2, this:r2201_1, 0:r2201_3 +# 2201| mu2201_5(unknown) = ^CallSideEffect : ~m? +# 2201| v2201_6(void) = ^IndirectReadSideEffect[-1] : &:r2201_1, ~m? +# 2201| mu2201_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_1 +#-----| Goto -> Block 3 + +# 2201| Block 3 # 2201| r2201_8(glval) = VariableAddress[x] : # 2201| r2201_9(glval) = FunctionAddress[~ClassWithDestructor] : # 2201| v2201_10(void) = Call[~ClassWithDestructor] : func:r2201_9, this:r2201_8 # 2201| mu2201_11(unknown) = ^CallSideEffect : ~m? # 2201| v2201_12(void) = ^IndirectReadSideEffect[-1] : &:r2201_8, ~m? # 2201| mu2201_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2201_8 -#-----| Goto -> Block 3 - -# 2203| Block 3 -# 2203| r2203_1(glval) = VariableAddress[x] : -# 2203| mu2203_2(ClassWithDestructor) = Uninitialized[x] : &:r2203_1 -# 2203| r2203_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2203| v2203_4(void) = Call[ClassWithDestructor] : func:r2203_3, this:r2203_1 -# 2203| mu2203_5(unknown) = ^CallSideEffect : ~m? -# 2203| mu2203_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 -# 2203| r2203_7(bool) = Constant[1] : -# 2203| v2203_8(void) = ConditionalBranch : r2203_7 +# 2203| r2203_1(glval) = VariableAddress[x] : +# 2203| mu2203_2(ClassWithDestructor) = Uninitialized[x] : &:r2203_1 +# 2203| r2203_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2203| v2203_4(void) = Call[ClassWithDestructor] : func:r2203_3, this:r2203_1 +# 2203| mu2203_5(unknown) = ^CallSideEffect : ~m? +# 2203| mu2203_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2203_1 +# 2203| r2203_7(bool) = Constant[1] : +# 2203| v2203_8(void) = ConditionalBranch : r2203_7 #-----| False -> Block 5 #-----| True -> Block 4 # 2204| Block 4 -# 2204| r2204_1(glval) = VariableAddress[x] : -# 2204| r2204_2(glval) = FunctionAddress[set_x] : -# 2204| r2204_3(char) = Constant[97] : -# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 -# 2204| mu2204_5(unknown) = ^CallSideEffect : ~m? -# 2204| v2204_6(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, ~m? -# 2204| mu2204_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 +# 2204| r2204_1(glval) = VariableAddress[x] : +# 2204| r2204_2(glval) = FunctionAddress[set_x] : +# 2204| r2204_3(char) = Constant[97] : +# 2204| v2204_4(void) = Call[set_x] : func:r2204_2, this:r2204_1, 0:r2204_3 +# 2204| mu2204_5(unknown) = ^CallSideEffect : ~m? +# 2204| v2204_6(void) = ^IndirectReadSideEffect[-1] : &:r2204_1, ~m? +# 2204| mu2204_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_1 +#-----| Goto -> Block 5 + +# 2204| Block 5 # 2204| r2204_8(glval) = VariableAddress[x] : # 2204| r2204_9(glval) = FunctionAddress[~ClassWithDestructor] : # 2204| v2204_10(void) = Call[~ClassWithDestructor] : func:r2204_9, this:r2204_8 # 2204| mu2204_11(unknown) = ^CallSideEffect : ~m? # 2204| v2204_12(void) = ^IndirectReadSideEffect[-1] : &:r2204_8, ~m? # 2204| mu2204_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2204_8 -#-----| Goto -> Block 5 - -# 2206| Block 5 -# 2206| r2206_1(glval) = VariableAddress[x] : -# 2206| mu2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 -# 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : -# 2206| v2206_4(void) = Call[ClassWithDestructor] : func:r2206_3, this:r2206_1 -# 2206| mu2206_5(unknown) = ^CallSideEffect : ~m? -# 2206| mu2206_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2206_1 -# 2206| r2206_7(glval) = VariableAddress[c] : -# 2206| r2206_8(char) = Load[c] : &:r2206_7, ~m? -# 2206| r2206_9(int) = Convert : r2206_8 -# 2206| v2206_10(void) = Switch : r2206_9 +# 2206| r2206_1(glval) = VariableAddress[x] : +# 2206| mu2206_2(ClassWithDestructor) = Uninitialized[x] : &:r2206_1 +# 2206| r2206_3(glval) = FunctionAddress[ClassWithDestructor] : +# 2206| v2206_4(void) = Call[ClassWithDestructor] : func:r2206_3, this:r2206_1 +# 2206| mu2206_5(unknown) = ^CallSideEffect : ~m? +# 2206| mu2206_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2206_1 +# 2206| r2206_7(glval) = VariableAddress[c] : +# 2206| r2206_8(char) = Load[c] : &:r2206_7, ~m? +# 2206| r2206_9(int) = Convert : r2206_8 +# 2206| v2206_10(void) = Switch : r2206_9 #-----| Case[97] -> Block 6 #-----| Default -> Block 7 @@ -16641,20 +16641,20 @@ ir.cpp: #-----| True -> Block 1 # 2547| Block 1 -# 2547| v2547_1(void) = NoOp : +# 2547| v2547_1(void) = NoOp : +#-----| Goto -> Block 2 + +# 2547| Block 2 # 2547| r2547_2(glval) = CopyValue : r2546_2 # 2547| r2547_3(glval) = FunctionAddress[~ClassWithDestructor] : # 2547| v2547_4(void) = Call[~ClassWithDestructor] : func:r2547_3, this:r2547_2 # 2547| mu2547_5(unknown) = ^CallSideEffect : ~m? # 2547| v2547_6(void) = ^IndirectReadSideEffect[-1] : &:r2547_2, ~m? # 2547| mu2547_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2547_2 -#-----| Goto -> Block 2 - -# 2548| Block 2 -# 2548| v2548_1(void) = NoOp : -# 2545| v2545_6(void) = ReturnVoid : -# 2545| v2545_7(void) = AliasedUse : ~m? -# 2545| v2545_8(void) = ExitFunction : +# 2548| v2548_1(void) = NoOp : +# 2545| v2545_6(void) = ReturnVoid : +# 2545| v2545_7(void) = AliasedUse : ~m? +# 2545| v2545_8(void) = ExitFunction : # 2550| void constexpr_inconsistency(bool) # 2550| Block 0 @@ -16678,20 +16678,20 @@ ir.cpp: #-----| True -> Block 1 # 2552| Block 1 -# 2552| v2552_1(void) = NoOp : +# 2552| v2552_1(void) = NoOp : +#-----| Goto -> Block 2 + +# 2552| Block 2 # 2552| r2552_2(glval) = CopyValue : r2551_2 # 2552| r2552_3(glval) = FunctionAddress[~ClassWithDestructor] : # 2552| v2552_4(void) = Call[~ClassWithDestructor] : func:r2552_3, this:r2552_2 # 2552| mu2552_5(unknown) = ^CallSideEffect : ~m? # 2552| v2552_6(void) = ^IndirectReadSideEffect[-1] : &:r2552_2, ~m? # 2552| mu2552_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2552_2 -#-----| Goto -> Block 2 - -# 2553| Block 2 -# 2553| v2553_1(void) = NoOp : -# 2550| v2550_6(void) = ReturnVoid : -# 2550| v2550_7(void) = AliasedUse : ~m? -# 2550| v2550_8(void) = ExitFunction : +# 2553| v2553_1(void) = NoOp : +# 2550| v2550_6(void) = ReturnVoid : +# 2550| v2550_7(void) = AliasedUse : ~m? +# 2550| v2550_8(void) = ExitFunction : perf-regression.cpp: # 6| void Big::Big() From 088f8297b60bfefa5bedf964eb3cefc1439b3ae3 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 8 May 2024 14:04:21 +0100 Subject: [PATCH 106/118] C++: Use nullptr. --- cpp/ql/src/Critical/DoubleFreeBad2.cpp | 2 +- cpp/ql/src/Critical/DoubleFreeGood2.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/ql/src/Critical/DoubleFreeBad2.cpp b/cpp/ql/src/Critical/DoubleFreeBad2.cpp index e4e758dfa10..b63e100434d 100644 --- a/cpp/ql/src/Critical/DoubleFreeBad2.cpp +++ b/cpp/ql/src/Critical/DoubleFreeBad2.cpp @@ -1,5 +1,5 @@ void g() { - MyTask *task = NULL; + MyTask *task = nullptr; try { diff --git a/cpp/ql/src/Critical/DoubleFreeGood2.cpp b/cpp/ql/src/Critical/DoubleFreeGood2.cpp index dbcac3d175c..f1abdd01688 100644 --- a/cpp/ql/src/Critical/DoubleFreeGood2.cpp +++ b/cpp/ql/src/Critical/DoubleFreeGood2.cpp @@ -1,5 +1,5 @@ void g() { - MyTask *task = NULL; + MyTask *task = nullptr; try { @@ -8,7 +8,7 @@ void g() { ... delete task; - task = NULL; + task = nullptr; ... } catch (...) { From 9842445b52ae48baad705815958a4569507dcf02 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 7 May 2024 12:10:27 +0100 Subject: [PATCH 107/118] Fix `getType` on `ImplicitVarArgsSlice` It was not defined for built-in functions or for functions called via a function variable. --- go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll b/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll index 6b230bc728f..947491b44bb 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll @@ -455,8 +455,8 @@ module Public { CallNode getCallNode() { result = call } override Type getType() { - exists(Function f | f = call.getTarget() | - result = f.getParameterType(f.getNumParameter() - 1) + exists(SignatureType t | t = call.getCall().getCalleeType() | + result = t.getParameterType(t.getNumParameter() - 1) ) } From 4d42a88c3cb7bf5c5802fb993e560011eeba3987 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 8 May 2024 15:31:22 +0100 Subject: [PATCH 108/118] Add change note --- .../2024-05-08-fix-flow-variadic-builtin-variable.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md diff --git a/go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md b/go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md new file mode 100644 index 00000000000..9d9dabb34a2 --- /dev/null +++ b/go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Fixed a bug that stopped data flow from being followed through variadic arguments to built-in functions or to functions called using a variable. From fb74a2a170246090195da7e8fa806a47e9580939 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Mon, 6 May 2024 07:29:00 +0100 Subject: [PATCH 109/118] Use "" in qualified name for entities without a package --- go/ql/lib/semmle/go/Scopes.qll | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/go/ql/lib/semmle/go/Scopes.qll b/go/ql/lib/semmle/go/Scopes.qll index 3f2b394d775..d45f4142427 100644 --- a/go/ql/lib/semmle/go/Scopes.qll +++ b/go/ql/lib/semmle/go/Scopes.qll @@ -103,7 +103,11 @@ class Entity extends @object { */ pragma[nomagic] predicate hasQualifiedName(string pkg, string name) { - pkg = this.getPackage().getPath() and + ( + pkg = this.getPackage().getPath() + or + not exists(this.getPackage()) and pkg = "" + ) and name = this.getName() } From f6f594e4b580a7ba50b4591f87fa104502524388 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Mon, 6 May 2024 07:30:19 +0100 Subject: [PATCH 110/118] parse empty string as package name --- go/ql/lib/semmle/go/dataflow/ExternalFlow.qll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll index 26572e27a78..02049bf66c7 100644 --- a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll +++ b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll @@ -271,6 +271,8 @@ private string interpretPackage(string p) { then result = package(p.regexpCapture(r, 1), p.regexpCapture(r, 4)) else result = package(p, "") ) + or + p = "" and result = "" } /** Gets the source/sink/summary element corresponding to the supplied parameters. */ From 1ccea884ff37e261ebea4c9bab34aa6d6f6229a4 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 8 May 2024 15:37:25 +0100 Subject: [PATCH 111/118] Add change note --- .../change-notes/2024-05-08-builtin-functions-no-package.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 go/ql/lib/change-notes/2024-05-08-builtin-functions-no-package.md diff --git a/go/ql/lib/change-notes/2024-05-08-builtin-functions-no-package.md b/go/ql/lib/change-notes/2024-05-08-builtin-functions-no-package.md new file mode 100644 index 00000000000..245a4490fbe --- /dev/null +++ b/go/ql/lib/change-notes/2024-05-08-builtin-functions-no-package.md @@ -0,0 +1,5 @@ +--- +category: minorAnalysis +--- +* Fixed a bug that stopped built-in functions from being referenced using the predicate `hasQualifiedName` because technically they do not belong to any package. Now you can use the empty string as the package, e.g. `f.hasQualifiedName("", "len")`. +* Fixed a bug that stopped data flow models for built-in functions from having any effect because the package "" was not parsed correctly. From 57ff30c5f3510319313c8521514bf4e502b597a1 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 8 May 2024 16:07:02 +0100 Subject: [PATCH 112/118] Update tests: built-in models now work --- .../dataflow/FlowSteps/LocalFlowStep.expected | 2 ++ .../PromotedFields/LocalFlowStep.expected | 2 ++ .../Security/CWE-078/CommandInjection.expected | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected b/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected index 928d7a9f394..065d000cd4b 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected @@ -1,3 +1,5 @@ +| file://:0:0:0:0 | [summary param] 1 in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | +| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | | file://:0:0:0:0 | function Encode | url.go:51:14:51:21 | selection of Encode | | file://:0:0:0:0 | function EscapedPath | url.go:28:14:28:26 | selection of EscapedPath | | file://:0:0:0:0 | function Get | url.go:52:14:52:18 | selection of Get | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected b/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected index d61d6be9c5f..95f4fecfb42 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected @@ -1,3 +1,5 @@ +| file://:0:0:0:0 | [summary param] 1 in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | +| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | | main.go:3:6:3:11 | function source | main.go:23:31:23:36 | source | | main.go:3:6:3:11 | function source | main.go:31:31:31:36 | source | | main.go:3:6:3:11 | function source | main.go:40:30:40:35 | source | diff --git a/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected b/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected index afe35f92dc6..19fb8e88ea3 100644 --- a/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected +++ b/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected @@ -13,6 +13,7 @@ edges | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:13:25:13:31 | tainted | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:14:23:14:33 | slice expression | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:39:31:39:37 | tainted | provenance | | +| SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:52:24:52:30 | tainted | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:53:21:53:28 | arrayLit | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:68:31:68:37 | tainted | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:80:23:80:29 | tainted | provenance | | @@ -23,8 +24,12 @@ edges | SanitizingDoubleDash.go:14:23:14:33 | slice expression [array] | SanitizingDoubleDash.go:14:23:14:33 | slice expression | provenance | | | SanitizingDoubleDash.go:39:14:39:44 | call to append | SanitizingDoubleDash.go:40:23:40:30 | arrayLit | provenance | | | SanitizingDoubleDash.go:39:31:39:37 | tainted | SanitizingDoubleDash.go:39:14:39:44 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:52:15:52:31 | slice literal [array] | SanitizingDoubleDash.go:53:21:53:28 | arrayLit [array] | provenance | | +| SanitizingDoubleDash.go:52:24:52:30 | tainted | SanitizingDoubleDash.go:52:15:52:31 | slice literal [array] | provenance | | | SanitizingDoubleDash.go:53:14:53:35 | call to append | SanitizingDoubleDash.go:54:23:54:30 | arrayLit | provenance | | +| SanitizingDoubleDash.go:53:14:53:35 | call to append [array] | SanitizingDoubleDash.go:54:23:54:30 | arrayLit | provenance | | | SanitizingDoubleDash.go:53:21:53:28 | arrayLit | SanitizingDoubleDash.go:53:14:53:35 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:53:21:53:28 | arrayLit [array] | SanitizingDoubleDash.go:53:14:53:35 | call to append [array] | provenance | MaD:28 | | SanitizingDoubleDash.go:68:14:68:38 | call to append | SanitizingDoubleDash.go:69:21:69:28 | arrayLit | provenance | | | SanitizingDoubleDash.go:68:31:68:37 | tainted | SanitizingDoubleDash.go:68:14:68:38 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:69:14:69:35 | call to append | SanitizingDoubleDash.go:70:23:70:30 | arrayLit | provenance | | @@ -39,6 +44,7 @@ edges | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:111:37:111:43 | tainted | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:117:31:117:37 | tainted | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:123:31:123:37 | tainted | provenance | | +| SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:128:24:128:30 | tainted | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:129:21:129:28 | arrayLit | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:136:31:136:37 | tainted | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:142:31:142:37 | tainted | provenance | | @@ -62,8 +68,12 @@ edges | SanitizingDoubleDash.go:117:31:117:37 | tainted | SanitizingDoubleDash.go:117:14:117:44 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:123:14:123:38 | call to append | SanitizingDoubleDash.go:124:24:124:31 | arrayLit | provenance | | | SanitizingDoubleDash.go:123:31:123:37 | tainted | SanitizingDoubleDash.go:123:14:123:38 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:128:15:128:31 | slice literal [array] | SanitizingDoubleDash.go:129:21:129:28 | arrayLit [array] | provenance | | +| SanitizingDoubleDash.go:128:24:128:30 | tainted | SanitizingDoubleDash.go:128:15:128:31 | slice literal [array] | provenance | | | SanitizingDoubleDash.go:129:14:129:35 | call to append | SanitizingDoubleDash.go:130:24:130:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:129:14:129:35 | call to append [array] | SanitizingDoubleDash.go:130:24:130:31 | arrayLit | provenance | | | SanitizingDoubleDash.go:129:21:129:28 | arrayLit | SanitizingDoubleDash.go:129:14:129:35 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:129:21:129:28 | arrayLit [array] | SanitizingDoubleDash.go:129:14:129:35 | call to append [array] | provenance | MaD:28 | | SanitizingDoubleDash.go:136:14:136:38 | call to append | SanitizingDoubleDash.go:137:24:137:31 | arrayLit | provenance | | | SanitizingDoubleDash.go:136:31:136:37 | tainted | SanitizingDoubleDash.go:136:14:136:38 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:142:14:142:38 | call to append | SanitizingDoubleDash.go:143:21:143:28 | arrayLit | provenance | | @@ -95,8 +105,12 @@ nodes | SanitizingDoubleDash.go:39:14:39:44 | call to append | semmle.label | call to append | | SanitizingDoubleDash.go:39:31:39:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:40:23:40:30 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:52:15:52:31 | slice literal [array] | semmle.label | slice literal [array] | +| SanitizingDoubleDash.go:52:24:52:30 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:53:14:53:35 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:53:14:53:35 | call to append [array] | semmle.label | call to append [array] | | SanitizingDoubleDash.go:53:21:53:28 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:53:21:53:28 | arrayLit [array] | semmle.label | arrayLit [array] | | SanitizingDoubleDash.go:54:23:54:30 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:68:14:68:38 | call to append | semmle.label | call to append | | SanitizingDoubleDash.go:68:31:68:37 | tainted | semmle.label | tainted | @@ -130,8 +144,12 @@ nodes | SanitizingDoubleDash.go:123:14:123:38 | call to append | semmle.label | call to append | | SanitizingDoubleDash.go:123:31:123:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:124:24:124:31 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:128:15:128:31 | slice literal [array] | semmle.label | slice literal [array] | +| SanitizingDoubleDash.go:128:24:128:30 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:129:14:129:35 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:129:14:129:35 | call to append [array] | semmle.label | call to append [array] | | SanitizingDoubleDash.go:129:21:129:28 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:129:21:129:28 | arrayLit [array] | semmle.label | arrayLit [array] | | SanitizingDoubleDash.go:130:24:130:31 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:136:14:136:38 | call to append | semmle.label | call to append | | SanitizingDoubleDash.go:136:31:136:37 | tainted | semmle.label | tainted | From 4f10cb5fa08688c3f61413a88b9f286f1d3bd9f7 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 8 May 2024 16:13:37 +0100 Subject: [PATCH 113/118] Local flow tests: do not list summary models This is so that when we don't change the test results every time we add a summary model for a built-in function. --- .../semmle/go/dataflow/FlowSteps/LocalFlowStep.expected | 2 -- .../semmle/go/dataflow/FlowSteps/LocalFlowStep.ql | 4 +++- .../semmle/go/dataflow/PromotedFields/LocalFlowStep.expected | 2 -- .../semmle/go/dataflow/PromotedFields/LocalFlowStep.ql | 4 +++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected b/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected index 065d000cd4b..928d7a9f394 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected @@ -1,5 +1,3 @@ -| file://:0:0:0:0 | [summary param] 1 in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | -| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | | file://:0:0:0:0 | function Encode | url.go:51:14:51:21 | selection of Encode | | file://:0:0:0:0 | function EscapedPath | url.go:28:14:28:26 | selection of EscapedPath | | file://:0:0:0:0 | function Get | url.go:52:14:52:18 | selection of Get | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.ql b/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.ql index 979c4fd6700..8bc89603405 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.ql +++ b/go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.ql @@ -1,5 +1,7 @@ import go from DataFlow::Node nd, DataFlow::Node succ -where DataFlow::localFlowStep(nd, succ) +where + DataFlow::localFlowStep(nd, succ) and + (exists(nd.getFile()) or exists(succ.getFile())) select nd, succ diff --git a/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected b/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected index 95f4fecfb42..d61d6be9c5f 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.expected @@ -1,5 +1,3 @@ -| file://:0:0:0:0 | [summary param] 1 in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | -| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in append | file://:0:0:0:0 | [summary] to write: ReturnValue.ArrayElement in append | | main.go:3:6:3:11 | function source | main.go:23:31:23:36 | source | | main.go:3:6:3:11 | function source | main.go:31:31:31:36 | source | | main.go:3:6:3:11 | function source | main.go:40:30:40:35 | source | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.ql b/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.ql index 979c4fd6700..8bc89603405 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.ql +++ b/go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.ql @@ -1,5 +1,7 @@ import go from DataFlow::Node nd, DataFlow::Node succ -where DataFlow::localFlowStep(nd, succ) +where + DataFlow::localFlowStep(nd, succ) and + (exists(nd.getFile()) or exists(succ.getFile())) select nd, succ From 53d4a10108ae8e4c9604bbbb1684a6c2be85e21d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 8 May 2024 17:15:08 +0100 Subject: [PATCH 114/118] Update cpp/ql/src/Critical/DoubleFree.qhelp Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> --- cpp/ql/src/Critical/DoubleFree.qhelp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/ql/src/Critical/DoubleFree.qhelp b/cpp/ql/src/Critical/DoubleFree.qhelp index 52d586caf1e..b8c817617f7 100644 --- a/cpp/ql/src/Critical/DoubleFree.qhelp +++ b/cpp/ql/src/Critical/DoubleFree.qhelp @@ -26,9 +26,8 @@ In the following example, buff is allocated and then freed twice:

    -Reviewing the code above, the issue can be fixed by simply deleting the additonal call to -free(buff). Another buffer new_buffer is allocated, but we can see the intent was -not to free new_buffer as this pointer is returned by the function. +Reviewing the code above, the issue can be fixed by simply deleting the additional call to +free(buff).

    From d68d2cca41551fae1e0597a1e36919385aa59c87 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 18:05:20 +0200 Subject: [PATCH 115/118] C++: Fix destructor translation for handlers --- .../raw/internal/TranslatedElement.qll | 6 ++ .../raw/internal/TranslatedStmt.qll | 76 ++++++++++++++++++- .../library-tests/ir/ir/aliased_ir.expected | 60 +++++++-------- .../test/library-tests/ir/ir/raw_ir.expected | 46 +++++------ 4 files changed, 134 insertions(+), 54 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll index 7024911a420..4d2b1a95d31 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll @@ -830,6 +830,12 @@ newtype TTranslatedElement = not ignoreExpr(dc) ) } or + // The set of destructors to invoke after a handler for a `try` statement. These + // need to be special cased because the destructors need to run following an + // `ExceptionEdge`, but not following a `GotoEdge` edge. + TTranslatedDestructorsAfterHandler(Handler handler) { + exists(handler.getAnImplicitDestructorCall()) + } or // A precise side effect of an argument to a `Call` TTranslatedArgumentExprSideEffect(Call call, Expr expr, int n, SideEffectOpcode opcode) { not ignoreExpr(expr) and diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll index 4423a7c33c2..b2d9910514b 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll @@ -777,6 +777,72 @@ abstract class TranslatedHandler extends TranslatedStmt { TranslatedStmt getBlock() { result = getTranslatedStmt(stmt.getBlock()) } } +/** + * The IR translation of the destructor calls of the parent `TranslatedCatchByTypeHandler`. + * + * This object does not itself generate the destructor calls. Instead, its + * children provide the actual calls. + */ +class TranslatedDestructorsAfterHandler extends TranslatedElement, + TTranslatedDestructorsAfterHandler +{ + Handler handler; + + TranslatedDestructorsAfterHandler() { this = TTranslatedDestructorsAfterHandler(handler) } + + override string toString() { result = "Destructor calls after handler: " + handler } + + private TranslatedCall getTranslatedImplicitDestructorCall(int id) { + result.getExpr() = handler.getImplicitDestructorCall(id) + } + + override Instruction getFirstInstruction(EdgeKind kind) { + result = this.getChild(0).getFirstInstruction(kind) + } + + override Handler getAst() { result = handler } + + override Instruction getInstructionSuccessorInternal(InstructionTag tag, EdgeKind kind) { none() } + + override TranslatedElement getChild(int id) { + result = this.getTranslatedImplicitDestructorCall(id) + } + + override predicate handlesDestructorsExplicitly() { any() } + + override Declaration getFunction() { result = handler.getEnclosingFunction() } + + override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) { + exists(int id | child = this.getChild(id) | + // Transition to the next child, if any. + result = this.getChild(id + 1).getFirstInstruction(kind) + or + // And otherwise, exit this element with an exceptional edge + not exists(this.getChild(id + 1)) and + result = + getTranslatedStmt(handler) + .getParent() + .(TranslatedTryStmt) + .getNextHandler(getTranslatedStmt(handler), kind) + ) + } + + override TranslatedElement getLastChild() { + result = + this.getTranslatedImplicitDestructorCall(max(int id | + exists(handler.getImplicitDestructorCall(id)) + )) + } + + override Instruction getALastInstructionInternal() { + result = this.getLastChild().getALastInstruction() + } + + override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType resultType) { + none() + } +} + /** * The IR translation of a C++ `catch` block that catches an exception with a * specific type (e.g. `catch (const std::exception&)`). @@ -790,10 +856,14 @@ class TranslatedCatchByTypeHandler extends TranslatedHandler { resultType = getVoidType() } + override predicate handlesDestructorsExplicitly() { any() } + override TranslatedElement getChildInternal(int id) { result = super.getChildInternal(id) or id = 0 and result = this.getParameter() + or + id = 1 and result = this.getDestructors() } override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) { @@ -810,7 +880,9 @@ class TranslatedCatchByTypeHandler extends TranslatedHandler { result = this.getParameter().getFirstInstruction(kind) or kind instanceof ExceptionEdge and - result = this.getParent().(TranslatedTryStmt).getNextHandler(this, any(GotoEdge edge)) + if exists(this.getDestructors()) + then result = this.getDestructors().getFirstInstruction(any(GotoEdge edge)) + else result = this.getParent().(TranslatedTryStmt).getNextHandler(this, any(GotoEdge edge)) ) } @@ -822,6 +894,8 @@ class TranslatedCatchByTypeHandler extends TranslatedHandler { private TranslatedParameter getParameter() { result = getTranslatedParameter(stmt.getParameter()) } + + private TranslatedDestructorsAfterHandler getDestructors() { result.getAst() = stmt } } /** diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index 54b24b4875b..b7b9f1520bf 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -18220,44 +18220,44 @@ ir.cpp: # 2537| r2537_2(int) = Constant[42] : # 2537| m2537_3(int) = Store[#throw2537:5] : &:r2537_1, r2537_2 # 2537| v2537_4(void) = ThrowValue : &:r2537_1, m2537_3 -#-----| Exception -> Block 3 +#-----| Exception -> Block 2 # 2534| Block 1 -# 2534| m2534_5(unknown) = Phi : from 2:~m2535_6, from 4:~m2541_14 +# 2534| m2534_5(unknown) = Phi : from 3:~m2541_6, from 4:~m2541_14 # 2534| v2534_6(void) = AliasedUse : ~m2534_5 # 2534| v2534_7(void) = ExitFunction : -# 2534| Block 2 -# 2534| v2534_8(void) = Unwind : -#-----| Goto -> Block 1 +# 2539| Block 2 +# 2539| v2539_1(void) = CatchByType[char] : +#-----| Exception -> Block 4 +#-----| Goto -> Block 3 # 2539| Block 3 -# 2539| v2539_1(void) = CatchByType[char] : -#-----| Exception -> Block 2 -#-----| Goto -> Block 4 +# 2539| r2539_2(glval) = VariableAddress[(unnamed parameter 0)] : +# 2539| m2539_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2539_2 +# 2539| v2539_4(void) = NoOp : +# 2541| v2541_1(void) = NoOp : +# 2541| r2541_2(glval) = VariableAddress[x] : +# 2541| r2541_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_4(void) = Call[~ClassWithDestructor] : func:r2541_3, this:r2541_2 +# 2541| m2541_5(unknown) = ^CallSideEffect : ~m2535_6 +# 2541| m2541_6(unknown) = Chi : total:m2535_6, partial:m2541_5 +# 2541| v2541_7(void) = ^IndirectReadSideEffect[-1] : &:r2541_2, m2535_8 +# 2541| m2541_8(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_2 +# 2541| m2541_9(ClassWithDestructor) = Chi : total:m2535_8, partial:m2541_8 +# 2534| v2534_8(void) = ReturnVoid : +#-----| Goto -> Block 1 -# 2539| Block 4 -# 2539| r2539_2(glval) = VariableAddress[(unnamed parameter 0)] : -# 2539| m2539_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2539_2 -# 2539| v2539_4(void) = NoOp : -# 2541| r2541_1(glval) = VariableAddress[x] : -# 2541| r2541_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2541| v2541_3(void) = Call[~ClassWithDestructor] : func:r2541_2, this:r2541_1 -# 2541| m2541_4(unknown) = ^CallSideEffect : ~m2535_6 -# 2541| m2541_5(unknown) = Chi : total:m2535_6, partial:m2541_4 -# 2541| v2541_6(void) = ^IndirectReadSideEffect[-1] : &:r2541_1, m2535_8 -# 2541| m2541_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_1 -# 2541| m2541_8(ClassWithDestructor) = Chi : total:m2535_8, partial:m2541_7 -# 2541| v2541_9(void) = NoOp : -# 2541| r2541_10(glval) = VariableAddress[x] : -# 2541| r2541_11(glval) = FunctionAddress[~ClassWithDestructor] : -# 2541| v2541_12(void) = Call[~ClassWithDestructor] : func:r2541_11, this:r2541_10 -# 2541| m2541_13(unknown) = ^CallSideEffect : ~m2541_5 -# 2541| m2541_14(unknown) = Chi : total:m2541_5, partial:m2541_13 -# 2541| v2541_15(void) = ^IndirectReadSideEffect[-1] : &:r2541_10, m2541_8 -# 2541| m2541_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_10 -# 2541| m2541_17(ClassWithDestructor) = Chi : total:m2541_8, partial:m2541_16 -# 2534| v2534_9(void) = ReturnVoid : +# 2541| Block 4 +# 2541| r2541_10(glval) = VariableAddress[x] : +# 2541| r2541_11(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_12(void) = Call[~ClassWithDestructor] : func:r2541_11, this:r2541_10 +# 2541| m2541_13(unknown) = ^CallSideEffect : ~m2535_6 +# 2541| m2541_14(unknown) = Chi : total:m2535_6, partial:m2541_13 +# 2541| v2541_15(void) = ^IndirectReadSideEffect[-1] : &:r2541_10, m2535_8 +# 2541| m2541_16(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_10 +# 2541| m2541_17(ClassWithDestructor) = Chi : total:m2535_8, partial:m2541_16 +# 2534| v2534_9(void) = Unwind : #-----| Goto -> Block 1 # 2545| void this_inconsistency(bool) diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 8c48006a448..842aa7ad4b7 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -16577,39 +16577,39 @@ ir.cpp: # 2537| r2537_2(int) = Constant[42] : # 2537| mu2537_3(int) = Store[#throw2537:5] : &:r2537_1, r2537_2 # 2537| v2537_4(void) = ThrowValue : &:r2537_1, ~m? -#-----| Exception -> Block 3 +#-----| Exception -> Block 2 # 2534| Block 1 # 2534| v2534_4(void) = AliasedUse : ~m? # 2534| v2534_5(void) = ExitFunction : -# 2534| Block 2 -# 2534| v2534_6(void) = Unwind : -#-----| Goto -> Block 1 +# 2539| Block 2 +# 2539| v2539_1(void) = CatchByType[char] : +#-----| Exception -> Block 4 +#-----| Goto -> Block 3 # 2539| Block 3 -# 2539| v2539_1(void) = CatchByType[char] : -#-----| Exception -> Block 2 -#-----| Goto -> Block 4 - -# 2539| Block 4 # 2539| r2539_2(glval) = VariableAddress[(unnamed parameter 0)] : # 2539| mu2539_3(char) = InitializeParameter[(unnamed parameter 0)] : &:r2539_2 # 2539| v2539_4(void) = NoOp : -# 2541| r2541_1(glval) = VariableAddress[x] : -# 2541| r2541_2(glval) = FunctionAddress[~ClassWithDestructor] : -# 2541| v2541_3(void) = Call[~ClassWithDestructor] : func:r2541_2, this:r2541_1 -# 2541| mu2541_4(unknown) = ^CallSideEffect : ~m? -# 2541| v2541_5(void) = ^IndirectReadSideEffect[-1] : &:r2541_1, ~m? -# 2541| mu2541_6(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_1 -# 2541| v2541_7(void) = NoOp : -# 2541| r2541_8(glval) = VariableAddress[x] : -# 2541| r2541_9(glval) = FunctionAddress[~ClassWithDestructor] : -# 2541| v2541_10(void) = Call[~ClassWithDestructor] : func:r2541_9, this:r2541_8 -# 2541| mu2541_11(unknown) = ^CallSideEffect : ~m? -# 2541| v2541_12(void) = ^IndirectReadSideEffect[-1] : &:r2541_8, ~m? -# 2541| mu2541_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_8 -# 2534| v2534_7(void) = ReturnVoid : +# 2541| v2541_1(void) = NoOp : +# 2541| r2541_2(glval) = VariableAddress[x] : +# 2541| r2541_3(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_4(void) = Call[~ClassWithDestructor] : func:r2541_3, this:r2541_2 +# 2541| mu2541_5(unknown) = ^CallSideEffect : ~m? +# 2541| v2541_6(void) = ^IndirectReadSideEffect[-1] : &:r2541_2, ~m? +# 2541| mu2541_7(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_2 +# 2534| v2534_6(void) = ReturnVoid : +#-----| Goto -> Block 1 + +# 2541| Block 4 +# 2541| r2541_8(glval) = VariableAddress[x] : +# 2541| r2541_9(glval) = FunctionAddress[~ClassWithDestructor] : +# 2541| v2541_10(void) = Call[~ClassWithDestructor] : func:r2541_9, this:r2541_8 +# 2541| mu2541_11(unknown) = ^CallSideEffect : ~m? +# 2541| v2541_12(void) = ^IndirectReadSideEffect[-1] : &:r2541_8, ~m? +# 2541| mu2541_13(ClassWithDestructor) = ^IndirectMayWriteSideEffect[-1] : &:r2541_8 +# 2534| v2534_7(void) = Unwind : #-----| Goto -> Block 1 # 2545| void this_inconsistency(bool) From a51d24cbabc3d87c773a60ba8f74e0263c25d540 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Wed, 8 May 2024 19:34:50 +0200 Subject: [PATCH 116/118] apply suggestions from code review, and the examples to the test --- .../CWE/CWE-022/examples/TaintedPath.c | 8 +++--- .../CWE/CWE-022/examples/TaintedPathFolder.c | 2 +- .../CWE-022/examples/TaintedPathNormalize.c | 10 ++++--- .../CWE-022/semmle/tests/TaintedPath.expected | 11 +++++--- .../Security/CWE/CWE-022/semmle/tests/test.c | 27 +++++++++++++------ 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c index fe0f466713a..ff309d7d9d8 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPath.c @@ -2,11 +2,9 @@ int main(int argc, char** argv) { char *userAndFile = argv[2]; { - char fileBuffer[FILENAME_MAX] = "/home/"; - char *fileName = fileBuffer; - size_t len = strlen(fileName); - strncat(fileName+len, userAndFile, FILENAME_MAX-len-1); + char fileBuffer[PATH_MAX]; + snprintf(fileBuffer, sizeof(fileBuffer), "/home/%s", userAndFile); // BAD: a string from the user is used in a filename - fopen(fileName, "wb+"); + fopen(fileBuffer, "wb+"); } } diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c index e1dc3dafcd7..1970e515d02 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathFolder.c @@ -3,7 +3,7 @@ int main(int argc, char** argv) { char *userAndFile = argv[2]; - char baseDir[PATH_MAX] = "/home/user/public/"; + const char *baseDir = "/home/user/public/"; char fullPath[PATH_MAX]; // Attempt to concatenate the base directory and the user-supplied path diff --git a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c index d891155a8e2..ab7607cdd3d 100644 --- a/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c +++ b/cpp/ql/src/Security/CWE/CWE-022/examples/TaintedPathNormalize.c @@ -2,13 +2,15 @@ #include int main(int argc, char** argv) { - - char *userAndFile = argv[2]; + char *fileName = argv[2]; // Check for invalid sequences in the user input - if (strstr(userAndFile, "..") || strchr(userAndFile, '/') || strchr(userAndFile, '\\')) { + if (strstr(fileName , "..") || strchr(fileName , '/') || strchr(fileName , '\\')) { printf("Invalid filename.\n"); return 1; } - // use `userAndFile` as a safe filename + char fileBuffer[PATH_MAX]; + snprintf(fileBuffer, sizeof(fileBuffer), "/home/user/files/%s", fileName); + // GOOD: We know that the filename is safe and stays within the public folder + FILE *file = fopen(fileBuffer, "wb+"); } \ No newline at end of file diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected index b107fd8b130..948de8316e4 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected @@ -3,6 +3,7 @@ edges | test.c:8:27:8:30 | **argv | test.c:31:22:31:28 | *access to array | provenance | | | test.c:8:27:8:30 | **argv | test.c:69:14:69:20 | *access to array | provenance | | | test.c:8:27:8:30 | **argv | test.c:80:25:80:31 | *access to array | provenance | | +| test.c:8:27:8:30 | **argv | test.c:88:22:88:28 | *access to array | provenance | | | test.c:9:23:9:29 | *access to array | test.c:17:11:17:18 | *fileName | provenance | TaintFunction | | test.c:31:22:31:28 | *access to array | test.c:32:11:32:18 | *fileName | provenance | | | test.c:37:17:37:24 | scanf output argument | test.c:38:11:38:18 | *fileName | provenance | | @@ -12,7 +13,8 @@ edges | test.c:54:21:54:26 | *call to getenv | test.c:55:11:55:16 | *buffer | provenance | TaintFunction | | test.c:74:13:74:18 | read output argument | test.c:76:11:76:16 | *buffer | provenance | | | test.c:75:13:75:18 | read output argument | test.c:76:11:76:16 | *buffer | provenance | | -| test.c:80:25:80:31 | *access to array | test.c:91:24:91:33 | *fileBuffer | provenance | TaintFunction | +| test.c:80:25:80:31 | *access to array | test.c:84:11:84:20 | *fileBuffer | provenance | TaintFunction | +| test.c:88:22:88:28 | *access to array | test.c:98:24:98:33 | *fileBuffer | provenance | TaintFunction | nodes | test.c:8:27:8:30 | **argv | semmle.label | **argv | | test.c:9:23:9:29 | *access to array | semmle.label | *access to array | @@ -33,7 +35,9 @@ nodes | test.c:75:13:75:18 | read output argument | semmle.label | read output argument | | test.c:76:11:76:16 | *buffer | semmle.label | *buffer | | test.c:80:25:80:31 | *access to array | semmle.label | *access to array | -| test.c:91:24:91:33 | *fileBuffer | semmle.label | *fileBuffer | +| test.c:84:11:84:20 | *fileBuffer | semmle.label | *fileBuffer | +| test.c:88:22:88:28 | *access to array | semmle.label | *access to array | +| test.c:98:24:98:33 | *fileBuffer | semmle.label | *fileBuffer | subpaths #select | test.c:17:11:17:18 | fileName | test.c:8:27:8:30 | **argv | test.c:17:11:17:18 | *fileName | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | @@ -45,4 +49,5 @@ subpaths | test.c:69:14:69:20 | access to array | test.c:8:27:8:30 | **argv | test.c:69:14:69:20 | *access to array | This argument to a file access function is derived from $@ and then passed to readFile(fileName), which calls fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | | test.c:76:11:76:16 | buffer | test.c:74:13:74:18 | read output argument | test.c:76:11:76:16 | *buffer | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:74:13:74:18 | read output argument | user input (buffer read by read) | | test.c:76:11:76:16 | buffer | test.c:75:13:75:18 | read output argument | test.c:76:11:76:16 | *buffer | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:75:13:75:18 | read output argument | user input (buffer read by read) | -| test.c:91:24:91:33 | fileBuffer | test.c:8:27:8:30 | **argv | test.c:91:24:91:33 | *fileBuffer | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | +| test.c:84:11:84:20 | fileBuffer | test.c:8:27:8:30 | **argv | test.c:84:11:84:20 | *fileBuffer | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | +| test.c:98:24:98:33 | fileBuffer | test.c:8:27:8:30 | **argv | test.c:98:24:98:33 | *fileBuffer | This argument to a file access function is derived from $@ and then passed to fopen(filename). | test.c:8:27:8:30 | **argv | user input (a command-line argument) | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c index 8546ab42079..4324f269df6 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c @@ -78,40 +78,51 @@ int main(int argc, char** argv) { { char *userAndFile = argv[2]; + char fileBuffer[PATH_MAX]; + snprintf(fileBuffer, sizeof(fileBuffer), "/home/%s", userAndFile); + // BAD: a string from the user is used in a filename + fopen(fileBuffer, "wb+"); + } + + { + char *fileName = argv[2]; // Check for invalid sequences in the user input - if (strstr(userAndFile, "..") || strchr(userAndFile, '/') || strchr(userAndFile, '\\')) { - // printf("Invalid filename.\n"); + if (strstr(fileName , "..") || strchr(fileName , '/') || strchr(fileName , '\\')) { + printf("Invalid filename.\n"); return 1; } - char fileBuffer[FILENAME_MAX] = "/home/user/files/"; - // Ensure buffer overflow is prevented - strncat(fileBuffer, userAndFile, FILENAME_MAX - strlen(fileBuffer) - 1); + char fileBuffer[PATH_MAX]; + snprintf(fileBuffer, sizeof(fileBuffer), "/home/user/files/%s", fileName); // GOOD: We know that the filename is safe and stays within the public folder. But we currently get an FP here. FILE *file = fopen(fileBuffer, "wb+"); } { char *userAndFile = argv[2]; - char baseDir[PATH_MAX] = "/home/user/public/"; + const char *baseDir = "/home/user/public/"; char fullPath[PATH_MAX]; - char resolvedPath[PATH_MAX]; // Attempt to concatenate the base directory and the user-supplied path snprintf(fullPath, sizeof(fullPath), "%s%s", baseDir, userAndFile); // Resolve the absolute path, normalizing any ".." or "." - if (realpath(fullPath, resolvedPath) == 0) { + char *resolvedPath = realpath(fullPath, 0); // <- we're using `NULL` in the example, but 0 here to get it to compile. Same for next line. + if (resolvedPath == 0) { + perror("Error resolving path"); return 1; } // Check if the resolved path starts with the base directory if (strncmp(baseDir, resolvedPath, strlen(baseDir)) != 0) { + free(resolvedPath); return 1; } // GOOD: Path is within the intended directory FILE *file = fopen(resolvedPath, "wb+"); + free(resolvedPath); + } } From 9e09c5a6cfb8090853635f4b1f79f846de644122 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 8 May 2024 22:11:19 +0200 Subject: [PATCH 117/118] C++: Fix copy and paste error in comment --- .../code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll index b2d9910514b..ad17722477f 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll @@ -817,7 +817,7 @@ class TranslatedDestructorsAfterHandler extends TranslatedElement, // Transition to the next child, if any. result = this.getChild(id + 1).getFirstInstruction(kind) or - // And otherwise, exit this element with an exceptional edge + // And otherwise go to the next handler, if any. not exists(this.getChild(id + 1)) and result = getTranslatedStmt(handler) From 674e65e134d95b9b78a254b99df6dab0f0b7e730 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 9 May 2024 16:26:30 +0100 Subject: [PATCH 118/118] Fix test expectations --- .../CWE-078/CommandInjection.expected | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected b/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected index 19fb8e88ea3..8c8037fa57e 100644 --- a/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected +++ b/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected @@ -22,7 +22,10 @@ edges | SanitizingDoubleDash.go:14:23:14:30 | arrayLit [array] | SanitizingDoubleDash.go:14:23:14:33 | slice element node | provenance | | | SanitizingDoubleDash.go:14:23:14:33 | slice element node | SanitizingDoubleDash.go:14:23:14:33 | slice expression [array] | provenance | | | SanitizingDoubleDash.go:14:23:14:33 | slice expression [array] | SanitizingDoubleDash.go:14:23:14:33 | slice expression | provenance | | +| SanitizingDoubleDash.go:39:14:39:44 | []type{args} [array] | SanitizingDoubleDash.go:39:14:39:44 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:39:14:39:44 | call to append | SanitizingDoubleDash.go:40:23:40:30 | arrayLit | provenance | | +| SanitizingDoubleDash.go:39:14:39:44 | call to append [array, array] | SanitizingDoubleDash.go:40:23:40:30 | arrayLit | provenance | | +| SanitizingDoubleDash.go:39:31:39:37 | tainted | SanitizingDoubleDash.go:39:14:39:44 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:39:31:39:37 | tainted | SanitizingDoubleDash.go:39:14:39:44 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:52:15:52:31 | slice literal [array] | SanitizingDoubleDash.go:53:21:53:28 | arrayLit [array] | provenance | | | SanitizingDoubleDash.go:52:24:52:30 | tainted | SanitizingDoubleDash.go:52:15:52:31 | slice literal [array] | provenance | | @@ -30,10 +33,15 @@ edges | SanitizingDoubleDash.go:53:14:53:35 | call to append [array] | SanitizingDoubleDash.go:54:23:54:30 | arrayLit | provenance | | | SanitizingDoubleDash.go:53:21:53:28 | arrayLit | SanitizingDoubleDash.go:53:14:53:35 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:53:21:53:28 | arrayLit [array] | SanitizingDoubleDash.go:53:14:53:35 | call to append [array] | provenance | MaD:28 | +| SanitizingDoubleDash.go:68:14:68:38 | []type{args} [array] | SanitizingDoubleDash.go:68:14:68:38 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:68:14:68:38 | call to append | SanitizingDoubleDash.go:69:21:69:28 | arrayLit | provenance | | +| SanitizingDoubleDash.go:68:14:68:38 | call to append [array, array] | SanitizingDoubleDash.go:69:21:69:28 | arrayLit [array, array] | provenance | | +| SanitizingDoubleDash.go:68:31:68:37 | tainted | SanitizingDoubleDash.go:68:14:68:38 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:68:31:68:37 | tainted | SanitizingDoubleDash.go:68:14:68:38 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:69:14:69:35 | call to append | SanitizingDoubleDash.go:70:23:70:30 | arrayLit | provenance | | +| SanitizingDoubleDash.go:69:14:69:35 | call to append [array, array] | SanitizingDoubleDash.go:70:23:70:30 | arrayLit | provenance | | | SanitizingDoubleDash.go:69:21:69:28 | arrayLit | SanitizingDoubleDash.go:69:14:69:35 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:69:21:69:28 | arrayLit [array, array] | SanitizingDoubleDash.go:69:14:69:35 | call to append [array, array] | provenance | MaD:28 | | SanitizingDoubleDash.go:92:13:92:19 | selection of URL | SanitizingDoubleDash.go:92:13:92:27 | call to Query | provenance | MaD:732 | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:95:25:95:31 | tainted | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:96:24:96:34 | slice expression | provenance | | @@ -62,11 +70,20 @@ edges | SanitizingDoubleDash.go:101:24:101:34 | slice expression [array] | SanitizingDoubleDash.go:101:24:101:34 | slice expression | provenance | | | SanitizingDoubleDash.go:105:15:105:37 | slice literal [array] | SanitizingDoubleDash.go:106:24:106:31 | arrayLit | provenance | | | SanitizingDoubleDash.go:105:30:105:36 | tainted | SanitizingDoubleDash.go:105:15:105:37 | slice literal [array] | provenance | | +| SanitizingDoubleDash.go:111:14:111:44 | []type{args} [array] | SanitizingDoubleDash.go:111:14:111:44 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:111:14:111:44 | call to append | SanitizingDoubleDash.go:112:24:112:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:111:14:111:44 | call to append [array, array] | SanitizingDoubleDash.go:112:24:112:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:111:37:111:43 | tainted | SanitizingDoubleDash.go:111:14:111:44 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:111:37:111:43 | tainted | SanitizingDoubleDash.go:111:14:111:44 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:117:14:117:44 | []type{args} [array] | SanitizingDoubleDash.go:117:14:117:44 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:117:14:117:44 | call to append | SanitizingDoubleDash.go:118:24:118:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:117:14:117:44 | call to append [array, array] | SanitizingDoubleDash.go:118:24:118:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:117:31:117:37 | tainted | SanitizingDoubleDash.go:117:14:117:44 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:117:31:117:37 | tainted | SanitizingDoubleDash.go:117:14:117:44 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:123:14:123:38 | []type{args} [array] | SanitizingDoubleDash.go:123:14:123:38 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:123:14:123:38 | call to append | SanitizingDoubleDash.go:124:24:124:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:123:14:123:38 | call to append [array, array] | SanitizingDoubleDash.go:124:24:124:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:123:31:123:37 | tainted | SanitizingDoubleDash.go:123:14:123:38 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:123:31:123:37 | tainted | SanitizingDoubleDash.go:123:14:123:38 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:128:15:128:31 | slice literal [array] | SanitizingDoubleDash.go:129:21:129:28 | arrayLit [array] | provenance | | | SanitizingDoubleDash.go:128:24:128:30 | tainted | SanitizingDoubleDash.go:128:15:128:31 | slice literal [array] | provenance | | @@ -74,12 +91,20 @@ edges | SanitizingDoubleDash.go:129:14:129:35 | call to append [array] | SanitizingDoubleDash.go:130:24:130:31 | arrayLit | provenance | | | SanitizingDoubleDash.go:129:21:129:28 | arrayLit | SanitizingDoubleDash.go:129:14:129:35 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:129:21:129:28 | arrayLit [array] | SanitizingDoubleDash.go:129:14:129:35 | call to append [array] | provenance | MaD:28 | +| SanitizingDoubleDash.go:136:14:136:38 | []type{args} [array] | SanitizingDoubleDash.go:136:14:136:38 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:136:14:136:38 | call to append | SanitizingDoubleDash.go:137:24:137:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:136:14:136:38 | call to append [array, array] | SanitizingDoubleDash.go:137:24:137:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:136:31:136:37 | tainted | SanitizingDoubleDash.go:136:14:136:38 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:136:31:136:37 | tainted | SanitizingDoubleDash.go:136:14:136:38 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:142:14:142:38 | []type{args} [array] | SanitizingDoubleDash.go:142:14:142:38 | call to append [array, array] | provenance | MaD:29 | | SanitizingDoubleDash.go:142:14:142:38 | call to append | SanitizingDoubleDash.go:143:21:143:28 | arrayLit | provenance | | +| SanitizingDoubleDash.go:142:14:142:38 | call to append [array, array] | SanitizingDoubleDash.go:143:21:143:28 | arrayLit [array, array] | provenance | | +| SanitizingDoubleDash.go:142:31:142:37 | tainted | SanitizingDoubleDash.go:142:14:142:38 | []type{args} [array] | provenance | | | SanitizingDoubleDash.go:142:31:142:37 | tainted | SanitizingDoubleDash.go:142:14:142:38 | call to append | provenance | FunctionModel | | SanitizingDoubleDash.go:143:14:143:35 | call to append | SanitizingDoubleDash.go:144:24:144:31 | arrayLit | provenance | | +| SanitizingDoubleDash.go:143:14:143:35 | call to append [array, array] | SanitizingDoubleDash.go:144:24:144:31 | arrayLit | provenance | | | SanitizingDoubleDash.go:143:21:143:28 | arrayLit | SanitizingDoubleDash.go:143:14:143:35 | call to append | provenance | FunctionModel | +| SanitizingDoubleDash.go:143:21:143:28 | arrayLit [array, array] | SanitizingDoubleDash.go:143:14:143:35 | call to append [array, array] | provenance | MaD:28 | nodes | ArgumentInjection.go:9:10:9:16 | selection of URL | semmle.label | selection of URL | | ArgumentInjection.go:9:10:9:24 | call to Query | semmle.label | call to Query | @@ -102,7 +127,9 @@ nodes | SanitizingDoubleDash.go:14:23:14:33 | slice element node | semmle.label | slice element node | | SanitizingDoubleDash.go:14:23:14:33 | slice expression | semmle.label | slice expression | | SanitizingDoubleDash.go:14:23:14:33 | slice expression [array] | semmle.label | slice expression [array] | +| SanitizingDoubleDash.go:39:14:39:44 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:39:14:39:44 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:39:14:39:44 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:39:31:39:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:40:23:40:30 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:52:15:52:31 | slice literal [array] | semmle.label | slice literal [array] | @@ -112,10 +139,14 @@ nodes | SanitizingDoubleDash.go:53:21:53:28 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:53:21:53:28 | arrayLit [array] | semmle.label | arrayLit [array] | | SanitizingDoubleDash.go:54:23:54:30 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:68:14:68:38 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:68:14:68:38 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:68:14:68:38 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:68:31:68:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:69:14:69:35 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:69:14:69:35 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:69:21:69:28 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:69:21:69:28 | arrayLit [array, array] | semmle.label | arrayLit [array, array] | | SanitizingDoubleDash.go:70:23:70:30 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:80:23:80:29 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:92:13:92:19 | selection of URL | semmle.label | selection of URL | @@ -135,13 +166,19 @@ nodes | SanitizingDoubleDash.go:105:15:105:37 | slice literal [array] | semmle.label | slice literal [array] | | SanitizingDoubleDash.go:105:30:105:36 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:106:24:106:31 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:111:14:111:44 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:111:14:111:44 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:111:14:111:44 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:111:37:111:43 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:112:24:112:31 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:117:14:117:44 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:117:14:117:44 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:117:14:117:44 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:117:31:117:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:118:24:118:31 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:123:14:123:38 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:123:14:123:38 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:123:14:123:38 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:123:31:123:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:124:24:124:31 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:128:15:128:31 | slice literal [array] | semmle.label | slice literal [array] | @@ -151,13 +188,19 @@ nodes | SanitizingDoubleDash.go:129:21:129:28 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:129:21:129:28 | arrayLit [array] | semmle.label | arrayLit [array] | | SanitizingDoubleDash.go:130:24:130:31 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:136:14:136:38 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:136:14:136:38 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:136:14:136:38 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:136:31:136:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:137:24:137:31 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:142:14:142:38 | []type{args} [array] | semmle.label | []type{args} [array] | | SanitizingDoubleDash.go:142:14:142:38 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:142:14:142:38 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:142:31:142:37 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:143:14:143:35 | call to append | semmle.label | call to append | +| SanitizingDoubleDash.go:143:14:143:35 | call to append [array, array] | semmle.label | call to append [array, array] | | SanitizingDoubleDash.go:143:21:143:28 | arrayLit | semmle.label | arrayLit | +| SanitizingDoubleDash.go:143:21:143:28 | arrayLit [array, array] | semmle.label | arrayLit [array, array] | | SanitizingDoubleDash.go:144:24:144:31 | arrayLit | semmle.label | arrayLit | | SanitizingDoubleDash.go:148:30:148:36 | tainted | semmle.label | tainted | | SanitizingDoubleDash.go:152:24:152:30 | tainted | semmle.label | tainted |