[llvm] Refactoring llvm-ir2vec.cpp for better separation of concerns in the Tooling classes (PR #170078)

S. VenkataKeerthy via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 05:56:17 PST 2025


================
@@ -182,32 +200,16 @@ class IR2VecTool {
     return Vocab->isValid();
   }
 
-  /// Generate triplets for the module
-  /// Output format: MAX_RELATION=N header followed by relationships
-  void generateTriplets(raw_ostream &OS) const {
-    unsigned MaxRelation = NextRelation; // Track maximum relation ID
-    std::string Relationships;
-    raw_string_ostream RelOS(Relationships);
-
-    for (const Function &F : M) {
-      unsigned FuncMaxRelation = generateTriplets(F, RelOS);
-      MaxRelation = std::max(MaxRelation, FuncMaxRelation);
-    }
-
-    RelOS.flush();
-
-    // Write metadata header followed by relationships
-    OS << "MAX_RELATION=" << MaxRelation << '\n';
-    OS << Relationships;
-  }
-
   /// Generate triplets for a single function
   /// Returns the maximum relation ID used in this function
----------------
svkeerthy wrote:

This is not true anymore?

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


More information about the llvm-commits mailing list