Skip to content

Commit 09d1da2

Browse files
author
Dave Bartolomeo
committed
C++/C#: Rename sanity -> consistency
I did both of these languages together because they share some of the changed code via `identical-files.json`.
1 parent 86a774d commit 09d1da2

File tree

109 files changed

+500
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+500
-500
lines changed

config/identical-files.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@
111111
"csharp/ql/src/semmle/code/csharp/ir/implementation/raw/IR.qll",
112112
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/IR.qll"
113113
],
114-
"IR IRSanity": [
115-
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRSanity.qll",
116-
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRSanity.qll",
117-
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRSanity.qll",
118-
"csharp/ql/src/semmle/code/csharp/ir/implementation/raw/IRSanity.qll",
119-
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/IRSanity.qll"
114+
"IR IRConsistency": [
115+
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll",
116+
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll",
117+
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll",
118+
"csharp/ql/src/semmle/code/csharp/ir/implementation/raw/IRConsistency.qll",
119+
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/IRConsistency.qll"
120120
],
121121
"IR PrintIR": [
122122
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll",
@@ -157,10 +157,10 @@
157157
"cpp/ql/src/semmle/code/cpp/ir/implementation/Opcode.qll",
158158
"csharp/ql/src/semmle/code/csharp/ir/implementation/Opcode.qll"
159159
],
160-
"IR SSASanity": [
161-
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSASanity.qll",
162-
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSASanity.qll",
163-
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSASanity.qll"
160+
"IR SSAConsistency": [
161+
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConsistency.qll",
162+
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConsistency.qll",
163+
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSAConsistency.qll"
164164
],
165165
"C++ IR InstructionImports": [
166166
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/InstructionImports.qll",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @name AST Consistency Check
3+
* @description Performs consistency checks on the Abstract Syntax Tree. This query should have no results.
4+
* @kind table
5+
* @id cpp/ast-consistency-check
6+
*/
7+
8+
import cpp
9+
import CastConsistency

cpp/ql/src/semmle/code/cpp/ASTSanity.ql

Lines changed: 0 additions & 9 deletions
This file was deleted.

cpp/ql/src/semmle/code/cpp/exprs/Cast.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ class Cast extends Conversion, @cast {
4848
/**
4949
* INTERNAL: Do not use.
5050
* Query predicates used to check invariants that should hold for all `Cast`
51-
* nodes. To run all sanity queries for the ASTs, including the ones below,
52-
* run "semmle/code/cpp/ASTSanity.ql".
51+
* nodes. To run all consistency queries for the ASTs, including the ones below,
52+
* run "semmle/code/cpp/ASTConsistency.ql".
5353
*/
54-
module CastSanity {
54+
module CastConsistency {
5555
query predicate multipleSemanticConversionStrings(Cast cast, Type fromType, string kind) {
5656
// Every cast should have exactly one semantic conversion kind
5757
count(cast.getSemanticConversionString()) > 1 and
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @name IR Consistency Check
3+
* @description Performs consistency checks on the Intermediate Representation. This query should have no results.
4+
* @kind table
5+
* @id cpp/ir-consistency-check
6+
*/
7+
8+
import implementation.aliased_ssa.IRConsistency

cpp/ql/src/semmle/code/cpp/ir/IRSanity.ql

Lines changed: 0 additions & 8 deletions
This file was deleted.

cpp/ql/src/semmle/code/cpp/ir/implementation/IRType.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class IROpaqueType extends IRSizedType, TIROpaqueType {
275275
final override int getByteSize() { result = byteSize }
276276
}
277277

278-
module IRTypeSanity {
278+
module IRTypeConsistency {
279279
query predicate missingCanonicalLanguageType(IRType type, string message) {
280280
not exists(type.getCanonicalLanguageType()) and
281281
message = "Type does not have a canonical `LanguageType`"
@@ -300,5 +300,5 @@ module IRTypeSanity {
300300
concat(type.getIRType().toString(), ", ")
301301
}
302302

303-
import Language::LanguageTypeSanity
303+
import Language::LanguageTypeConsistency
304304
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @name Aliased SSA IR Consistency Check
3+
* @description Performs consistency checks on the Intermediate Representation. This query should have no results.
4+
* @kind table
5+
* @id cpp/aliased-ssa-ir-consistency-check
6+
*/
7+
8+
import IRConsistency

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRSanity.qll renamed to cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
private import IR
2-
import InstructionSanity // module is below
3-
import IRTypeSanity // module is in IRType.qll
2+
import InstructionConsistency // module is below
3+
import IRTypeConsistency // module is in IRType.qll
44

5-
module InstructionSanity {
5+
module InstructionConsistency {
66
private import internal.InstructionImports as Imports
77
private import Imports::OperandTag
88
private import Imports::Overlap

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRSanity.ql

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)