summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/LangOptions.def
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2018-06-20 17:19:40 +0000
committerLeonard Chan <leonardchan@google.com>2018-06-20 17:19:40 +0000
commit84dd23f357de28ff35ffb7343d72cbfc79e49130 (patch)
tree7ec94dafa03219c940a7dff6086b060e16fb9eb4 /include/clang/Basic/LangOptions.def
parent2e7bf27afabf7dd4fce58a26b0eee4b60c42f337 (diff)
[Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals
This diff includes the logic for setting the precision bits for each primary fixed point type in the target info and logic for initializing a fixed point literal. Fixed point literals are declared using the suffixes ``` hr: short _Fract uhr: unsigned short _Fract r: _Fract ur: unsigned _Fract lr: long _Fract ulr: unsigned long _Fract hk: short _Accum uhk: unsigned short _Accum k: _Accum uk: unsigned _Accum ``` Errors are also thrown for illegal literal values ``` unsigned short _Accum u_short_accum = 256.0uhk; // expected-error{{the integral part of this literal is too large for this unsigned _Accum type}} ``` Differential Revision: https://reviews.llvm.org/D46915 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/LangOptions.def')
-rw-r--r--include/clang/Basic/LangOptions.def2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def
index f9246bd893..d7d66be32d 100644
--- a/include/clang/Basic/LangOptions.def
+++ b/include/clang/Basic/LangOptions.def
@@ -305,6 +305,8 @@ ENUM_LANGOPT(ClangABICompat, ClangABI, 4, ClangABI::Latest,
COMPATIBLE_VALUE_LANGOPT(FunctionAlignment, 5, 0, "Default alignment for functions")
LANGOPT(FixedPoint, 1, 0, "fixed point types")
+LANGOPT(SameFBits, 1, 0,
+ "unsigned and signed fixed point type having the same number of fractional bits")
#undef LANGOPT
#undef COMPATIBLE_LANGOPT