[llvm-branch-commits] [llvm] [IR2Vec] Minor vocab changes and exposing weights (PR #143200)

Mircea Trofin via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 6 19:21:18 PDT 2025


================
@@ -254,35 +257,57 @@ Error IR2VecVocabAnalysis::readVocabulary() {
     return createStringError(errc::illegal_byte_sequence,
                              "Unable to parse the vocabulary");
   }
-  assert(Vocabulary.size() > 0 && "Vocabulary is empty");
+
+  if (Vocabulary.empty()) {
----------------
mtrofin wrote:

you can avoid `{}` for simple cases like these

https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

https://github.com/llvm/llvm-project/pull/143200


More information about the llvm-branch-commits mailing list