summaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTCommon.cpp
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2018-06-02 02:58:51 +0000
committerLeonard Chan <leonardchan@google.com>2018-06-02 02:58:51 +0000
commitd10551520b50a0c7c847b35ae27066fee5a6617e (patch)
tree3233f3564d1e4a7aec289458c8e64dfe39a87023 /lib/Serialization/ASTCommon.cpp
parent02af30a94970b343ab052cab5166b2140b7071b8 (diff)
downloadclang-d10551520b50a0c7c847b35ae27066fee5a6617e.tar.gz
This diff includes changes for supporting the following types.
``` // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; ``` This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches. The tests included are for asserting that we can declare these types. Differential Revision: https://reviews.llvm.org/D46084 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTCommon.cpp')
-rw-r--r--lib/Serialization/ASTCommon.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Serialization/ASTCommon.cpp b/lib/Serialization/ASTCommon.cpp
index 54cea92042..f5584cc04d 100644
--- a/lib/Serialization/ASTCommon.cpp
+++ b/lib/Serialization/ASTCommon.cpp
@@ -91,6 +91,24 @@ serialization::TypeIdxFromBuiltin(const BuiltinType *BT) {
case BuiltinType::LongDouble:
ID = PREDEF_TYPE_LONGDOUBLE_ID;
break;
+ case BuiltinType::ShortAccum:
+ ID = PREDEF_TYPE_SHORT_ACCUM_ID;
+ break;
+ case BuiltinType::Accum:
+ ID = PREDEF_TYPE_ACCUM_ID;
+ break;
+ case BuiltinType::LongAccum:
+ ID = PREDEF_TYPE_LONG_ACCUM_ID;
+ break;
+ case BuiltinType::UShortAccum:
+ ID = PREDEF_TYPE_USHORT_ACCUM_ID;
+ break;
+ case BuiltinType::UAccum:
+ ID = PREDEF_TYPE_UACCUM_ID;
+ break;
+ case BuiltinType::ULongAccum:
+ ID = PREDEF_TYPE_ULONG_ACCUM_ID;
+ break;
case BuiltinType::Float16:
ID = PREDEF_TYPE_FLOAT16_ID;
break;