C++/C#: More sanity checks for IRType

This commit is contained in:
Dave Bartolomeo
2019-10-21 14:22:46 -07:00
parent 958754bed8
commit 7241c1aae6
13 changed files with 31 additions and 2 deletions

View File

@@ -610,7 +610,9 @@ class FloatingPointType extends ArithmeticType {
(
kind >= 24 and kind <= 32
or
kind = 38
kind >= 38 and kind <= 42
or
kind >= 45 and kind <= 50
)
)
}

View File

@@ -258,4 +258,6 @@ module IRTypeSanity {
strictcount(type.getIRType()) > 1 and
message = "`LanguageType` " + type.getAQlClass() + " has multiple `IRType`s: " + concat(type.getIRType().toString(), ", ")
}
import Language::LanguageTypeSanity
}

View File

@@ -532,3 +532,13 @@ string getOpaqueTagIdentityString(Type tag) {
hasOpaqueType(tag, _) and
result = getTypeIdentityString(tag)
}
module LanguageTypeSanity {
query predicate missingCppType(Type type, string message) {
not exists(getTypeForPRValue(type)) and
exists(type.getSize()) and
// `ProxyClass`es have a size, but only appear in uninstantiated templates
not type instanceof ProxyClass and
message = "Type does not have an associated `CppType`."
}
}

View File

@@ -17,3 +17,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -17,3 +17,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -17,3 +17,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -17,3 +17,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -17,3 +17,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -548,3 +548,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -696,3 +696,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType

View File

@@ -557,3 +557,4 @@ missingCanonicalLanguageType
multipleCanonicalLanguageTypes
missingIRType
multipleIRTypes
missingCppType