Flow cancellation token to GetTypeInfo calls
このコミットが含まれているのは:
1 親
bf11fc7620
コミット
031f2f7948
3ファイル変更
+8
-8
検索条件に一致するファイルはありません
@@ -17,7 +17,7 @@ partial class HlslSourceRewriter
|
||||
/// <returns>A <see cref="SyntaxNode"/> instance that represents a type compatible with HLSL.</returns>
|
||||
protected TypeSyntax TrackType(SyntaxNode node, SemanticModel semanticModel)
|
||||
{
|
||||
ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(node).Type!;
|
||||
ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(node, CancellationToken).Type!;
|
||||
string typeName = typeSymbol.GetFullyQualifiedName();
|
||||
|
||||
DiscoveredTypes.Add((INamedTypeSymbol)typeSymbol);
|
||||
@@ -65,10 +65,10 @@ partial class HlslSourceRewriter
|
||||
// Handle the various possible type kinds
|
||||
ITypeSymbol typeSymbol = sourceType switch
|
||||
{
|
||||
RefTypeSyntax refType => semanticModel.GetTypeInfo(refType.Type).Type!,
|
||||
PointerTypeSyntax pointerType => semanticModel.GetTypeInfo(pointerType.ElementType).Type!,
|
||||
ArrayTypeSyntax arrayType => semanticModel.GetTypeInfo(arrayType.ElementType).Type!,
|
||||
_ => semanticModel.GetTypeInfo(sourceType).Type!
|
||||
RefTypeSyntax refType => semanticModel.GetTypeInfo(refType.Type, CancellationToken).Type!,
|
||||
PointerTypeSyntax pointerType => semanticModel.GetTypeInfo(pointerType.ElementType, CancellationToken).Type!,
|
||||
ArrayTypeSyntax arrayType => semanticModel.GetTypeInfo(arrayType.ElementType, CancellationToken).Type!,
|
||||
_ => semanticModel.GetTypeInfo(sourceType, CancellationToken).Type!
|
||||
};
|
||||
|
||||
// Do nothing if the type is just void
|
||||
|
||||
@@ -95,7 +95,7 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
|
||||
{
|
||||
VariableDeclarationSyntax updatedNode = (VariableDeclarationSyntax)base.VisitVariableDeclaration(node)!;
|
||||
|
||||
if (SemanticModel.For(node).GetTypeInfo(node.Type).Type is ITypeSymbol { IsUnmanagedType: false } type)
|
||||
if (SemanticModel.For(node).GetTypeInfo(node.Type, CancellationToken).Type is ITypeSymbol { IsUnmanagedType: false } type)
|
||||
{
|
||||
Diagnostics.Add(InvalidObjectDeclaration, node, type);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
|
||||
{
|
||||
CancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
ITypeSymbol? typeSymbol = SemanticModel.For(node).GetTypeInfo(node).Type;
|
||||
ITypeSymbol? typeSymbol = SemanticModel.For(node).GetTypeInfo(node, CancellationToken).Type;
|
||||
|
||||
// Handle the edge case of the type being null (shouldn't really happen)
|
||||
if (typeSymbol is null)
|
||||
|
||||
@@ -438,7 +438,7 @@ internal sealed partial class ShaderSourceRewriter(
|
||||
|
||||
if (!this.staticMethods.TryGetValue(key, out MethodDeclarationSyntax? methodSyntax))
|
||||
{
|
||||
INamedTypeSymbol resourceType = (INamedTypeSymbol)SemanticModel.For(node).GetTypeInfo(node.Expression).Type!;
|
||||
INamedTypeSymbol resourceType = (INamedTypeSymbol)SemanticModel.For(node).GetTypeInfo(node.Expression, CancellationToken).Type!;
|
||||
string resourceName = HlslKnownTypes.GetMappedName(resourceType);
|
||||
|
||||
// Create a static method to get a specified dimension for a target resource type.
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする