Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3657269

Browse files
committed
C++: Autoformat.
1 parent d1fc700 commit 3657269

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,11 @@ class CastNode extends Node {
983983

984984
cached
985985
newtype TDataFlowCallable =
986-
TSourceCallable(Cpp::Declaration decl) /*{ not decl instanceof FlowSummaryImpl::Public::SummarizedCallable }*/ or // TODO: figure this out
987-
TSummarizedCallable(FlowSummaryImpl::Public::SummarizedCallable c)
986+
TSourceCallable(Cpp::Declaration decl) or
987+
/*{ not decl instanceof FlowSummaryImpl::Public::SummarizedCallable }*/ TSummarizedCallable(
988+
// TODO: figure this out
989+
FlowSummaryImpl::Public::SummarizedCallable c
990+
)
988991

989992
/**
990993
* A callable, which may be:
@@ -1006,7 +1009,9 @@ class DataFlowCallable extends TDataFlowCallable {
10061009

10071010
Cpp::Declaration asSourceCallable() { this = TSourceCallable(result) }
10081011

1009-
FlowSummaryImpl::Public::SummarizedCallable asSummarizedCallable() { this = TSummarizedCallable(result) }
1012+
FlowSummaryImpl::Public::SummarizedCallable asSummarizedCallable() {
1013+
this = TSummarizedCallable(result)
1014+
}
10101015

10111016
Cpp::Declaration getUnderlyingCallable() {
10121017
result = this.asSummarizedCallable() or // SummarizedCallable = Function (in CPP)
@@ -1117,13 +1122,15 @@ private class NormalCall extends DataFlowCall, TNormalCall {
11171122

11181123
override CallTargetOperand getCallTargetOperand() { result = call.getCallTargetOperand() }
11191124

1120-
override DataFlowCallable getStaticCallTarget() { result = TSourceCallable(call.getStaticCallTarget()) }
1125+
override DataFlowCallable getStaticCallTarget() {
1126+
result = TSourceCallable(call.getStaticCallTarget())
1127+
}
11211128

1122-
override ArgumentOperand getArgumentOperand(int index) {
1123-
result = call.getArgumentOperand(index)
1124-
}
1129+
override ArgumentOperand getArgumentOperand(int index) { result = call.getArgumentOperand(index) }
11251130

1126-
override DataFlowCallable getEnclosingCallable() { result = TSourceCallable(call.getEnclosingFunction()) }
1131+
override DataFlowCallable getEnclosingCallable() {
1132+
result = TSourceCallable(call.getEnclosingFunction())
1133+
}
11271134

11281135
override string toString() { result = call.toString() }
11291136

@@ -1144,14 +1151,10 @@ class SummaryCall extends DataFlowCall, TSummaryCall {
11441151
/** Gets the data flow node that this call targets. */
11451152
FlowSummaryImpl::Private::SummaryNode getReceiver() { result = receiver }
11461153

1147-
// override CallTargetOperand getCallTargetOperand() TODO
1148-
1149-
override DataFlowCallable getStaticCallTarget() {
1150-
result = TSummarizedCallable(c)
1151-
}
1152-
1153-
// override ArgumentOperand getArgumentOperand(int index) TODO
1154+
// override CallTargetOperand getCallTargetOperand() TODO
1155+
override DataFlowCallable getStaticCallTarget() { result = TSummarizedCallable(c) }
11541156

1157+
// override ArgumentOperand getArgumentOperand(int index) TODO
11551158
override DataFlowCallable getEnclosingCallable() { result = TSummarizedCallable(c) } // TODO: is this right?
11561159

11571160
override string toString() { result = "[summary] call to " + receiver + " in " + c }
@@ -1262,7 +1265,8 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
12621265
* One example would be to allow flow like `p.foo = p.bar;`, which is disallowed
12631266
* by default as a heuristic.
12641267
*/
1265-
predicate allowParameterReturnInSelf(ParameterNode p) { p instanceof IndirectParameterNode
1268+
predicate allowParameterReturnInSelf(ParameterNode p) {
1269+
p instanceof IndirectParameterNode
12661270
// TODO: Swift has a case for summarized callables here.
12671271
}
12681272

0 commit comments

Comments
 (0)