summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-11-19 08:59:28 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-11-19 08:59:28 +0000
commit02fb33730c346d6a785d935d7aba9af93ba51da6 (patch)
treebc7d702d3d7f66d1e9083201cc8327bc0d06a450 /lib/CodeGen/AsmPrinter/DwarfException.cpp
parentd2e985fd323c167e20f77b045a1d99ad166e65db (diff)
downloadFreeBSD-src-02fb33730c346d6a785d935d7aba9af93ba51da6.zip
FreeBSD-src-02fb33730c346d6a785d935d7aba9af93ba51da6.tar.gz
Update LLVM to r89337.
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 1c8b8f4..fcdcfd3 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -727,7 +727,8 @@ void DwarfException::EmitExceptionTable() {
// somewhere. This predicate should be moved to a shared location that is
// in target-independent code.
//
- if (LSDASection->getKind().isWriteable() ||
+ if ((LSDASection->getKind().isWriteable() &&
+ !LSDASection->getKind().isReadOnlyWithRel()) ||
Asm->TM.getRelocationModel() == Reloc::Static)
TTypeFormat = dwarf::DW_EH_PE_absptr;
else
@@ -917,14 +918,36 @@ void DwarfException::EmitExceptionTable() {
}
// Emit the Catch TypeInfos.
+ const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
+ unsigned Index = 1;
+
for (std::vector<GlobalVariable *>::const_reverse_iterator
I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) {
- const GlobalVariable *GV = *I;
- PrintRelDirective();
-
- if (GV) {
- O << Asm->Mang->getMangledName(GV);
+ const GlobalVariable *TI = *I;
+
+ if (TI) {
+ if (!LSDASection->getKind().isReadOnlyWithRel() &&
+ (TTypeFormat == dwarf::DW_EH_PE_absptr ||
+ TI->getLinkage() == GlobalValue::InternalLinkage)) {
+ // Print out the unadorned name of the type info.
+ PrintRelDirective();
+ O << Asm->Mang->getMangledName(TI);
+ } else {
+ bool IsTypeInfoIndirect = false, IsTypeInfoPCRel = false;
+ const MCExpr *TypeInfoRef =
+ TLOF.getSymbolForDwarfGlobalReference(TI, Asm->Mang, Asm->MMI,
+ IsTypeInfoIndirect,
+ IsTypeInfoPCRel);
+
+ if (!IsTypeInfoPCRel)
+ TypeInfoRef = CreateLabelDiff(TypeInfoRef, "typeinforef_addr",
+ Index++);
+
+ O << MAI->getData32bitsDirective();
+ TypeInfoRef->print(O, MAI);
+ }
} else {
+ PrintRelDirective();
O << "0x0";
}
OpenPOWER on IntegriCloud