[HLSL] Support PCH for cc1 mode
authorXiang Li <python3kgae@outlook.com>
Mon, 22 Aug 2022 23:57:48 +0000 (16:57 -0700)
committerXiang Li <python3kgae@outlook.com>
Tue, 20 Sep 2022 22:13:43 +0000 (15:13 -0700)
commit079a5ffb0a3f862bee3076f785d5c71c03e14f00
tree794a1206a6b9ac371bad950faa78a6b688da85de
parent7f19e59a6e4c9323507aadc13ff9e4208779dfe2
[HLSL] Support PCH for cc1 mode

Add HLSLExternalSemaSource as ExternalSemaSource instead of ASTContext::ExternalSource when PCH is included.

This allows a different external source to be set for the AST context.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D132421
clang/include/clang/Sema/HLSLExternalSemaSource.h
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Sema/HLSLExternalSemaSource.cpp
clang/test/AST/HLSL/Inputs/pch.hlsl [new file with mode: 0644]
clang/test/AST/HLSL/Inputs/pch_with_buf.hlsl [new file with mode: 0644]
clang/test/AST/HLSL/pch.hlsl [new file with mode: 0644]
clang/test/AST/HLSL/pch_with_buf.hlsl [new file with mode: 0644]