summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2019-07-02 18:28:13 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2019-07-02 18:28:13 +0000
commiteee944e7f9e60df44714eb547d0b876ee5dc7290 (patch)
treebfbb77d0b88de0f45c22ce3747d8d214d0f5a0d7 /clang/include/clang-c
parent5613874947462fd4ceb4f66926c879269609463f (diff)
downloadbcm5719-llvm-eee944e7f9e60df44714eb547d0b876ee5dc7290.tar.gz
bcm5719-llvm-eee944e7f9e60df44714eb547d0b876ee5dc7290.zip
[C++2a] Add __builtin_bit_cast, used to implement std::bit_cast
This commit adds a new builtin, __builtin_bit_cast(T, v), which performs a bit_cast from a value v to a type T. This expression can be evaluated at compile time under specific circumstances. The compile time evaluation currently doesn't support bit-fields, but I'm planning on fixing this in a follow up (some of the logic for figuring this out is in CodeGen). I'm also planning follow-ups for supporting some more esoteric types that the constexpr evaluator supports, as well as extending __builtin_memcpy constexpr evaluation to use the same infrastructure. rdar://44987528 Differential revision: https://reviews.llvm.org/D62825 llvm-svn: 364954
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 07e71bd48d0..74badac740b 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -2546,7 +2546,11 @@ enum CXCursorKind {
*/
CXCursor_OMPTargetTeamsDistributeSimdDirective = 279,
- CXCursor_LastStmt = CXCursor_OMPTargetTeamsDistributeSimdDirective,
+ /** C++2a std::bit_cast expression.
+ */
+ CXCursor_BuiltinBitCastExpr = 280,
+
+ CXCursor_LastStmt = CXCursor_BuiltinBitCastExpr,
/**
* Cursor that represents the translation unit itself.
OpenPOWER on IntegriCloud