Skip to content

Commit e60ccba

Browse files
committed
[gardening] Call llvm_unreachable after exhaustive switches.
Failing to provokes warnings from MSVC.
1 parent 37d52fb commit e60ccba

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,7 @@ std::pair<llvm::Value *, llvm::Value *> irgen::getAsyncFunctionAndSize(
21172117
return {fn, size};
21182118
}
21192119
}
2120+
llvm_unreachable("unhandled case");
21202121
}
21212122

21222123
static void externalizeArguments(IRGenFunction &IGF, const Callee &callee,
@@ -4688,6 +4689,7 @@ StringRef FunctionPointer::getName(IRGenModule &IGM) const {
46884689
cast<llvm::Constant>(getDirectPointer()->getOperand(0)))
46894690
->getName();
46904691
}
4692+
llvm_unreachable("unhandled case");
46914693
}
46924694

46934695
llvm::Value *FunctionPointer::getPointer(IRGenFunction &IGF) const {
@@ -4716,6 +4718,7 @@ llvm::Value *FunctionPointer::getPointer(IRGenFunction &IGF) const {
47164718
}
47174719
}
47184720
}
4721+
llvm_unreachable("unhandled case");
47194722
}
47204723

47214724
FunctionPointer FunctionPointer::forExplosionValue(IRGenFunction &IGF,

lib/IRGen/NecessaryBindings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class NecessaryBindings {
129129
case Kind::AsyncFunction:
130130
return RequirementsVector;
131131
}
132+
llvm_unreachable("unhandled case");
132133
}
133134

134135
bool forPartialApply() const { return kind == Kind::PartialApply; }

0 commit comments

Comments
 (0)