rename Memo/Count to AnonGlobalIDs/NextAnonGlobalID to be more

descriptive.  Thange them to keep track of the ID of a global that is
assigned, not the first mangled name returned for it.  Without doing this,
we are required to always use the same suffix for a global that gets 
mangled.  This means that we can mangle the same global once with $stub
and another time with $non_lazy_ptr or whatever.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75561 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-07-14 00:01:06 +00:00
parent 385396221b
commit 59ecdfbee3
2 changed files with 23 additions and 24 deletions

View File

@@ -42,13 +42,15 @@ class Mangler {
/// from names with 'asm' specifiers.
bool PreserveAsmNames;
/// Memo - This is used to remember the name that we assign a value.
/// AnonGlobalIDs - We need to give global values the same name every time
/// they are mangled. This keeps track of the number we give to anonymous
/// ones.
///
DenseMap<const Value*, std::string> Memo;
DenseMap<const GlobalValue*, unsigned> AnonGlobalIDs;
/// Count - This simple counter is used to unique value names.
/// NextAnonGlobalID - This simple counter is used to unique value names.
///
unsigned Count;
unsigned NextAnonGlobalID;
/// AcceptableChars - This bitfield contains a one for each character that is
/// allowed to be part of an unmangled name.