static void getNameWithPrefixx(raw_ostream &OS, const Twine &GVName, Mangler::ManglerPrefixTy PrefixTy, const DataLayout &DL, bool UseAt) { SmallString<256> TmpData; StringRef Name = GVName.toStringRef(TmpData); assert(!Name.empty() && "getNameWithPrefix requires non-empty name"); if (PrefixTy == Mangler::Private) OS << DL.getPrivateGlobalPrefix(); else if (PrefixTy == Mangler::LinkerPrivate) OS << DL.getLinkerPrivateGlobalPrefix(); if (UseAt) { OS << '@'; } else { char Prefix = DL.getGlobalPrefix(); if (Prefix != '\0') OS << Prefix; } // If this is a simple string that doesn't need escaping, just append it. OS << Name; }
DynamicLibrarySearchGenerator::DynamicLibrarySearchGenerator( sys::DynamicLibrary Dylib, const DataLayout &DL, SymbolPredicate Allow) : Dylib(std::move(Dylib)), Allow(std::move(Allow)), GlobalPrefix(DL.getGlobalPrefix()) {}
void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName, const Twine &GVName, const DataLayout &DL) { raw_svector_ostream OS(OutName); char Prefix = DL.getGlobalPrefix(); return getNameWithPrefixImpl(OS, GVName, Default, DL, Prefix); }
static void getNameWithPrefixImpl(raw_ostream &OS, const Twine &GVName, const DataLayout &DL, ManglerPrefixTy PrefixTy) { char Prefix = DL.getGlobalPrefix(); return getNameWithPrefixImpl(OS, GVName, PrefixTy, DL, Prefix); }