1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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
This commit is contained in:
Eric Christopher 2016-09-29 02:03:50 +00:00
parent 1279434d8e
commit 8e278c36c0
2 changed files with 1 additions and 6 deletions

View File

@ -29,12 +29,7 @@ class Mangler {
/// This keeps track of the number we give to anonymous ones.
mutable DenseMap<const GlobalValue*, unsigned> 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.

View File

@ -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);