From ae09e77fa2704e4c0798f3216eacc43a7e9b3ce6 Mon Sep 17 00:00:00 2001 From: Ruowen Qin Date: Tue, 25 Jun 2024 09:45:38 +0800 Subject: [PATCH] Remove redundancy cast and header Signed-off-by: Ruowen Qin --- llvm/lib/Transforms/InnerUnikernels/IUInsertEntry.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Transforms/InnerUnikernels/IUInsertEntry.cpp b/llvm/lib/Transforms/InnerUnikernels/IUInsertEntry.cpp index 6df790ce1ce292..0fe2a9bd5bc25c 100644 --- a/llvm/lib/Transforms/InnerUnikernels/IUInsertEntry.cpp +++ b/llvm/lib/Transforms/InnerUnikernels/IUInsertEntry.cpp @@ -41,7 +41,6 @@ #include "llvm/IRReader/IRReader.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/ErrorOr.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Utils/ModuleUtils.h" @@ -224,12 +223,10 @@ bool IUEntryInsertion::runOnModule(Module &M) const { ProgNameCda->getType()->getNumElements()); // Add inserted program name metadata to backend pass - if (auto *FunOP1 = dyn_cast(Func)) { - StringRef UserProg = FunOP1->getName(); - Metadata *Str = MDString::get(Context, UserProg); - MDNode *Node = MDNode::get(Context, Str); - NamedMD->addOperand(Node); - } + StringRef UserProg = Func->getName(); + Metadata *Str = MDString::get(Context, UserProg); + MDNode *Node = MDNode::get(Context, Str); + NamedMD->addOperand(Node); // Add the function using the extracted information above Function *EntryFunc = insertEntry(M, ProgRun, &G, CtxPT, ProgName, RTTI);