GeezerVison is showing github.com — C++: Remove deprecated code · fredatgithub/codeql@7862922
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/DefaultOptions.qll +2-14Lines changed: 2 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,8 +30,6 @@ class Options extends string { | 30 | 30 | predicate overrideReturnsNull(Call call) { | 31 | 31 | // Used in CVS: | 32 | 32 | call.(FunctionCall).getTarget().hasGlobalName("Xstrdup") | 33 | | - or | 34 | | - CustomOptions::overrideReturnsNull(call) // old Options.qll | 35 | 33 | } | 36 | 34 |
| 37 | 35 | /** | @@ -45,8 +43,6 @@ class Options extends string { | 45 | 43 | // Used in CVS: | 46 | 44 | call.(FunctionCall).getTarget().hasGlobalName("Xstrdup") and | 47 | 45 | nullValue(call.getArgument(0)) | 48 | | - or | 49 | | - CustomOptions::returnsNull(call) // old Options.qll | 50 | 46 | } | 51 | 47 |
| 52 | 48 | /** | @@ -65,8 +61,6 @@ class Options extends string { | 65 | 61 | f.hasGlobalOrStdName([ | 66 | 62 | "exit", "_exit", "_Exit", "abort", "__assert_fail", "longjmp", "__builtin_unreachable" | 67 | 63 | ]) | 68 | | - or | 69 | | - CustomOptions::exits(f) // old Options.qll | 70 | 64 | } | 71 | 65 |
| 72 | 66 | /** | @@ -79,19 +73,15 @@ class Options extends string { | 79 | 73 | * runtime, the program's behavior is undefined) | 80 | 74 | */ | 81 | 75 | predicate exprExits(Expr e) { | 82 | | - e.(AssumeExpr).getChild(0).(CompileTimeConstantInt).getIntValue() = 0 or | 83 | | - CustomOptions::exprExits(e) // old Options.qll | | 76 | + e.(AssumeExpr).getChild(0).(CompileTimeConstantInt).getIntValue() = 0 | 84 | 77 | } | 85 | 78 |
| 86 | 79 | /** | 87 | 80 | * Holds if function `f` should always have its return value checked. | 88 | 81 | * | 89 | 82 | * By default holds only for `fgets`. | 90 | 83 | */ | 91 | | - predicate alwaysCheckReturnValue(Function f) { | 92 | | - f.hasGlobalOrStdName("fgets") or | 93 | | - CustomOptions::alwaysCheckReturnValue(f) // old Options.qll | 94 | | - } | | 84 | + predicate alwaysCheckReturnValue(Function f) { f.hasGlobalOrStdName("fgets") } | 95 | 85 |
| 96 | 86 | /** | 97 | 87 | * Holds if it is reasonable to ignore the return value of function | @@ -107,8 +97,6 @@ class Options extends string { | 107 | 97 | // common way of sleeping using select: | 108 | 98 | fc.getTarget().hasGlobalName("select") and | 109 | 99 | fc.getArgument(0).getValue() = "0" | 110 | | - or | 111 | | - CustomOptions::okToIgnoreReturnValue(fc) // old Options.qll | 112 | 100 | } | 113 | 101 | } | 114 | 102 |
| |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/Options.qll -54Lines changed: 0 additions & 54 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -98,57 +98,3 @@ class CustomMutexType extends MutexType { | 98 | 98 | */ | 99 | 99 | override predicate unlockAccess(FunctionCall fc, Expr arg) { none() } | 100 | 100 | } | 101 | | - | 102 | | -/** | 103 | | - * DEPRECATED: customize `CustomOptions.overrideReturnsNull` instead. | 104 | | - * | 105 | | - * This predicate is required to support backwards compatibility for | 106 | | - * older `Options.qll` files. It should not be removed or modified by | 107 | | - * end users. | 108 | | - */ | 109 | | -predicate overrideReturnsNull(Call call) { none() } | 110 | | - | 111 | | -/** | 112 | | - * DEPRECATED: customize `CustomOptions.returnsNull` instead. | 113 | | - * | 114 | | - * This predicate is required to support backwards compatibility for | 115 | | - * older `Options.qll` files. It should not be removed or modified by | 116 | | - * end users. | 117 | | - */ | 118 | | -predicate returnsNull(Call call) { none() } | 119 | | - | 120 | | -/** | 121 | | - * DEPRECATED: customize `CustomOptions.exits` instead. | 122 | | - * | 123 | | - * This predicate is required to support backwards compatibility for | 124 | | - * older `Options.qll` files. It should not be removed or modified by | 125 | | - * end users. | 126 | | - */ | 127 | | -predicate exits(Function f) { none() } | 128 | | - | 129 | | -/** | 130 | | - * DEPRECATED: customize `CustomOptions.exprExits` instead. | 131 | | - * | 132 | | - * This predicate is required to support backwards compatibility for | 133 | | - * older `Options.qll` files. It should not be removed or modified by | 134 | | - * end users. | 135 | | - */ | 136 | | -predicate exprExits(Expr e) { none() } | 137 | | - | 138 | | -/** | 139 | | - * DEPRECATED: customize `CustomOptions.alwaysCheckReturnValue` instead. | 140 | | - * | 141 | | - * This predicate is required to support backwards compatibility for | 142 | | - * older `Options.qll` files. It should not be removed or modified by | 143 | | - * end users. | 144 | | - */ | 145 | | -predicate alwaysCheckReturnValue(Function f) { none() } | 146 | | - | 147 | | -/** | 148 | | - * DEPRECATED: customize `CustomOptions.okToIgnoreReturnValue` instead. | 149 | | - * | 150 | | - * This predicate is required to support backwards compatibility for | 151 | | - * older `Options.qll` files. It should not be removed or modified by | 152 | | - * end users. | 153 | | - */ | 154 | | -predicate okToIgnoreReturnValue(FunctionCall fc) { none() } |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/cpp.qll -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -32,7 +32,6 @@ import semmle.code.cpp.Class | 32 | 32 | import semmle.code.cpp.Struct | 33 | 33 | import semmle.code.cpp.Union | 34 | 34 | import semmle.code.cpp.Enum | 35 | | -import semmle.code.cpp.Member | 36 | 35 | import semmle.code.cpp.Field | 37 | 36 | import semmle.code.cpp.Function | 38 | 37 | import semmle.code.cpp.MemberFunction | |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/Location.qll -25Lines changed: 0 additions & 25 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -148,28 +148,3 @@ class UnknownLocation extends Location { | 148 | 148 | this.getFile().getAbsolutePath() = "" and locations_default(this, _, 0, 0, 0, 0) | 149 | 149 | } | 150 | 150 | } | 151 | | - | 152 | | -/** | 153 | | - * A dummy location which is used when something doesn't have a location in | 154 | | - * the source code but needs to have a `Location` associated with it. | 155 | | - * | 156 | | - * DEPRECATED: use `UnknownLocation` | 157 | | - */ | 158 | | -deprecated class UnknownDefaultLocation extends UnknownLocation { } | 159 | | - | 160 | | -/** | 161 | | - * A dummy location which is used when an expression doesn't have a | 162 | | - * location in the source code but needs to have a `Location` associated | 163 | | - * with it. | 164 | | - * | 165 | | - * DEPRECATED: use `UnknownLocation` | 166 | | - */ | 167 | | -deprecated class UnknownExprLocation extends UnknownLocation { } | 168 | | - | 169 | | -/** | 170 | | - * A dummy location which is used when a statement doesn't have a location | 171 | | - * in the source code but needs to have a `Location` associated with it. | 172 | | - * | 173 | | - * DEPRECATED: use `UnknownLocation` | 174 | | - */ | 175 | | -deprecated class UnknownStmtLocation extends UnknownLocation { } |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/Member.qll -6Lines changed: 0 additions & 6 deletions Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/TemplateParameter.qll -7Lines changed: 0 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,13 +35,6 @@ class NonTypeTemplateParameter extends Literal, TemplateParameterImpl { | 35 | 35 | override string getAPrimaryQlClass() { result = "NonTypeTemplateParameter" } | 36 | 36 | } | 37 | 37 |
| 38 | | -/** | 39 | | - * A C++ `typename` (or `class`) template parameter. | 40 | | - * | 41 | | - * DEPRECATED: Use `TypeTemplateParameter` instead. | 42 | | - */ | 43 | | -deprecated class TemplateParameter = TypeTemplateParameter; | 44 | | - | 45 | 38 | /** | 46 | 39 | * A C++ `typename` (or `class`) template parameter. | 47 | 40 | * | |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/internal/ResolveClass.qll -57Lines changed: 0 additions & 57 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import semmle.code.cpp.Type | 2 | 2 |
| 3 | | -/** For upgraded databases without mangled name info. */ | 4 | | -pragma[noinline] | 5 | | -private string getTopLevelClassName(@usertype c) { | 6 | | - not mangled_name(_, _, _) and | 7 | | - isClass(c) and | 8 | | - usertypes(c, result, _) and | 9 | | - not namespacembrs(_, c) and // not in a namespace | 10 | | - not member(_, _, c) and // not in some structure | 11 | | - not class_instantiation(c, _) // not a template instantiation | 12 | | -} | 13 | | - | 14 | | -/** | 15 | | - * For upgraded databases without mangled name info. | 16 | | - * Holds if `d` is a unique complete class named `name`. | 17 | | - */ | 18 | | -pragma[noinline] | 19 | | -private predicate existsCompleteWithName(string name, @usertype d) { | 20 | | - not mangled_name(_, _, _) and | 21 | | - is_complete(d) and | 22 | | - name = getTopLevelClassName(d) and | 23 | | - onlyOneCompleteClassExistsWithName(name) | 24 | | -} | 25 | | - | 26 | | -/** For upgraded databases without mangled name info. */ | 27 | | -pragma[noinline] | 28 | | -private predicate onlyOneCompleteClassExistsWithName(string name) { | 29 | | - not mangled_name(_, _, _) and | 30 | | - strictcount(@usertype c | is_complete(c) and getTopLevelClassName(c) = name) = 1 | 31 | | -} | 32 | | - | 33 | | -/** | 34 | | - * For upgraded databases without mangled name info. | 35 | | - * Holds if `c` is an incomplete class named `name`. | 36 | | - */ | 37 | | -pragma[noinline] | 38 | | -private predicate existsIncompleteWithName(string name, @usertype c) { | 39 | | - not mangled_name(_, _, _) and | 40 | | - not is_complete(c) and | 41 | | - name = getTopLevelClassName(c) | 42 | | -} | 43 | | - | 44 | | -/** | 45 | | - * For upgraded databases without mangled name info. | 46 | | - * Holds if `c` is an incomplete class, and there exists a unique complete class `d` | 47 | | - * with the same name. | 48 | | - */ | 49 | | -private predicate oldHasCompleteTwin(@usertype c, @usertype d) { | 50 | | - not mangled_name(_, _, _) and | 51 | | - exists(string name | | 52 | | - existsIncompleteWithName(name, c) and | 53 | | - existsCompleteWithName(name, d) | 54 | | - ) | 55 | | -} | 56 | | - | 57 | 3 | pragma[noinline] | 58 | 4 | private @mangledname getClassMangledName(@usertype c) { | 59 | 5 | isClass(c) and | @@ -103,10 +49,7 @@ private module Cached { | 103 | 49 | @usertype resolveClass(@usertype c) { | 104 | 50 | hasCompleteTwin(c, result) | 105 | 51 | or | 106 | | - oldHasCompleteTwin(c, result) | 107 | | - or | 108 | 52 | not hasCompleteTwin(c, _) and | 109 | | - not oldHasCompleteTwin(c, _) and | 110 | 53 | result = c | 111 | 54 | } | 112 | 55 |
| |
|