diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-16 01:46:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-16 01:46:41 +0000 |
commit | 8c6ed05157e9c97ff8f3ccb211dd797e53228da1 (patch) | |
tree | bd6106930b39d094647ca34aa8572c913dfdaf41 /include/llvm/Target/TargetLoweringObjectFile.h | |
parent | 7c748661ce1e8898479106bc808cce9b55110f5c (diff) | |
download | external_llvm-8c6ed05157e9c97ff8f3ccb211dd797e53228da1.zip external_llvm-8c6ed05157e9c97ff8f3ccb211dd797e53228da1.tar.gz external_llvm-8c6ed05157e9c97ff8f3ccb211dd797e53228da1.tar.bz2 |
Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.
To replace their functionality, add a new
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.
The default implementation just returns the symbol. The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub. The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.
DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another
horrible hack from DwarfException.cpp:
- if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
- O << "-" << MAI->getPCSymbol();
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetLoweringObjectFile.h')
-rw-r--r-- | include/llvm/Target/TargetLoweringObjectFile.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLoweringObjectFile.h b/include/llvm/Target/TargetLoweringObjectFile.h index 7cb7b98..6480bf4 100644 --- a/include/llvm/Target/TargetLoweringObjectFile.h +++ b/include/llvm/Target/TargetLoweringObjectFile.h @@ -26,6 +26,7 @@ namespace llvm { class StringRef; class TargetMachine; class MCAsmInfo; + class MCExpr; class TargetLoweringObjectFile { MCContext *Ctx; @@ -173,6 +174,22 @@ public: return 0; } + /// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a + /// pc-relative reference to the specified global variable from exception + /// handling information. In addition to the symbol, this returns + /// by-reference: + /// + /// IsIndirect - True if the returned symbol is actually a stub that contains + /// the address of the symbol, false if the symbol is the global itself. + /// + /// IsPCRel - True if the symbol reference is already pc-relative, false if + /// the caller needs to subtract off the address of the reference from the + /// symbol. + /// + virtual const MCExpr * + getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const; + protected: virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, @@ -298,6 +315,12 @@ public: const MCSection *getNonLazySymbolPointerSection() const { return NonLazySymbolPointerSection; } + + /// getSymbolForDwarfGlobalReference - The mach-o version of this method + /// defaults to returning a stub reference. + virtual const MCExpr * + getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const; }; |