From 3d435f7321c3f9241d33a0f7521573f21b548186 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Jan 2018 13:41:09 -0800 Subject: Bug fixes for Slang integration (#356) * fix #353 * move validateEntryPoint to after all entrypoints has been checked * bug fix: DeclRefType::SubstituteImpl should change ioDiff * bug fix: generic resource usage should have count of 1 instead of 0. * update test case --- source/slang/slang.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 0b3e0ceb7..2ebf024e3 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -174,6 +174,8 @@ void CompileRequest::parseTranslationUnit( } } +void validateEntryPoint(EntryPointRequest*); + void CompileRequest::checkAllTranslationUnits() { // Iterate over all translation units and @@ -182,6 +184,24 @@ void CompileRequest::checkAllTranslationUnits() { checkTranslationUnit(translationUnit.Ptr()); } + + for (auto& translationUnit : translationUnits) + { + // Next, do follow-up validation on any entry + // points that the user declared via API or + // command line, to ensure that they meet + // requirements. + // + // Note: We may eventually have syntax to + // identify entry points via a modifier on + // declarations, and in this case they should + // probably get validated as part of orindary + // checking above. + for (auto entryPoint : translationUnit->entryPoints) + { + validateEntryPoint(entryPoint); + } + } } void CompileRequest::generateIR() -- cgit v1.2.3