Skip to content

Commit 30a9d9d

Browse files
[Analysis] Fix warnings
This patch fixes: llvm/lib/Analysis/IR2Vec.cpp:76:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default] llvm/lib/Analysis/IR2Vec.cpp:218:12: error: unused variable 'Dim' [-Werror,-Wunused-variable]
1 parent 6fd3c20 commit 30a9d9d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Analysis/IR2Vec.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ Expected<std::unique_ptr<Embedder>> Embedder::create(IR2VecKind Mode,
7373
switch (Mode) {
7474
case IR2VecKind::Symbolic:
7575
return std::make_unique<SymbolicEmbedder>(F, Vocabulary, Dimension);
76-
default:
77-
return make_error<StringError>("Unknown IR2VecKind",
78-
errc::invalid_argument);
7976
}
77+
return make_error<StringError>("Unknown IR2VecKind", errc::invalid_argument);
8078
}
8179

8280
void Embedder::addVectors(Embedding &Dst, const Embedding &Src) {
@@ -217,6 +215,7 @@ Error IR2VecVocabAnalysis::readVocabulary() {
217215

218216
unsigned Dim = Vocabulary.begin()->second.size();
219217
assert(Dim > 0 && "Dimension of vocabulary is zero");
218+
(void)Dim;
220219
assert(std::all_of(Vocabulary.begin(), Vocabulary.end(),
221220
[Dim](const std::pair<StringRef, Embedding> &Entry) {
222221
return Entry.second.size() == Dim;

0 commit comments

Comments
 (0)