Skip to content

Commit ac0e99e

Browse files
[Analysis] Fix a warning
This patch fixes: llvm/lib/Analysis/IR2Vec.cpp:289:14: error: unused variable 'allSameDim' [-Werror,-Wunused-variable]
1 parent 129d5ce commit ac0e99e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/Analysis/IR2Vec.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,13 @@ VocabStorage::VocabStorage(std::vector<std::vector<Embedding>> &&SectionData)
286286

287287
// Verify that all embeddings across all sections have the same
288288
// dimension
289-
auto allSameDim = [ExpectedDim](const std::vector<Embedding> &Section) {
290-
return std::all_of(Section.begin(), Section.end(),
291-
[ExpectedDim](const Embedding &Emb) {
292-
return Emb.size() == ExpectedDim;
293-
});
294-
};
289+
[[maybe_unused]] auto allSameDim =
290+
[ExpectedDim](const std::vector<Embedding> &Section) {
291+
return std::all_of(Section.begin(), Section.end(),
292+
[ExpectedDim](const Embedding &Emb) {
293+
return Emb.size() == ExpectedDim;
294+
});
295+
};
295296
assert(std::all_of(Sections.begin(), Sections.end(), allSameDim) &&
296297
"All embeddings must have the same dimension");
297298

0 commit comments

Comments
 (0)