[llvm] cdf5f47 - [NFC] Fix warning in IR2Vec Embedder creation in printer pass (#155917)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 28 15:25:21 PDT 2025
Author: S. VenkataKeerthy
Date: 2025-08-28T15:25:17-07:00
New Revision: cdf5f4770b6c9a2ba066fc5eafc70f65b8d8a2bd
URL: https://github.com/llvm/llvm-project/commit/cdf5f4770b6c9a2ba066fc5eafc70f65b8d8a2bd
DIFF: https://github.com/llvm/llvm-project/commit/cdf5f4770b6c9a2ba066fc5eafc70f65b8d8a2bd.diff
LOG: [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]`
Added:
Modified:
llvm/lib/Analysis/IR2Vec.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/IR2Vec.cpp b/llvm/lib/Analysis/IR2Vec.cpp
index 7d0ad6a69a398..af6242d72e1c9 100644
--- a/llvm/lib/Analysis/IR2Vec.cpp
+++ b/llvm/lib/Analysis/IR2Vec.cpp
@@ -601,17 +601,7 @@ PreservedAnalyses IR2VecPrinterPass::run(Module &M,
assert(Vocabulary.isValid() && "IR2Vec Vocabulary is invalid");
for (Function &F : M) {
- std::unique_ptr<Embedder> Emb;
- switch (IR2VecEmbeddingKind) {
- case IR2VecKind::Symbolic:
- Emb = std::make_unique<SymbolicEmbedder>(F, Vocabulary);
- break;
- case IR2VecKind::FlowAware:
- Emb = std::make_unique<FlowAwareEmbedder>(F, Vocabulary);
- break;
- default:
- llvm_unreachable("Unknown IR2Vec embedding kind");
- }
+ auto Emb = Embedder::create(IR2VecEmbeddingKind, F, Vocabulary);
if (!Emb) {
OS << "Error creating IR2Vec embeddings \n";
continue;
More information about the llvm-commits
mailing list