From 0407ebb4f7b6a078b924ba9c5685820e33cebb37 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 20 Jul 2009 19:41:27 +0000 Subject: [PATCH] Rename Mangler linkage enums to something less gross. llvm-svn: 76456 --- include/llvm/Support/Mangler.h | 8 ++++---- lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 12 ++++-------- lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 6 +++--- lib/VMCore/Mangler.cpp | 16 ++++++++-------- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h index 416f382bef4..d9234ac50aa 100644 --- a/include/llvm/Support/Mangler.h +++ b/include/llvm/Support/Mangler.h @@ -27,9 +27,9 @@ class GlobalValue; class Mangler { public: enum ManglerPrefixTy { - DefaultPrefixTy, ///< Emit default string before each symbol. - PrivatePrefixTy, ///< Emit "private" prefix before each symbol. - LinkerPrivatePrefixTy ///< Emit "linker private" prefix before each symbol. + Default, ///< Emit default string before each symbol. + Private, ///< Emit "private" prefix before each symbol. + LinkerPrivate ///< Emit "linker private" prefix before each symbol. }; private: @@ -103,7 +103,7 @@ public: /// from getValueName. /// std::string makeNameProper(const std::string &x, - ManglerPrefixTy PrefixTy = DefaultPrefixTy); + ManglerPrefixTy PrefixTy = Mangler::Default); }; } // End llvm namespace diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 08c664880c2..21a36953a52 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -93,14 +93,10 @@ namespace { void Init(const std::string &GV, Mangler *Mang) { // Already initialized. if (!Stub.empty()) return; - Stub = Mang->makeNameProper(GV + "$stub", - Mangler::PrivatePrefixTy); - LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr", - Mangler::PrivatePrefixTy); - SLP = Mang->makeNameProper(GV + "$slp", - Mangler::PrivatePrefixTy); - SCV = Mang->makeNameProper(GV + "$scv", - Mangler::PrivatePrefixTy); + Stub = Mang->makeNameProper(GV + "$stub", Mangler::Private); + LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr", Mangler::Private); + SLP = Mang->makeNameProper(GV + "$slp", Mangler::Private); + SCV = Mang->makeNameProper(GV + "$scv", Mangler::Private); } }; diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index a4fcdf661b9..cb0a8663078 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -71,11 +71,11 @@ namespace { // Already initialized. if (!Stub.empty()) return; Stub = Mang->makeNameProper(GV + "$stub", - Mangler::PrivatePrefixTy); + Mangler::Private); LazyPtr = Mang->makeNameProper(GV + "$lazy_ptr", - Mangler::PrivatePrefixTy); + Mangler::Private); AnonSymbol = Mang->makeNameProper(GV + "$stub$tmp", - Mangler::PrivatePrefixTy); + Mangler::Private); } }; diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp index c4c2502f0c2..5c4672b7e5a 100644 --- a/lib/VMCore/Mangler.cpp +++ b/lib/VMCore/Mangler.cpp @@ -60,9 +60,9 @@ std::string Mangler::makeNameProper(const std::string &X, if (NeedPrefix) { Result = Prefix + Result; - if (PrefixTy == PrivatePrefixTy) + if (PrefixTy == Mangler::Private) Result = PrivatePrefix + Result; - else if (PrefixTy == LinkerPrivatePrefixTy) + else if (PrefixTy == Mangler::LinkerPrivate) Result = LinkerPrivatePrefix + Result; } @@ -98,9 +98,9 @@ std::string Mangler::makeNameProper(const std::string &X, Result = Prefix + X; - if (PrefixTy == PrivatePrefixTy) + if (PrefixTy == Mangler::Private) Result = PrivatePrefix + Result; - else if (PrefixTy == LinkerPrivatePrefixTy) + else if (PrefixTy == Mangler::LinkerPrivate) Result = LinkerPrivatePrefix + Result; return Result; @@ -121,9 +121,9 @@ std::string Mangler::makeNameProper(const std::string &X, if (NeedPrefix) { Result = Prefix + Result; - if (PrefixTy == PrivatePrefixTy) + if (PrefixTy == Mangler::Private) Result = PrivatePrefix + Result; - else if (PrefixTy == LinkerPrivatePrefixTy) + else if (PrefixTy == Mangler::LinkerPrivate) Result = LinkerPrivatePrefix + Result; } @@ -142,8 +142,8 @@ std::string Mangler::getMangledName(const GlobalValue *GV, const char *Suffix, "Intrinsic functions cannot be mangled by Mangler"); ManglerPrefixTy PrefixTy = - (GV->hasPrivateLinkage() || ForcePrivate) ? PrivatePrefixTy : - GV->hasLinkerPrivateLinkage() ? LinkerPrivatePrefixTy : DefaultPrefixTy; + (GV->hasPrivateLinkage() || ForcePrivate) ? Mangler::Private : + GV->hasLinkerPrivateLinkage() ? Mangler::LinkerPrivate : Mangler::Default; if (GV->hasName()) return makeNameProper(GV->getName() + Suffix, PrefixTy);