Skip to content

Commit 7f9ba19

Browse files
committed
[DirectX] Fix two "not all control paths return a value" warnings
These switch statements are fully covered. Add an llvm_unreachable so that compilers that don't recognize that don't warn. Differential Revision: https://reviews.llvm.org/D154882
1 parent cf410b1 commit 7f9ba19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/DirectX/DXILResource.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ StringRef ResourceBase::getComponentTypeName(ComponentType CompType) {
105105
case ComponentType::PackedU8x32:
106106
return "p32u8";
107107
}
108+
llvm_unreachable("All ComponentType enums are handled in switch");
108109
}
109110

110111
void ResourceBase::printComponentType(Kinds Kind, ComponentType CompType,
@@ -172,6 +173,7 @@ StringRef ResourceBase::getKindName(Kinds Kind) {
172173
case Kinds::FeedbackTexture2DArray:
173174
return "fbtex2darray";
174175
}
176+
llvm_unreachable("All Kinds enums are handled in switch");
175177
}
176178

177179
void ResourceBase::printKind(Kinds Kind, unsigned Alignment, raw_ostream &OS,

0 commit comments

Comments
 (0)