@@ -155,22 +155,7 @@ class SymbolicEmbedder : public Embedder {
155155
156156} // namespace ir2vec
157157
158- class IR2VecVocabResult ;
159-
160- // / This analysis provides the vocabulary for IR2Vec. The vocabulary provides a
161- // / mapping between an entity of the IR (like opcode, type, argument, etc.) and
162- // / its corresponding embedding.
163- class IR2VecVocabAnalysis : public AnalysisInfoMixin <IR2VecVocabAnalysis> {
164- ir2vec::Vocab Vocabulary;
165- Error readVocabulary ();
166-
167- public:
168- static AnalysisKey Key;
169- IR2VecVocabAnalysis () = default ;
170- using Result = IR2VecVocabResult;
171- Result run (Module &M, ModuleAnalysisManager &MAM);
172- };
173-
158+ // / Class for storing the result of the IR2VecVocabAnalysis.
174159class IR2VecVocabResult {
175160 ir2vec::Vocab Vocabulary;
176161 bool Valid = false ;
@@ -186,6 +171,20 @@ class IR2VecVocabResult {
186171 ModuleAnalysisManager::Invalidator &Inv);
187172};
188173
174+ // / This analysis provides the vocabulary for IR2Vec. The vocabulary provides a
175+ // / mapping between an entity of the IR (like opcode, type, argument, etc.) and
176+ // / its corresponding embedding.
177+ class IR2VecVocabAnalysis : public AnalysisInfoMixin <IR2VecVocabAnalysis> {
178+ ir2vec::Vocab Vocabulary;
179+ Error readVocabulary ();
180+
181+ public:
182+ static AnalysisKey Key;
183+ IR2VecVocabAnalysis () = default ;
184+ using Result = IR2VecVocabResult;
185+ Result run (Module &M, ModuleAnalysisManager &MAM);
186+ };
187+
189188// / This pass prints the IR2Vec embeddings for instructions, basic blocks, and
190189// / functions.
191190class IR2VecPrinterPass : public PassInfoMixin <IR2VecPrinterPass> {
0 commit comments