Fixed/added namespace ending comments using clang-tidy. NFC
[oota-llvm.git] / lib / DebugInfo / PDB / PDBSymbolTypeFunctionSig.cpp
index f9a1bbf74e637d22f217688533bead93978ac190..fcee1825f7d70506c7fde72546d11e3491760d99 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBSession.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
 
 #include <utility>
 
@@ -33,25 +34,27 @@ public:
                         std::unique_ptr<ArgEnumeratorType> ArgEnumerator)
       : Session(PDBSession), Enumerator(std::move(ArgEnumerator)) {}
 
-  uint32_t getChildCount() const { return Enumerator->getChildCount(); }
+  uint32_t getChildCount() const override {
+    return Enumerator->getChildCount();
+  }
 
-  std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const {
+  std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override {
     auto FunctionArgSymbol = Enumerator->getChildAtIndex(Index);
     if (!FunctionArgSymbol)
       return nullptr;
     return Session.getSymbolById(FunctionArgSymbol->getTypeId());
   }
 
-  std::unique_ptr<PDBSymbol> getNext() {
+  std::unique_ptr<PDBSymbol> getNext() override {
     auto FunctionArgSymbol = Enumerator->getNext();
     if (!FunctionArgSymbol)
       return nullptr;
     return Session.getSymbolById(FunctionArgSymbol->getTypeId());
   }
 
-  void reset() { Enumerator->reset(); }
+  void reset() override { Enumerator->reset(); }
 
-  MyType *clone() const {
+  MyType *clone() const override {
     std::unique_ptr<ArgEnumeratorType> Clone(Enumerator->clone());
     return new FunctionArgEnumerator(Session, std::move(Clone));
   }
@@ -60,7 +63,7 @@ private:
   const IPDBSession &Session;
   std::unique_ptr<ArgEnumeratorType> Enumerator;
 };
-}
+} // namespace
 
 PDBSymbolTypeFunctionSig::PDBSymbolTypeFunctionSig(
     const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
@@ -82,38 +85,6 @@ std::unique_ptr<PDBSymbol> PDBSymbolTypeFunctionSig::getClassParent() const {
   return Session.getSymbolById(ClassId);
 }
 
-void PDBSymbolTypeFunctionSig::dumpArgList(raw_ostream &OS) const {
-  OS << "(";
-  if (auto ChildEnum = getArguments()) {
-    uint32_t Index = 0;
-    while (auto Arg = ChildEnum->getNext()) {
-      Arg->dump(OS, 0, PDB_DumpLevel::Compact);
-      if (++Index < ChildEnum->getChildCount())
-        OS << ", ";
-    }
-  }
-  OS << ")";
-  if (isConstType())
-    OS << " const";
-  if (isVolatileType())
-    OS << " volatile";
-}
-
-void PDBSymbolTypeFunctionSig::dump(raw_ostream &OS, int Indent,
-                                    PDB_DumpLevel Level) const {
-  OS << stream_indent(Indent);
-
-  if (auto ReturnType = getReturnType()) {
-    ReturnType->dump(OS, 0, PDB_DumpLevel::Compact);
-    OS << " ";
-  }
-
-  OS << getCallingConvention() << " ";
-  if (auto ClassParent = getClassParent()) {
-    OS << "(";
-    ClassParent->dump(OS, 0, PDB_DumpLevel::Compact);
-    OS << "::*)";
-  }
-
-  dumpArgList(OS);
+void PDBSymbolTypeFunctionSig::dump(PDBSymDumper &Dumper) const {
+  Dumper.dump(*this);
 }