[CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 311124
diff --git a/llvm/lib/CodeGen/AsmPrinter/AddressPool.h b/llvm/lib/CodeGen/AsmPrinter/AddressPool.h
index ba3e3b7..990a158 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AddressPool.h
+++ b/llvm/lib/CodeGen/AsmPrinter/AddressPool.h
@@ -1,4 +1,4 @@
-//===-- llvm/CodeGen/AddressPool.h - Dwarf Debug Framework -----*- C++ -*--===//
+//===- llvm/CodeGen/AddressPool.h - Dwarf Debug Framework -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -11,11 +11,13 @@
#define LLVM_LIB_CODEGEN_ASMPRINTER_ADDRESSPOOL_H
#include "llvm/ADT/DenseMap.h"
-#include "llvm/MC/MCSymbol.h"
namespace llvm {
-class MCSection;
+
class AsmPrinter;
+class MCSection;
+class MCSymbol;
+
// Collection of addresses for this unit and assorted labels.
// A Symbol->unsigned mapping of addresses used by indirect
// references.
@@ -23,6 +25,7 @@
struct AddressPoolEntry {
unsigned Number;
bool TLS;
+
AddressPoolEntry(unsigned Number, bool TLS) : Number(Number), TLS(TLS) {}
};
DenseMap<const MCSymbol *, AddressPoolEntry> Pool;
@@ -31,10 +34,10 @@
/// the last "resetUsedFlag" call. Used to implement type unit fallback - a
/// type that references addresses cannot be placed in a type unit when using
/// fission.
- bool HasBeenUsed;
+ bool HasBeenUsed = false;
public:
- AddressPool() : HasBeenUsed(false) {}
+ AddressPool() = default;
/// \brief Returns the index into the address pool with the given
/// label/symbol.
@@ -48,5 +51,7 @@
void resetUsedFlag() { HasBeenUsed = false; }
};
-}
-#endif
+
+} // end namespace llvm
+
+#endif // LLVM_LIB_CODEGEN_ASMPRINTER_ADDRESSPOOL_H