[llvm] r307237 - Fix -Wunused-function by making function declarations in a header non-static

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 22:33:32 PDT 2017


Author: dblaikie
Date: Wed Jul  5 22:33:32 2017
New Revision: 307237

URL: http://llvm.org/viewvc/llvm-project?rev=307237&view=rev
Log:
Fix -Wunused-function by making function declarations in a header non-static

Also avoids ODR violations by ensuring names used in headers find the
same entity, not different, file-local entities in each translation
unit.

Modified:
    llvm/trunk/tools/llvm-pdbutil/FormatUtil.h

Modified: llvm/trunk/tools/llvm-pdbutil/FormatUtil.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/FormatUtil.h?rev=307237&r1=307236&r2=307237&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbutil/FormatUtil.h (original)
+++ llvm/trunk/tools/llvm-pdbutil/FormatUtil.h Wed Jul  5 22:33:32 2017
@@ -23,7 +23,7 @@ namespace llvm {
 namespace pdb {
 
 std::string truncateStringBack(StringRef S, uint32_t MaxLen);
-static std::string truncateStringFront(StringRef S, uint32_t MaxLen);
+std::string truncateStringFront(StringRef S, uint32_t MaxLen);
 std::string truncateQuotedNameFront(StringRef Label, StringRef Name,
                                     uint32_t MaxLen);
 std::string truncateQuotedNameBack(StringRef Label, StringRef Name,
@@ -40,7 +40,7 @@ std::string truncateQuotedNameBack(Strin
   case Enum::X:                                                                \
     return Ret;
 
-template <typename T> static std::string formatUnknownEnum(T Value) {
+template <typename T> std::string formatUnknownEnum(T Value) {
   return formatv("unknown ({0})",
                  static_cast<typename std::underlying_type<T>::type>(Value))
       .str();




More information about the llvm-commits mailing list