]> granicus.if.org Git - llvm/commitdiff
Fix some more warnings.
authorZachary Turner <zturner@google.com>
Thu, 15 Jun 2017 20:03:57 +0000 (20:03 +0000)
committerZachary Turner <zturner@google.com>
Thu, 15 Jun 2017 20:03:57 +0000 (20:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305499 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-pdbutil/MinimalSymbolDumper.cpp
tools/llvm-pdbutil/MinimalSymbolDumper.h
tools/llvm-pdbutil/MinimalTypeDumper.cpp
tools/llvm-pdbutil/RawOutputStyle.cpp

index 013f89bf2d6615091e76a23f01d71fa82786e915..8b36de0b715760e634262cd598a437df1d135744 100644 (file)
@@ -172,18 +172,16 @@ static std::string formatThunkOrdinal(ThunkOrdinal Ordinal) {
     RETURN_CASE(ThunkOrdinal, UnknownLoad, "unknown load");
     RETURN_CASE(ThunkOrdinal, TrampIncremental, "tramp incremental");
     RETURN_CASE(ThunkOrdinal, BranchIsland, "branch island");
-  default:
-    return formatUnknownEnum(Ordinal);
   }
+  return formatUnknownEnum(Ordinal);
 }
 
 static std::string formatTrampolineType(TrampolineType Tramp) {
   switch (Tramp) {
     RETURN_CASE(TrampolineType, TrampIncremental, "tramp incremental");
     RETURN_CASE(TrampolineType, BranchIsland, "branch island");
-  default:
-    return formatUnknownEnum(Tramp);
   }
+  return formatUnknownEnum(Tramp);
 }
 
 static std::string formatSourceLanguage(SourceLanguage Lang) {
@@ -196,6 +194,7 @@ static std::string formatSourceLanguage(SourceLanguage Lang) {
     RETURN_CASE(SourceLanguage, Basic, "basic");
     RETURN_CASE(SourceLanguage, Cobol, "cobol");
     RETURN_CASE(SourceLanguage, Link, "link");
+    RETURN_CASE(SourceLanguage, VB, "vb");
     RETURN_CASE(SourceLanguage, Cvtres, "cvtres");
     RETURN_CASE(SourceLanguage, Cvtpgd, "cvtpgd");
     RETURN_CASE(SourceLanguage, CSharp, "c#");
@@ -204,9 +203,8 @@ static std::string formatSourceLanguage(SourceLanguage Lang) {
     RETURN_CASE(SourceLanguage, JScript, "javascript");
     RETURN_CASE(SourceLanguage, MSIL, "msil");
     RETURN_CASE(SourceLanguage, HLSL, "hlsl");
-  default:
-    return formatUnknownEnum(Lang);
   }
+  return formatUnknownEnum(Lang);
 }
 
 static std::string formatMachineType(CPUType Cpu) {
@@ -270,9 +268,8 @@ static std::string formatMachineType(CPUType Cpu) {
     RETURN_CASE(CPUType, Thumb, "thumb");
     RETURN_CASE(CPUType, ARMNT, "arm nt");
     RETURN_CASE(CPUType, D3D11_Shader, "d3d11 shader");
-  default:
-    return formatUnknownEnum(Cpu);
   }
+  return formatUnknownEnum(Cpu);
 }
 
 static std::string formatCookieKind(FrameCookieKind Kind) {
@@ -281,9 +278,8 @@ static std::string formatCookieKind(FrameCookieKind Kind) {
     RETURN_CASE(FrameCookieKind, XorStackPointer, "xor stack ptr");
     RETURN_CASE(FrameCookieKind, XorFramePointer, "xor frame ptr");
     RETURN_CASE(FrameCookieKind, XorR13, "xor rot13");
-  default:
-    return formatUnknownEnum(Kind);
   }
+  return formatUnknownEnum(Kind);
 }
 
 static std::string formatRegisterId(RegisterId Id) {
index 319e4c211cdb864b1397237e005817b301993730..451f2da6fd1d4b0b3ac6f321180f9aabc2b9953e 100644 (file)
@@ -24,10 +24,10 @@ class MinimalSymbolDumper : public codeview::SymbolVisitorCallbacks {
 public:
   MinimalSymbolDumper(LinePrinter &P, bool RecordBytes,
                       codeview::LazyRandomTypeCollection &Types)
-      : P(P), RecordBytes(RecordBytes), Types(Types) {}
+      : P(P), Types(Types) {}
 
-  virtual Error visitSymbolBegin(codeview::CVSymbol &Record);
-  virtual Error visitSymbolEnd(codeview::CVSymbol &Record);
+  Error visitSymbolBegin(codeview::CVSymbol &Record) override;
+  Error visitSymbolEnd(codeview::CVSymbol &Record) override;
 
 #define SYMBOL_RECORD(EnumName, EnumVal, Name)                                 \
   virtual Error visitKnownRecord(codeview::CVSymbol &CVR,                      \
@@ -39,7 +39,6 @@ private:
   std::string typeIndex(codeview::TypeIndex TI) const;
 
   LinePrinter &P;
-  bool RecordBytes = false;
   codeview::LazyRandomTypeCollection &Types;
 };
 } // namespace pdb
index 185dd40e7a97ad33538c0da7479f7ec134746065..98813e03c380cfbe8cec8bb803515c9f637b351e 100644 (file)
@@ -103,15 +103,15 @@ static std::string formatCallingConvention(CallingConvention Convention) {
     RETURN_CASE(CallingConvention, NearFast, "fastcall");
     RETURN_CASE(CallingConvention, NearPascal, "pascal");
     RETURN_CASE(CallingConvention, NearStdCall, "stdcall");
+    RETURN_CASE(CallingConvention, NearSysCall, "near syscall");
     RETURN_CASE(CallingConvention, NearVector, "vectorcall");
     RETURN_CASE(CallingConvention, PpcCall, "ppccall");
+    RETURN_CASE(CallingConvention, SHCall, "shcall");
     RETURN_CASE(CallingConvention, SH5Call, "sh5call");
     RETURN_CASE(CallingConvention, ThisCall, "thiscall");
     RETURN_CASE(CallingConvention, TriCall, "tricall");
-  default:
-    return formatUnknownEnum(Convention);
   }
-  return "";
+  return formatUnknownEnum(Convention);
 }
 
 static std::string formatPointerMode(PointerMode Mode) {
@@ -121,19 +121,18 @@ static std::string formatPointerMode(PointerMode Mode) {
     RETURN_CASE(PointerMode, PointerToDataMember, "data member pointer");
     RETURN_CASE(PointerMode, PointerToMemberFunction, "member fn pointer");
     RETURN_CASE(PointerMode, RValueReference, "rvalue ref");
-  default:
-    return formatUnknownEnum(Mode);
   }
+  return formatUnknownEnum(Mode);
 }
 
 static std::string memberAccess(MemberAccess Access) {
   switch (Access) {
+    RETURN_CASE(MemberAccess, None, "");
     RETURN_CASE(MemberAccess, Private, "private");
     RETURN_CASE(MemberAccess, Protected, "protected");
     RETURN_CASE(MemberAccess, Public, "public");
-  default:
-    return formatUnknownEnum(Access);
   }
+  return formatUnknownEnum(Access);
 }
 
 static std::string methodKind(MethodKind Kind) {
@@ -145,9 +144,8 @@ static std::string methodKind(MethodKind Kind) {
     RETURN_CASE(MethodKind, IntroducingVirtual, "intro virtual");
     RETURN_CASE(MethodKind, PureVirtual, "pure virtual");
     RETURN_CASE(MethodKind, PureIntroducingVirtual, "pure intro virtual");
-  default:
-    return formatUnknownEnum(Kind);
   }
+  return formatUnknownEnum(Kind);
 }
 
 static std::string pointerKind(PointerKind Kind) {
@@ -165,9 +163,8 @@ static std::string pointerKind(PointerKind Kind) {
     RETURN_CASE(PointerKind, Near32, "ptr32");
     RETURN_CASE(PointerKind, Far32, "far ptr32");
     RETURN_CASE(PointerKind, Near64, "ptr64");
-  default:
-    return formatUnknownEnum(Kind);
   }
+  return formatUnknownEnum(Kind);
 }
 
 static std::string memberAttributes(const MemberAttributes &Attrs) {
index aba34c1dba6e2fc1d29c46d21d78ae9a19ca11dc..8afd727f032c3850da4f321934215db7b080f957 100644 (file)
@@ -608,7 +608,7 @@ Error RawOutputStyle::dumpSectionContribs() {
 
   class Visitor : public ISectionContribVisitor {
   public:
-    Visitor(LinePrinter &P, DbiStream &DS) : P(P), DS(DS) {}
+    Visitor(LinePrinter &P) : P(P) {}
     void visit(const SectionContrib &SC) override {
       P.formatLine(
           "SC  | mod = {2}, {0}, size = {1}, data crc = {3}, reloc crc = {4}",
@@ -631,10 +631,9 @@ Error RawOutputStyle::dumpSectionContribs() {
 
   private:
     LinePrinter &P;
-    DbiStream &DS;
   };
 
-  Visitor V(P, Dbi);
+  Visitor V(P);
   Dbi.visitSectionContributions(V);
   return Error::success();
 }