diff options
Diffstat (limited to 'lib/ObjectYAML/DWARFEmitter.cpp')
-rw-r--r-- | lib/ObjectYAML/DWARFEmitter.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/lib/ObjectYAML/DWARFEmitter.cpp b/lib/ObjectYAML/DWARFEmitter.cpp index 91c928771a65..89fc652035ca 100644 --- a/lib/ObjectYAML/DWARFEmitter.cpp +++ b/lib/ObjectYAML/DWARFEmitter.cpp @@ -13,15 +13,25 @@ //===----------------------------------------------------------------------===// #include "llvm/ObjectYAML/DWARFEmitter.h" +#include "DWARFVisitor.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ObjectYAML/DWARFYAML.h" #include "llvm/Support/Error.h" +#include "llvm/Support/Host.h" #include "llvm/Support/LEB128.h" +#include "llvm/Support/MathExtras.h" +#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SwapByteOrder.h" +#include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" - -#include "DWARFVisitor.h" - #include <algorithm> +#include <cassert> +#include <cstddef> +#include <cstdint> +#include <memory> +#include <string> +#include <vector> using namespace llvm; @@ -127,7 +137,7 @@ class DumpVisitor : public DWARFYAML::ConstVisitor { raw_ostream &OS; protected: - virtual void onStartCompileUnit(const DWARFYAML::Unit &CU) { + void onStartCompileUnit(const DWARFYAML::Unit &CU) override { writeInitialLength(CU.Length, OS, DebugInfo.IsLittleEndian); writeInteger((uint16_t)CU.Version, OS, DebugInfo.IsLittleEndian); if(CU.Version >= 5) { @@ -141,41 +151,43 @@ protected: } - virtual void onStartDIE(const DWARFYAML::Unit &CU, - const DWARFYAML::Entry &DIE) { + void onStartDIE(const DWARFYAML::Unit &CU, + const DWARFYAML::Entry &DIE) override { encodeULEB128(DIE.AbbrCode, OS); } - virtual void onValue(const uint8_t U) { + void onValue(const uint8_t U) override { writeInteger(U, OS, DebugInfo.IsLittleEndian); } - virtual void onValue(const uint16_t U) { + void onValue(const uint16_t U) override { writeInteger(U, OS, DebugInfo.IsLittleEndian); } - virtual void onValue(const uint32_t U) { + + void onValue(const uint32_t U) override { writeInteger(U, OS, DebugInfo.IsLittleEndian); } - virtual void onValue(const uint64_t U, const bool LEB = false) { + + void onValue(const uint64_t U, const bool LEB = false) override { if (LEB) encodeULEB128(U, OS); else writeInteger(U, OS, DebugInfo.IsLittleEndian); } - virtual void onValue(const int64_t S, const bool LEB = false) { + void onValue(const int64_t S, const bool LEB = false) override { if (LEB) encodeSLEB128(S, OS); else writeInteger(S, OS, DebugInfo.IsLittleEndian); } - virtual void onValue(const StringRef String) { + void onValue(const StringRef String) override { OS.write(String.data(), String.size()); OS.write('\0'); } - virtual void onValue(const MemoryBufferRef MBR) { + void onValue(const MemoryBufferRef MBR) override { OS.write(MBR.getBufferStart(), MBR.getBufferSize()); } @@ -280,7 +292,7 @@ void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) { } } -typedef void (*EmitFuncType)(raw_ostream &, const DWARFYAML::Data &); +using EmitFuncType = void (*)(raw_ostream &, const DWARFYAML::Data &); static void EmitDebugSectionImpl(const DWARFYAML::Data &DI, EmitFuncType EmitFunc, |