Skip to content

Commit 4f92e08

Browse files
committed
fix isValid()
1 parent 1224c14 commit 4f92e08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/Analysis/IR2Vec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class Vocabulary {
211211
Vocabulary() = default;
212212
LLVM_ABI Vocabulary(VocabVector &&Vocab) : Vocab(std::move(Vocab)) {}
213213

214-
LLVM_ABI bool isValid() const { return !Vocab.empty(); };
214+
LLVM_ABI bool isValid() const { return Vocab.size() == NumCanonicalEntries; };
215215
LLVM_ABI unsigned getDimension() const;
216216
/// Total number of entries (opcodes + canonicalized types + operand kinds)
217217
static constexpr size_t getCanonicalSize() { return NumCanonicalEntries; }

0 commit comments

Comments
 (0)