Fix covered-switch-default warnings in RustWrapper
These switch statements cover all possible values, so the default case is dead code (it contains an llvm_unreachable anyway), triggering a -Wcovered-switch-default warning. Moving the unreachable after the switch resolves these warnings. This keeps the build output clean.
This commit is contained in:
parent
7d82d95af9
commit
004f18d9fb
@ -148,9 +148,8 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
||||
return Attribute::ZExt;
|
||||
case InReg:
|
||||
return Attribute::InReg;
|
||||
default:
|
||||
llvm_unreachable("bad AttributeKind");
|
||||
}
|
||||
llvm_unreachable("bad AttributeKind");
|
||||
}
|
||||
|
||||
extern "C" void LLVMRustAddCallSiteAttribute(LLVMValueRef Instr, unsigned Index,
|
||||
@ -1233,9 +1232,8 @@ static LLVMLinkage fromRust(LLVMRustLinkage Linkage) {
|
||||
return LLVMExternalWeakLinkage;
|
||||
case LLVMRustLinkage::CommonLinkage:
|
||||
return LLVMCommonLinkage;
|
||||
default:
|
||||
llvm_unreachable("Invalid LLVMRustLinkage value!");
|
||||
}
|
||||
llvm_unreachable("Invalid LLVMRustLinkage value!");
|
||||
}
|
||||
|
||||
extern "C" LLVMRustLinkage LLVMRustGetLinkage(LLVMValueRef V) {
|
||||
@ -1282,10 +1280,8 @@ static LLVMRustVisibility toRust(LLVMVisibility Vis) {
|
||||
return LLVMRustVisibility::Hidden;
|
||||
case LLVMProtectedVisibility:
|
||||
return LLVMRustVisibility::Protected;
|
||||
|
||||
default:
|
||||
llvm_unreachable("Invalid LLVMRustVisibility value!");
|
||||
}
|
||||
llvm_unreachable("Invalid LLVMRustVisibility value!");
|
||||
}
|
||||
|
||||
static LLVMVisibility fromRust(LLVMRustVisibility Vis) {
|
||||
@ -1296,10 +1292,8 @@ static LLVMVisibility fromRust(LLVMRustVisibility Vis) {
|
||||
return LLVMHiddenVisibility;
|
||||
case LLVMRustVisibility::Protected:
|
||||
return LLVMProtectedVisibility;
|
||||
|
||||
default:
|
||||
llvm_unreachable("Invalid LLVMRustVisibility value!");
|
||||
}
|
||||
llvm_unreachable("Invalid LLVMRustVisibility value!");
|
||||
}
|
||||
|
||||
extern "C" LLVMRustVisibility LLVMRustGetVisibility(LLVMValueRef V) {
|
||||
|
Loading…
Reference in New Issue
Block a user