C++: Final IR reshuffle

Moved IR flavors into "implementation", with internal files under "implementation/internal". Made `IRBlockConstruction` just a nested module of `IRConstruction`/`SSAConstruction`, so it gets picked up from the `Construction` parameter of the `IR` module, rather than being picked up just from being in the same directory as `IRBlock`.
This commit is contained in:
Dave Bartolomeo
2018-08-31 14:25:16 -07:00
parent aa4436fa22
commit fce7a5fccb
71 changed files with 83 additions and 81 deletions

View File

@@ -1,58 +1,58 @@
{ {
"C++ IR Instruction": [ "C++ IR Instruction": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/Instruction.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/Instruction.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/Instruction.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll"
], ],
"C++ IR IRBlock": [ "C++ IR IRBlock": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/IRBlock.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRBlock.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/IRBlock.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRBlock.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/IRBlock.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRBlock.qll"
], ],
"C++ IR IRVariable": [ "C++ IR IRVariable": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/IRVariable.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRVariable.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/IRVariable.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRVariable.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/IRVariable.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRVariable.qll"
], ],
"C++ IR FunctionIR": [ "C++ IR FunctionIR": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/FunctionIR.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/FunctionIR.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/FunctionIR.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/FunctionIR.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/FunctionIR.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/FunctionIR.qll"
], ],
"C++ IR OperandTag": [ "C++ IR OperandTag": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/OperandTag.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/OperandTag.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/OperandTag.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/OperandTag.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/OperandTag.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/OperandTag.qll"
], ],
"C++ IR IRImpl": [ "C++ IR IRImpl": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/IR.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/IR.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IR.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/IR.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IR.qll"
], ],
"C++ IR IRSanityImpl": [ "C++ IR IRSanityImpl": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/IRSanity.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRSanity.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/IRSanity.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRSanity.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/IRSanity.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRSanity.qll"
], ],
"C++ IR PrintIRImpl": [ "C++ IR PrintIRImpl": [
"cpp/ql/src/semmle/code/cpp/ir/internal/raw_ir/PrintIR.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/PrintIR.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/PrintIR.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll"
], ],
"C++ SSA AliasAnalysis": [ "C++ SSA AliasAnalysis": [
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/AliasAnalysis.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/AliasAnalysis.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/AliasAnalysis.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasAnalysis.qll"
], ],
"C++ SSA SimpleSSA": [ "C++ SSA SimpleSSA": [
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/SimpleSSA.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SimpleSSA.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/SimpleSSA.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SimpleSSA.qll"
], ],
"C++ SSA IRBlockConstruction": [ "C++ SSA IRBlockConstruction": [
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/IRBlockConstruction.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/IRBlockConstruction.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/IRBlockConstruction.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/IRBlockConstruction.qll"
], ],
"C++ SSA SSAConstruction": [ "C++ SSA SSAConstruction": [
"cpp/ql/src/semmle/code/cpp/ir/internal/ssa_ir/SSAConstruction.qll", "cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll",
"cpp/ql/src/semmle/code/cpp/ir/internal/aliased_ssa_ir/SSAConstruction.qll" "cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll"
] ]
} }

View File

@@ -1,3 +1,3 @@
// Most queries should operate on the aliased SSA IR, so that's what we expose // Most queries should operate on the aliased SSA IR, so that's what we expose
// publically as the "IR". // publically as the "IR".
import internal.aliased_ssa.IR import implementation.aliased_ssa.IR

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import Instruction import Instruction
import cpp import cpp

View File

