-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fix build failure in DXILResource.h on newer versions of MSVC #139309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-analysis Author: Daniel Paoliello (dpaoliello) ChangesThe change #137258 introduced a build break on newer versions of MSVC:
Fix is to add a Full diff: https://github.com/llvm/llvm-project/pull/139309.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Analysis/DXILResource.h b/llvm/include/llvm/Analysis/DXILResource.h
index cfeed5c4ef76f..090b6e77eac00 100644
--- a/llvm/include/llvm/Analysis/DXILResource.h
+++ b/llvm/include/llvm/Analysis/DXILResource.h
@@ -670,6 +670,8 @@ class DXILResourceBindingInfo {
return CBufferSpaces;
case dxil::ResourceClass::Sampler:
return SamplerSpaces;
+ default:
+ llvm_unreachable("Invalid resource class");
}
}
|
@llvm/pr-subscribers-backend-directx Author: Daniel Paoliello (dpaoliello) ChangesThe change #137258 introduced a build break on newer versions of MSVC:
Fix is to add a Full diff: https://github.com/llvm/llvm-project/pull/139309.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Analysis/DXILResource.h b/llvm/include/llvm/Analysis/DXILResource.h
index cfeed5c4ef76f..090b6e77eac00 100644
--- a/llvm/include/llvm/Analysis/DXILResource.h
+++ b/llvm/include/llvm/Analysis/DXILResource.h
@@ -670,6 +670,8 @@ class DXILResourceBindingInfo {
return CBufferSpaces;
case dxil::ResourceClass::Sampler:
return SamplerSpaces;
+ default:
+ llvm_unreachable("Invalid resource class");
}
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
default: | ||
llvm_unreachable("Invalid resource class"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite right. We should put the llvm_unreachable
outside of the switch so that we can still benefit from clang's -Wcovered-switch
warnings if dxil::ResourceClass
were ever to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
The change #137258 introduced a build break on newer versions of MSVC:
Fix is to add a
default
case that will ICE.