diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-03-10 22:34:10 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-03-10 22:34:10 +0000 |
commit | a810bdfccae99fd62f2610d3cee9c36870a880da (patch) | |
tree | 27515bcd71779515dc477c39dd762f3a3145e680 /llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | |
parent | 0d0b588fb2551cdb8d5e9350063a25eb63dbd41b (diff) | |
download | bcm5719-llvm-a810bdfccae99fd62f2610d3cee9c36870a880da.tar.gz bcm5719-llvm-a810bdfccae99fd62f2610d3cee9c36870a880da.zip |
Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that
indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.
llvm-svn: 98199
Diffstat (limited to 'llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 716f4fb0e30..c1490cbff1c 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -205,11 +205,12 @@ namespace { MachineModuleInfoMachO &MMIMachO = MMI->getObjFileInfo<MachineModuleInfoMachO>(); - MCSymbol *&StubSym = + MachineModuleInfoImpl::StubValueTy &StubSym = GV->hasHiddenVisibility() ? MMIMachO.getHiddenGVStubEntry(Sym) : MMIMachO.getGVStubEntry(Sym); - if (StubSym == 0) - StubSym = GetGlobalValueSymbol(GV); + if (StubSym.getPointer() == 0) + StubSym = MachineModuleInfoImpl:: + StubValueTy(GetGlobalValueSymbol(GV), !GV->hasInternalLinkage()); } } else { assert(ACPV->isExtSymbol() && "unrecognized constant pool value"); @@ -1126,7 +1127,7 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { // Output non-lazy-pointers for external and common global variables. MachineModuleInfoMachO::SymbolListTy Stubs = MMIMacho.GetGVStubList(); - + if (!Stubs.empty()) { // Switch with ".non_lazy_symbol_pointer" directive. OutStreamer.SwitchSection(TLOFMacho.getNonLazySymbolPointerSection()); @@ -1135,7 +1136,7 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { // L_foo$stub: OutStreamer.EmitLabel(Stubs[i].first); // .indirect_symbol _foo - MCSymbol *MCSym = Stubs[i].second; + MCSymbol *MCSym = Stubs[i].second.getPointer(); OutStreamer.EmitSymbolAttribute(MCSym, MCSA_IndirectSymbol); if (MCSym->isUndefined()) @@ -1159,8 +1160,9 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { // L_foo$stub: OutStreamer.EmitLabel(Stubs[i].first); // .long _foo - OutStreamer.EmitValue(MCSymbolRefExpr::Create(Stubs[i].second, - OutContext), + OutStreamer.EmitValue(MCSymbolRefExpr:: + Create(Stubs[i].second.getPointer(), + OutContext), 4/*size*/, 0/*addrspace*/); } |