Skip to content

Commit fbc8aed

Browse files
authored
Fix lib_6_x bug blocking CI (#8252)
#8202 and #8233 collided post merge to reveal a long standing bug with `-lib_6_x` that is currently breaking CI on main. This change fixes that bug by skipping reachable call diagnostics in the case that they are allowed to be transiently invalid. The comment in the PR is a bit more verbose on the details and I'll avoid reposting it here.
1 parent e9be4c4 commit fbc8aed

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tools/clang/lib/Sema/SemaHLSLDiagnoseTU.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,15 @@ void hlsl::DiagnoseTranslationUnit(clang::Sema *self) {
759759
}
760760
}
761761

762+
// lib_6_x is an offline linking target, which allows exported functions to
763+
// perform actions that would otherwise be disallowed, as long as these
764+
// actions are either inlined into entry points where they are allowed, or
765+
// eliminated by the time the final library is linked to a runtime supported
766+
// shader model. Therefore, skip reachable call diagnostics for non-entry
767+
// points.
768+
if (EntrySK == DXIL::ShaderKind::Library && IsTargetProfileLib6x(*self))
769+
continue;
770+
762771
// Visit all visited functions in call graph to collect illegal intrinsic
763772
// calls.
764773
HLSLReachableDiagnoseVisitor Visitor(

0 commit comments

Comments
 (0)