Skip to content

Commit ea4e109

Browse files
committed
C++: Remove decimal types from the dbscheme
1 parent 8ac0cb8 commit ea4e109

File tree

8 files changed

+9895
-3
lines changed

8 files changed

+9895
-3
lines changed

cpp/downgrades/d2d611b3fdcc7c4fe370f0d115200a3aa6ad5837/old.dbscheme

Lines changed: 2469 additions & 0 deletions
Large diffs are not rendered by default.

cpp/downgrades/d2d611b3fdcc7c4fe370f0d115200a3aa6ad5837/semmlecode.cpp.dbscheme

Lines changed: 2469 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description: Remove _Decimal{32,64,128} types
2+
compatibility: full

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,9 @@ case @builtintype.kind of
617617
| 37 = @signed_int128 // signed __int128
618618
| 38 = @float128 // __float128
619619
| 39 = @complex_float128 // _Complex __float128
620-
| 40 = @decimal32 // _Decimal32
621-
| 41 = @decimal64 // _Decimal64
622-
| 42 = @decimal128 // _Decimal128
620+
// ... 40 _Decimal32
621+
// ... 41 _Decimal64
622+
// ... 42 _Decimal128
623623
| 43 = @char16_t
624624
| 44 = @char32_t
625625
| 45 = @std_float32 // _Float32
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class BuiltinType extends @builtintype {
2+
string toString() { none() }
3+
}
4+
5+
predicate isDecimalBuiltinType(BuiltinType type) { builtintypes(type, _, [40, 41, 42], _, _, _) }
6+
7+
from BuiltinType type, string name, int kind, int kind_new, int size, int sign, int alignment
8+
where
9+
builtintypes(type, name, kind, size, sign, alignment) and
10+
if isDecimalBuiltinType(type) then kind_new = 1 else kind_new = kind
11+
select type, name, kind_new, size, sign, alignment

0 commit comments

Comments
 (0)