X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FARM%2FARMTargetObjectFile.cpp;h=eaed5cc6875058e80da9a21a4e84b0748175b987;hb=9eaef595284c567310bc6f0009f83d77a554b881;hp=047e19480023c5b34f83e69dcbff1ae29c6154c2;hpb=25efd6d556718295a63d37f5294985746af354f6;p=oota-llvm.git diff --git a/lib/Target/ARM/ARMTargetObjectFile.cpp b/lib/Target/ARM/ARMTargetObjectFile.cpp index 047e1948002..eaed5cc6875 100644 --- a/lib/Target/ARM/ARMTargetObjectFile.cpp +++ b/lib/Target/ARM/ARMTargetObjectFile.cpp @@ -8,15 +8,16 @@ //===----------------------------------------------------------------------===// #include "ARMTargetObjectFile.h" -#include "ARMSubtarget.h" +#include "ARMTargetMachine.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/IR/Mangler.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSectionELF.h" -#include "llvm/Target/Mangler.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/ELF.h" -#include "llvm/ADT/StringExtras.h" +#include "llvm/Target/TargetLowering.h" using namespace llvm; using namespace dwarf; @@ -26,28 +27,35 @@ using namespace dwarf; void ARMElfTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM) { - bool isAAPCS_ABI = TM.getSubtarget().isAAPCS_ABI(); + bool isAAPCS_ABI = static_cast(TM).TargetABI == + ARMTargetMachine::ARMABI::ARM_ABI_AAPCS; TargetLoweringObjectFileELF::Initialize(Ctx, TM); InitializeELF(isAAPCS_ABI); if (isAAPCS_ABI) { - LSDASection = NULL; + LSDASection = nullptr; } AttributesSection = - getContext().getELFSection(".ARM.attributes", - ELF::SHT_ARM_ATTRIBUTES, - 0, - SectionKind::getMetadata()); + getContext().getELFSection(".ARM.attributes", ELF::SHT_ARM_ATTRIBUTES, 0); } -const MCExpr *ARMElfTargetObjectFile:: -getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang, - MachineModuleInfo *MMI, unsigned Encoding, - MCStreamer &Streamer) const { +const MCExpr *ARMElfTargetObjectFile::getTTypeGlobalReference( + const GlobalValue *GV, unsigned Encoding, Mangler &Mang, + const TargetMachine &TM, MachineModuleInfo *MMI, + MCStreamer &Streamer) const { + if (TM.getMCAsmInfo()->getExceptionHandlingType() != ExceptionHandling::ARM) + return TargetLoweringObjectFileELF::getTTypeGlobalReference( + GV, Encoding, Mang, TM, MMI, Streamer); + assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only"); - return MCSymbolRefExpr::Create(Mang->getSymbol(GV), - MCSymbolRefExpr::VK_ARM_TARGET2, + return MCSymbolRefExpr::create(TM.getSymbol(GV, Mang), + MCSymbolRefExpr::VK_ARM_TARGET2, getContext()); +} + +const MCExpr *ARMElfTargetObjectFile:: +getDebugThreadLocalSymbol(const MCSymbol *Sym) const { + return MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_ARM_TLSLDO, getContext()); }