[LSan] Use a typedef for frontier vector

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183973 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/lsan/lsan_common.cc b/lib/lsan/lsan_common.cc
index 84d3152..e11d304 100644
--- a/lib/lsan/lsan_common.cc
+++ b/lib/lsan/lsan_common.cc
@@ -88,7 +88,7 @@
 // (tag = kIndirectlyLeaked). In the second case, there's no flood fill,
 // so frontier = 0.
 void ScanRangeForPointers(uptr begin, uptr end,
-                          InternalMmapVector<uptr> *frontier,
+                          Frontier *frontier,
                           const char *region_type, ChunkTag tag) {
   const uptr alignment = flags()->pointer_alignment();
   if (flags()->log_pointers)
@@ -117,7 +117,7 @@
 
 // Scan thread data (stacks and TLS) for heap pointers.
 static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
-                           InternalMmapVector<uptr> *frontier) {
+                           Frontier *frontier) {
   InternalScopedBuffer<uptr> registers(SuspendedThreadsList::RegisterCount());
   uptr registers_begin = reinterpret_cast<uptr>(registers.data());
   uptr registers_end = registers_begin + registers.size();
@@ -184,7 +184,7 @@
   }
 }
 
-static void FloodFillTag(InternalMmapVector<uptr> *frontier, ChunkTag tag) {
+static void FloodFillTag(Frontier *frontier, ChunkTag tag) {
   while (frontier->size()) {
     uptr next_chunk = frontier->back();
     frontier->pop_back();
@@ -215,7 +215,7 @@
 // Set the appropriate tag on each chunk.
 static void ClassifyAllChunks(SuspendedThreadsList const &suspended_threads) {
   // Holds the flood fill frontier.
-  InternalMmapVector<uptr> frontier(GetPageSizeCached());
+  Frontier frontier(GetPageSizeCached());
 
   if (flags()->use_globals)
     ProcessGlobalRegions(&frontier);
diff --git a/lib/lsan/lsan_common.h b/lib/lsan/lsan_common.h
index 09a72a1..18de272 100644
--- a/lib/lsan/lsan_common.h
+++ b/lib/lsan/lsan_common.h
@@ -100,13 +100,15 @@
   InternalMmapVector<Leak> leaks_;
 };
 
+typedef InternalMmapVector<uptr> Frontier;
+
 // Platform-specific functions.
 void InitializePlatformSpecificModules();
-void ProcessGlobalRegions(InternalMmapVector<uptr> *frontier);
-void ProcessPlatformSpecificAllocations(InternalMmapVector<uptr> *frontier);
+void ProcessGlobalRegions(Frontier *frontier);
+void ProcessPlatformSpecificAllocations(Frontier *frontier);
 
 void ScanRangeForPointers(uptr begin, uptr end,
-                          InternalMmapVector<uptr> *frontier,
+                          Frontier *frontier,
                           const char *region_type, ChunkTag tag);
 
 // Callables for iterating over chunks. Those classes are used as template
@@ -118,11 +120,11 @@
 class ProcessPlatformSpecificAllocationsCb {
  public:
   explicit ProcessPlatformSpecificAllocationsCb(
-      InternalMmapVector<uptr> *frontier)
+      Frontier *frontier)
       : frontier_(frontier) {}
   void operator()(void *p) const;
  private:
-  InternalMmapVector<uptr> *frontier_;
+  Frontier *frontier_;
 };
 
 // Prints addresses of unreachable chunks.
@@ -151,11 +153,11 @@
 // Finds all chunk marked as kIgnored and adds their addresses to frontier.
 class CollectSuppressedCb {
  public:
-  explicit CollectSuppressedCb(InternalMmapVector<uptr> *frontier)
+  explicit CollectSuppressedCb(Frontier *frontier)
       : frontier_(frontier) {}
   void operator()(void *p) const;
  private:
-  InternalMmapVector<uptr> *frontier_;
+  Frontier *frontier_;
 };
 
 enum IgnoreObjectResult {
diff --git a/lib/lsan/lsan_common_linux.cc b/lib/lsan/lsan_common_linux.cc
index 087ea3e..3ce0ea4 100644
--- a/lib/lsan/lsan_common_linux.cc
+++ b/lib/lsan/lsan_common_linux.cc
@@ -53,8 +53,8 @@
 
 static int ProcessGlobalRegionsCallback(struct dl_phdr_info *info, size_t size,
                                         void *data) {
-  InternalMmapVector<uptr> *frontier =
-      reinterpret_cast<InternalMmapVector<uptr> *>(data);
+  Frontier *frontier =
+      reinterpret_cast<Frontier *>(data);
   for (uptr j = 0; j < info->dlpi_phnum; j++) {
     const ElfW(Phdr) *phdr = &(info->dlpi_phdr[j]);
     // We're looking for .data and .bss sections, which reside in writeable,
@@ -83,7 +83,7 @@
 }
 
 // Scan global variables for heap pointers.
-void ProcessGlobalRegions(InternalMmapVector<uptr> *frontier) {
+void ProcessGlobalRegions(Frontier *frontier) {
   // FIXME: dl_iterate_phdr acquires a linker lock, so we run a risk of
   // deadlocking by running this under StopTheWorld. However, the lock is
   // reentrant, so we should be able to fix this by acquiring the lock before
@@ -114,7 +114,7 @@
 
 // Handle dynamically allocated TLS blocks by treating all chunks allocated from
 // ld-linux.so as reachable.
-void ProcessPlatformSpecificAllocations(InternalMmapVector<uptr> *frontier) {
+void ProcessPlatformSpecificAllocations(Frontier *frontier) {
   if (!flags()->use_tls) return;
   if (!linker) return;
   ForEachChunk(ProcessPlatformSpecificAllocationsCb(frontier));