Skip to content

Commit

Permalink
Remove more guts of TargetMachine::getNameWithPrefix and migrate one …
Browse files Browse the repository at this point in the history
…check to the TLOF mach-o version.

NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281983 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
echristo committed Sep 20, 2016
1 parent 57ab7e9 commit 663e1b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,13 @@ 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 =
Expand Down
9 changes: 1 addition & 8 deletions lib/Target/TargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,7 @@ TargetIRAnalysis TargetMachine::getTargetIRAnalysis() {

void TargetMachine::getNameWithPrefix(SmallVectorImpl<char> &Name,
const GlobalValue *GV, Mangler &Mang) 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.
Mang.getNameWithPrefix(Name, GV, false);
return;
}
const TargetLoweringObjectFile *TLOF = getObjFileLowering();
TLOF->getNameWithPrefix(Name, GV, *this);
getObjFileLowering()->getNameWithPrefix(Name, GV, *this);
}

MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {
Expand Down

0 comments on commit 663e1b0

Please sign in to comment.