aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorXiang Li <python3kgae@outlook.com>2022-05-05 15:31:22 -0700
committerXiang Li <python3kgae@outlook.com>2022-05-31 13:54:17 -0700
commit13e1a653278ba4a9805f0247c5bc92dad720aab3 (patch)
tree4cfee4192938d701a73b1abe35873bea7c9dfa37 /clang/lib/Frontend/InitPreprocessor.cpp
parent8579db96e8c319acb02064542632f42dd63039ba (diff)
downloadllvm-13e1a653278ba4a9805f0247c5bc92dad720aab3.zip
llvm-13e1a653278ba4a9805f0247c5bc92dad720aab3.tar.gz
llvm-13e1a653278ba4a9805f0247c5bc92dad720aab3.tar.bz2
[HLSL] Enable vector types for hlsl.
Vector types in hlsl is using clang ext_vector_type. Declaration of vector types is in builtin header hlsl.h. hlsl.h will be included by default for hlsl shader. Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D125052
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 3921f79..4c5e732 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -377,6 +377,10 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__HLSL_VERSION",
Twine((unsigned)LangOpts.getHLSLVersion()));
+ if (LangOpts.NativeHalfType)
+ Builder.defineMacro("__HLSL_ENABLE_16_BIT",
+ Twine((unsigned)LangOpts.getHLSLVersion()));
+
// Shader target information
// "enums" for shader stages
Builder.defineMacro("__SHADER_STAGE_VERTEX",