mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-03 08:41:44 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cfc9fcc21b
commit
b660c903c1
@ -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.
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user