aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.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/CompilerInvocation.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/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 32b084d..a51d462 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4202,6 +4202,10 @@ static void GeneratePreprocessorArgs(PreprocessorOptions &Opts,
((LangOpts.DeclareOpenCLBuiltins && I == "opencl-c-base.h") ||
I == "opencl-c.h"))
continue;
+ // Don't generate HLSL includes. They are implied by other flags that are
+ // generated elsewhere.
+ if (LangOpts.HLSL && I == "hlsl.h")
+ continue;
GenerateArg(Args, OPT_include, I, SA);
}