[clang] bae275f - [TableGen] Avoid repeated map lookups (NFC) (#108675)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 14 07:39:03 PDT 2024


Author: Kazu Hirata
Date: 2024-09-14T07:39:00-07:00
New Revision: bae275f65ecd27a16743f7b4695940dcfa70b218

URL: https://github.com/llvm/llvm-project/commit/bae275f65ecd27a16743f7b4695940dcfa70b218
DIFF: https://github.com/llvm/llvm-project/commit/bae275f65ecd27a16743f7b4695940dcfa70b218.diff

LOG: [TableGen] Avoid repeated map lookups (NFC) (#108675)

Added: 
    

Modified: 
    clang/utils/TableGen/NeonEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp
index 9e5480be20adac..82148f98d04fcc 100644
--- a/clang/utils/TableGen/NeonEmitter.cpp
+++ b/clang/utils/TableGen/NeonEmitter.cpp
@@ -2155,9 +2155,7 @@ void NeonEmitter::genOverloadTypeCheckCode(raw_ostream &OS,
     }
 
     if (Mask) {
-      std::string Name = Def->getMangledName();
-      OverloadMap.insert(std::make_pair(Name, OverloadInfo()));
-      OverloadInfo &OI = OverloadMap[Name];
+      OverloadInfo &OI = OverloadMap[Def->getMangledName()];
       OI.Mask |= Mask;
       OI.PtrArgNum |= PtrArgNum;
       OI.HasConstPtr = HasConstPtr;


        


More information about the cfe-commits mailing list