[llvm] [NFC][IR2Vec][MIR2Vec] llvm-ir2vec refactor - move Tool class implementations into a separate utils file (PR #174133)

Nishant Sachdeva via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 9 07:08:26 PST 2026


================
@@ -152,8 +151,7 @@ void IR2VecTool::writeEntitiesToStream(raw_ostream &OS) {
 void IR2VecTool::writeEmbeddingsToStream(raw_ostream &OS,
                                          EmbeddingLevel Level) const {
   if (!Vocab->isValid()) {
-    WithColor::error(errs(), ToolName)
-        << "Vocabulary is not valid. IR2VecTool not initialized.\n";
+    errs() << "Error: Vocabulary is not valid. IR2VecTool not initialized.\n";
----------------
nishant-sachdeva wrote:

That's an oversight on my part. I've restored this change.

However, in general, in this file, at some places which check the vocabulary validity, errors are printed through the `errs()` method, and in other places, we've used `WithColor` method. We may want to check it would be better to standardize it. 

If indeed we choose to do that, we'll have to revise some of our test case results accordingly.

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


More information about the llvm-commits mailing list