MCSymbol *&Sym = Symbols[NameRef];
if (!Sym)
- Sym = CreateSymbol(NameRef, false);
+ Sym = createSymbol(NameRef, false, false);
return Sym;
}
return new (*this) MCSymbol(false, Name, IsTemporary);
}
-MCSymbol *MCContext::CreateSymbol(StringRef Name, bool AlwaysAddSuffix) {
- // Determine whether this is an assembler temporary or normal label, if used.
- bool IsTemporary = false;
+MCSymbol *MCContext::createSymbol(StringRef Name, bool AlwaysAddSuffix,
+ bool IsTemporary) {
+ if (IsTemporary && !UseNamesOnTempLabels)
+ return createSymbolImpl(nullptr, true);
+
+ // Determine whether this is an user writter assembler temporary or normal
+ // label, if used.
+ IsTemporary = false;
if (AllowTemporaryLabels)
IsTemporary = Name.startswith(MAI->getPrivateGlobalPrefix());
- if (IsTemporary && AlwaysAddSuffix && !UseNamesOnTempLabels)
- return createSymbolImpl(nullptr, true);
-
SmallString<128> NewName = Name;
bool AddSuffix = AlwaysAddSuffix;
unsigned &NextUniqueID = NextID[Name];
MCSymbol *MCContext::createTempSymbol(const Twine &Name, bool AlwaysAddSuffix) {
SmallString<128> NameSV;
raw_svector_ostream(NameSV) << MAI->getPrivateGlobalPrefix() << Name;
- return CreateSymbol(NameSV, AlwaysAddSuffix);
+ return createSymbol(NameSV, AlwaysAddSuffix, true);
}
MCSymbol *MCContext::createLinkerPrivateTempSymbol() {
SmallString<128> NameSV;
raw_svector_ostream(NameSV) << MAI->getLinkerPrivateGlobalPrefix() << "tmp";
- return CreateSymbol(NameSV, true);
+ return createSymbol(NameSV, true, false);
}
MCSymbol *MCContext::createTempSymbol() {