Skip to content

Commit 78cace7

Browse files
committed
try using IDxcCompiler interface in extval path instead
1 parent 39864aa commit 78cace7

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

tools/clang/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ foreach(i RANGE 0 ${loop_end})
196196

197197
# Hook into check-all
198198
if (WIN32 AND TARGET check-all)
199-
add_dependencies(check-all "check-clang-${name}")
199+
add_dependencies(check-all "check-${name}")
200200
endif()
201201
endif()
202202
endforeach()

tools/clang/tools/dxclib/dxc.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -880,17 +880,14 @@ int DxcContext::Compile() {
880880
args.data(), args.size(), m_Opts.Defines.data(),
881881
m_Opts.Defines.size(), pIncludeHandler, &pCompileResult));
882882
} else {
883-
DxcBuffer buf = {};
884-
buf.Ptr = pSource->GetBufferPointer();
885-
buf.Size = pSource->GetBufferSize();
886-
buf.Encoding = CP_UTF8;
887-
888-
CComPtr<IDxcCompiler3> pCompilerv3;
889-
IFT(CreateInstance(CLSID_DxcCompiler, &pCompilerv3));
890-
891-
IFT(pCompilerv3->Compile(&buf, args.data(), args.size(),
892-
pIncludeHandler,
893-
IID_PPV_ARGS(&pCompileResult)));
883+
// This compilation invocation will sub in "-Vd" to disable internal
884+
// validation so that validation is handled directly immediately
885+
// afterwards.
886+
IFT(pCompiler->Compile(
887+
pSource, StringRefWide(m_Opts.InputFile),
888+
StringRefWide(m_Opts.EntryPoint), StringRefWide(TargetProfile),
889+
args.data(), args.size(), m_Opts.Defines.data(),
890+
m_Opts.Defines.size(), pIncludeHandler, &pCompileResult));
894891

895892
// dont validate when validation was disabled, or
896893
// there are compilation errors

0 commit comments

Comments
 (0)