Skip to content

Commit 35668e2

Browse files
authored
Remove llvm/MC/MCAsmLayout.h and the unused parameter in MCAssembler::layout
This restores 63ec52f and 46f7929, NFC changes that were unnecessarily reverted. This completes the work that merges MCAsmLayout into MCAssembler. Pull Request: llvm#97449
1 parent a1c4926 commit 35668e2

File tree

7 files changed

+5
-37
lines changed

7 files changed

+5
-37
lines changed

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
2121
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
2222
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
23-
#include "llvm/MC/MCAsmLayout.h"
2423
#include "llvm/MC/MCAssembler.h"
2524
#include "llvm/MC/MCContext.h"
2625
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
@@ -2416,8 +2415,7 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
24162415

24172416
MCAssembler &Assembler =
24182417
static_cast<MCObjectStreamer *>(Streamer.get())->getAssembler();
2419-
MCAsmLayout Layout(Assembler);
2420-
Assembler.layout(Layout);
2418+
Assembler.layout();
24212419

24222420
// Obtain fragment sizes.
24232421
std::vector<uint64_t> FragmentSizes;

clang/docs/tools/clang-formatted-files.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5357,7 +5357,6 @@ llvm/include/llvm/MC/MCAsmInfoELF.h
53575357
llvm/include/llvm/MC/MCAsmInfoGOFF.h
53585358
llvm/include/llvm/MC/MCAsmInfoWasm.h
53595359
llvm/include/llvm/MC/MCAsmInfoXCOFF.h
5360-
llvm/include/llvm/MC/MCAsmLayout.h
53615360
llvm/include/llvm/MC/MCCodeView.h
53625361
llvm/include/llvm/MC/MCContext.h
53635362
llvm/include/llvm/MC/MCFixedLenDisassembler.h

llvm/include/llvm/MC/MCAsmLayout.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

llvm/include/llvm/MC/MCAssembler.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class MCRelaxableFragment;
4646
class MCSymbolRefExpr;
4747
class raw_ostream;
4848
class MCAsmBackend;
49-
class MCAsmLayout;
5049
class MCContext;
5150
class MCCodeEmitter;
5251
class MCFragment;
@@ -341,7 +340,7 @@ class MCAssembler {
341340
void Finish();
342341

343342
// Layout all section and prepare them for emission.
344-
void layout(MCAsmLayout &Layout);
343+
void layout();
345344

346345
// FIXME: This does not belong here.
347346
bool getSubsectionsViaSymbols() const { return SubsectionsViaSymbols; }

llvm/lib/MC/MCAssembler.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "llvm/ADT/Twine.h"
1616
#include "llvm/MC/MCAsmBackend.h"
1717
#include "llvm/MC/MCAsmInfo.h"
18-
#include "llvm/MC/MCAsmLayout.h"
1918
#include "llvm/MC/MCCodeEmitter.h"
2019
#include "llvm/MC/MCCodeView.h"
2120
#include "llvm/MC/MCContext.h"
@@ -936,7 +935,7 @@ MCAssembler::handleFixup(MCFragment &F, const MCFixup &Fixup,
936935
return std::make_tuple(Target, FixedValue, IsResolved);
937936
}
938937

939-
void MCAssembler::layout(MCAsmLayout &Layout) {
938+
void MCAssembler::layout() {
940939
assert(getBackendPtr() && "Expected assembler backend");
941940
DEBUG_WITH_TYPE("mc-dump", {
942941
errs() << "assembler backend - pre-layout\n--\n";
@@ -1073,9 +1072,7 @@ void MCAssembler::layout(MCAsmLayout &Layout) {
10731072
}
10741073

10751074
void MCAssembler::Finish() {
1076-
// Create the layout object.
1077-
MCAsmLayout Layout(*this);
1078-
layout(Layout);
1075+
layout();
10791076

10801077
// Write the object file.
10811078
stats::ObjectBytes += getWriter().writeObject(*this);

llvm/lib/MC/MCExpr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "llvm/Config/llvm-config.h"
1313
#include "llvm/MC/MCAsmBackend.h"
1414
#include "llvm/MC/MCAsmInfo.h"
15-
#include "llvm/MC/MCAsmLayout.h"
1615
#include "llvm/MC/MCAssembler.h"
1716
#include "llvm/MC/MCContext.h"
1817
#include "llvm/MC/MCObjectWriter.h"

llvm/tools/dsymutil/MachOUtils.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "LinkUtils.h"
1313
#include "llvm/ADT/SmallString.h"
1414
#include "llvm/CodeGen/NonRelocatableStringpool.h"
15-
#include "llvm/MC/MCAsmLayout.h"
1615
#include "llvm/MC/MCAssembler.h"
1716
#include "llvm/MC/MCMachObjectWriter.h"
1817
#include "llvm/MC/MCObjectStreamer.h"
@@ -381,8 +380,7 @@ bool generateDsymCompanion(
381380
auto &Writer = static_cast<MachObjectWriter &>(MCAsm.getWriter());
382381

383382
// Layout but don't emit.
384-
MCAsmLayout Layout(MCAsm);
385-
MCAsm.layout(Layout);
383+
MCAsm.layout();
386384

387385
BinaryHolder InputBinaryHolder(VFS, false);
388386

0 commit comments

Comments
 (0)