Skip to content

Commit 84d08b0

Browse files
committed
Revert "Merge pull request #12125 from jketema/unique-function"
This reverts commit 9c039c4, reversing changes made to ecd2003.
1 parent 98a2af8 commit 84d08b0

File tree

5 files changed

+4
-68
lines changed

5 files changed

+4
-68
lines changed

cpp/ql/lib/semmle/code/cpp/Element.qll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import semmle.code.cpp.Location
77
private import semmle.code.cpp.Enclosing
88
private import semmle.code.cpp.internal.ResolveClass
99
private import semmle.code.cpp.internal.ResolveGlobalVariable
10-
private import semmle.code.cpp.internal.ResolveFunction
1110

1211
/**
1312
* Get the `Element` that represents this `@element`.
@@ -31,14 +30,11 @@ pragma[inline]
3130
@element unresolveElement(Element e) {
3231
not result instanceof @usertype and
3332
not result instanceof @variable and
34-
not result instanceof @function and
3533
result = e
3634
or
3735
e = resolveClass(result)
3836
or
3937
e = resolveGlobalVariable(result)
40-
or
41-
e = resolveFunction(result)
4238
}
4339

4440
/**

cpp/ql/lib/semmle/code/cpp/Function.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import semmle.code.cpp.exprs.Call
99
import semmle.code.cpp.metrics.MetricFunction
1010
import semmle.code.cpp.Linkage
1111
private import semmle.code.cpp.internal.ResolveClass
12-
private import semmle.code.cpp.internal.ResolveFunction
1312

1413
/**
1514
* A C/C++ function [N4140 8.3.5]. Both member functions and non-member
@@ -26,8 +25,6 @@ private import semmle.code.cpp.internal.ResolveFunction
2625
* in more detail in `Declaration.qll`.
2726
*/
2827
class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
29-
Function() { isFunction(underlyingElement(this)) }
30-
3128
override string getName() { functions(underlyingElement(this), result, _) }
3229

3330
/**

cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ private predicate loopConditionAlwaysUponEntry(ControlFlowNode loop, Expr condit
110110
* should be in this relation.
111111
*/
112112
pragma[noinline]
113-
private predicate isFunction(@element el) {
114-
el instanceof @function
113+
private predicate isFunction(Element el) {
114+
el instanceof Function
115115
or
116116
el.(Expr).getParent() = el
117117
}
@@ -122,7 +122,7 @@ private predicate isFunction(@element el) {
122122
*/
123123
pragma[noopt]
124124
private predicate callHasNoTarget(@funbindexpr fc) {
125-
exists(@function f |
125+
exists(Function f |
126126
funbind(fc, f) and
127127
not isFunction(f)
128128
)

cpp/ql/lib/semmle/code/cpp/internal/ResolveFunction.qll

Lines changed: 0 additions & 57 deletions
This file was deleted.

cpp/ql/lib/semmle/code/cpp/internal/ResolveGlobalVariable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ private predicate isGlobalWithMangledNameAndWithoutDefinition(@mangledname name,
2424
* a unique global variable `complete` with the same name that does have a definition.
2525
*/
2626
private predicate hasTwinWithDefinition(@globalvariable incomplete, @globalvariable complete) {
27-
not variable_instantiation(incomplete, complete) and
2827
exists(@mangledname name |
28+
not variable_instantiation(incomplete, complete) and
2929
isGlobalWithMangledNameAndWithoutDefinition(name, incomplete) and
3030
isGlobalWithMangledNameAndWithDefinition(name, complete)
3131
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy