aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-07-21 13:03:21 -0700
committerFangrui Song <i@maskray.me>2024-07-21 13:03:21 -0700
commit09a399a1ddbef1e5e51b77fd6bd1792d34697187 (patch)
treeb62b9fdb7fb17ee964c0cc032d05e317a1d0f2f4 /llvm/lib/MC/MachObjectWriter.cpp
parentc1562374c8f24e5f873490639420b9c732b7e33d (diff)
downloadllvm-09a399a1ddbef1e5e51b77fd6bd1792d34697187.zip
llvm-09a399a1ddbef1e5e51b77fd6bd1792d34697187.tar.gz
llvm-09a399a1ddbef1e5e51b77fd6bd1792d34697187.tar.bz2
[MC] Move VersionInfo to MachObjectWriter
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 3c67f16..cc29c1a 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -56,6 +56,10 @@ void MachObjectWriter::reset() {
ExternalSymbolData.clear();
UndefinedSymbolData.clear();
LOHContainer.reset();
+ VersionInfo.Major = 0;
+ VersionInfo.SDKVersion = VersionTuple();
+ TargetVariantVersionInfo.Major = 0;
+ TargetVariantVersionInfo.SDKVersion = VersionTuple();
MCObjectWriter::reset();
}
@@ -803,7 +807,6 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) {
}
unsigned NumSections = Asm.end() - Asm.begin();
- const MCAssembler::VersionInfoType &VersionInfo = Asm.getVersionInfo();
// The section data starts after the header, the segment load command (and
// section headers) and the symbol table.
@@ -821,9 +824,6 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) {
LoadCommandsSize += sizeof(MachO::version_min_command);
}
- const MCAssembler::VersionInfoType &TargetVariantVersionInfo =
- Asm.getDarwinTargetVariantVersionInfo();
-
// Add the target variant version info load command size, if used.
if (TargetVariantVersionInfo.Major != 0) {
++NumLoadCommands;
@@ -928,7 +928,7 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) {
// Write out the deployment target information, if it's available.
auto EmitDeploymentTargetVersion =
- [&](const MCAssembler::VersionInfoType &VersionInfo) {
+ [&](const VersionInfoType &VersionInfo) {
auto EncodeVersion = [](VersionTuple V) -> uint32_t {
assert(!V.empty() && "empty version");
unsigned Update = V.getSubminor().value_or(0);