diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCMCInstLower.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp index 1fcff52f1c9..18377a44a7f 100644 --- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp +++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp @@ -40,21 +40,15 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){ Mangler *Mang = AP.Mang; const DataLayout &DL = AP.getDataLayout(); MCContext &Ctx = AP.OutContext; - bool isDarwin = TM.getTargetTriple().isOSDarwin(); SmallString<128> Name; StringRef Suffix; - if (MO.getTargetFlags() == PPCII::MO_PLT_OR_STUB) { - if (isDarwin) - Suffix = "$stub"; - } else if (MO.getTargetFlags() & PPCII::MO_NLP_FLAG) + if (MO.getTargetFlags() & PPCII::MO_NLP_FLAG) Suffix = "$non_lazy_ptr"; if (!Suffix.empty()) Name += DL.getPrivateGlobalPrefix(); - unsigned PrefixLen = Name.size(); - if (!MO.isGlobal()) { assert(MO.isSymbol() && "Isn't a symbol reference"); Mangler::getNameWithPrefix(Name, MO.getSymbolName(), DL); @@ -63,32 +57,8 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){ TM.getNameWithPrefix(Name, GV, *Mang); } - unsigned OrigLen = Name.size() - PrefixLen; - Name += Suffix; MCSymbol *Sym = Ctx.getOrCreateSymbol(Name); - StringRef OrigName = StringRef(Name).substr(PrefixLen, OrigLen); - - // If the target flags on the operand changes the name of the symbol, do that - // before we return the symbol. - if (MO.getTargetFlags() == PPCII::MO_PLT_OR_STUB && isDarwin) { - MachineModuleInfoImpl::StubValueTy &StubSym = - getMachOMMI(AP).getFnStubEntry(Sym); - if (StubSym.getPointer()) - return Sym; - - if (MO.isGlobal()) { - StubSym = - MachineModuleInfoImpl:: - StubValueTy(AP.getSymbol(MO.getGlobal()), - !MO.getGlobal()->hasInternalLinkage()); - } else { - StubSym = - MachineModuleInfoImpl:: - StubValueTy(Ctx.getOrCreateSymbol(OrigName), false); - } - return Sym; - } // If the symbol reference is actually to a non_lazy_ptr, not to the symbol, // then add the suffix. @@ -137,7 +107,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol, break; } - if (MO.getTargetFlags() == PPCII::MO_PLT_OR_STUB && !isDarwin) + if (MO.getTargetFlags() == PPCII::MO_PLT) RefKind = MCSymbolRefExpr::VK_PLT; const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx); |