Skip to content

Commit f595c67

Browse files
committed
[llvm] clang-format changes to MC and MCA libraries
1 parent 2c0c917 commit f595c67

Some content is hidden

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

52 files changed

+309
-261
lines changed

llvm/include/llvm/MC/MCAsmBackend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#ifndef LLVM_MC_MCASMBACKEND_H
1010
#define LLVM_MC_MCASMBACKEND_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/MC/MCDirectives.h"
1514
#include "llvm/MC/MCFixup.h"
15+
#include "llvm/Support/Compiler.h"
1616
#include "llvm/Support/Endian.h"
1717
#include <cstdint>
1818

llvm/include/llvm/MC/MCAsmInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
#ifndef LLVM_MC_MCASMINFO_H
1616
#define LLVM_MC_MCASMINFO_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/DenseMap.h"
2019
#include "llvm/ADT/StringMap.h"
2120
#include "llvm/ADT/StringRef.h"
2221
#include "llvm/MC/MCDirectives.h"
2322
#include "llvm/MC/MCTargetOptions.h"
23+
#include "llvm/Support/Compiler.h"
2424
#include <vector>
2525

2626
namespace llvm {
@@ -429,8 +429,8 @@ class LLVM_ABI MCAsmInfo {
429429
virtual ~MCAsmInfo();
430430

431431
// Explicitly non-copyable.
432-
MCAsmInfo(MCAsmInfo const&) = delete;
433-
MCAsmInfo& operator=(MCAsmInfo const&) = delete;
432+
MCAsmInfo(MCAsmInfo const &) = delete;
433+
MCAsmInfo &operator=(MCAsmInfo const &) = delete;
434434

435435
/// Get the code pointer size in bytes.
436436
unsigned getCodePointerSize() const { return CodePointerSize; }

llvm/include/llvm/MC/MCAsmMacro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#ifndef LLVM_MC_MCASMMACRO_H
1010
#define LLVM_MC_MCASMMACRO_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/APInt.h"
1413
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/Support/Compiler.h"
1515
#include "llvm/Support/Debug.h"
1616
#include "llvm/Support/SMLoc.h"
1717
#include <vector>

llvm/include/llvm/MC/MCAssembler.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLVM_MC_MCASSEMBLER_H
1010
#define LLVM_MC_MCASSEMBLER_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/ADT/SmallPtrSet.h"
1514
#include "llvm/ADT/SmallVector.h"
@@ -18,6 +17,7 @@
1817
#include "llvm/ADT/iterator_range.h"
1918
#include "llvm/MC/MCDwarf.h"
2019
#include "llvm/MC/MCSymbol.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include "llvm/Support/SMLoc.h"
2222
#include <algorithm>
2323
#include <cassert>
@@ -136,9 +136,10 @@ class MCAssembler {
136136
// concrete and require clients to pass in a target like object. The other
137137
// option is to make this abstract, and have targets provide concrete
138138
// implementations as we do with AsmParser.
139-
LLVM_ABI MCAssembler(MCContext &Context, std::unique_ptr<MCAsmBackend> Backend,
140-
std::unique_ptr<MCCodeEmitter> Emitter,
141-
std::unique_ptr<MCObjectWriter> Writer);
139+
LLVM_ABI MCAssembler(MCContext &Context,
140+
std::unique_ptr<MCAsmBackend> Backend,
141+
std::unique_ptr<MCCodeEmitter> Emitter,
142+
std::unique_ptr<MCObjectWriter> Writer);
142143
MCAssembler(const MCAssembler &) = delete;
143144
MCAssembler &operator=(const MCAssembler &) = delete;
144145

@@ -165,7 +166,8 @@ class MCAssembler {
165166
LLVM_ABI const MCSymbol *getBaseSymbol(const MCSymbol &Symbol) const;
166167

167168
/// Emit the section contents to \p OS.
168-
LLVM_ABI void writeSectionData(raw_ostream &OS, const MCSection *Section) const;
169+
LLVM_ABI void writeSectionData(raw_ostream &OS,
170+
const MCSection *Section) const;
169171

170172
/// Check whether a given symbol has been flagged with .thumb_func.
171173
LLVM_ABI bool isThumbFunc(const MCSymbol *Func) const;
@@ -229,8 +231,9 @@ class MCAssembler {
229231

230232
/// Write the necessary bundle padding to \p OS.
231233
/// Expects a fragment \p F containing instructions and its size \p FSize.
232-
LLVM_ABI void writeFragmentPadding(raw_ostream &OS, const MCEncodedFragment &F,
233-
uint64_t FSize) const;
234+
LLVM_ABI void writeFragmentPadding(raw_ostream &OS,
235+
const MCEncodedFragment &F,
236+
uint64_t FSize) const;
234237

235238
LLVM_ABI void reportError(SMLoc L, const Twine &Msg) const;
236239
// Record pending errors during layout iteration, as they may go away once the

llvm/include/llvm/MC/MCContext.h

Lines changed: 65 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,12 @@ class MCContext {
376376

377377
public:
378378
LLVM_ABI explicit MCContext(const Triple &TheTriple, const MCAsmInfo *MAI,
379-
const MCRegisterInfo *MRI, const MCSubtargetInfo *MSTI,
380-
const SourceMgr *Mgr = nullptr,
381-
MCTargetOptions const *TargetOpts = nullptr,
382-
bool DoAutoReset = true,
383-
StringRef Swift5ReflSegmentName = {});
379+
const MCRegisterInfo *MRI,
380+
const MCSubtargetInfo *MSTI,
381+
const SourceMgr *Mgr = nullptr,
382+
MCTargetOptions const *TargetOpts = nullptr,
383+
bool DoAutoReset = true,
384+
StringRef Swift5ReflSegmentName = {});
384385
MCContext(const MCContext &) = delete;
385386
MCContext &operator=(const MCContext &) = delete;
386387
LLVM_ABI ~MCContext();
@@ -448,7 +449,8 @@ class MCContext {
448449
/// in the symbol table if UseNamesOnTempLabels is false (default except
449450
/// MCAsmStreamer). The overload without Name uses an unspecified name.
450451
LLVM_ABI MCSymbol *createTempSymbol();
451-
LLVM_ABI MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix = true);
452+
LLVM_ABI MCSymbol *createTempSymbol(const Twine &Name,
453+
bool AlwaysAddSuffix = true);
452454

453455
/// Create a temporary symbol with a unique name whose name cannot be
454456
/// omitted in the symbol table. This is rarely used.
@@ -459,7 +461,8 @@ class MCContext {
459461
/// this behaves like createTempSymbol, except that it uses the
460462
/// PrivateLabelPrefix instead of the PrivateGlobalPrefix. When AlwaysEmit is
461463
/// true, behaves like getOrCreateSymbol, prefixed with PrivateLabelPrefix.
462-
LLVM_ABI MCSymbol *createBlockSymbol(const Twine &Name, bool AlwaysEmit = false);
464+
LLVM_ABI MCSymbol *createBlockSymbol(const Twine &Name,
465+
bool AlwaysEmit = false);
463466

464467
/// Create a local, non-temporary symbol like an ELF mapping symbol. Calling
465468
/// the function with the same name will generate new, unique instances.
@@ -471,7 +474,8 @@ class MCContext {
471474

472475
/// Create and return a directional local symbol for numbered label (used
473476
/// for "1b" or 1f" references).
474-
LLVM_ABI MCSymbol *getDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before);
477+
LLVM_ABI MCSymbol *getDirectionalLocalSymbol(unsigned LocalLabelVal,
478+
bool Before);
475479

476480
/// Lookup the symbol inside with the specified \p Name. If it exists,
477481
/// return it. If not, create a forward reference and return it.
@@ -483,7 +487,8 @@ class MCContext {
483487
/// variable after codegen.
484488
///
485489
/// \param Idx - The index of a local variable passed to \@llvm.localescape.
486-
LLVM_ABI MCSymbol *getOrCreateFrameAllocSymbol(const Twine &FuncName, unsigned Idx);
490+
LLVM_ABI MCSymbol *getOrCreateFrameAllocSymbol(const Twine &FuncName,
491+
unsigned Idx);
487492

488493
LLVM_ABI MCSymbol *getOrCreateParentFrameOffsetSymbol(const Twine &FuncName);
489494

@@ -498,7 +503,8 @@ class MCContext {
498503
LLVM_ABI MCSymbol *cloneSymbol(MCSymbol &Sym);
499504

500505
/// Set value for a symbol.
501-
LLVM_ABI void setSymbolValue(MCStreamer &Streamer, const Twine &Sym, uint64_t Val);
506+
LLVM_ABI void setSymbolValue(MCStreamer &Streamer, const Twine &Sym,
507+
uint64_t Val);
502508

503509
/// getSymbols - Get a reference for the symbol table for clients that
504510
/// want to, for example, iterate over all symbols. 'const' because we
@@ -528,9 +534,9 @@ class MCContext {
528534
/// Return the MCSection for the specified mach-o section. This requires
529535
/// the operands to be valid.
530536
LLVM_ABI MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
531-
unsigned TypeAndAttributes,
532-
unsigned Reserved2, SectionKind K,
533-
const char *BeginSymName = nullptr);
537+
unsigned TypeAndAttributes,
538+
unsigned Reserved2, SectionKind K,
539+
const char *BeginSymName = nullptr);
534540

535541
MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
536542
unsigned TypeAndAttributes, SectionKind K,
@@ -558,53 +564,59 @@ class MCContext {
558564
}
559565

560566
LLVM_ABI MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
561-
unsigned Flags, unsigned EntrySize,
562-
const Twine &Group, bool IsComdat,
563-
unsigned UniqueID,
564-
const MCSymbolELF *LinkedToSym);
567+
unsigned Flags, unsigned EntrySize,
568+
const Twine &Group, bool IsComdat,
569+
unsigned UniqueID,
570+
const MCSymbolELF *LinkedToSym);
565571

566572
LLVM_ABI MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
567-
unsigned Flags, unsigned EntrySize,
568-
const MCSymbolELF *Group, bool IsComdat,
569-
unsigned UniqueID,
570-
const MCSymbolELF *LinkedToSym);
573+
unsigned Flags, unsigned EntrySize,
574+
const MCSymbolELF *Group, bool IsComdat,
575+
unsigned UniqueID,
576+
const MCSymbolELF *LinkedToSym);
571577

572578
/// Get a section with the provided group identifier. This section is
573579
/// named by concatenating \p Prefix with '.' then \p Suffix. The \p Type
574580
/// describes the type of the section and \p Flags are used to further
575581
/// configure this named section.
576-
LLVM_ABI MCSectionELF *getELFNamedSection(const Twine &Prefix, const Twine &Suffix,
577-
unsigned Type, unsigned Flags,
578-
unsigned EntrySize = 0);
582+
LLVM_ABI MCSectionELF *getELFNamedSection(const Twine &Prefix,
583+
const Twine &Suffix, unsigned Type,
584+
unsigned Flags,
585+
unsigned EntrySize = 0);
579586

580-
LLVM_ABI MCSectionELF *createELFRelSection(const Twine &Name, unsigned Type,
581-
unsigned Flags, unsigned EntrySize,
582-
const MCSymbolELF *Group,
583-
const MCSectionELF *RelInfoSection);
587+
LLVM_ABI MCSectionELF *
588+
createELFRelSection(const Twine &Name, unsigned Type, unsigned Flags,
589+
unsigned EntrySize, const MCSymbolELF *Group,
590+
const MCSectionELF *RelInfoSection);
584591

585-
LLVM_ABI MCSectionELF *createELFGroupSection(const MCSymbolELF *Group, bool IsComdat);
592+
LLVM_ABI MCSectionELF *createELFGroupSection(const MCSymbolELF *Group,
593+
bool IsComdat);
586594

587-
LLVM_ABI void recordELFMergeableSectionInfo(StringRef SectionName, unsigned Flags,
588-
unsigned UniqueID, unsigned EntrySize);
595+
LLVM_ABI void recordELFMergeableSectionInfo(StringRef SectionName,
596+
unsigned Flags, unsigned UniqueID,
597+
unsigned EntrySize);
589598

590599
LLVM_ABI bool isELFImplicitMergeableSectionNamePrefix(StringRef Name);
591600

592601
LLVM_ABI bool isELFGenericMergeableSection(StringRef Name);
593602

594603
/// Return the unique ID of the section with the given name, flags and entry
595604
/// size, if it exists.
596-
LLVM_ABI std::optional<unsigned> getELFUniqueIDForEntsize(StringRef SectionName,
597-
unsigned Flags,
598-
unsigned EntrySize);
605+
LLVM_ABI std::optional<unsigned>
606+
getELFUniqueIDForEntsize(StringRef SectionName, unsigned Flags,
607+
unsigned EntrySize);
599608

600609
LLVM_ABI MCSectionGOFF *getGOFFSection(StringRef Section, SectionKind Kind,
601-
MCSection *Parent, uint32_t Subsection = 0);
610+
MCSection *Parent,
611+
uint32_t Subsection = 0);
602612

603-
LLVM_ABI MCSectionCOFF *getCOFFSection(StringRef Section, unsigned Characteristics,
604-
StringRef COMDATSymName, int Selection,
605-
unsigned UniqueID = MCSection::NonUniqueID);
613+
LLVM_ABI MCSectionCOFF *
614+
getCOFFSection(StringRef Section, unsigned Characteristics,
615+
StringRef COMDATSymName, int Selection,
616+
unsigned UniqueID = MCSection::NonUniqueID);
606617

607-
LLVM_ABI MCSectionCOFF *getCOFFSection(StringRef Section, unsigned Characteristics);
618+
LLVM_ABI MCSectionCOFF *getCOFFSection(StringRef Section,
619+
unsigned Characteristics);
608620

609621
/// Gets or creates a section equivalent to Sec that is associated with the
610622
/// section containing KeySym. For example, to create a debug info section
@@ -622,18 +634,20 @@ class MCContext {
622634
}
623635

624636
LLVM_ABI MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
625-
unsigned Flags, const Twine &Group,
626-
unsigned UniqueID);
637+
unsigned Flags, const Twine &Group,
638+
unsigned UniqueID);
627639

