mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: "IR" means "Aliased SSA IR"
This change makes the public IR.qll module resolve to the flavor of the IR that we want queries to use. Today, this is the aliased SSA flavor of the IR. Should we add additional IR iterations in the future, we'll update IR.qll to resolve to whichever one we consider the default. I moved the PrintIR.ql and IRSanity.ql queries into the internal directories of the corresponding flavors. There's still a PrintIR.ql and an IRSanity.ql in the public IR directory, which use the same IR flavor as the public IR.qll.
This commit is contained in:
@@ -1 +0,0 @@
|
||||
import internal.aliased_ssa_ir.IR
|
||||
@@ -1 +1,3 @@
|
||||
import internal.raw_ir.IR
|
||||
// Most queries should operate on the aliased SSA IR, so that's what we expose
|
||||
// publically as the "IR".
|
||||
import internal.aliased_ssa_ir.IR
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.raw_ir.IRSanity
|
||||
import internal.aliased_ssa_ir.IRSanity
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import internal.aliased_ssa_ir.PrintIR
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintIR
|
||||
import internal.aliased_ssa_ir.PrintIR
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import internal.raw_ir.PrintIR
|
||||
@@ -1 +0,0 @@
|
||||
import internal.ssa_ir.PrintIR
|
||||
@@ -1 +0,0 @@
|
||||
import internal.ssa_ir.IR
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/aliased-ssa-ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.aliased_ssa_ir.IRSanity
|
||||
import IRSanity
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintAliasedSSAIR
|
||||
import PrintIR
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @name Raw IR Sanity Check
|
||||
* @description Performs sanity checks on the Intermediate Representation. This query should have no results.
|
||||
* @kind problem
|
||||
* @id cpp/raw-ir-sanity-check
|
||||
*/
|
||||
|
||||
import IRSanity
|
||||
8
cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/PrintIR.ql
Normal file
8
cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/PrintIR.ql
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @name Print Raw IR
|
||||
* @description Outputs a representation of the Raw IR graph
|
||||
* @id cpp/print-raw-ir
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintIR
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/ssa-ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.ssa_ir.IRSanity
|
||||
import IRSanity
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintSSAIR
|
||||
import PrintIR
|
||||
@@ -1,5 +1,5 @@
|
||||
import default
|
||||
import semmle.code.cpp.ir.SSAIR
|
||||
import semmle.code.cpp.ir.internal.ssa_ir.IR
|
||||
import semmle.code.cpp.ir.internal.IntegerConstant
|
||||
|
||||
language[monotonicAggregates]
|
||||
|
||||
@@ -1 +1 @@
|
||||
semmle/code/cpp/ir/AliasedSSAIRSanity.ql
|
||||
semmle/code/cpp/ir/IRSanity.ql
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ir/IRSanity.ql
|
||||
1
cpp/ql/test/library-tests/ir/ir/RawIRSanity.qlref
Normal file
1
cpp/ql/test/library-tests/ir/ir/RawIRSanity.qlref
Normal file
@@ -0,0 +1 @@
|
||||
semmle/code/cpp/ir/internal/raw_ir/IRSanity.ql
|
||||
@@ -1 +1 @@
|
||||
semmle/code/cpp/ir/SSAIRSanity.ql
|
||||
semmle/code/cpp/ir/internal/ssa_ir/IRSanity.ql
|
||||
@@ -1 +1 @@
|
||||
semmle/code/cpp/ir/PrintAliasedSSAIR.ql
|
||||
semmle/code/cpp/ir/PrintIR.ql
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ir/PrintIR.ql
|
||||
1
cpp/ql/test/library-tests/ir/ir/raw_ir.qlref
Normal file
1
cpp/ql/test/library-tests/ir/ir/raw_ir.qlref
Normal file
@@ -0,0 +1 @@
|
||||
semmle/code/cpp/ir/internal/raw_ir/PrintIR.ql
|
||||
@@ -1,5 +1,5 @@
|
||||
import default
|
||||
import semmle.code.cpp.ir.SSAIR
|
||||
import semmle.code.cpp.ir.IR
|
||||
|
||||
from FunctionIR funcIR
|
||||
select funcIR.toString(), count(funcIR.getABlock())
|
||||
|
||||
@@ -1 +1 @@
|
||||
semmle/code/cpp/ir/PrintSSAIR.ql
|
||||
semmle/code/cpp/ir/internal/ssa_ir/PrintIR.ql
|
||||
Reference in New Issue
Block a user