Add llvm_unreachable to unreachable code.

The original code was an infinite recursion when the control reaches there.

llvm-svn: 256981
This commit is contained in:
Rui Ueyama 2016-01-06 22:01:25 +00:00
parent a61e5a8d4e
commit 58a636ac06
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ InputSectionBase<ELFT>::getOffset(uintX_t Offset) {
case Merge:
return cast<MergeInputSection<ELFT>>(this)->getOffset(Offset);
case MipsReginfo:
return cast<MipsReginfoInputSection<ELFT>>(this)->getOffset(Offset);
// MIPS .reginfo sections are consumed by the linker,
// so it should never be copied to output.
llvm_unreachable("MIPS .reginfo reached writeTo().");
}
llvm_unreachable("Invalid section kind");
}