mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
C++: Autoformat everything
Some files that will change in #1736 have been spared. ./build -j4 target/jars/qlformat find ql/cpp/ql -name "*.ql" -print0 | xargs -0 target/jars/qlformat --input find ql/cpp/ql -name "*.qll" -print0 | xargs -0 target/jars/qlformat --input (cd ql && git checkout 'cpp/ql/src/semmle/code/cpp/ir/implementation/**/*SSA*.qll') buildutils-internal/scripts/pr-checks/sync-identical-files.py --latest
This commit is contained in:
@@ -3,9 +3,7 @@ import semmle.code.cpp.dataflow.DataFlow
|
||||
|
||||
/** Common data flow configuration to be used by tests. */
|
||||
class TestAllocationConfig extends DataFlow::Configuration {
|
||||
TestAllocationConfig() {
|
||||
this = "TestAllocationConfig"
|
||||
}
|
||||
TestAllocationConfig() { this = "TestAllocationConfig" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
source.asExpr().(FunctionCall).getTarget().getName() = "source"
|
||||
|
||||
@@ -3,9 +3,7 @@ import semmle.code.cpp.ir.dataflow.DataFlow
|
||||
|
||||
/** Common data flow configuration to be used by tests. */
|
||||
class TestAllocationConfig extends DataFlow::Configuration {
|
||||
TestAllocationConfig() {
|
||||
this = "TestAllocationConfig"
|
||||
}
|
||||
TestAllocationConfig() { this = "TestAllocationConfig" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
source.asExpr().(FunctionCall).getTarget().getName() = "source"
|
||||
|
||||
@@ -2,6 +2,7 @@ import cpp
|
||||
import semmle.code.cpp.dataflow.DataFlow
|
||||
|
||||
from DataFlow::Node nodeFrom, DataFlow::Node nodeTo
|
||||
where DataFlow::localFlowStep(nodeFrom, nodeTo)
|
||||
and nodeFrom.getFunction().getName().matches("%\\_with\\_local\\_flow")
|
||||
where
|
||||
DataFlow::localFlowStep(nodeFrom, nodeTo) and
|
||||
nodeFrom.getFunction().getName().matches("%\\_with\\_local\\_flow")
|
||||
select nodeFrom, nodeTo
|
||||
|
||||
@@ -5,8 +5,10 @@ import semmle.code.cpp.dataflow.DataFlow as ASTDataFlow
|
||||
import semmle.code.cpp.ir.dataflow.DataFlow as IRDataFlow
|
||||
|
||||
predicate astFlow(Location sourceLocation, Location sinkLocation) {
|
||||
exists(ASTDataFlow::DataFlow::Node source, ASTDataFlow::DataFlow::Node sink,
|
||||
ASTCommon::TestAllocationConfig cfg |
|
||||
exists(
|
||||
ASTDataFlow::DataFlow::Node source, ASTDataFlow::DataFlow::Node sink,
|
||||
ASTCommon::TestAllocationConfig cfg
|
||||
|
|
||||
cfg.hasFlow(source, sink) and
|
||||
sourceLocation = source.getLocation() and
|
||||
sinkLocation = sink.getLocation()
|
||||
@@ -14,8 +16,10 @@ predicate astFlow(Location sourceLocation, Location sinkLocation) {
|
||||
}
|
||||
|
||||
predicate irFlow(Location sourceLocation, Location sinkLocation) {
|
||||
exists(IRDataFlow::DataFlow::Node source, IRDataFlow::DataFlow::Node sink,
|
||||
IRCommon::TestAllocationConfig cfg |
|
||||
exists(
|
||||
IRDataFlow::DataFlow::Node source, IRDataFlow::DataFlow::Node sink,
|
||||
IRCommon::TestAllocationConfig cfg
|
||||
|
|
||||
cfg.hasFlow(source, sink) and
|
||||
sourceLocation = source.getLocation() and
|
||||
sinkLocation = sink.getLocation()
|
||||
@@ -23,15 +27,12 @@ predicate irFlow(Location sourceLocation, Location sinkLocation) {
|
||||
}
|
||||
|
||||
from Location sourceLocation, Location sinkLocation, string note
|
||||
where
|
||||
(
|
||||
astFlow(sourceLocation, sinkLocation) and
|
||||
not irFlow(sourceLocation, sinkLocation) and
|
||||
note = "AST only"
|
||||
) or
|
||||
(
|
||||
irFlow(sourceLocation, sinkLocation) and
|
||||
not astFlow(sourceLocation, sinkLocation) and
|
||||
note = "IR only"
|
||||
)
|
||||
where
|
||||
astFlow(sourceLocation, sinkLocation) and
|
||||
not irFlow(sourceLocation, sinkLocation) and
|
||||
note = "AST only"
|
||||
or
|
||||
irFlow(sourceLocation, sinkLocation) and
|
||||
not astFlow(sourceLocation, sinkLocation) and
|
||||
note = "IR only"
|
||||
select sourceLocation.toString(), sinkLocation.toString(), note
|
||||
|
||||
Reference in New Issue
Block a user