/// \brief Create a symbol reference to describe the given TLS variable when
/// emitting the address in debug info.
- virtual const MCSymbolRefExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
+ virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
protected:
virtual const MCSection *
unsigned PointerSize = Asm->getDataLayout().getPointerSize();
assert((PointerSize == 4 || PointerSize == 8) &&
"Add support for other sizes if necessary");
- const MCSymbolRefExpr *Ref =
+ const MCExpr *Expr =
Asm->getObjFileLowering().getDebugThreadLocalSymbol(Sym);
// Based on GCC's support for TLS:
if (!DD->useSplitDwarf()) {
addUInt(Block, 0, dwarf::DW_FORM_data1,
PointerSize == 4 ? dwarf::DW_OP_const4u : dwarf::DW_OP_const8u);
// 2) containing the (relocated) address of the TLS variable
- addExpr(Block, 0, dwarf::DW_FORM_udata, Ref);
+ addExpr(Block, 0, dwarf::DW_FORM_udata, Expr);
} else {
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index);
- addUInt(Block, 0, dwarf::DW_FORM_udata, DU->getAddrPoolIndex(Ref));
+ addUInt(Block, 0, dwarf::DW_FORM_udata, DU->getAddrPoolIndex(Expr));
}
// 3) followed by a custom OP to tell the debugger about TLS (presumably)
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_lo_user);
}
}
-const MCSymbolRefExpr *TargetLoweringObjectFile::getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
+const MCExpr *TargetLoweringObjectFile::getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
// FIXME: It's not clear what, if any, default this should have - perhaps a
// null return could mean 'no location' & we should just do that here.
return MCSymbolRefExpr::Create(Sym, *Ctx);
InitializeELF(TM.Options.UseInitArray);
}
-const MCSymbolRefExpr *
+const MCExpr *
X86LinuxTargetObjectFile::getDebugThreadLocalSymbol(
const MCSymbol *Sym) const {
return MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_DTPOFF, getContext());
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
/// \brief Describe a TLS variable address within debug info.
- virtual const MCSymbolRefExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
+ virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
};
} // end namespace llvm