diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-02-08 22:23:19 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-02-08 22:23:19 +0000 |
commit | 498b48e527cc66ce469df79e1c6c5005d4255313 (patch) | |
tree | 659ee030dfe1fabd85e1c049f549b36be0ee803b | |
parent | 2ba05b10d12b65883381225e02cc8dd47a1ab805 (diff) |
[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294526 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/MC/MCAsmBackend.h | 20 | ||||
-rw-r--r-- | include/llvm/MC/MCCodeEmitter.h | 15 | ||||
-rw-r--r-- | include/llvm/MC/MCDisassembler/MCDisassembler.h | 17 | ||||
-rw-r--r-- | include/llvm/MC/MCDisassembler/MCRelocationInfo.h | 18 | ||||
-rw-r--r-- | include/llvm/MC/MCDisassembler/MCSymbolizer.h | 16 | ||||
-rw-r--r-- | include/llvm/MC/MCLabel.h | 12 | ||||
-rw-r--r-- | include/llvm/MC/MCObjectWriter.h | 19 | ||||
-rw-r--r-- | include/llvm/MC/MCSection.h | 29 | ||||
-rw-r--r-- | include/llvm/MC/MCSubtargetInfo.h | 21 | ||||
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 24 | ||||
-rw-r--r-- | lib/MC/MCAsmBackend.cpp | 13 | ||||
-rw-r--r-- | lib/MC/MCCodeEmitter.cpp | 8 | ||||
-rw-r--r-- | lib/MC/MCDisassembler/MCDisassembler.cpp | 7 | ||||
-rw-r--r-- | lib/MC/MCDisassembler/MCRelocationInfo.cpp | 11 | ||||
-rw-r--r-- | lib/MC/MCDisassembler/MCSymbolizer.cpp | 5 | ||||
-rw-r--r-- | lib/MC/MCLabel.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCObjectWriter.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCSection.cpp | 20 | ||||
-rw-r--r-- | lib/MC/MCSubtargetInfo.cpp | 9 | ||||
-rw-r--r-- | lib/MC/MCSymbol.cpp | 8 |
20 files changed, 142 insertions, 138 deletions
diff --git a/include/llvm/MC/MCAsmBackend.h b/include/llvm/MC/MCAsmBackend.h index d4bdbcd2baa..5537b97ed42 100644 --- a/include/llvm/MC/MCAsmBackend.h +++ b/include/llvm/MC/MCAsmBackend.h @@ -1,4 +1,4 @@ -//===-- llvm/MC/MCAsmBackend.h - MC Asm Backend -----------------*- C++ -*-===// +//===- llvm/MC/MCAsmBackend.h - MC Asm Backend ------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,35 +12,33 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" +#include "llvm/ADT/StringRef.h" #include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCFixup.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/ErrorHandling.h" +#include <cstdint> namespace llvm { + class MCAsmLayout; class MCAssembler; class MCCFIInstruction; -class MCELFObjectTargetWriter; struct MCFixupKindInfo; class MCFragment; class MCInst; -class MCRelaxableFragment; class MCObjectWriter; -class MCSection; +class MCRelaxableFragment; class MCSubtargetInfo; class MCValue; class raw_pwrite_stream; /// Generic interface to target specific assembler backends. class MCAsmBackend { - MCAsmBackend(const MCAsmBackend &) = delete; - void operator=(const MCAsmBackend &) = delete; - protected: // Can only create subclasses. MCAsmBackend(); public: + MCAsmBackend(const MCAsmBackend &) = delete; + MCAsmBackend &operator=(const MCAsmBackend &) = delete; virtual ~MCAsmBackend(); /// lifetime management @@ -136,6 +134,6 @@ public: } }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_MC_MCASMBACKEND_H diff --git a/include/llvm/MC/MCCodeEmitter.h b/include/llvm/MC/MCCodeEmitter.h index b6c19150c12..f1b0b784a2d 100644 --- a/include/llvm/MC/MCCodeEmitter.h +++ b/include/llvm/MC/MCCodeEmitter.h @@ -1,4 +1,4 @@ -//===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===// +//===- llvm/MC/MCCodeEmitter.h - Instruction Encoding -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,9 +10,8 @@ #ifndef LLVM_MC_MCCODEEMITTER_H #define LLVM_MC_MCCODEEMITTER_H -#include "llvm/Support/Compiler.h" - namespace llvm { + class MCFixup; class MCInst; class MCSubtargetInfo; @@ -21,14 +20,12 @@ template<typename T> class SmallVectorImpl; /// MCCodeEmitter - Generic instruction encoding interface. class MCCodeEmitter { -private: - MCCodeEmitter(const MCCodeEmitter &) = delete; - void operator=(const MCCodeEmitter &) = delete; - protected: // Can only create subclasses. MCCodeEmitter(); public: + MCCodeEmitter(const MCCodeEmitter &) = delete; + MCCodeEmitter &operator=(const MCCodeEmitter &) = delete; virtual ~MCCodeEmitter(); /// Lifetime management @@ -41,6 +38,6 @@ public: const MCSubtargetInfo &STI) const = 0; }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_MC_MCCODEEMITTER_H diff --git a/include/llvm/MC/MCDisassembler/MCDisassembler.h b/include/llvm/MC/MCDisassembler/MCDisassembler.h index 9006d87abb4..5e626f18698 100644 --- a/include/llvm/MC/MCDisassembler/MCDisassembler.h +++ b/include/llvm/MC/MCDisassembler/MCDisassembler.h @@ -1,4 +1,4 @@ -//===-- llvm/MC/MCDisassembler.h - Disassembler interface -------*- C++ -*-===// +//===- llvm/MC/MCDisassembler.h - Disassembler interface --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,20 +6,21 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// + #ifndef LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H #define LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H -#include "llvm-c/Disassembler.h" #include "llvm/MC/MCDisassembler/MCSymbolizer.h" -#include "llvm/Support/DataTypes.h" +#include <cstdint> +#include <memory> namespace llvm { template <typename T> class ArrayRef; +class MCContext; class MCInst; class MCSubtargetInfo; class raw_ostream; -class MCContext; /// Superclass for all disassemblers. Consumes a memory region and provides an /// array of assembly instructions. @@ -54,7 +55,7 @@ public: }; MCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) - : Ctx(Ctx), STI(STI), Symbolizer(), CommentStream(nullptr) {} + : Ctx(Ctx), STI(STI) {} virtual ~MCDisassembler(); @@ -105,9 +106,9 @@ public: // Marked mutable because we cache it inside the disassembler, rather than // having to pass it around as an argument through all the autogenerated code. - mutable raw_ostream *CommentStream; + mutable raw_ostream *CommentStream = nullptr; }; -} // namespace llvm +} // end namespace llvm -#endif +#endif // LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H diff --git a/include/llvm/MC/MCDisassembler/MCRelocationInfo.h b/include/llvm/MC/MCDisassembler/MCRelocationInfo.h index 25334f755ee..7836e886c30 100644 --- a/include/llvm/MC/MCDisassembler/MCRelocationInfo.h +++ b/include/llvm/MC/MCDisassembler/MCRelocationInfo.h @@ -1,4 +1,4 @@ -//==-- llvm/MC/MCRelocationInfo.h --------------------------------*- C++ -*-==// +//===- llvm/MC/MCRelocationInfo.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -16,26 +16,20 @@ #ifndef LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H #define LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H -#include "llvm/Support/Compiler.h" - namespace llvm { -namespace object { -class RelocationRef; -} -class MCExpr; class MCContext; +class MCExpr; /// \brief Create MCExprs from relocations found in an object file. class MCRelocationInfo { - MCRelocationInfo(const MCRelocationInfo &) = delete; - void operator=(const MCRelocationInfo &) = delete; - protected: MCContext &Ctx; public: MCRelocationInfo(MCContext &Ctx); + MCRelocationInfo(const MCRelocationInfo &) = delete; + MCRelocationInfo &operator=(const MCRelocationInfo &) = delete; virtual ~MCRelocationInfo(); /// \brief Create an MCExpr for the target-specific \p VariantKind. @@ -46,6 +40,6 @@ public: unsigned VariantKind); }; -} +} // end namespace llvm -#endif +#endif // LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H diff --git a/include/llvm/MC/MCDisassembler/MCSymbolizer.h b/include/llvm/MC/MCDisassembler/MCSymbolizer.h index 713467c0a3e..d85cf5e066f 100644 --- a/include/llvm/MC/MCDisassembler/MCSymbolizer.h +++ b/include/llvm/MC/MCDisassembler/MCSymbolizer.h @@ -1,4 +1,4 @@ -//===-- llvm/MC/MCSymbolizer.h - MCSymbolizer class -------------*- C++ -*-===// +//===- llvm/MC/MCSymbolizer.h - MCSymbolizer class --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,9 +17,8 @@ #define LLVM_MC_MCDISASSEMBLER_MCSYMBOLIZER_H #include "llvm/MC/MCDisassembler/MCRelocationInfo.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/DataTypes.h" -#include <cassert> +#include <algorithm> +#include <cstdint> #include <memory> namespace llvm { @@ -38,9 +37,6 @@ class raw_ostream; /// operands are actually symbolizable, and in what way. I don't think this /// information exists right now. class MCSymbolizer { - MCSymbolizer(const MCSymbolizer &) = delete; - void operator=(const MCSymbolizer &) = delete; - protected: MCContext &Ctx; std::unique_ptr<MCRelocationInfo> RelInfo; @@ -51,6 +47,8 @@ public: : Ctx(Ctx), RelInfo(std::move(RelInfo)) { } + MCSymbolizer(const MCSymbolizer &) = delete; + MCSymbolizer &operator=(const MCSymbolizer &) = delete; virtual ~MCSymbolizer(); /// \brief Try to add a symbolic operand instead of \p Value to the MCInst. @@ -80,6 +78,6 @@ public: uint64_t Address) = 0; }; -} +} // end namespace llvm -#endif +#endif // LLVM_MC_MCDISASSEMBLER_MCSYMBOLIZER_H diff --git a/include/llvm/MC/MCLabel.h b/include/llvm/MC/MCLabel.h index a12473fdad0..b6579fd654a 100644 --- a/include/llvm/MC/MCLabel.h +++ b/include/llvm/MC/MCLabel.h @@ -14,10 +14,8 @@ #ifndef LLVM_MC_MCLABEL_H #define LLVM_MC_MCLABEL_H -#include "llvm/Support/Compiler.h" - namespace llvm { -class MCContext; + class raw_ostream; /// \brief Instances of this class represent a label name in the MC file, @@ -29,12 +27,13 @@ class MCLabel { private: // MCContext creates and uniques these. friend class MCContext; + MCLabel(unsigned instance) : Instance(instance) {} +public: MCLabel(const MCLabel &) = delete; - void operator=(const MCLabel &) = delete; + MCLabel &operator=(const MCLabel &) = delete; -public: /// \brief Get the current instance of this Directional Local Label. unsigned getInstance() const { return Instance; } @@ -52,6 +51,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCLabel &Label) { Label.print(OS); return OS; } + } // end namespace llvm -#endif +#endif // LLVM_MC_MCLABEL_H diff --git a/include/llvm/MC/MCObjectWriter.h b/include/llvm/MC/MCObjectWriter.h index 0ecebe42a0b..32d4d1f357e 100644 --- a/include/llvm/MC/MCObjectWriter.h +++ b/include/llvm/MC/MCObjectWriter.h @@ -1,4 +1,4 @@ -//===-- llvm/MC/MCObjectWriter.h - Object File Writer Interface -*- C++ -*-===// +//===- llvm/MC/MCObjectWriter.h - Object File Writer Interface --*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -11,13 +11,15 @@ #define LLVM_MC_MCOBJECTWRITER_H #include "llvm/ADT/SmallVector.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/DataTypes.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Endian.h" #include "llvm/Support/EndianStream.h" #include "llvm/Support/raw_ostream.h" #include <cassert> +#include <cstdint> namespace llvm { + class MCAsmLayout; class MCAssembler; class MCFixup; @@ -38,15 +40,12 @@ class MCValue; /// The object writer also contains a number of helper methods for writing /// binary data to the output stream. class MCObjectWriter { - MCObjectWriter(const MCObjectWriter &) = delete; - void operator=(const MCObjectWriter &) = delete; - raw_pwrite_stream *OS; protected: unsigned IsLittleEndian : 1; -protected: // Can only create subclasses. + // Can only create subclasses. MCObjectWriter(raw_pwrite_stream &OS, bool IsLittleEndian) : OS(&OS), IsLittleEndian(IsLittleEndian) {} @@ -55,6 +54,8 @@ protected: // Can only create subclasses. } public: + MCObjectWriter(const MCObjectWriter &) = delete; + MCObjectWriter &operator=(const MCObjectWriter &) = delete; virtual ~MCObjectWriter(); /// lifetime management @@ -199,6 +200,6 @@ public: /// @} }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_MC_MCOBJECTWRITER_H diff --git a/include/llvm/MC/MCSection.h b/include/llvm/MC/MCSection.h index 68d4a7f5509..7fb1220748a 100644 --- a/include/llvm/MC/MCSection.h +++ b/include/llvm/MC/MCSection.h @@ -14,23 +14,21 @@ #ifndef LLVM_MC_MCSECTION_H #define LLVM_MC_MCSECTION_H -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/ilist.h" -#include "llvm/ADT/ilist_node.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCFragment.h" #include "llvm/MC/SectionKind.h" -#include "llvm/Support/Compiler.h" +#include <cassert> +#include <utility> namespace llvm { + class MCAsmInfo; -class MCAssembler; class MCContext; class MCExpr; -class MCFragment; -class MCSection; class MCSymbol; -class Triple; class raw_ostream; +class Triple; template <> struct ilist_alloc_traits<MCFragment> { static void deleteNode(MCFragment *V); @@ -58,9 +56,6 @@ public: typedef FragmentListType::reverse_iterator reverse_iterator; private: - MCSection(const MCSection &) = delete; - void operator=(const MCSection &) = delete; - MCSymbol *Begin; MCSymbol *End = nullptr; /// The alignment requirement of this section. @@ -78,12 +73,12 @@ private: /// \brief We've seen a bundle_lock directive but not its first instruction /// yet. - unsigned BundleGroupBeforeFirstInst : 1; + bool BundleGroupBeforeFirstInst : 1; /// Whether this section has had instructions emitted into it. - unsigned HasInstructions : 1; + bool HasInstructions : 1; - unsigned IsRegistered : 1; + bool IsRegistered : 1; MCDummyFragment DummyFragment; @@ -94,12 +89,16 @@ private: SmallVector<std::pair<unsigned, MCFragment *>, 1> SubsectionFragmentMap; protected: - MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin); SectionVariant Variant; SectionKind Kind; + + MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin); ~MCSection(); public: + MCSection(const MCSection &) = delete; + MCSection &operator=(const MCSection &) = delete; + SectionKind getKind() const { return Kind; } SectionVariant getVariant() const { return Variant; } @@ -185,4 +184,4 @@ public: } // end namespace llvm -#endif +#endif // LLVM_MC_MCSECTION_H diff --git a/include/llvm/MC/MCSubtargetInfo.h b/include/llvm/MC/MCSubtargetInfo.h index 5ede043fa2e..bbdac8fad5f 100644 --- a/include/llvm/MC/MCSubtargetInfo.h +++ b/include/llvm/MC/MCSubtargetInfo.h @@ -1,4 +1,4 @@ -//==-- llvm/MC/MCSubtargetInfo.h - Subtarget Information ---------*- C++ -*-==// +//===- llvm/MC/MCSubtargetInfo.h - Subtarget Information --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -15,14 +15,18 @@ #define LLVM_MC_MCSUBTARGETINFO_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Triple.h" #include "llvm/MC/MCInstrItineraries.h" +#include "llvm/MC/MCSchedule.h" #include "llvm/MC/SubtargetFeature.h" +#include <algorithm> +#include <cassert> +#include <cstdint> #include <string> namespace llvm { -class StringRef; - //===----------------------------------------------------------------------===// /// /// MCSubtargetInfo - Generic base class for all target subtargets. @@ -45,10 +49,6 @@ class MCSubtargetInfo { const unsigned *ForwardingPaths; // Forwarding paths FeatureBitset FeatureBits; // Feature bits for current CPU + FS - MCSubtargetInfo() = delete; - MCSubtargetInfo &operator=(MCSubtargetInfo &&) = delete; - MCSubtargetInfo &operator=(const MCSubtargetInfo &) = delete; - public: MCSubtargetInfo(const MCSubtargetInfo &) = default; MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS, @@ -58,6 +58,9 @@ public: const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL, const MCReadAdvanceEntry *RA, const InstrStage *IS, const unsigned *OC, const unsigned *FP); + MCSubtargetInfo() = delete; + MCSubtargetInfo &operator=(const MCSubtargetInfo &) = delete; + MCSubtargetInfo &operator=(MCSubtargetInfo &&) = delete; /// getTargetTriple - Return the target triple string. const Triple &getTargetTriple() const { return TargetTriple; } @@ -166,6 +169,6 @@ public: } }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_MC_MCSUBTARGETINFO_H diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 23e34b7869a..10c5ec12a01 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -15,18 +15,21 @@ #define LLVM_MC_MCSYMBOL_H #include "llvm/ADT/PointerIntPair.h" -#include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" #include "llvm/MC/MCFragment.h" -#include "llvm/Support/Compiler.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/MathExtras.h" +#include <cassert> +#include <cstddef> +#include <cstdint> namespace llvm { + class MCAsmInfo; +class MCContext; class MCExpr; -class MCSymbol; -class MCFragment; class MCSection; -class MCContext; class raw_ostream; /// MCSymbol - Instances of this class represent a symbol name in the MC file, @@ -133,7 +136,7 @@ protected: const MCExpr *Value; }; -protected: // MCContext creates and uniques these. + // MCContext creates and uniques these. friend class MCExpr; friend class MCContext; @@ -163,7 +166,6 @@ protected: // MCContext creates and uniques these. MCContext &Ctx); private: - void operator delete(void *); /// \brief Placement delete - required by std, but never called. void operator delete(void*, unsigned) { @@ -174,8 +176,6 @@ private: llvm_unreachable("Constructor throws?"); } - MCSymbol(const MCSymbol &) = delete; - void operator=(const MCSymbol &) = delete; MCSection *getSectionPtr(bool SetUsed = true) const { if (MCFragment *F = getFragment(SetUsed)) { assert(F != AbsolutePseudoFragment); @@ -195,6 +195,9 @@ private: } public: + MCSymbol(const MCSymbol &) = delete; + MCSymbol &operator=(const MCSymbol &) = delete; + /// getName - Get the symbol name. StringRef getName() const { if (!FragmentAndHasName.getInt()) @@ -416,6 +419,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCSymbol &Sym) { Sym.print(OS, nullptr); return OS; } + } // end namespace llvm -#endif +#endif // LLVM_MC_MCSYMBOL_H diff --git a/lib/MC/MCAsmBackend.cpp b/lib/MC/MCAsmBackend.cpp index 570f764f664..fc0aa788f6d 100644 --- a/lib/MC/MCAsmBackend.cpp +++ b/lib/MC/MCAsmBackend.cpp @@ -1,4 +1,4 @@ -//===-- MCAsmBackend.cpp - Target MC Assembly Backend ----------------------==// +//===- MCAsmBackend.cpp - Target MC Assembly Backend ----------------------===// // // The LLVM Compiler Infrastructure // @@ -7,14 +7,19 @@ // //===----------------------------------------------------------------------===// -#include "llvm/MC/MCAsmBackend.h" +#include "llvm/ADT/None.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCFixupKindInfo.h" +#include <cassert> +#include <cstddef> +#include <cstdint> + using namespace llvm; -MCAsmBackend::MCAsmBackend() {} +MCAsmBackend::MCAsmBackend() = default; -MCAsmBackend::~MCAsmBackend() {} +MCAsmBackend::~MCAsmBackend() = default; Optional<MCFixupKind> MCAsmBackend::getFixupKind(StringRef Name) const { return None; diff --git a/lib/MC/MCCodeEmitter.cpp b/lib/MC/MCCodeEmitter.cpp index c122763b2fe..ca69478ed10 100644 --- a/lib/MC/MCCodeEmitter.cpp +++ b/lib/MC/MCCodeEmitter.cpp @@ -1,4 +1,4 @@ -//===-- MCCodeEmitter.cpp - Instruction Encoding --------------------------===// +//===- MCCodeEmitter.cpp - Instruction Encoding ---------------------------===// // // The LLVM Compiler Infrastructure // @@ -11,8 +11,6 @@ using namespace llvm; -MCCodeEmitter::MCCodeEmitter() { -} +MCCodeEmitter::MCCodeEmitter() = default; -MCCodeEmitter::~MCCodeEmitter() { -} +MCCodeEmitter::~MCCodeEmitter() = default; diff --git a/lib/MC/MCDisassembler/MCDisassembler.cpp b/lib/MC/MCDisassembler/MCDisassembler.cpp index 3a4f7382bd3..2f1275d00b8 100644 --- a/lib/MC/MCDisassembler/MCDisassembler.cpp +++ b/lib/MC/MCDisassembler/MCDisassembler.cpp @@ -1,4 +1,4 @@ -//===-- MCDisassembler.cpp - Disassembler interface -----------------------===// +//===- MCDisassembler.cpp - Disassembler interface ------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,13 +8,12 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCDisassembler/MCDisassembler.h" -#include "llvm/MC/MCDisassembler/MCExternalSymbolizer.h" #include "llvm/Support/raw_ostream.h" +#include <algorithm> using namespace llvm; -MCDisassembler::~MCDisassembler() { -} +MCDisassembler::~MCDisassembler() = default; bool MCDisassembler::tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, diff --git a/lib/MC/MCDisassembler/MCRelocationInfo.cpp b/lib/MC/MCDisassembler/MCRelocationInfo.cpp index 1612562497d..5805fd7007d 100644 --- a/lib/MC/MCDisassembler/MCRelocationInfo.cpp +++ b/lib/MC/MCDisassembler/MCRelocationInfo.cpp @@ -1,4 +1,4 @@ -//==-- MCRelocationInfo.cpp ------------------------------------------------==// +//===-- MCRelocationInfo.cpp ----------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,17 +8,14 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCDisassembler/MCRelocationInfo.h" -#include "llvm-c/Disassembler.h" #include "llvm/Support/TargetRegistry.h" +#include "llvm-c/Disassembler.h" using namespace llvm; -MCRelocationInfo::MCRelocationInfo(MCContext &Ctx) - : Ctx(Ctx) { -} +MCRelocationInfo::MCRelocationInfo(MCContext &Ctx) : Ctx(Ctx) {} -MCRelocationInfo::~MCRelocationInfo() { -} +MCRelocationInfo::~MCRelocationInfo() = default; const MCExpr * MCRelocationInfo::createExprForCAPIVariantKind(const MCExpr *SubExpr, diff --git a/lib/MC/MCDisassembler/MCSymbolizer.cpp b/lib/MC/MCDisassembler/MCSymbolizer.cpp index c0f707d356c..78e611e3ddd 100644 --- a/lib/MC/MCDisassembler/MCSymbolizer.cpp +++ b/lib/MC/MCDisassembler/MCSymbolizer.cpp @@ -1,4 +1,4 @@ -//===-- llvm/MC/MCSymbolizer.cpp - MCSymbolizer class -----------*- C++ -*-===// +//===-- llvm/MC/MCSymbolizer.cpp - MCSymbolizer class ---------------------===// // // The LLVM Compiler Infrastructure // @@ -11,5 +11,4 @@ using namespace llvm; -MCSymbolizer::~MCSymbolizer() { -} +MCSymbolizer::~MCSymbolizer() = default; diff --git a/lib/MC/MCLabel.cpp b/lib/MC/MCLabel.cpp index d973fc93b98..db25a46fce1 100644 --- a/lib/MC/MCLabel.cpp +++ b/lib/MC/MCLabel.cpp @@ -1,4 +1,4 @@ -//===- lib/MC/MCLabel.cpp - MCLabel implementation ----------------------===// +//===- lib/MC/MCLabel.cpp - MCLabel implementation ------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,8 +8,10 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCLabel.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" + using namespace llvm; void MCLabel::print(raw_ostream &OS) const { diff --git a/lib/MC/MCObjectWriter.cpp b/lib/MC/MCObjectWriter.cpp index e84f74ae81d..26ed5855e3d 100644 --- a/lib/MC/MCObjectWriter.cpp +++ b/lib/MC/MCObjectWriter.cpp @@ -8,14 +8,14 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCAssembler.h" +#include "llvm/MC/MCFragment.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCSymbol.h" using namespace llvm; -MCObjectWriter::~MCObjectWriter() { -} +MCObjectWriter::~MCObjectWriter() = default; bool MCObjectWriter::isSymbolRefDifferenceFullyResolved( const MCAssembler &Asm, const MCSymbolRefExpr *A, const MCSymbolRefExpr *B, diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index 7a42a2758e8..7986c012204 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -7,17 +7,18 @@ // //===----------------------------------------------------------------------===// -#include "llvm/MC/MCSection.h" -#include "llvm/MC/MCAssembler.h" -#include "llvm/MC/MCAsmInfo.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCFragment.h" +#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSymbol.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" -using namespace llvm; +#include <algorithm> +#include <utility> -//===----------------------------------------------------------------------===// -// MCSection -//===----------------------------------------------------------------------===// +using namespace llvm; MCSection::MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin) : Begin(Begin), BundleGroupBeforeFirstInst(false), HasInstructions(false), @@ -31,8 +32,7 @@ MCSymbol *MCSection::getEndSymbol(MCContext &Ctx) { bool MCSection::hasEnded() const { return End && End->isInSection(); } -MCSection::~MCSection() { -} +MCSection::~MCSection() = default; void MCSection::setBundleLockState(BundleLockStateType NewState) { if (NewState == NotBundleLocked) { @@ -87,7 +87,7 @@ MCSection::getSubsectionInsertionPoint(unsigned Subsection) { #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MCSection::dump() { - raw_ostream &OS = llvm::errs(); + raw_ostream &OS = errs(); OS << "<MCSection"; OS << " Fragments:[\n "; diff --git a/lib/MC/MCSubtargetInfo.cpp b/lib/MC/MCSubtargetInfo.cpp index 1b592504b1e..777b4e3d6b6 100644 --- a/lib/MC/MCSubtargetInfo.cpp +++ b/lib/MC/MCSubtargetInfo.cpp @@ -1,4 +1,4 @@ -//===-- MCSubtargetInfo.cpp - Subtarget Information -----------------------===// +//===- MCSubtargetInfo.cpp - Subtarget Information ------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,13 +7,16 @@ // //===----------------------------------------------------------------------===// -#include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/Triple.h" #include "llvm/MC/MCInstrItineraries.h" +#include "llvm/MC/MCSchedule.h" +#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> +#include <cassert> +#include <cstring> using namespace llvm; diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index ad303ef0218..cb262542b89 100644 --- a/lib/MC/MCSymbol.cpp +++ b/lib/MC/MCSymbol.cpp @@ -7,13 +7,19 @@ // //===----------------------------------------------------------------------===// -#include "llvm/MC/MCSymbol.h" +#include "llvm/ADT/StringRef.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCFragment.h" +#include "llvm/MC/MCSymbol.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" +#include <cassert> +#include <cstddef> + using namespace llvm; // Only the address of this fragment is ever actually used. |