628640
LLVM_ABI MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
629-
unsigned Flags, const MCSymbolWasm *Group,
630-
unsigned UniqueID);
641+
unsigned Flags,
642+
const MCSymbolWasm *Group,
643+
unsigned UniqueID);
631644

632645
/// Get the section for the provided Section name
633-
LLVM_ABI MCSectionDXContainer *getDXContainerSection(StringRef Section, SectionKind K);
646+
LLVM_ABI MCSectionDXContainer *getDXContainerSection(StringRef Section,
647+
SectionKind K);
634648

635649
LLVM_ABI bool hasXCOFFSection(StringRef Section,
636-
XCOFF::CsectProperties CsectProp) const;
650+
XCOFF::CsectProperties CsectProp) const;
637651

638652
LLVM_ABI MCSectionXCOFF *getXCOFFSection(
639653
StringRef Section, SectionKind K,
@@ -661,7 +675,8 @@ class MCContext {
661675
void setCompilationDir(StringRef S) { CompilationDir = S.str(); }
662676

663677
/// Add an entry to the debug prefix map.
664-
LLVM_ABI void addDebugPrefixMapEntry(const std::string &From, const std::string &To);
678+
LLVM_ABI void addDebugPrefixMapEntry(const std::string &From,
679+
const std::string &To);
665680

666681
/// Remap one path in-place as per the debug prefix map.
667682
LLVM_ABI void remapDebugPath(SmallVectorImpl<char> &Path);
@@ -678,11 +693,10 @@ class MCContext {
678693
void setMainFileName(StringRef S) { MainFileName = std::string(S); }
679694

680695
/// Creates an entry in the dwarf file and directory tables.
681-
LLVM_ABI Expected<unsigned> getDwarfFile(StringRef Directory, StringRef FileName,
682-
unsigned FileNumber,
683-
std::optional<MD5::MD5Result> Checksum,
684-
std::optional<StringRef> Source,
685-
unsigned CUID);
696+
LLVM_ABI Expected<unsigned>
697+
getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber,
698+
std::optional<MD5::MD5Result> Checksum,
699+
std::optional<StringRef> Source, unsigned CUID);
686700

687701
LLVM_ABI bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID = 0);
688702

llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#ifndef LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H
1010
#define LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/StringRef.h"
1413
#include "llvm/BinaryFormat/XCOFF.h"
1514
#include "llvm/MC/MCDisassembler/MCSymbolizer.h"
15+
#include "llvm/Support/Compiler.h"
1616
#include "llvm/Support/Error.h"
1717
#include <cstdint>
1818
#include <memory>

llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#ifndef LLVM_MC_MCDISASSEMBLER_MCSYMBOLIZER_H
1616
#define LLVM_MC_MCDISASSEMBLER_MCSYMBOLIZER_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/ArrayRef.h"
2019
#include "llvm/MC/MCDisassembler/MCRelocationInfo.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include <cstdint>
2222
#include <memory>
2323
#include <utility>

0 commit comments

Comments
 (0)