[llvm] [IR2Vec] Exposing Embedding as an ADT wrapped around std::vector<double> (PR #143197)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 19:05:24 PDT 2025


================
@@ -53,7 +53,24 @@ class raw_ostream;
 enum class IR2VecKind { Symbolic };
 
 namespace ir2vec {
-using Embedding = std::vector<double>;
+/// Embedding is a ADT that wraps std::vector<double>. It provides
+/// additional functionality for arithmetic and comparison operations.
+struct Embedding : public std::vector<double> {
----------------
mtrofin wrote:

I'm not sure inheritance is ideal here. How about containment, and implicit constructor from a std::vector?

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


More information about the llvm-commits mailing list