From 1e3419fd60ee62b6d6e8de9fcbbdb239114daa62 Mon Sep 17 00:00:00 2001 From: Robert Marsh Date: Tue, 3 Mar 2020 14:34:08 -0800 Subject: [PATCH] C++/C#: generate IR for funcs excluded in PrintIR Previously, functions excluded from PrintIR would not have IR generated. This sometimes affected escacpe analysis of functions that were printed. --- .../code/cpp/ir/implementation/aliased_ssa/PrintIR.qll | 9 --------- .../semmle/code/cpp/ir/implementation/raw/PrintIR.qll | 9 --------- .../code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll | 9 --------- .../semmle/code/csharp/ir/implementation/raw/PrintIR.qll | 9 --------- .../csharp/ir/implementation/unaliased_ssa/PrintIR.qll | 9 --------- 5 files changed, 45 deletions(-) diff --git a/cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll b/cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll index ff9c557601c..5849f438fbc 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll @@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) { exists(PrintIRConfiguration config | config.shouldPrintFunction(func)) } -/** - * Override of `IRConfiguration` to only create IR for the functions that are to be dumped. - */ -private class FilteredIRConfiguration extends IRConfiguration { - override predicate shouldCreateIRForFunction(Language::Function func) { - shouldPrintFunction(func) - } -} - private string getAdditionalInstructionProperty(Instruction instr, string key) { exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key)) } diff --git a/cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll b/cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll index ff9c557601c..5849f438fbc 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll @@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) { exists(PrintIRConfiguration config | config.shouldPrintFunction(func)) } -/** - * Override of `IRConfiguration` to only create IR for the functions that are to be dumped. - */ -private class FilteredIRConfiguration extends IRConfiguration { - override predicate shouldCreateIRForFunction(Language::Function func) { - shouldPrintFunction(func) - } -} - private string getAdditionalInstructionProperty(Instruction instr, string key) { exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key)) } diff --git a/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll b/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll index ff9c557601c..5849f438fbc 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll @@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) { exists(PrintIRConfiguration config | config.shouldPrintFunction(func)) } -/** - * Override of `IRConfiguration` to only create IR for the functions that are to be dumped. - */ -private class FilteredIRConfiguration extends IRConfiguration { - override predicate shouldCreateIRForFunction(Language::Function func) { - shouldPrintFunction(func) - } -} - private string getAdditionalInstructionProperty(Instruction instr, string key) { exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key)) } diff --git a/csharp/ql/src/semmle/code/csharp/ir/implementation/raw/PrintIR.qll b/csharp/ql/src/semmle/code/csharp/ir/implementation/raw/PrintIR.qll index ff9c557601c..5849f438fbc 100644 --- a/csharp/ql/src/semmle/code/csharp/ir/implementation/raw/PrintIR.qll +++ b/csharp/ql/src/semmle/code/csharp/ir/implementation/raw/PrintIR.qll @@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) { exists(PrintIRConfiguration config | config.shouldPrintFunction(func)) } -/** - * Override of `IRConfiguration` to only create IR for the functions that are to be dumped. - */ -private class FilteredIRConfiguration extends IRConfiguration { - override predicate shouldCreateIRForFunction(Language::Function func) { - shouldPrintFunction(func) - } -} - private string getAdditionalInstructionProperty(Instruction instr, string key) { exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key)) } diff --git a/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/PrintIR.qll b/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/PrintIR.qll index ff9c557601c..5849f438fbc 100644 --- a/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/PrintIR.qll +++ b/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/PrintIR.qll @@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) { exists(PrintIRConfiguration config | config.shouldPrintFunction(func)) } -/** - * Override of `IRConfiguration` to only create IR for the functions that are to be dumped. - */ -private class FilteredIRConfiguration extends IRConfiguration { - override predicate shouldCreateIRForFunction(Language::Function func) { - shouldPrintFunction(func) - } -} - private string getAdditionalInstructionProperty(Instruction instr, string key) { exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key)) }