mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 11:51:13 +00:00
Revert "In preparation for removing getNameWithPrefix off of
TargetMachine," as it's causing sanitizer/memory issues until I can track down this set. This reverts commit r284203 llvm-svn: 284252
This commit is contained in:
parent
163ed3d9fd
commit
259a7b3aba
@ -301,7 +301,7 @@ selectELFSectionForGlobal(MCContext &Ctx, const GlobalValue *GV,
|
||||
|
||||
if (EmitUniqueSection && UniqueSectionNames) {
|
||||
Name.push_back('.');
|
||||
Mang.getNameWithPrefix(Name, GV, false);
|
||||
TM.getNameWithPrefix(Name, GV, Mang, true);
|
||||
}
|
||||
unsigned UniqueID = MCContext::GenericSectionID;
|
||||
if (EmitUniqueSection && !UniqueSectionNames) {
|
||||
@ -817,13 +817,6 @@ static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo,
|
||||
void TargetLoweringObjectFileMachO::getNameWithPrefix(
|
||||
SmallVectorImpl<char> &OutName, const GlobalValue *GV,
|
||||
const TargetMachine &TM) const {
|
||||
if (!GV->hasPrivateLinkage()) {
|
||||
// Simple case: If GV is not private, it is not important to find out if
|
||||
// private labels are legal in this case or not.
|
||||
getMangler().getNameWithPrefix(OutName, GV, false);
|
||||
return;
|
||||
}
|
||||
|
||||
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
|
||||
const MCSection *TheSection = SectionForGlobal(GV, GVKind, TM);
|
||||
bool CannotUsePrivateLabel =
|
||||
|
@ -203,13 +203,19 @@ TargetIRAnalysis TargetMachine::getTargetIRAnalysis() {
|
||||
void TargetMachine::getNameWithPrefix(SmallVectorImpl<char> &Name,
|
||||
const GlobalValue *GV, Mangler &Mang,
|
||||
bool MayAlwaysUsePrivate) const {
|
||||
if (MayAlwaysUsePrivate || !GV->hasPrivateLinkage()) {
|
||||
// Simple case: If GV is not private, it is not important to find out if
|
||||
// private labels are legal in this case or not.
|
||||
Mang.getNameWithPrefix(Name, GV, false);
|
||||
return;
|
||||
}
|
||||
const TargetLoweringObjectFile *TLOF = getObjFileLowering();
|
||||
TLOF->getNameWithPrefix(Name, GV, *this);
|
||||
}
|
||||
|
||||
MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {
|
||||
SmallString<128> NameStr;
|
||||
getNameWithPrefix(NameStr, GV, Mang);
|
||||
const TargetLoweringObjectFile *TLOF = getObjFileLowering();
|
||||
TLOF->getNameWithPrefix(NameStr, GV, *this);
|
||||
return TLOF->getContext().getOrCreateSymbol(NameStr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user