Skip to content

Commit cdf5f47

Browse files
authored
[NFC] Fix warning in IR2Vec Embedder creation in printer pass (#155917)
Fixes the warning `default label in switch which covers all enumeration values [-Wcovered-switch-default]`
1 parent 1213d4e commit cdf5f47

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

llvm/lib/Analysis/IR2Vec.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -601,17 +601,7 @@ PreservedAnalyses IR2VecPrinterPass::run(Module &M,
601601
assert(Vocabulary.isValid() && "IR2Vec Vocabulary is invalid");
602602

603603
for (Function &F : M) {
604-
std::unique_ptr<Embedder> Emb;
605-
switch (IR2VecEmbeddingKind) {
606-
case IR2VecKind::Symbolic:
607-
Emb = std::make_unique<SymbolicEmbedder>(F, Vocabulary);
608-
break;
609-
case IR2VecKind::FlowAware:
610-
Emb = std::make_unique<FlowAwareEmbedder>(F, Vocabulary);
611-
break;
612-
default:
613-
llvm_unreachable("Unknown IR2Vec embedding kind");
614-
}
604+
auto Emb = Embedder::create(IR2VecEmbeddingKind, F, Vocabulary);
615605
if (!Emb) {
616606
OS << "Error creating IR2Vec embeddings \n";
617607
continue;

0 commit comments

Comments
 (0)