aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorXiang Li <python3kgae@outlook.com>2022-10-18 09:22:46 -0700
committerXiang Li <python3kgae@outlook.com>2022-10-20 16:06:25 -0700
commit464926ef4484e4cb2d410fd2e959a296d7b8d58e (patch)
tree5cfec4a1857e2d693c75d9b64bfc90bae48a0fbd /clang/lib/Sema/SemaInit.cpp
parent4309bb28ae77061d528b09dfe1c41335e92bc7a3 (diff)
downloadllvm-464926ef4484e4cb2d410fd2e959a296d7b8d58e.zip
llvm-464926ef4484e4cb2d410fd2e959a296d7b8d58e.tar.gz
llvm-464926ef4484e4cb2d410fd2e959a296d7b8d58e.tar.bz2
[HLSL] Disable integer promotion to avoid int16_t being promoted to int for HLSL.
short will be promoted to int in UsualUnaryConversions. Disable it for HLSL to keep int16_t as 16bit. Reviewed By: aaron.ballman, rjmccall Differential Revision: https://reviews.llvm.org/D133668
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index ee6fee0..db5580c 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -2934,7 +2934,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
// Compute the type of the integer literals.
QualType PromotedCharTy = CharTy;
- if (CharTy->isPromotableIntegerType())
+ if (Context.isPromotableIntegerType(CharTy))
PromotedCharTy = Context.getPromotedIntegerType(CharTy);
unsigned PromotedCharTyWidth = Context.getTypeSize(PromotedCharTy);