[llvm] [NFC][DominanceFrontier] Replace std::map with DenseMap for DomSetMapType (PR #70403)

Wenju He via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 19:27:03 PDT 2023


https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/70403

DenseMap is preferred according to llvm CodingStandards.

>From e5b2d1edc1c8912b2ad046f99649a35131943fdb Mon Sep 17 00:00:00 2001
From: Wenju He <wenju.he at intel.com>
Date: Fri, 27 Oct 2023 09:57:33 +0800
Subject: [PATCH] [NFC][DominanceFrontier] Replace std::map with DenseMap for
 DomSetMapType

DenseMap is preferred according to llvm CodingStandards.
---
 llvm/include/llvm/Analysis/DominanceFrontier.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index 42ede2ac5ece38d..db0130e4804b801 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_ANALYSIS_DOMINANCEFRONTIER_H
 #define LLVM_ANALYSIS_DOMINANCEFRONTIER_H
 
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/Config/llvm-config.h"
@@ -24,7 +25,6 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/GenericDomTree.h"
 #include <cassert>
-#include <map>
 #include <utility>
 
 namespace llvm {
@@ -42,7 +42,7 @@ class DominanceFrontierBase {
   // Dom set for a bb. Use SetVector to make iterating dom frontiers of a bb
   // deterministic.
   using DomSetType = SetVector<BlockT *>;
-  using DomSetMapType = std::map<BlockT *, DomSetType>; // Dom set map
+  using DomSetMapType = DenseMap<BlockT *, DomSetType>; // Dom set map
 
 protected:
   using BlockTraits = GraphTraits<BlockT *>;



More information about the llvm-commits mailing list