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:
Dave Bartolomeo
2018-08-30 13:46:43 -07:00
parent 9fd5f26e2e
commit 97cfbd9488
26 changed files with 33 additions and 20 deletions

View File

@@ -1 +0,0 @@
import internal.aliased_ssa_ir.IR

View File

@@ -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

View File

@@ -5,4 +5,4 @@
* @id cpp/ir-sanity-check
*/
import internal.raw_ir.IRSanity
import internal.aliased_ssa_ir.IRSanity

View File

@@ -1 +0,0 @@
import internal.aliased_ssa_ir.PrintIR

View File

@@ -5,4 +5,4 @@
* @kind graph
*/
import PrintIR
import internal.aliased_ssa_ir.PrintIR

View File

@@ -1 +0,0 @@
import internal.raw_ir.PrintIR

View File

@@ -1 +0,0 @@
import internal.ssa_ir.PrintIR

View File

@@ -1 +0,0 @@
import internal.ssa_ir.IR

View File

@@ -5,4 +5,4 @@
* @id cpp/aliased-ssa-ir-sanity-check
*/
import internal.aliased_ssa_ir.IRSanity
import IRSanity

View File

@@ -5,4 +5,4 @@
* @kind graph
*/
import PrintAliasedSSAIR
import PrintIR

View File

@@ -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

View 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

View File

@@ -5,4 +5,4 @@
* @id cpp/ssa-ir-sanity-check
*/
import internal.ssa_ir.IRSanity
import IRSanity

View File

@@ -5,4 +5,4 @@
* @kind graph
*/
import PrintSSAIR
import PrintIR

View File

@@ -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]

View File

@@ -1 +1 @@
semmle/code/cpp/ir/AliasedSSAIRSanity.ql
semmle/code/cpp/ir/IRSanity.ql

View File

@@ -1 +0,0 @@
semmle/code/cpp/ir/IRSanity.ql

View File

@@ -0,0 +1 @@
semmle/code/cpp/ir/internal/raw_ir/IRSanity.ql

View File

@@ -1 +1 @@
semmle/code/cpp/ir/SSAIRSanity.ql
semmle/code/cpp/ir/internal/ssa_ir/IRSanity.ql

View File

@@ -1 +1 @@
semmle/code/cpp/ir/PrintAliasedSSAIR.ql
semmle/code/cpp/ir/PrintIR.ql

View File

@@ -1 +0,0 @@
semmle/code/cpp/ir/PrintIR.ql

View File

@@ -0,0 +1 @@
semmle/code/cpp/ir/internal/raw_ir/PrintIR.ql

View File

@@ -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())

View File

@@ -1 +1 @@
semmle/code/cpp/ir/PrintSSAIR.ql
semmle/code/cpp/ir/internal/ssa_ir/PrintIR.ql