[Docs] [HLSL] Add note about PCH support
authorXiang Li <python3kgae@outlook.com>
Wed, 5 Oct 2022 16:26:25 +0000 (09:26 -0700)
committerXiang Li <python3kgae@outlook.com>
Fri, 7 Oct 2022 17:49:21 +0000 (10:49 -0700)
PCH supported for HLSL is added when compile in -cc1 mode using -include-pch for test AST.
This change add some notes about the support of PCH for HLSL.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D134330

clang/docs/HLSL/HLSLSupport.rst

index a8c9c09..b091c17 100644 (file)
@@ -89,6 +89,15 @@ types and built-in templates. Clang is already designed to allow an attached
 ``ExternalSemaSource`` to lazily complete data types, which is a **huge**
 performance win for HLSL.
 
+If precompiled headers are used when compiling HLSL, the ``ExternalSemaSource``
+will be a ``MultiplexExternalSemaSource`` which includes both the ``ASTReader``
+and ``HLSLExternalSemaSource``. For Built-in declarations that are already
+completed in the serialized AST, the ``HLSLExternalSemaSource`` will reuse the
+existing declarations and not introduce new declarations. If the built-in types
+are not completed in the serialized AST, the ``HLSLExternalSemaSource`` will
+create new declarations and connect the de-serialized decls as the previous
+declaration.
+
 CodeGen
 -------