From: Eric Christopher Date: Thu, 29 Sep 2016 02:03:50 +0000 (+0000) Subject: Remove the default constructor and count variable from the Mangler since X-Git-Tag: llvmorg-4.0.0-rc1~8661 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c3bb79864f45bd3c6dfc1563d72a2eb89f03a3a;p=platform%2Fupstream%2Fllvm.git Remove the default constructor and count variable from the Mangler since we can just use the size of the DenseMap as a unique counter. llvm-svn: 282674 --- diff --git a/llvm/include/llvm/IR/Mangler.h b/llvm/include/llvm/IR/Mangler.h index 349218e..0eb91a3 100644 --- a/llvm/include/llvm/IR/Mangler.h +++ b/llvm/include/llvm/IR/Mangler.h @@ -29,12 +29,7 @@ class Mangler { /// This keeps track of the number we give to anonymous ones. mutable DenseMap AnonGlobalIDs; - /// This simple counter is used to unique value names. - mutable unsigned NextAnonGlobalID; - public: - Mangler() : NextAnonGlobalID(1) {} - /// Print the appropriate prefix and the specified global variable's name. /// If the global variable doesn't have a name, this fills in a unique name /// for the global. diff --git a/llvm/lib/IR/Mangler.cpp b/llvm/lib/IR/Mangler.cpp index ddf024d..41e11b3 100644 --- a/llvm/lib/IR/Mangler.cpp +++ b/llvm/lib/IR/Mangler.cpp @@ -121,7 +121,7 @@ void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, // already. unsigned &ID = AnonGlobalIDs[GV]; if (ID == 0) - ID = NextAnonGlobalID++; + ID = AnonGlobalIDs.size(); // Must mangle the global into a unique ID. getNameWithPrefixImpl(OS, "__unnamed_" + Twine(ID), DL, PrefixTy);