Skip to content

Commit 3829528

Browse files
committed
PS: Delete stuff we don't actually need.
1 parent f8bdfa4 commit 3829528

File tree

2 files changed

+0
-96
lines changed

2 files changed

+0
-96
lines changed

powershell/ql/lib/semmle/code/powershell/ApiGraphs.qll

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,6 @@ module API {
204204
Impl::positionalParameterOrArgumentEdge(this.getAnEpsilonSuccessor(), n, result)
205205
}
206206

207-
/**
208-
* Gets the given keyword parameter of this callable, or keyword argument to this call.
209-
*
210-
* Note: for historical reasons, this predicate may refer to an argument of a call, but this may change in the future.
211-
* When referring to an argument, it is recommended to use `getKeywordArgument(n)` instead.
212-
*/
213-
pragma[inline]
214-
Node getKeywordParameter(string name) {
215-
// This predicate is currently not 'inline_late' because 'name' can be an input or output
216-
Impl::keywordParameterOrArgumentEdge(this.getAnEpsilonSuccessor(), name, result)
217-
}
218-
219207
/**
220208
* Gets the argument passed in argument position `pos` at this call.
221209
*/
@@ -260,15 +248,6 @@ module API {
260248
result = this.getContent(contents.getAReadContent())
261249
}
262250

263-
/**
264-
* Gets a representative for the instance field of the given `name`.
265-
*/
266-
pragma[inline]
267-
Node getField(string name) {
268-
// This predicate is currently not 'inline_late' because 'name' can be an input or output
269-
Impl::fieldEdge(this.getAnEpsilonSuccessor(), name, result)
270-
}
271-
272251
/**
273252
* Gets a representative for an arbitrary element of this collection.
274253
*/
@@ -405,13 +384,6 @@ module API {
405384
/** Gets the root node. */
406385
Node root() { result instanceof RootNode }
407386

408-
bindingset[name]
409-
pragma[inline_late]
410-
Node namespace(string name) {
411-
// This predicate is currently not 'inline_late' because 'n' can be an input or output
412-
Impl::namespace(name, result)
413-
}
414-
415387
pragma[inline]
416388
Node getTopLevelMember(string name) { Impl::topLevelMember(name, result) }
417389

@@ -516,43 +488,6 @@ module API {
516488
)
517489
}
518490

519-
cached
520-
predicate callEdge(Node pred, string name, Node succ) {
521-
exists(DataFlow::CallNode call |
522-
// from receiver to method call node
523-
pred = getForwardEndNode(getALocalSourceStrict(call.getQualifier())) and
524-
succ = MkMethodAccessNode(call) and
525-
name = call.getLowerCaseName()
526-
)
527-
}
528-
529-
bindingset[name]
530-
private string memberOrMethodReturnValue(string name) {
531-
// This predicate is a bit ad-hoc, but it's okay for now.
532-
// We can delete it once we no longer use the typeModel and summaryModel
533-
// tables to represent implicit root members.
534-
result = "Method[" + name + "]"
535-
or
536-
result = "Method[" + name + "].ReturnValue"
537-
or
538-
result = "Member[" + name + "]"
539-
}
540-
541-
private Node getAnImplicitRootMember(string name) {
542-
exists(DataFlow::CallNode call |
543-
Extensions::typeModel(_, Specific::getAnImplicitImport(), memberOrMethodReturnValue(name))
544-
or
545-
Extensions::summaryModel(Specific::getAnImplicitImport(), memberOrMethodReturnValue(name),
546-
_, _, _, _)
547-
or
548-
Extensions::sourceModel(Specific::getAnImplicitImport(), memberOrMethodReturnValue(name), _,
549-
_)
550-
|
551-
result = MkMethodAccessNode(call) and
552-
name = call.getLowerCaseName()
553-
)
554-
}
555-
556491
cached
557492
predicate memberEdge(Node pred, string name, Node succ) {
558493
pred = API::root() and
@@ -617,11 +552,6 @@ module API {
617552
)
618553
}
619554

620-
cached
621-
predicate fieldEdge(Node pred, string name, Node succ) {
622-
Impl::contentEdge(pred, DataFlowPrivate::TFieldContent(name), succ)
623-
}
624-
625555
cached
626556
predicate elementEdge(Node pred, Node succ) {
627557
contentEdge(pred, any(DataFlow::ContentSet set | set.isAnyElement()).getAReadContent(), succ)
@@ -665,24 +595,13 @@ module API {
665595
), succ)
666596
}
667597

668-
private predicate keywordParameterEdge(Node pred, string name, Node succ) {
669-
parameterEdge(pred, any(DataFlowDispatch::ParameterPosition pos | pos.isKeyword(name)), succ)
670-
}
671-
672598
cached
673599
predicate positionalParameterOrArgumentEdge(Node pred, int n, Node succ) {
674600
positionalArgumentEdge(pred, n, succ)
675601
or
676602
positionalParameterEdge(pred, n, succ)
677603
}
678604

679-
cached
680-
predicate keywordParameterOrArgumentEdge(Node pred, string name, Node succ) {
681-
keywordArgumentEdge(pred, name, succ)
682-
or
683-
keywordParameterEdge(pred, name, succ)
684-
}
685-
686605
cached
687606
predicate instanceEdge(Node pred, Node succ) {
688607
// TODO: Also model parameters with a given type here

powershell/ql/lib/semmle/code/powershell/dataflow/FlowSummary.qll

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,3 @@ abstract class SummarizedCallable extends LibraryCallable, Impl::Public::Summari
4747
)
4848
}
4949
}
50-
51-
/**
52-
* A callable with a flow summary, identified by a unique string, where all
53-
* calls to a method with the same name are considered relevant.
54-
*/
55-
abstract class SimpleSummarizedCallable extends SummarizedCallable {
56-
CallExpr c;
57-
58-
bindingset[this]
59-
SimpleSummarizedCallable() { c.getLowerCaseName() = this }
60-
61-
final override CallExpr getACall() { result = c }
62-
63-
final override CallExpr getACallSimple() { result = c }
64-
}

0 commit comments

Comments
 (0)