[llvm] [llvm-ir2vec] Decoupling Vocab loading from initEmbedding (PR #190507)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 00:10:37 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/tools/llvm-ir2vec/Bindings/PyIR2Vec.cpp llvm/tools/llvm-ir2vec/lib/Utils.cpp llvm/tools/llvm-ir2vec/lib/Utils.h llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/tools/llvm-ir2vec/lib/Utils.cpp b/llvm/tools/llvm-ir2vec/lib/Utils.cpp
index cdf3e0196..d37fd5e24 100644
--- a/llvm/tools/llvm-ir2vec/lib/Utils.cpp
+++ b/llvm/tools/llvm-ir2vec/lib/Utils.cpp
@@ -59,10 +59,12 @@ Expected<std::shared_ptr<Vocabulary>> loadVocabulary(StringRef VocabPath) {
 Error IR2VecTool::setVocabulary(std::shared_ptr<Vocabulary> V) {
   if (!V)
     return createStringError(errc::invalid_argument,
-                             "Null pointer provided for vocabulary. Will not set IR2VecTool vocabulary.");
+                             "Null pointer provided for vocabulary. Will not "
+                             "set IR2VecTool vocabulary.");
   if (!V->isValid())
-    return createStringError(errc::invalid_argument,
-                             "Vocabulary is not valid. Will not set IR2VecTool vocabulary.");
+    return createStringError(
+        errc::invalid_argument,
+        "Vocabulary is not valid. Will not set IR2VecTool vocabulary.");
   Vocab = std::move(V);
   return Error::success();
 }

``````````

</details>


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


More information about the llvm-commits mailing list