41#define DEBUG_TYPE "mc"
45 IndirectSymBase.clear();
46 IndirectSymbols.clear();
48 SectionDataOffset.clear();
51 LocalSymbolData.clear();
52 ExternalSymbolData.clear();
53 UndefinedSymbolData.clear();
55 VersionInfo.Major = 0;
57 TargetVariantVersionInfo.Major = 0;
59 LinkerOptions.clear();
65 TargetObjectWriter->setAssembler(
Asm);
82bool MachObjectWriter::
83MachSymbolData::operator<(
const MachSymbolData &RHS)
const {
84 return Symbol->getName() < RHS.Symbol->getName();
107 if (
Target.getAddSym() &&
Target.getAddSym()->isUndefined())
110 if (
Target.getSubSym() &&
Target.getSubSym()->isUndefined())
123 Asm->getSymbolOffset(S);
129 if (
getContext().getAsmInfo().doesDwarfUseRelocationsAcrossSections() &&
130 static_cast<const MCSectionMachO *
>(Sec)->getSegmentName() ==
"__DWARF")
132 return SectionDataOffset.lookup(Sec);
138 SectionDataOffset.lookup(Sec) +
Asm.getSectionAddressSize(*Sec);
141 if (
Next >= SectionOrder.size())
152 if (!Symbol.isTemporary())
155 if (Symbol.isUsedInReloc())
181 unsigned NumLoadCommands,
182 unsigned LoadCommandsSize,
192 uint64_t Start =
W.OS.tell();
197 W.write<
uint32_t>(TargetObjectWriter->getCPUType());
199 uint32_t Cpusubtype = TargetObjectWriter->getCPUSubtype();
222void MachObjectWriter::writeWithPadding(
StringRef Str, uint64_t
Size) {
233 StringRef Name,
unsigned NumSections, uint64_t VMAddr, uint64_t VMSize,
234 uint64_t SectionDataStartOffset, uint64_t SectionDataSize,
uint32_t MaxProt,
239 uint64_t Start =
W.OS.tell();
242 unsigned SegmentLoadCommandSize =
246 W.write<
uint32_t>(SegmentLoadCommandSize +
250 writeWithPadding(Name, 16);
252 W.write<uint64_t>(VMAddr);
253 W.write<uint64_t>(VMSize);
254 W.write<uint64_t>(SectionDataStartOffset);
255 W.write<uint64_t>(SectionDataSize);
259 W.write<
uint32_t>(SectionDataStartOffset);
269 assert(
W.OS.tell() - Start == SegmentLoadCommandSize);
274 uint64_t FileOffset,
unsigned Flags,
275 uint64_t RelocationsStart,
276 unsigned NumRelocations) {
279 assert(
Asm.getSectionFileSize(Sec) == 0 &&
"Invalid file size!");
286 uint64_t SectionSize =
Asm.getSectionAddressSize(Sec);
287 uint64_t Start =
W.OS.tell();
289 writeWithPadding(Sec.
getName(), 16);
292 W.write<uint64_t>(VMAddr);
293 W.write<uint64_t>(SectionSize);
303 "Cannot encode offset of relocations");
304 W.write<
uint32_t>(NumRelocations ? RelocationsStart : 0);
307 W.write<
uint32_t>(IndirectSymBase.lookup(&Sec));
322 uint64_t Start =
W.OS.tell();
345 uint64_t Start =
W.OS.tell();
372MachObjectWriter::MachSymbolData *
373MachObjectWriter::findSymbolData(
const MCSymbol &Sym) {
374 for (
auto *SymbolData :
375 {&LocalSymbolData, &ExternalSymbolData, &UndefinedSymbolData})
376 for (MachSymbolData &Entry : *SymbolData)
377 if (Entry.Symbol == &Sym)
390 S = &
Ref->getSymbol();
396 auto *Symbol = MSD.Symbol;
398 auto *AliasedSymbol =
400 uint8_t SectionIndex = MSD.SectionIndex;
403 bool IsAlias = Symbol != AliasedSymbol;
406 MachSymbolData *AliaseeInfo;
408 AliaseeInfo = findSymbolData(*AliasedSymbol);
410 SectionIndex = AliaseeInfo->SectionIndex;
411 Symbol = AliasedSymbol;
418 if (IsAlias && Symbol->isUndefined())
420 else if (Symbol->isUndefined())
422 else if (Symbol->isAbsolute())
429 if (
Data.isPrivateExtern())
433 if (
Data.isExternal() || (!IsAlias && Symbol->isUndefined()))
437 if (IsAlias && Symbol->isUndefined())
438 Address = AliaseeInfo->StringIndex;
439 else if (Symbol->isDefined())
441 else if (Symbol->isCommon()) {
444 Address = Symbol->getCommonSize();
451 W.OS <<
char(SectionIndex);
455 bool EncodeAsAltEntry = IsAlias && OrigSymbol.
isAltEntry();
456 W.write<uint16_t>(Symbol->getEncodedFlags(EncodeAsAltEntry));
466 uint64_t Start =
W.OS.tell();
481 for (
const std::string &Option :
Options)
482 Size += Option.size() + 1;
487 const std::vector<std::string> &
Options)
490 uint64_t Start =
W.OS.tell();
493 W.write<
uint32_t>(MachO::LC_LINKER_OPTION);
497 for (
const std::string &Option :
Options) {
499 W.OS << Option <<
'\0';
500 BytesWritten += Option.size() + 1;
520 uint64_t &FixedValue) {
523 "unsupported relocation expression");
527 TargetObjectWriter->recordRelocation(
this, *
Asm, &
F, Fixup,
Target,
541 for (IndirectSymbolData &
ISD : IndirectSymbols) {
550 "' not in a symbol pointer or stub section");
555 for (
auto [IndirectIndex,
ISD] :
enumerate(IndirectSymbols)) {
563 IndirectSymBase.insert(std::make_pair(
ISD.Section, IndirectIndex));
565 Asm.registerSymbol(*
ISD.Symbol);
569 for (
auto [IndirectIndex,
ISD] :
enumerate(IndirectSymbols)) {
577 IndirectSymBase.insert(std::make_pair(
ISD.Section, IndirectIndex));
582 if (
Asm.registerSymbol(*
ISD.Symbol))
583 ISD.Symbol->setReferenceTypeUndefinedLazy(
true);
590 std::vector<MachSymbolData> &ExternalSymbolData,
591 std::vector<MachSymbolData> &UndefinedSymbolData) {
596 SectionIndexMap[&Sec] = Index++;
609 StringTable.add(Symbol.getName());
611 StringTable.finalize();
621 if (!Sym.isSymbolLinkerVisible())
629 MSD.StringIndex = StringTable.getOffset(Symbol.getName());
631 if (Symbol.isUndefined()) {
632 MSD.SectionIndex = 0;
633 UndefinedSymbolData.push_back(MSD);
634 }
else if (Symbol.isAbsolute()) {
635 MSD.SectionIndex = 0;
636 ExternalSymbolData.push_back(MSD);
638 MSD.SectionIndex = SectionIndexMap.
lookup(&Symbol.getSection());
639 if (!MSD.SectionIndex)
641 ExternalSymbolData.push_back(MSD);
649 if (!Sym.isSymbolLinkerVisible())
657 MSD.StringIndex = StringTable.getOffset(Symbol.getName());
659 if (Symbol.isAbsolute()) {
660 MSD.SectionIndex = 0;
661 LocalSymbolData.push_back(MSD);
663 MSD.SectionIndex = SectionIndexMap.
lookup(&Symbol.getSection());
664 if (!MSD.SectionIndex)
666 LocalSymbolData.push_back(MSD);
676 for (
auto *SymbolData :
677 {&LocalSymbolData, &ExternalSymbolData, &UndefinedSymbolData})
678 for (MachSymbolData &Entry : *SymbolData)
679 Entry.Symbol->setIndex(Index++);
682 for (RelAndSymbol &Rel : Relocations[&Section]) {
687 unsigned Index = Rel.Sym->getIndex();
690 Rel.MRE.r_word1 = (Rel.MRE.r_word1 & (~0U << 24)) | Index | (1 << 27);
692 Rel.MRE.r_word1 = (Rel.MRE.r_word1 & 0xff) | Index << 8 | (1 << 4);
702 if (!Sec.isBssSection()) {
703 SectionOrder.push_back(&Sec);
708 if (Sec.isBssSection()) {
709 SectionOrder.push_back(&Sec);
714 uint64_t StartOffset = 0;
715 for (
const MCSection *Sec : SectionOrder) {
716 StartOffset =
alignTo(StartOffset, Sec->getAlign());
717 SectionDataOffset[Sec] = StartOffset;
718 StartOffset +=
Asm.getSectionAddressSize(*Sec);
736 bool IsPCRel)
const {
763 bool hasReliableSymbolDifference =
isX86_64();
764 if (!hasReliableSymbolDifference) {
794 unsigned Log2Size =
is64Bit() ? 3 : 2;
796 if (!S->isRegistered())
807 uint64_t StartOffset =
W.OS.tell();
808 auto NumBytesWritten = [&] {
return W.OS.tell() - StartOffset; };
814 UndefinedSymbolData);
820 uint32_t FromIndex = CGPE.From->getSymbol().getIndex();
821 uint32_t ToIndex = CGPE.To->getSymbol().getIndex();
831 unsigned NumSections =
Asm.end() -
Asm.begin();
835 unsigned NumLoadCommands = 1;
836 uint64_t LoadCommandsSize =
is64Bit() ?
841 if (VersionInfo.Major != 0) {
843 if (VersionInfo.EmitBuildVersion)
850 if (TargetVariantVersionInfo.Major != 0) {
852 assert(TargetVariantVersionInfo.EmitBuildVersion &&
853 "target variant should use build version");
858 uint32_t TargetTripleCommandSize = 0;
863 TargetTripleCommandSize =
866 LoadCommandsSize += TargetTripleCommandSize;
870 unsigned NumDataRegions = DataRegions.size();
871 if (NumDataRegions) {
877 uint64_t LOHRawSize = LOHContainer.getEmitSize(
Asm, *
this);
885 unsigned NumSymbols = LocalSymbolData.size() + ExternalSymbolData.size() +
886 UndefinedSymbolData.size();
888 NumLoadCommands += 2;
894 for (
const auto &Option : LinkerOptions) {
903 uint64_t SectionDataSize = 0;
904 uint64_t SectionDataFileSize = 0;
908 uint64_t
Offset = SectionDataOffset.lookup(&Sec);
909 uint64_t
Size =
Asm.getSectionAddressSize(Sec);
910 uint64_t FileSize =
Asm.getSectionFileSize(Sec);
915 if (Sec.isBssSection())
918 SectionDataSize = std::max(SectionDataSize,
Offset +
Size);
919 SectionDataFileSize = std::max(SectionDataFileSize,
Offset + FileSize);
923 VMSize = std::max(VMSize, SectionDataSize);
928 unsigned SectionDataPadding =
930 SectionDataFileSize += SectionDataPadding;
938 SectionDataSize, Prot, Prot);
941 uint64_t RelocTableEnd = SectionDataStart + SectionDataFileSize;
944 std::vector<RelAndSymbol> &Relocs = Relocations[&Sec];
945 unsigned NumRelocs = Relocs.size();
946 uint64_t SectionStart = SectionDataStart + SectionDataOffset.lookup(&Sec);
947 unsigned Flags = Sec.getTypeAndAttributes();
948 if (Sec.hasInstructions())
953 SMLoc(),
"cannot encode offset of section; object file too large");
954 return NumBytesWritten();
956 if (NumRelocs && !
isUInt<32>(RelocTableEnd)) {
959 "cannot encode offset of relocations; object file too large");
960 return NumBytesWritten();
963 RelocTableEnd, NumRelocs);
968 auto EmitDeploymentTargetVersion =
971 assert(!V.empty() &&
"empty version");
972 unsigned Update = V.getSubminor().value_or(0);
973 unsigned Minor = V.getMinor().value_or(0);
974 assert(Update < 256 &&
"unencodable update target version");
975 assert(Minor < 256 &&
"unencodable minor target version");
976 assert(V.getMajor() < 65536 &&
"unencodable major target version");
977 return Update | (Minor << 8) | (V.getMajor() << 16);
980 VersionInfo.Major, VersionInfo.Minor, VersionInfo.Update));
981 uint32_t SDKVersion = !VersionInfo.SDKVersion.empty()
982 ? EncodeVersion(VersionInfo.SDKVersion)
984 if (VersionInfo.EmitBuildVersion) {
986 W.write<
uint32_t>(MachO::LC_BUILD_VERSION);
988 W.write<
uint32_t>(VersionInfo.TypeOrPlatform.Platform);
1001 if (VersionInfo.Major != 0)
1002 EmitDeploymentTargetVersion(VersionInfo);
1003 if (TargetVariantVersionInfo.Major != 0)
1004 EmitDeploymentTargetVersion(TargetVariantVersionInfo);
1009 "target triple load command size is too small");
1012 W.write<
uint32_t>(MachO::LC_TARGET_TRIPLE);
1013 W.write<
uint32_t>(TargetTripleCommandSize);
1019 uint64_t RemainingSize =
1021 writeWithPadding(*TargetTriple, RemainingSize);
1025 uint64_t DataInCodeTableEnd = RelocTableEnd + NumDataRegions * 8;
1026 if (NumDataRegions) {
1027 uint64_t DataRegionsOffset = RelocTableEnd;
1028 uint64_t DataRegionsSize = NumDataRegions * 8;
1034 uint64_t LOHTableEnd = DataInCodeTableEnd + LOHSize;
1037 DataInCodeTableEnd, LOHSize);
1041 unsigned FirstLocalSymbol = 0;
1042 unsigned NumLocalSymbols = LocalSymbolData.size();
1043 unsigned FirstExternalSymbol = FirstLocalSymbol + NumLocalSymbols;
1044 unsigned NumExternalSymbols = ExternalSymbolData.size();
1045 unsigned FirstUndefinedSymbol = FirstExternalSymbol + NumExternalSymbols;
1046 unsigned NumUndefinedSymbols = UndefinedSymbolData.size();
1047 unsigned NumIndirectSymbols = IndirectSymbols.size();
1048 unsigned NumSymTabSymbols =
1049 NumLocalSymbols + NumExternalSymbols + NumUndefinedSymbols;
1050 uint64_t IndirectSymbolSize = NumIndirectSymbols * 4;
1051 uint64_t IndirectSymbolOffset = 0;
1054 if (NumIndirectSymbols)
1055 IndirectSymbolOffset = LOHTableEnd;
1058 uint64_t SymbolTableOffset = LOHTableEnd + IndirectSymbolSize;
1061 uint64_t StringTableOffset =
1062 SymbolTableOffset + NumSymTabSymbols * (
is64Bit() ?
1066 StringTableOffset, StringTable.getSize());
1069 FirstExternalSymbol, NumExternalSymbols,
1070 FirstUndefinedSymbol, NumUndefinedSymbols,
1071 IndirectSymbolOffset, NumIndirectSymbols);
1075 for (
const auto &Option : LinkerOptions)
1080 Asm.writeSectionData(
W.OS, &Sec);
1083 W.OS.write_zeros(Pad);
1087 W.OS.write_zeros(SectionDataPadding);
1093 std::vector<RelAndSymbol> &Relocs = Relocations[&Sec];
1110 <<
" start: " << Start <<
"(" <<
Data.Start->getName()
1111 <<
")" <<
" end: " <<
End <<
"(" <<
Data.End->getName()
1112 <<
")" <<
" size: " <<
End - Start <<
"\n");
1114 W.write<uint16_t>(
End - Start);
1115 W.write<uint16_t>(
Data.Kind);
1121 unsigned Start =
W.OS.tell();
1123 LOHContainer.emit(
Asm, *
this);
1127 assert(
W.OS.tell() - Start == LOHSize);
1133 for (
auto &
ISD : IndirectSymbols) {
1140 if (
ISD.Symbol->isDefined() && !
ISD.Symbol->isExternal()) {
1142 if (
ISD.Symbol->isAbsolute())
1155 for (
auto *SymbolData :
1156 {&LocalSymbolData, &ExternalSymbolData, &UndefinedSymbolData})
1157 for (MachSymbolData &Entry : *SymbolData)
1161 StringTable.write(
W.OS);
1164 return NumBytesWritten();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file defines the DenseMap class.
static unsigned ComputeLinkerOptionsLoadCommandSize(const std::vector< std::string > &Options, bool is64Bit)
static bool isFixupTargetValid(const MCValue &Target)
static MachO::LoadCommandType getLCFromMCVM(MCVersionMinType Type)
static bool isSymbolLinkerVisible(const MCSymbol &Symbol)
static bool is64Bit(const char *name)
ValueT lookup(const_arg_type_t< KeyT > Val) const
Return the entry for the specified key, or a default constructed value if no such entry exists.
static bool isSectionAtomizableBySymbols(const MCSection &Section)
True if the section is atomized using the symbols in it.
const MCObjectFileInfo * getObjectFileInfo() const
LLVM_ABI MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_ABI bool evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm) const
Try to evaluate the expression to a relocatable value, i.e.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
LLVM_ABI const MCSymbol * getAtom() const
MCSection * getParent() const
MutableArrayRef< char > getVarContents()
MCSection * getAddrSigSection() const
SmallVector< CGProfileEntry, 0 > CGProfile
virtual void setAssembler(MCAssembler *A)
bool SubsectionsViaSymbols
std::vector< const MCSymbol * > & getAddrsigSyms()
virtual void reset()
lifetime management
MCContext & getContext() const
This represents a section on a Mach-O system (used by Mac OS X).
StringRef getSegmentName() const
unsigned getStubSize() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
bool isBssSection() const
Check whether this section is "virtual", that is has no actual object file contents.
StringRef getName() const
FragList * curFragList() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
bool isUndefined() const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
StringRef getName() const
getName - Get the symbol name.
bool isVariable() const
isVariable - Check if this is a variable symbol.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
const MCExpr * getVariableValue() const
Get the expression of the variable symbol.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
MCFragment * getFragment() const
uint64_t getPaddingSize(const MCAssembler &Asm, const MCSection *SD) const
void computeSectionAddresses(const MCAssembler &Asm)
bool doesSymbolRequireExternRelocation(const MCSymbol &S)
void recordRelocation(const MCFragment &F, const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue) override
Record a relocation entry.
void computeSymbolTable(MCAssembler &Asm, std::vector< MachSymbolData > &LocalSymbolData, std::vector< MachSymbolData > &ExternalSymbolData, std::vector< MachSymbolData > &UndefinedSymbolData)
Compute the symbol table data.
uint64_t writeObject() override
Write the object file and returns the number of bytes written.
uint64_t getFragmentAddress(const MCAssembler &Asm, const MCFragment *Fragment) const
bool isSymbolRefDifferenceFullyResolvedImpl(const MCSymbol &SymA, const MCFragment &FB, bool InSet, bool IsPCRel) const override
void addRelocation(const MCSymbol *RelSymbol, const MCSection *Sec, MachO::any_relocation_info &MRE)
void writeSection(const MCAssembler &Asm, const MCSectionMachO &Sec, uint64_t VMAddr, uint64_t FileOffset, unsigned Flags, uint64_t RelocationsStart, unsigned NumRelocations)
void populateAddrSigSection(MCAssembler &Asm)
support::endian::Writer W
void writeLinkerOptionsLoadCommand(const std::vector< std::string > &Options)
void executePostLayoutBinding() override
Perform any late binding of symbols (for example, to assign symbol indices for use when generating re...
void writeNlist(MachSymbolData &MSD, const MCAssembler &Asm)
void writeDysymtabLoadCommand(uint32_t FirstLocalSymbol, uint32_t NumLocalSymbols, uint32_t FirstExternalSymbol, uint32_t NumExternalSymbols, uint32_t FirstUndefinedSymbol, uint32_t NumUndefinedSymbols, uint32_t IndirectSymbolOffset, uint32_t NumIndirectSymbols)
const MCSymbol & findAliasedSymbol(const MCSymbol &Sym) const
uint64_t getSectionAddress(const MCSection *Sec) const
void writeSegmentLoadCommand(StringRef Name, unsigned NumSections, uint64_t VMAddr, uint64_t VMSize, uint64_t SectionDataStartOffset, uint64_t SectionDataSize, uint32_t MaxProt, uint32_t InitProt)
Write a segment load command.
const MCSymbol * getAtom(const MCSymbol &S) const
void writeLinkeditLoadCommand(uint32_t Type, uint32_t DataOffset, uint32_t DataSize)
void writeHeader(MachO::HeaderFileType Type, unsigned NumLoadCommands, unsigned LoadCommandsSize, bool SubsectionsViaSymbols)
void setAssembler(MCAssembler *Asm) override
void reset() override
lifetime management
void writeSymtabLoadCommand(uint32_t SymbolOffset, uint32_t NumSymbols, uint32_t StringTableOffset, uint32_t StringTableSize)
void bindIndirectSymbols(MCAssembler &Asm)
uint64_t getSymbolAddress(const MCSymbol &S) const
struct { bool EmitBuildVersion; union { MCVersionMinType Type; MachO::PlatformType Platform; } TypeOrPlatform; unsigned Major; unsigned Minor; unsigned Update; VersionTuple SDKVersion; } VersionInfoType
Represents a location in source code.
static SectionKind getMetadata()
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
const char * getName() const
getName - Get the target name.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
A raw_ostream that writes to an SmallVector or SmallString.
StringRef str() const
Return a StringRef for the vector contents.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ISD namespace - This namespace contains an enum which represents all of the SelectionDAG node types a...
@ S_THREAD_LOCAL_VARIABLE_POINTERS
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
@ S_LAZY_SYMBOL_POINTERS
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
@ S_NON_LAZY_SYMBOL_POINTERS
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
@ S_SYMBOL_STUBS
S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
@ MH_SUBSECTIONS_VIA_SYMBOLS
constexpr uint32_t S_ATTR_SOME_INSTRUCTIONS
Section contains some machine instructions.
constexpr uint32_t INDIRECT_SYMBOL_ABS
constexpr uint32_t INDIRECT_SYMBOL_LOCAL
uint32_t CPU_SUBTYPE_ARM64E_WITH_PTRAUTH_VERSION(unsigned PtrAuthABIVersion, bool PtrAuthKernelABIVersion)
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
auto reverse(ContainerTy &&C)
void sort(IteratorTy Start, IteratorTy End)
@ MCVM_WatchOSVersionMin
.watchos_version_min
@ MCVM_OSXVersionMin
.macosx_version_min
@ MCVM_TvOSVersionMin
.tvos_version_min
@ MCVM_IOSVersionMin
.ios_version_min
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
uint64_t offsetToAlignment(uint64_t Value, Align Alignment)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
@ Ref
The access may reference the value stored in memory.
OutputIt copy(R &&Range, OutputIt Out)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Next
unsigned Log2(Align A)
Returns the log2 of the alignment.
@ End
Run the machine verifier once, at the end of the pipeline.
This struct is a compact representation of a valid (non-zero power of two) alignment.