Rename Mangler linkage enums to something less gross.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2009-07-20 19:41:27 +00:00
parent 256be96457
commit 5c0ba804c0
4 changed files with 19 additions and 23 deletions

View File

@ -27,9 +27,9 @@ class GlobalValue;
class Mangler { class Mangler {
public: public:
enum ManglerPrefixTy { enum ManglerPrefixTy {
DefaultPrefixTy, ///< Emit default string before each symbol. Default, ///< Emit default string before each symbol.
PrivatePrefixTy, ///< Emit "private" prefix before each symbol. Private, ///< Emit "private" prefix before each symbol.
LinkerPrivatePrefixTy ///< Emit "linker private" prefix before each symbol. LinkerPrivate ///< Emit "linker private" prefix before each symbol.
}; };
private: private:
@ -103,7 +103,7 @@ public:
/// from getValueName. /// from getValueName.
/// ///
std::string makeNameProper(const std::string &x, std::string makeNameProper(const std::string &x,
ManglerPrefixTy PrefixTy = DefaultPrefixTy); ManglerPrefixTy PrefixTy = Mangler::Default);
}; };
} // End llvm namespace } // End llvm namespace

View File

@ -93,14 +93,10 @@ namespace {
void Init(const std::string &GV, Mangler *Mang) { void Init(const std::string &GV, Mangler *Mang) {
// Already initialized. // Already initialized.
if (!Stub.empty()) return; if (!Stub.empty()) return;
Stub = Mang->makeNameProper(GV + "$stub", Stub = Mang->makeNameProper(GV + "$stub", Mangler::Private);
Mangler::PrivatePrefixTy); LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr", Mangler::Private);
LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr", SLP = Mang->makeNameProper(GV + "$slp", Mangler::Private);
Mangler::PrivatePrefixTy); SCV = Mang->makeNameProper(GV + "$scv", Mangler::Private);
SLP = Mang->makeNameProper(GV + "$slp",
Mangler::PrivatePrefixTy);
SCV = Mang->makeNameProper(GV + "$scv",
Mangler::PrivatePrefixTy);
} }
}; };

View File

@ -71,11 +71,11 @@ namespace {
// Already initialized. // Already initialized.
if (!Stub.empty()) return; if (!Stub.empty()) return;
Stub = Mang->makeNameProper(GV + "$stub", Stub = Mang->makeNameProper(GV + "$stub",
Mangler::PrivatePrefixTy); Mangler::Private);
LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr", LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr",
Mangler::PrivatePrefixTy); Mangler::Private);
AnonSymbol = Mang->makeNameProper(GV + "$stub$tmp", AnonSymbol = Mang->makeNameProper(GV + "$stub$tmp",
Mangler::PrivatePrefixTy); Mangler::Private);
} }
}; };

View File

@ -60,9 +60,9 @@ std::string Mangler::makeNameProper(const std::string &X,
if (NeedPrefix) { if (NeedPrefix) {
Result = Prefix + Result; Result = Prefix + Result;
if (PrefixTy == PrivatePrefixTy) if (PrefixTy == Mangler::Private)
Result = PrivatePrefix + Result; Result = PrivatePrefix + Result;
else if (PrefixTy == LinkerPrivatePrefixTy) else if (PrefixTy == Mangler::LinkerPrivate)
Result = LinkerPrivatePrefix + Result; Result = LinkerPrivatePrefix + Result;
} }
@ -98,9 +98,9 @@ std::string Mangler::makeNameProper(const std::string &X,
Result = Prefix + X; Result = Prefix + X;
if (PrefixTy == PrivatePrefixTy) if (PrefixTy == Mangler::Private)
Result = PrivatePrefix + Result; Result = PrivatePrefix + Result;
else if (PrefixTy == LinkerPrivatePrefixTy) else if (PrefixTy == Mangler::LinkerPrivate)
Result = LinkerPrivatePrefix + Result; Result = LinkerPrivatePrefix + Result;
return Result; return Result;
@ -121,9 +121,9 @@ std::string Mangler::makeNameProper(const std::string &X,
if (NeedPrefix) { if (NeedPrefix) {
Result = Prefix + Result; Result = Prefix + Result;
if (PrefixTy == PrivatePrefixTy) if (PrefixTy == Mangler::Private)
Result = PrivatePrefix + Result; Result = PrivatePrefix + Result;
else if (PrefixTy == LinkerPrivatePrefixTy) else if (PrefixTy == Mangler::LinkerPrivate)
Result = LinkerPrivatePrefix + Result; Result = LinkerPrivatePrefix + Result;
} }
@ -142,8 +142,8 @@ std::string Mangler::getMangledName(const GlobalValue *GV, const char *Suffix,
"Intrinsic functions cannot be mangled by Mangler"); "Intrinsic functions cannot be mangled by Mangler");
ManglerPrefixTy PrefixTy = ManglerPrefixTy PrefixTy =
(GV->hasPrivateLinkage() || ForcePrivate) ? PrivatePrefixTy : (GV->hasPrivateLinkage() || ForcePrivate) ? Mangler::Private :
GV->hasLinkerPrivateLinkage() ? LinkerPrivatePrefixTy : DefaultPrefixTy; GV->hasLinkerPrivateLinkage() ? Mangler::LinkerPrivate : Mangler::Default;
if (GV->hasName()) if (GV->hasName())
return makeNameProper(GV->getName() + Suffix, PrefixTy); return makeNameProper(GV->getName() + Suffix, PrefixTy);