Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions clang-tools-extra/clang-doc/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ static llvm::Error decodeRecord(const Record &R, AccessSpecifier &Field,
case AS_none:
Field = (AccessSpecifier)R[0];
return llvm::Error::success();
default:
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"invalid value for AccessSpecifier");
}
llvm_unreachable("invalid value for AccessSpecifier");
}

static llvm::Error decodeRecord(const Record &R, TagTypeKind &Field,
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-doc/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ bool ClangDocBitcodeWriter::dispatchInfoForWrite(Info *I) {
case InfoType::IT_typedef:
emitBlock(*static_cast<clang::doc::TypedefInfo *>(I));
break;
default:
case InfoType::IT_default:
llvm::errs() << "Unexpected info, unable to write.\n";
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-doc/Representation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ mergeInfos(std::vector<std::unique_ptr<Info>> &Values) {
return reduce<FunctionInfo>(Values);
case InfoType::IT_typedef:
return reduce<TypedefInfo>(Values);
default:
case InfoType::IT_default:
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"unexpected info type");
}
Expand Down
11 changes: 8 additions & 3 deletions clang-tools-extra/clang-doc/Serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ std::string serialize(std::unique_ptr<Info> &I) {
return serialize(*static_cast<EnumInfo *>(I.get()));
case InfoType::IT_function:
return serialize(*static_cast<FunctionInfo *>(I.get()));
default:
case InfoType::IT_typedef:
case InfoType::IT_default:
return "";
}
}
Expand Down Expand Up @@ -525,9 +526,13 @@ static std::unique_ptr<Info> makeAndInsertIntoParent(ChildType Child) {
InsertChild(ParentRec->Children, std::forward<ChildType>(Child));
return ParentRec;
}
default:
llvm_unreachable("Invalid reference type for parent namespace");
case InfoType::IT_default:
case InfoType::IT_enum:
case InfoType::IT_function:
case InfoType::IT_typedef:
break;
}
llvm_unreachable("Invalid reference type for parent namespace");
}

// There are two uses for this function.
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/unittests/clang-doc/BitcodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static std::string writeInfo(Info *I) {
return writeInfo(*static_cast<FunctionInfo *>(I));
case InfoType::IT_typedef:
return writeInfo(*static_cast<TypedefInfo *>(I));
default:
case InfoType::IT_default:
return "";
}
}
Expand Down
Loading