LLVM 22.0.0git
MachOObjectFormat.cpp
Go to the documentation of this file.
1//===-------- MachOObjectFormat.cpp -- MachO format details for ORC -------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// ORC-specific MachO object format details.
10//
11//===----------------------------------------------------------------------===//
12
14
15namespace llvm {
16namespace orc {
17
20StringRef MachOEHFrameSectionName = "__TEXT,__eh_frame";
21StringRef MachOCompactUnwindSectionName = "__LD,__compact_unwind";
23StringRef MachOModInitFuncSectionName = "__DATA,__mod_init_func";
24StringRef MachOObjCCatListSectionName = "__DATA,__objc_catlist";
25StringRef MachOObjCCatList2SectionName = "__DATA,__objc_catlist2";
26StringRef MachOObjCClassListSectionName = "__DATA,__objc_classlist";
27StringRef MachOObjCClassNameSectionName = "__TEXT,__objc_classname";
28StringRef MachOObjCClassRefsSectionName = "__DATA,__objc_classrefs";
29StringRef MachOObjCConstSectionName = "__DATA,__objc_const";
30StringRef MachOObjCDataSectionName = "__DATA,__objc_data";
31StringRef MachOObjCImageInfoSectionName = "__DATA,__objc_imageinfo";
32StringRef MachOObjCMethNameSectionName = "__TEXT,__objc_methname";
33StringRef MachOObjCMethTypeSectionName = "__TEXT,__objc_methtype";
34StringRef MachOObjCNLCatListSectionName = "__DATA,__objc_nlcatlist";
35StringRef MachOObjCNLClassListSectionName = "__DATA,__objc_nlclslist";
36StringRef MachOObjCProtoListSectionName = "__DATA,__objc_protolist";
37StringRef MachOObjCProtoRefsSectionName = "__DATA,__objc_protorefs";
38StringRef MachOObjCSelRefsSectionName = "__DATA,__objc_selrefs";
39StringRef MachOSwift5ProtoSectionName = "__TEXT,__swift5_proto";
40StringRef MachOSwift5ProtosSectionName = "__TEXT,__swift5_protos";
41StringRef MachOSwift5TypesSectionName = "__TEXT,__swift5_types";
42StringRef MachOSwift5TypeRefSectionName = "__TEXT,__swift5_typeref";
44StringRef MachOSwift5EntrySectionName = "__TEXT,__swift5_entry";
46StringRef MachOThreadBSSSectionName = "__DATA,__thread_bss";
47StringRef MachOThreadDataSectionName = "__DATA,__thread_data";
48StringRef MachOThreadVarsSectionName = "__DATA,__thread_vars";
49StringRef MachOUnwindInfoSectionName = "__TEXT,__unwind_info";
50
63};
64
66 for (auto &InitSection : MachOInitSectionNames) {
67 // Loop below assumes all MachO init sectios have a length-6
68 // segment name.
69 assert(InitSection[6] == ',' && "Init section seg name has length != 6");
70 if (InitSection.starts_with(SegName) && InitSection.substr(7) == SecName)
71 return true;
72 }
73 return false;
74}
75
76} // namespace orc
77} // namespace llvm
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
LLVM_ABI StringRef MachOSwift5EntrySectionName
LLVM_ABI StringRef MachOThreadBSSSectionName
LLVM_ABI StringRef MachOThreadVarsSectionName
LLVM_ABI StringRef MachOObjCProtoListSectionName
LLVM_ABI StringRef MachOSwift5ProtosSectionName
LLVM_ABI StringRef MachOEHFrameSectionName
LLVM_ABI StringRef MachOModInitFuncSectionName
LLVM_ABI StringRef MachOObjCConstSectionName
LLVM_ABI StringRef MachODataDataSectionName
LLVM_ABI StringRef MachOCompactUnwindSectionName
LLVM_ABI StringRef MachOSwift5ProtoSectionName
LLVM_ABI bool isMachOInitializerSection(StringRef SegName, StringRef SecName)
LLVM_ABI StringRef MachOObjCCatListSectionName
LLVM_ABI StringRef MachOObjCClassRefsSectionName
LLVM_ABI StringRef MachOObjCDataSectionName
LLVM_ABI StringRef MachOObjCClassNameSectionName
LLVM_ABI StringRef MachOObjCMethNameSectionName
LLVM_ABI StringRef MachOInitSectionNames[22]
LLVM_ABI StringRef MachOObjCClassListSectionName
LLVM_ABI StringRef MachOObjCSelRefsSectionName
LLVM_ABI StringRef MachOTextTextSectionName
LLVM_ABI StringRef MachOSwift5FieldMetadataSectionName
LLVM_ABI StringRef MachOCStringSectionName
LLVM_ABI StringRef MachOObjCMethTypeSectionName
LLVM_ABI StringRef MachOSwift5TypesSectionName
LLVM_ABI StringRef MachOObjCNLCatListSectionName
LLVM_ABI StringRef MachOObjCNLClassListSectionName
LLVM_ABI StringRef MachOObjCImageInfoSectionName
LLVM_ABI StringRef MachOThreadDataSectionName
LLVM_ABI StringRef MachOUnwindInfoSectionName
LLVM_ABI StringRef MachODataCommonSectionName
LLVM_ABI StringRef MachOObjCProtoRefsSectionName
LLVM_ABI StringRef MachOSwift5TypeRefSectionName
LLVM_ABI StringRef MachOObjCCatList2SectionName
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18