C++: Remove omittable exists variables

This commit is contained in:
Tony Torralba
2022-12-21 16:17:49 +01:00
parent 16cd148961
commit 3fcc99e5cb
62 changed files with 484 additions and 579 deletions

View File

@@ -28,8 +28,8 @@ private newtype LibraryT =
lib.getVersion() = version
} or
LibraryTExternalPackage(@external_package ep, string name, string version) {
exists(string namespace, string package_name |
external_packages(ep, namespace, package_name, version) and
exists(string package_name |
external_packages(ep, _, package_name, version) and
name = package_name
)
}
@@ -42,8 +42,8 @@ class Library extends LibraryT {
string version;
Library() {
exists(LibraryElement lib | this = LibraryTElement(lib, name, version)) or
exists(@external_package ep | this = LibraryTExternalPackage(ep, name, version))
this = LibraryTElement(_, name, version) or
this = LibraryTExternalPackage(_, name, version)
}
string getName() { result = name }

View File

@@ -54,7 +54,7 @@ private PreprocessorDirective next(PreprocessorDirective ppd) {
private int level(PreprocessorDirective ppd) {
relevantDirective(ppd, _, _) and
not exists(PreprocessorDirective previous | ppd = next(previous)) and
not ppd = next(_) and
result = 0
or
exists(PreprocessorDirective previous |
@@ -101,8 +101,8 @@ predicate headerGuard(PreprocessorDirective notdef, File f) {
}
predicate headerGuardChild(PreprocessorDirective open) {
exists(File f, PreprocessorDirective headerGuard |
headerGuard(headerGuard, f) and
exists(File f |
headerGuard(_, f) and
openWithDepth(1, f, open, _)
)
}