Skip to content

Commit 7a36913

Browse files
MSMazayaquic-seaswara
authored andcommitted
Rename all LayoutPrinter class to LayoutInfo
Update `LayoutPrinter` class name to `LayoutInfo` to better reflect their current usage and purpose. Closes #76 Signed-off-by: Muhammad Sulthan Mazaya <[email protected]>
1 parent 7a1f56f commit 7a36913

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+506
-506
lines changed

include/eld/Core/LinkerScript.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ChangeOutputSectionOp;
4545
class DiagnosticEngine;
4646
class ELFSection;
4747
class GeneralOptions;
48-
class LayoutPrinter;
48+
class LayoutInfo;
4949
class LDSymbol;
5050
class OutputTarWriter;
5151
class RuleContainer;
@@ -96,7 +96,7 @@ class LinkerScript {
9696
PhdrSpecList &phdrList() { return PhdrList; }
9797

9898
void createSectionMap(LinkerScript &L, const LinkerConfig &Config,
99-
LayoutPrinter *LayoutPrinter);
99+
LayoutInfo *LayoutInfo);
100100

101101
SectionMap &sectionMap() const { return *OutputSectionMap; }
102102

include/eld/Core/Module.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "eld/Config/GeneralOptions.h"
2121
#include "eld/Core/Linker.h"
2222
#include "eld/Input/InputFile.h"
23-
#include "eld/LayoutMap/LayoutPrinter.h"
23+
#include "eld/LayoutMap/LayoutInfo.h"
2424
#include "eld/Plugin/PluginManager.h"
2525
#include "eld/PluginAPI/LinkerWrapper.h"
2626
#include "eld/Script/StrToken.h"
@@ -140,10 +140,10 @@ class Module {
140140

141141
public:
142142
explicit Module(LinkerScript &CurScript, LinkerConfig &Config,
143-
LayoutPrinter *LayoutPrinter);
143+
LayoutInfo *LayoutInfo);
144144

145145
Module(const std::string &Name, LinkerScript &CurScript, LinkerConfig &Config,
146-
LayoutPrinter *LayoutPrinter);
146+
LayoutInfo *LayoutInfo);
147147

148148
~Module();
149149

@@ -319,7 +319,7 @@ class Module {
319319
std::string Name, uint32_t Type,
320320
uint32_t PFlag, uint32_t PAlign);
321321

322-
LayoutPrinter *getLayoutPrinter() { return ThisLayoutPrinter; }
322+
LayoutInfo *getLayoutInfo() { return ThisLayoutInfo; }
323323

324324
// Section symbols and all other symbols that live in the output.
325325
void recordSectionSymbol(ELFSection *S, ResolveInfo *R) {
@@ -660,7 +660,7 @@ class Module {
660660
LDSymbol *DotSymbol = nullptr;
661661
Linker *Linker = nullptr;
662662
GNULDBackend *Backend = nullptr;
663-
LayoutPrinter *ThisLayoutPrinter = nullptr;
663+
LayoutInfo *ThisLayoutInfo = nullptr;
664664
bool Failure = false;
665665
bool UsesLto = false;
666666
plugin::LinkerWrapper::State State = plugin::LinkerWrapper::Unknown;

include/eld/LayoutMap/LayoutPrinter.h renamed to include/eld/LayoutMap/LayoutInfo.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- LayoutPrinter.h-----------------------------------------------------===//
1+
//===- LayoutInfo.h-----------------------------------------------------===//
22
// Part of the eld Project, under the BSD License
33
// See https://github.com/qualcomm/eld/LICENSE.txt for license information.
44
// SPDX-License-Identifier: BSD-3-Clause
@@ -69,7 +69,7 @@ struct LayoutFragmentInfo {
6969
std::vector<LDSymbol *> Symbols;
7070
};
7171

72-
class LayoutPrinter {
72+
class LayoutInfo {
7373
static uint32_t LayoutDetail;
7474

7575
public:
@@ -182,7 +182,7 @@ class LayoutPrinter {
182182

183183
// -------------------End Typedefs ---------------------------------
184184

185-
LayoutPrinter(LinkerConfig &PConfig);
185+
LayoutInfo(LinkerConfig &PConfig);
186186

187187
bool showStrings() const { return LayoutDetail & ShowStrings; }
188188

@@ -230,7 +230,7 @@ class LayoutPrinter {
230230
void recordOutputFileSize(uint32_t Sz) { LinkStats.OutputFileSize = Sz; }
231231

232232
// FIXME: Destructor is redundant here.
233-
~LayoutPrinter() { destroy(); }
233+
~LayoutInfo() { destroy(); }
234234

235235
// FIXME: This function is not required.
236236
void destroy() {
@@ -450,7 +450,7 @@ class LayoutPrinter {
450450
LinkerConfig &ThisConfig;
451451
/// It is required to compute relative path when -MapDetail
452452
/// 'show-relative-path=...' is used.
453-
// It needs to be 'static' because LayoutPrinter::setLayoutDetail member
453+
// It needs to be 'static' because LayoutInfo::setLayoutDetail member
454454
// function is static.
455455
static std::optional<std::string> ThisBasepath;
456456
std::optional<uint32_t> OutputFileSize;

include/eld/LayoutMap/TextLayoutPrinter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define ELD_LAYOUTMAP_TEXTLAYOUTPRINTER_H
99
#include "eld/Diagnostics/DiagnosticPrinter.h"
1010
#include "eld/Input/Input.h"
11-
#include "eld/LayoutMap/LayoutPrinter.h"
11+
#include "eld/LayoutMap/LayoutInfo.h"
1212
#include "eld/Readers/ELFSection.h"
1313
#include "eld/Support/MemoryArea.h"
1414
#include "eld/Support/MemoryRegion.h"
@@ -25,7 +25,7 @@ class LinkerConfig;
2525

2626
class TextLayoutPrinter {
2727
public:
28-
TextLayoutPrinter(LayoutPrinter *ThisLayoutPrinter);
28+
TextLayoutPrinter(LayoutInfo *ThisLayoutInfo);
2929

3030
eld::Expected<void> init();
3131

@@ -115,7 +115,7 @@ class TextLayoutPrinter {
115115
int64_t FillValue, bool IsAlign,
116116
bool UseColor = false) const;
117117

118-
void printStats(LayoutPrinter::Stats &L, const Module &Module);
118+
void printStats(LayoutInfo::Stats &L, const Module &Module);
119119

120120
void printStat(llvm::StringRef S, uint64_t Stats);
121121

@@ -160,7 +160,7 @@ class TextLayoutPrinter {
160160
std::string Storage;
161161
std::unique_ptr<llvm::raw_string_ostream> Buffer = nullptr;
162162
std::unique_ptr<llvm::raw_fd_ostream> LayoutFile = nullptr;
163-
LayoutPrinter *ThisLayoutPrinter = nullptr;
163+
LayoutInfo *ThisLayoutInfo = nullptr;
164164
};
165165

166166
} // namespace eld

include/eld/LayoutMap/YamlLayoutPrinter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define ELD_LAYOUTMAP_YAMLLAYOUTPRINTER_H
99

1010
#include "eld/LayoutMap/LDYAML.h"
11-
#include "eld/LayoutMap/LayoutPrinter.h"
11+
#include "eld/LayoutMap/LayoutInfo.h"
1212
#include "eld/Support/MemoryArea.h"
1313
#include "eld/Support/MemoryRegion.h"
1414
#include "eld/Target/GNULDBackend.h"
@@ -26,7 +26,7 @@ struct CommandLineDefault {
2626
class YamlLayoutPrinter {
2727

2828
public:
29-
YamlLayoutPrinter(LayoutPrinter *P);
29+
YamlLayoutPrinter(LayoutInfo *layoutInfo);
3030

3131
eld::Expected<void> init();
3232

@@ -50,7 +50,7 @@ class YamlLayoutPrinter {
5050

5151
eld::LDYAML::LinkStats addStat(std::string S, uint64_t Count);
5252

53-
void addStats(LayoutPrinter::Stats &L,
53+
void addStats(LayoutInfo::Stats &L,
5454
std::vector<eld::LDYAML::LinkStats> &S);
5555

5656
void insertCommons(std::vector<eld::LDYAML::Common> &Commons,
@@ -64,7 +64,7 @@ class YamlLayoutPrinter {
6464
std::string CommandLine;
6565
llvm::raw_fd_ostream *LayoutFile;
6666
llvm::raw_fd_ostream *TrampolineLayoutFile;
67-
LayoutPrinter *ThisLayoutPrinter = nullptr;
67+
LayoutInfo *ThisLayoutInfo = nullptr;
6868
};
6969

7070
} // namespace eld

include/eld/Object/SectionMap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
namespace eld {
2626

2727
class ELFSection;
28-
class LayoutPrinter;
28+
class LayoutInfo;
2929
class LinkerScript;
3030
class LinkerConfig;
3131
class EhFrameHdrSection;
@@ -48,7 +48,7 @@ class SectionMap {
4848

4949
public:
5050
SectionMap(LinkerScript &L, const LinkerConfig &Config,
51-
LayoutPrinter *LayoutPrinter);
51+
LayoutInfo *LayoutInfo);
5252

5353
~SectionMap();
5454

@@ -182,7 +182,7 @@ class SectionMap {
182182
SpecialSections;
183183
std::vector<ELFSection *> MEntrySections;
184184
const DiagnosticPrinter *MPrinter;
185-
LayoutPrinter *MLayoutPrinter = nullptr;
185+
LayoutInfo *MLayoutInfo = nullptr;
186186
};
187187

188188
} // namespace eld

include/eld/SymbolResolver/IRBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Module;
3333
class LinkerConfig;
3434
class InputTree;
3535
class InputFile;
36-
class LayoutPrinter;
36+
class LayoutInfo;
3737

3838
class IRBuilder {
3939
public:

include/eld/SymbolResolver/NamePool.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace eld {
3131

32-
class LayoutPrinter;
32+
class LayoutInfo;
3333
class LDSymbol;
3434
class Module;
3535
class PluginManager;
@@ -84,7 +84,7 @@ class NamePool {
8484

8585
LDSymbol *createPluginSymbol(InputFile *Input, std::string SymbolName,
8686
Fragment *CurFragment, uint64_t Val,
87-
LayoutPrinter *LP);
87+
LayoutInfo *layoutInfo);
8888

8989
size_t getNumGlobalSize() const { return GlobalSymbols.size(); }
9090

include/eld/Target/GNULDBackend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef ELD_TARGET_GNULDBACKEND_H
1414
#define ELD_TARGET_GNULDBACKEND_H
1515
#include "eld/GarbageCollection/GarbageCollection.h"
16-
#include "eld/LayoutMap/LayoutPrinter.h"
16+
#include "eld/LayoutMap/LayoutInfo.h"
1717
#include "eld/Object/ObjectBuilder.h"
1818
#include "eld/Readers/CommonELFSection.h"
1919
#include "eld/Readers/ELFExecObjParser.h"

lib/BranchIsland/BranchIslandFactory.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "eld/Config/LinkerConfig.h"
1616
#include "eld/Core/Module.h"
1717
#include "eld/Fragment/Fragment.h"
18-
#include "eld/LayoutMap/LayoutPrinter.h"
18+
#include "eld/LayoutMap/LayoutInfo.h"
1919
#include "eld/Object/ObjectLinker.h"
2020
#include "eld/Readers/ELFSection.h"
2121
#include "eld/Support/Memory.h"
@@ -83,7 +83,7 @@ BranchIslandFactory::createBranchIsland(Relocation &PReloc, Stub *S,
8383
eld::IRBuilder &PBuilder,
8484
const Relocator *PRelocator) {
8585
Module &PModule = PBuilder.getModule();
86-
LayoutPrinter *LayoutPrinter = PBuilder.getModule().getLayoutPrinter();
86+
LayoutInfo *LayoutInfo = PBuilder.getModule().getLayoutInfo();
8787

8888
bool CloneFrag = false;
8989

@@ -331,12 +331,12 @@ BranchIslandFactory::createBranchIsland(Relocation &PReloc, Stub *S,
331331
MatchedSection->splice(CurNodeIter, ToBeInsertedFrags);
332332
Symbol->resolveInfo()->setResolvedOrigin(TrampolineInput);
333333

334-
if (LayoutPrinter && !LayoutPrinter->showOnlyLayout()) {
334+
if (LayoutInfo && !LayoutInfo->showOnlyLayout()) {
335335
std::lock_guard<std::mutex> Guard(Mutex);
336-
LayoutPrinter->recordFragment(TrampolineInput, TrampolineInputSection,
336+
LayoutInfo->recordFragment(TrampolineInput, TrampolineInputSection,
337337
Clone);
338-
LayoutPrinter->recordSymbol(Clone, Symbol);
339-
LayoutPrinter->recordTrampolines();
338+
LayoutInfo->recordSymbol(Clone, Symbol);
339+
LayoutInfo->recordTrampolines();
340340
}
341341

342342
OutputElfSection->getOutputSection()->addBranchIsland(PReloc.symInfo(),

0 commit comments

Comments
 (0)