[llvm] 63ec52f - MCAssembler::layout: remove the unused MCAsmLayout parameter
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 18:17:10 PDT 2024
Author: Fangrui Song
Date: 2024-07-01T18:17:05-07:00
New Revision: 63ec52f867ada8d841dd872acf3d0cb62e2a99e8
URL: https://github.com/llvm/llvm-project/commit/63ec52f867ada8d841dd872acf3d0cb62e2a99e8
DIFF: https://github.com/llvm/llvm-project/commit/63ec52f867ada8d841dd872acf3d0cb62e2a99e8.diff
LOG: MCAssembler::layout: remove the unused MCAsmLayout parameter
Almost complete the MCAsmLayout removal work started by 67957a45ee1ec42ae1671cdbfa0d73127346cc95.
Added:
Modified:
bolt/lib/Core/BinaryContext.cpp
llvm/include/llvm/MC/MCAssembler.h
llvm/lib/MC/MCAssembler.cpp
llvm/lib/MC/MCExpr.cpp
llvm/tools/dsymutil/MachOUtils.cpp
Removed:
################################################################################
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index 3bd715d487e0f..f28a0cd6eb9c6 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -20,7 +20,6 @@
#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
-#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
@@ -2416,8 +2415,7 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
MCAssembler &Assembler =
static_cast<MCObjectStreamer *>(Streamer.get())->getAssembler();
- MCAsmLayout Layout(Assembler);
- Assembler.layout(Layout);
+ Assembler.layout();
// Obtain fragment sizes.
std::vector<uint64_t> FragmentSizes;
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index df5ad0e7bdf4b..9cd65d388d247 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -46,7 +46,6 @@ class MCRelaxableFragment;
class MCSymbolRefExpr;
class raw_ostream;
class MCAsmBackend;
-class MCAsmLayout;
class MCContext;
class MCCodeEmitter;
class MCFragment;
@@ -341,7 +340,7 @@ class MCAssembler {
void Finish();
// Layout all section and prepare them for emission.
- void layout(MCAsmLayout &Layout);
+ void layout();
// FIXME: This does not belong here.
bool getSubsectionsViaSymbols() const { return SubsectionsViaSymbols; }
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 6866a58ecde59..4cafec6024a7e 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -15,7 +15,6 @@
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
-#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCCodeView.h"
#include "llvm/MC/MCContext.h"
@@ -937,7 +936,7 @@ MCAssembler::handleFixup(MCFragment &F, const MCFixup &Fixup,
return std::make_tuple(Target, FixedValue, IsResolved);
}
-void MCAssembler::layout(MCAsmLayout &Layout) {
+void MCAssembler::layout() {
assert(getBackendPtr() && "Expected assembler backend");
DEBUG_WITH_TYPE("mc-dump", {
errs() << "assembler backend - pre-layout\n--\n";
@@ -1074,9 +1073,7 @@ void MCAssembler::layout(MCAsmLayout &Layout) {
}
void MCAssembler::Finish() {
- // Create the layout object.
- MCAsmLayout Layout(*this);
- layout(Layout);
+ layout();
// Write the object file.
stats::ObjectBytes += getWriter().writeObject(*this);
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index 0a175ade68d78..b42a668bce23c 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -12,7 +12,6 @@
#include "llvm/Config/llvm-config.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
-#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectWriter.h"
diff --git a/llvm/tools/dsymutil/MachOUtils.cpp b/llvm/tools/dsymutil/MachOUtils.cpp
index fba66309ca20b..d2bdcf8542b84 100644
--- a/llvm/tools/dsymutil/MachOUtils.cpp
+++ b/llvm/tools/dsymutil/MachOUtils.cpp
@@ -12,7 +12,6 @@
#include "LinkUtils.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/CodeGen/NonRelocatableStringpool.h"
-#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCObjectStreamer.h"
@@ -381,8 +380,7 @@ bool generateDsymCompanion(
auto &Writer = static_cast<MachObjectWriter &>(MCAsm.getWriter());
// Layout but don't emit.
- MCAsmLayout Layout(MCAsm);
- MCAsm.layout(Layout);
+ MCAsm.layout();
BinaryHolder InputBinaryHolder(VFS, false);
More information about the llvm-commits
mailing list