================
@@ -157,6 +157,18 @@ static bool ShouldDiagnoseAvailabilityInContext(
}
}
+ // In HLSL, emit diagnostic during parsing only if the diagnostic
+ // mode is set to strict (-fhlsl-strict-availability), and either the decl
+ // availability is not restricted to a specific environment/shader stage,
+ // or the target stage is known (= it is not shader library).
+ if (S.getLangOpts().HLSL) {
+ if (!S.getLangOpts().HLSLStrictAvailability ||
+ (DeclEnv != nullptr &&
+ S.getASTContext().getTargetInfo().getTriple().getEnvironment() ==
----------------
hekota wrote:
Yes, that is the current assumption everywhere - it is either library or a
shader with a known target stage. Unless you see any potential library-like
target on the horizon I think we can leave it like that.
https://github.com/llvm/llvm-project/pull/93860
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits