Skip to content

Commit 7576e13

Browse files
committed
Change code as recommended by MaskRay
1 parent 0b54967 commit 7576e13

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

llvm/include/llvm/MC/MCContext.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ class MCContext {
364364
MCSymbolXCOFF *createXCOFFSymbolImpl(const MCSymbolTableEntry *Name,
365365
bool IsTemporary);
366366

367+
template <typename TAttr>
368+
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
369+
TAttr SDAttributes, MCSection *Parent);
370+
367371
/// Map of currently defined macros.
368372
StringMap<MCAsmMacro> MacroMap;
369373

@@ -600,12 +604,6 @@ class MCContext {
600604
unsigned Flags,
601605
unsigned EntrySize);
602606

603-
private:
604-
template <typename TAttr>
605-
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
606-
TAttr SDAttributes, MCSection *Parent);
607-
608-
public:
609607
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
610608
GOFF::SDAttr SDAttributes);
611609
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,

llvm/lib/MC/MCGOFFStreamer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@ GOFFObjectWriter &MCGOFFStreamer::getWriter() {
2727
return static_cast<GOFFObjectWriter &>(getAssembler().getWriter());
2828
}
2929

30-
namespace {
3130
// Make sure that all section are registered in the correct order.
32-
void registerSectionHierarchy(MCAssembler &Asm, MCSectionGOFF *Section) {
31+
static void registerSectionHierarchy(MCAssembler &Asm, MCSectionGOFF *Section) {
3332
if (Section->isRegistered())
3433
return;
3534
if (Section->getParent())
3635
registerSectionHierarchy(Asm, Section->getParent());
3736
Asm.registerSection(*Section);
3837
}
39-
} // namespace
4038

4139
void MCGOFFStreamer::changeSection(MCSection *Section, uint32_t Subsection) {
4240
registerSectionHierarchy(getAssembler(),

llvm/lib/MC/MCSectionGOFF.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212

1313
using namespace llvm;
1414

15-
namespace {
16-
void emitCATTR(raw_ostream &OS, StringRef Name, GOFF::ESDRmode Rmode,
17-
GOFF::ESDAlignment Alignment,
18-
GOFF::ESDLoadingBehavior LoadBehavior,
19-
GOFF::ESDExecutable Executable, bool IsReadOnly,
20-
uint32_t SortKey, StringRef PartName) {
15+
static void emitCATTR(raw_ostream &OS, StringRef Name, GOFF::ESDRmode Rmode,
16+
GOFF::ESDAlignment Alignment,
17+
GOFF::ESDLoadingBehavior LoadBehavior,
18+
GOFF::ESDExecutable Executable, bool IsReadOnly,
19+
uint32_t SortKey, StringRef PartName) {
2120
OS << Name << " CATTR ";
2221
OS << "ALIGN(" << static_cast<unsigned>(Alignment) << ")";
2322
switch (LoadBehavior) {
@@ -67,9 +66,10 @@ void emitCATTR(raw_ostream &OS, StringRef Name, GOFF::ESDRmode Rmode,
6766
OS << '\n';
6867
}
6968

70-
void emitXATTR(raw_ostream &OS, StringRef Name, GOFF::ESDLinkageType Linkage,
71-
GOFF::ESDExecutable Executable,
72-
GOFF::ESDBindingScope BindingScope) {
69+
static void emitXATTR(raw_ostream &OS, StringRef Name,
70+
GOFF::ESDLinkageType Linkage,
71+
GOFF::ESDExecutable Executable,
72+
GOFF::ESDBindingScope BindingScope) {
7373
OS << Name << " XATTR ";
7474
OS << "LINKAGE(" << (Linkage == GOFF::ESD_LT_OS ? "OS" : "XPLINK") << "),";
7575
if (Executable != GOFF::ESD_EXE_Unspecified)
@@ -97,7 +97,6 @@ void emitXATTR(raw_ostream &OS, StringRef Name, GOFF::ESDLinkageType Linkage,
9797
}
9898
OS << '\n';
9999
}
100-
} // namespace
101100

102101
void MCSectionGOFF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
103102
raw_ostream &OS,

0 commit comments

Comments
 (0)