1//===-- CodeGen/AsmPrinter/DwarfException.cpp - Dwarf Exception Impl ------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
--- 713 unchanged lines hidden (view full) ---
722 // that is updated by the dynamic linker. This is easy enough, but we
723 // need to tell the personality function of the unwinder to indirect
724 // through the dyld stub.
725 //
726 // FIXME: When (3) is actually implemented, we'll have to emit the stubs
727 // somewhere. This predicate should be moved to a shared location that is
728 // in target-independent code.
729 //
730 if ((LSDASection->getKind().isWriteable() &&
731 !LSDASection->getKind().isReadOnlyWithRel()) ||
732 Asm->TM.getRelocationModel() == Reloc::Static)
733 TTypeFormat = dwarf::DW_EH_PE_absptr;
734 else
735 TTypeFormat = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
736 dwarf::DW_EH_PE_sdata4;
737
738 TypeFormatSize = SizeOfEncodedValue(TTypeFormat);
739 }
--- 173 unchanged lines hidden (view full) ---
913 // Self-relative signed displacement in bytes of the next action record,
914 // or 0 if there is no next action record.
915
916 Asm->EmitSLEB128Bytes(Action.NextAction);
917 Asm->EOL("Next action");
918 }
919
920 // Emit the Catch TypeInfos.
921 const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
922 unsigned Index = 1;
923
924 for (std::vector<GlobalVariable *>::const_reverse_iterator
925 I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) {
926 const GlobalVariable *TI = *I;
927
928 if (TI) {
929 if (!LSDASection->getKind().isReadOnlyWithRel() &&
930 (TTypeFormat == dwarf::DW_EH_PE_absptr ||
931 TI->getLinkage() == GlobalValue::InternalLinkage)) {
932 // Print out the unadorned name of the type info.
933 PrintRelDirective();
934 O << Asm->Mang->getMangledName(TI);
935 } else {
936 bool IsTypeInfoIndirect = false, IsTypeInfoPCRel = false;
937 const MCExpr *TypeInfoRef =
938 TLOF.getSymbolForDwarfGlobalReference(TI, Asm->Mang, Asm->MMI,
939 IsTypeInfoIndirect,
940 IsTypeInfoPCRel);
941
942 if (!IsTypeInfoPCRel)
943 TypeInfoRef = CreateLabelDiff(TypeInfoRef, "typeinforef_addr",
944 Index++);
945
946 O << MAI->getData32bitsDirective();
947 TypeInfoRef->print(O, MAI);
948 }
949 } else {
950 PrintRelDirective();
951 O << "0x0";
952 }
953
954 Asm->EOL("TypeInfo");
955 }
956
957 // Emit the Exception Specifications.
958 for (std::vector<unsigned>::const_iterator
--- 99 unchanged lines hidden ---
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
--- 713 unchanged lines hidden (view full) ---
722 // that is updated by the dynamic linker. This is easy enough, but we
723 // need to tell the personality function of the unwinder to indirect
724 // through the dyld stub.
725 //
726 // FIXME: When (3) is actually implemented, we'll have to emit the stubs
727 // somewhere. This predicate should be moved to a shared location that is
728 // in target-independent code.
729 //
730 if ((LSDASection->getKind().isWriteable() &&
731 !LSDASection->getKind().isReadOnlyWithRel()) ||
732 Asm->TM.getRelocationModel() == Reloc::Static)
733 TTypeFormat = dwarf::DW_EH_PE_absptr;
734 else
735 TTypeFormat = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
736 dwarf::DW_EH_PE_sdata4;
737
738 TypeFormatSize = SizeOfEncodedValue(TTypeFormat);
739 }
--- 173 unchanged lines hidden (view full) ---
913 // Self-relative signed displacement in bytes of the next action record,
914 // or 0 if there is no next action record.
915
916 Asm->EmitSLEB128Bytes(Action.NextAction);
917 Asm->EOL("Next action");
918 }
919
920 // Emit the Catch TypeInfos.
921 const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
922 unsigned Index = 1;
923
924 for (std::vector<GlobalVariable *>::const_reverse_iterator
925 I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) {
926 const GlobalVariable *TI = *I;
927
928 if (TI) {
929 if (!LSDASection->getKind().isReadOnlyWithRel() &&
930 (TTypeFormat == dwarf::DW_EH_PE_absptr ||
931 TI->getLinkage() == GlobalValue::InternalLinkage)) {
932 // Print out the unadorned name of the type info.
933 PrintRelDirective();
934 O << Asm->Mang->getMangledName(TI);
935 } else {
936 bool IsTypeInfoIndirect = false, IsTypeInfoPCRel = false;
937 const MCExpr *TypeInfoRef =
938 TLOF.getSymbolForDwarfGlobalReference(TI, Asm->Mang, Asm->MMI,
939 IsTypeInfoIndirect,
940 IsTypeInfoPCRel);
941
942 if (!IsTypeInfoPCRel)
943 TypeInfoRef = CreateLabelDiff(TypeInfoRef, "typeinforef_addr",
944 Index++);
945
946 O << MAI->getData32bitsDirective();
947 TypeInfoRef->print(O, MAI);
948 }
949 } else {
950 PrintRelDirective();
951 O << "0x0";
952 }
953
954 Asm->EOL("TypeInfo");
955 }
956
957 // Emit the Exception Specifications.
958 for (std::vector<unsigned>::const_iterator
--- 99 unchanged lines hidden ---