mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #122 from dave-bartolomeo/dave/IRShuffle
Approved by jbj
This commit is contained in:
@@ -1,58 +1,58 @@
|
||||
{
|
||||
"C++ IR Instruction": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/Instruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/Instruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/Instruction.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll"
|
||||
],
|
||||
"C++ IR IRBlock": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/IRBlock.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/IRBlock.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/IRBlock.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRBlock.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRBlock.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRBlock.qll"
|
||||
],
|
||||
"C++ IR IRVariable": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/IRVariable.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/IRVariable.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/IRVariable.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRVariable.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRVariable.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRVariable.qll"
|
||||
],
|
||||
"C++ IR FunctionIR": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/FunctionIR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/FunctionIR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/FunctionIR.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/FunctionIR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/FunctionIR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/FunctionIR.qll"
|
||||
],
|
||||
"C++ IR OperandTag": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/OperandTag.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/OperandTag.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/OperandTag.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/OperandTag.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/OperandTag.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/OperandTag.qll"
|
||||
],
|
||||
"C++ IR IRImpl": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/IRImpl.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/IRImpl.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/IRImpl.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IR.qll"
|
||||
],
|
||||
"C++ IR IRSanityImpl": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/IRSanityImpl.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/IRSanityImpl.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/IRSanityImpl.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRSanity.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRSanity.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRSanity.qll"
|
||||
],
|
||||
"C++ IR PrintIRImpl": [
|
||||
"cpp/ql/src/semmle/code/cpp/ir/internal/PrintIRImpl.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/PrintIRImpl.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/PrintIRImpl.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll"
|
||||
],
|
||||
"C++ SSA AliasAnalysis": [
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/AliasAnalysis.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/AliasAnalysis.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/AliasAnalysis.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasAnalysis.qll"
|
||||
],
|
||||
"C++ SSA SimpleSSA": [
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/SimpleSSA.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/SimpleSSA.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SimpleSSA.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SimpleSSA.qll"
|
||||
],
|
||||
"C++ SSA IRBlockConstruction": [
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/IRBlockConstruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/IRBlockConstruction.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/IRBlockConstruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/IRBlockConstruction.qll"
|
||||
],
|
||||
"C++ SSA SSAConstruction": [
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/ssa/SSAConstruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ssa/internal/aliased_ssa/SSAConstruction.qll"
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll",
|
||||
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
import internal.IRImpl
|
||||
// Most queries should operate on the aliased SSA IR, so that's what we expose
|
||||
// publically as the "IR".
|
||||
import implementation.aliased_ssa.IR
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.IRSanityImpl
|
||||
import implementation.aliased_ssa.IRSanity
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import internal.Opcode
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintIR
|
||||
import implementation.aliased_ssa.PrintIR
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import internal.PrintIRImpl
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
private import internal.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
class TempVariableTag extends TTempVariableTag {
|
||||
string toString() {
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import cpp
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import IRBlockConstruction
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
private import Construction::BlockConstruction
|
||||
|
||||
class IRBlock extends TIRBlock {
|
||||
final string toString() {
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/aliased-ssa-ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.aliased_ssa.IRSanityImpl
|
||||
import IRSanity
|
||||
@@ -1,3 +1,3 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import InstructionSanity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.TempVariableTag
|
||||
import semmle.code.cpp.ir.implementation.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
private newtype TIRVariable =
|
||||
@@ -1,13 +1,13 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.Opcode
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
|
||||
class InstructionTag = Construction::InstructionTagType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import cpp
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintAliasedSSAIR
|
||||
import PrintIR
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import cpp
|
||||
|
||||
private newtype TPrintableIRNode =
|
||||
@@ -83,8 +83,7 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
|
||||
override int getOrder() {
|
||||
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
|
||||
location = orderedFunc.getFunctionIR().getLocation() |
|
||||
orderedFunc order by location.getFile().getAbsolutePath(),
|
||||
location.getStartLine(),
|
||||
orderedFunc order by location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), orderedFunc.getLabel()
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
private import AliasAnalysisInternal
|
||||
import cpp
|
||||
private import IR
|
||||
private import semmle.code.cpp.ssa.internal.IntegerConstant as Ints
|
||||
private import InputIR
|
||||
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints
|
||||
|
||||
private class IntValue = Ints::IntValue;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as InputIR
|
||||
@@ -1,6 +1,6 @@
|
||||
private import IRInternal
|
||||
private import Construction::OldIR as OldIR
|
||||
import Instruction
|
||||
import SSAConstructionInternal
|
||||
private import SSAConstruction as Construction
|
||||
private import NewIR
|
||||
|
||||
import Cached
|
||||
private cached module Cached {
|
||||
@@ -1,7 +1,8 @@
|
||||
import SSAConstructionInternal
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
import NewIR
|
||||
import IRBlockConstruction as BlockConstruction
|
||||
|
||||
import Cached
|
||||
cached private module Cached {
|
||||
@@ -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
|
||||
@@ -1,8 +1,8 @@
|
||||
import SimpleSSAInternal
|
||||
import cpp
|
||||
import Alias
|
||||
import IR
|
||||
import semmle.code.cpp.ssa.internal.Overlap
|
||||
private import InputIR
|
||||
import semmle.code.cpp.ir.internal.Overlap
|
||||
|
||||
private newtype TVirtualVariable =
|
||||
MkVirtualVariable(IRVariable var) {
|
||||
@@ -0,0 +1,3 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as InputIR
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import cpp
|
||||
|
||||
7
cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll
Normal file
7
cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll
Normal file
@@ -0,0 +1,7 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import IRBlockConstruction
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
private import Construction::BlockConstruction
|
||||
|
||||
class IRBlock extends TIRBlock {
|
||||
final string toString() {
|
||||
@@ -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
|
||||
@@ -1,3 +1,3 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import InstructionSanity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.TempVariableTag
|
||||
import semmle.code.cpp.ir.implementation.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
private newtype TIRVariable =
|
||||
@@ -1,13 +1,13 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.Opcode
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
|
||||
class InstructionTag = Construction::InstructionTagType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import cpp
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import cpp
|
||||
|
||||
private newtype TPrintableIRNode =
|
||||
@@ -83,7 +83,7 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
|
||||
override int getOrder() {
|
||||
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
|
||||
location = orderedFunc.getFunctionIR().getLocation() |
|
||||
orderedFunc order by location.getFile().getURL(), location.getStartLine(),
|
||||
orderedFunc order by location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), orderedFunc.getLabel()
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
private import IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.implementation.raw.Instruction
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
|
||||
private predicate startsBasicBlock(Instruction instr) {
|
||||
not instr instanceof PhiInstruction and
|
||||
@@ -1,7 +1,8 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
import IRBlockConstruction as BlockConstruction
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import TempVariableTag
|
||||
private import TranslatedElement
|
||||
private import TranslatedFunction
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
private import TranslatedInitialization
|
||||
@@ -1,8 +1,8 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TempVariableTag
|
||||
private import TranslatedCondition
|
||||
private import TranslatedFunction
|
||||
private import TranslatedStmt
|
||||
@@ -1,7 +1,7 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TempVariableTag
|
||||
private import TranslatedCondition
|
||||
private import TranslatedElement
|
||||
private import TranslatedFunction
|
||||
@@ -1,8 +1,8 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TempVariableTag
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
private import TranslatedInitialization
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
private import TranslatedFunction
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedCondition
|
||||
private import TranslatedDeclarationEntry
|
||||
private import TranslatedElement
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import cpp
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import IRBlockConstruction
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
private import Construction::BlockConstruction
|
||||
|
||||
class IRBlock extends TIRBlock {
|
||||
final string toString() {
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/ssa-ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.ssa.IRSanityImpl
|
||||
import IRSanity
|
||||
@@ -1,3 +1,3 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import InstructionSanity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.TempVariableTag
|
||||
import semmle.code.cpp.ir.implementation.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
private newtype TIRVariable =
|
||||
@@ -1,13 +1,13 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.Opcode
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
|
||||
class InstructionTag = Construction::InstructionTagType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import cpp
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintSSAIR
|
||||
import PrintIR
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import cpp
|
||||
|
||||
private newtype TPrintableIRNode =
|
||||
@@ -83,7 +83,7 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
|
||||
override int getOrder() {
|
||||
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
|
||||
location = orderedFunc.getFunctionIR().getLocation() |
|
||||
orderedFunc order by location.getFile().getURL(), location.getStartLine(),
|
||||
orderedFunc order by location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), orderedFunc.getLabel()
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
private import AliasAnalysisInternal
|
||||
import cpp
|
||||
private import IR
|
||||
private import semmle.code.cpp.ssa.internal.IntegerConstant as Ints
|
||||
private import InputIR
|
||||
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints
|
||||
|
||||
private class IntValue = Ints::IntValue;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import semmle.code.cpp.ir.implementation.raw.IR as InputIR
|
||||
@@ -1,6 +1,6 @@
|
||||
private import IRInternal
|
||||
private import Construction::OldIR as OldIR
|
||||
import Instruction
|
||||
import SSAConstructionInternal
|
||||
private import SSAConstruction as Construction
|
||||
private import NewIR
|
||||
|
||||
import Cached
|
||||
private cached module Cached {
|
||||
@@ -1,7 +1,8 @@
|
||||
import SSAConstructionInternal
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
import NewIR
|
||||
import IRBlockConstruction as BlockConstruction
|
||||
|
||||
import Cached
|
||||
cached private module Cached {
|
||||
@@ -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
|
||||
@@ -1,8 +1,8 @@
|
||||
import SimpleSSAInternal
|
||||
import cpp
|
||||
import Alias
|
||||
import IR
|
||||
import semmle.code.cpp.ssa.internal.Overlap
|
||||
private import InputIR
|
||||
import semmle.code.cpp.ir.internal.Overlap
|
||||
|
||||
private newtype TVirtualVariable =
|
||||
MkVirtualVariable(IRVariable var) {
|
||||
@@ -0,0 +1,2 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ir.implementation.raw.IR as InputIR
|
||||
@@ -1,7 +0,0 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
@@ -1 +0,0 @@
|
||||
import internal.aliased_ssa.IRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import internal.aliased_ssa.PrintIRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import internal.ssa.PrintIRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import internal.ssa.IRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import semmle.code.cpp.ssa.SSAIR as IR
|
||||
@@ -1,7 +0,0 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
@@ -1,3 +0,0 @@
|
||||
import semmle.code.cpp.ssa.SSAIR as OldIR
|
||||
import semmle.code.cpp.ssa.AliasedSSAIR as NewIR
|
||||
import SimpleSSA as Alias
|
||||
@@ -1,3 +0,0 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ssa.SSAIR as IR
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import semmle.code.cpp.ir.IR as IR
|
||||
@@ -1,7 +0,0 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
@@ -1,3 +0,0 @@
|
||||
import semmle.code.cpp.ir.IR as OldIR
|
||||
import semmle.code.cpp.ssa.SSAIR as NewIR
|
||||
import SimpleSSA as Alias
|
||||
@@ -1,3 +0,0 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ir.IR as IR
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.SSAIR
|
||||
import semmle.code.cpp.ssa.internal.IntegerConstant
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.internal.IntegerConstant
|
||||
|
||||
language[monotonicAggregates]
|
||||
IntValue getConstantValue(Instruction instr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ssa.internal.IntegerConstant as Ints
|
||||
import semmle.code.cpp.ir.internal.IntegerConstant as Ints
|
||||
|
||||
bindingset[n]
|
||||
string resultString(int n) {
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.internal.ssa.AliasAnalysis
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.AliasAnalysis
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
|
||||
predicate shouldEscape(IRAutomaticUserVariable var) {
|
||||
exists(string name |
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.internal.ssa.AliasAnalysis
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.AliasAnalysis
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
|
||||
from Instruction instr, string pointsTo
|
||||
where
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.internal.aliased_ssa.AliasAnalysis
|
||||
import semmle.code.cpp.ssa.SSAIR
|
||||
import semmle.code.cpp.ir.implementation.aliased_ssa.internal.AliasAnalysis
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR
|
||||
|
||||
predicate shouldEscape(IRAutomaticUserVariable var) {
|
||||
exists(string name |
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ssa/AliasedSSAIRSanity.ql
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ssa/SSAIRSanity.ql
|
||||
@@ -1 +1 @@
|
||||
semmle/code/cpp/ssa/PrintAliasedSSAIR.ql
|
||||
semmle/code/cpp/ir/PrintIR.ql
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ir/PrintIR.ql
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user