@@ -1,7 +1,7 @@
private import IRInternal private import internal.IRInternal
private import IRBlockConstruction
import Instruction import Instruction
import semmle.code.cpp.ir.implementation.EdgeKind import semmle.code.cpp.ir.implementation.EdgeKind
private import Construction::BlockConstruction
class IRBlock extends TIRBlock { class IRBlock extends TIRBlock {
final string toString() { final string toString() {

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import FunctionIR import FunctionIR
import cpp import cpp
import semmle.code.cpp.ir.implementation.TempVariableTag import semmle.code.cpp.ir.implementation.TempVariableTag

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import FunctionIR import FunctionIR
import IRBlock import IRBlock
import IRVariable import IRVariable

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import Instruction import Instruction
import IRBlock import IRBlock
import cpp import cpp

View File

@@ -0,0 +1 @@
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as InputIR

View File

@@ -1,6 +1,6 @@
private import IRInternal import SSAConstructionInternal
private import Construction::OldIR as OldIR private import SSAConstruction as Construction
import Instruction private import NewIR
import Cached import Cached
private cached module Cached { private cached module Cached {

View File

@@ -2,6 +2,7 @@ import SSAConstructionInternal
import cpp import cpp
private import semmle.code.cpp.ir.implementation.Opcode private import semmle.code.cpp.ir.implementation.Opcode
import NewIR import NewIR
import IRBlockConstruction as BlockConstruction
import Cached import Cached
cached private module Cached { cached private module Cached {

View File

@@ -0,0 +1,3 @@
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as OldIR
import semmle.code.cpp.ir.implementation.aliased_ssa.IR as NewIR
import SimpleSSA as Alias

View File

@@ -0,0 +1,3 @@
import AliasAnalysis as Alias
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as InputIR

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import Instruction import Instruction
import cpp import cpp

View File

@@ -1,7 +1,7 @@
private import IRInternal private import internal.IRInternal
private import IRBlockConstruction
import Instruction import Instruction
import semmle.code.cpp.ir.implementation.EdgeKind import semmle.code.cpp.ir.implementation.EdgeKind
private import Construction::BlockConstruction
class IRBlock extends TIRBlock { class IRBlock extends TIRBlock {
final string toString() { final string toString() {

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import FunctionIR import FunctionIR
import cpp import cpp
import semmle.code.cpp.ir.implementation.TempVariableTag import semmle.code.cpp.ir.implementation.TempVariableTag

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import FunctionIR import FunctionIR
import IRBlock import IRBlock
import IRVariable import IRVariable

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import Instruction import Instruction
import IRBlock import IRBlock
import cpp import cpp

View File

@@ -1,5 +1,4 @@
private import IRInternal import semmle.code.cpp.ir.implementation.raw.Instruction
import Instruction
import cpp import cpp
import semmle.code.cpp.ir.implementation.EdgeKind import semmle.code.cpp.ir.implementation.EdgeKind

View File

@@ -1,5 +1,6 @@
import cpp import cpp
import semmle.code.cpp.ir.internal.raw.IR import semmle.code.cpp.ir.implementation.raw.IR
import IRBlockConstruction as BlockConstruction
private import semmle.code.cpp.ir.internal.TempVariableTag private import semmle.code.cpp.ir.internal.TempVariableTag
private import InstructionTag private import InstructionTag
private import TranslatedElement private import TranslatedElement

View File

@@ -1,5 +1,5 @@
import cpp import cpp
import semmle.code.cpp.ir.internal.raw.IR import semmle.code.cpp.ir.implementation.raw.IR
private import semmle.code.cpp.ir.implementation.Opcode private import semmle.code.cpp.ir.implementation.Opcode
private import semmle.code.cpp.ir.internal.TempVariableTag private import semmle.code.cpp.ir.internal.TempVariableTag
private import InstructionTag private import InstructionTag

View File

@@ -1,5 +1,5 @@
import cpp import cpp
import semmle.code.cpp.ir.internal.raw.IR import semmle.code.cpp.ir.implementation.raw.IR
private import semmle.code.cpp.ir.implementation.Opcode private import semmle.code.cpp.ir.implementation.Opcode
private import semmle.code.cpp.ir.internal.TempVariableTag private import semmle.code.cpp.ir.internal.TempVariableTag
private import InstructionTag private import InstructionTag

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import Instruction import Instruction
import cpp import cpp

View File

@@ -1,7 +1,7 @@
private import IRInternal private import internal.IRInternal
private import IRBlockConstruction
import Instruction import Instruction
import semmle.code.cpp.ir.implementation.EdgeKind import semmle.code.cpp.ir.implementation.EdgeKind
private import Construction::BlockConstruction
class IRBlock extends TIRBlock { class IRBlock extends TIRBlock {
final string toString() { final string toString() {

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import FunctionIR import FunctionIR
import cpp import cpp
import semmle.code.cpp.ir.implementation.TempVariableTag import semmle.code.cpp.ir.implementation.TempVariableTag

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import FunctionIR import FunctionIR
import IRBlock import IRBlock
import IRVariable import IRVariable

View File

@@ -1,4 +1,4 @@
private import IRInternal private import internal.IRInternal
import Instruction import Instruction
import IRBlock import IRBlock
import cpp import cpp

View File

@@ -0,0 +1 @@
import semmle.code.cpp.ir.implementation.raw.IR as InputIR

View File

@@ -1,6 +1,6 @@
private import IRInternal import SSAConstructionInternal
private import Construction::OldIR as OldIR private import SSAConstruction as Construction
import Instruction private import NewIR
import Cached import Cached
private cached module Cached { private cached module Cached {

View File

@@ -2,6 +2,7 @@ import SSAConstructionInternal
import cpp import cpp
private import semmle.code.cpp.ir.implementation.Opcode private import semmle.code.cpp.ir.implementation.Opcode
import NewIR import NewIR
import IRBlockConstruction as BlockConstruction
import Cached import Cached
cached private module Cached { cached private module Cached {

View File

@@ -0,0 +1,3 @@
import semmle.code.cpp.ir.implementation.raw.IR as OldIR
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as NewIR
import SimpleSSA as Alias

View File

@@ -0,0 +1,2 @@
import AliasAnalysis as Alias
import semmle.code.cpp.ir.implementation.raw.IR as InputIR

View File

@@ -1 +0,0 @@
import semmle.code.cpp.ir.internal.unaliased_ssa.IR as InputIR

View File

@@ -1,3 +0,0 @@
import semmle.code.cpp.ir.internal.unaliased_ssa.IR as OldIR
import semmle.code.cpp.ir.internal.aliased_ssa.IR as NewIR
import SimpleSSA as Alias

View File

@@ -1,3 +0,0 @@
import AliasAnalysis as Alias
import semmle.code.cpp.ir.internal.unaliased_ssa.IR as InputIR

View File

@@ -1 +0,0 @@
import semmle.code.cpp.ir.internal.raw.IR as InputIR

View File

@@ -1,3 +0,0 @@
import semmle.code.cpp.ir.internal.raw.IR as OldIR
import semmle.code.cpp.ir.internal.unaliased_ssa.IR as NewIR
import SimpleSSA as Alias

View File

@@ -1,2 +0,0 @@
import AliasAnalysis as Alias
import semmle.code.cpp.ir.internal.raw.IR as InputIR

View File

@@ -1 +1 @@
semmle/code/cpp/ir/internal/raw/PrintIR.ql semmle/code/cpp/ir/implementation/raw/PrintIR.ql

View File

@@ -1 +1 @@
semmle/code/cpp/ir/internal/raw/IRSanity.ql semmle/code/cpp/ir/implementation/raw/IRSanity.ql

View File

@@ -1 +1 @@
semmle/code/cpp/ir/internal/unaliased_ssa/PrintIR.ql semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.ql

View File

@@ -1 +1 @@
semmle/code/cpp/ir/internal/unaliased_ssa/IRSanity.ql semmle/code/cpp/ir/implementation/unaliased_ssa/IRSanity.ql