we can just use the size of the DenseMap as a unique counter.
llvm-svn: 282674
/// 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.
// 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);