[llvm] r311628 - Support all integer types in DiagnosticInfoOptimizationBase::Argument

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 21:04:49 PDT 2017


Author: anemet
Date: Wed Aug 23 21:04:49 2017
New Revision: 311628

URL: http://llvm.org/viewvc/llvm-project?rev=311628&view=rev
Log:
Support all integer types in  DiagnosticInfoOptimizationBase::Argument

We were missing size_t (unsigned long) on macOS.

Modified:
    llvm/trunk/include/llvm/IR/DiagnosticInfo.h
    llvm/trunk/lib/IR/DiagnosticInfo.cpp

Modified: llvm/trunk/include/llvm/IR/DiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DiagnosticInfo.h?rev=311628&r1=311627&r2=311628&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DiagnosticInfo.h Wed Aug 23 21:04:49 2017
@@ -421,9 +421,11 @@ public:
     Argument(StringRef Key, const Type *T);
     Argument(StringRef Key, StringRef S);
     Argument(StringRef Key, int N);
-    Argument(StringRef Key, int64_t N);
+    Argument(StringRef Key, long N);
+    Argument(StringRef Key, long long N);
     Argument(StringRef Key, unsigned N);
-    Argument(StringRef Key, uint64_t N);
+    Argument(StringRef Key, unsigned long N);
+    Argument(StringRef Key, unsigned long long N);
     Argument(StringRef Key, bool B) : Key(Key), Val(B ? "true" : "false") {}
     Argument(StringRef Key, DebugLoc dl);
   };

Modified: llvm/trunk/lib/IR/DiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DiagnosticInfo.cpp?rev=311628&r1=311627&r2=311628&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/IR/DiagnosticInfo.cpp Wed Aug 23 21:04:49 2017
@@ -221,13 +221,21 @@ DiagnosticInfoOptimizationBase::Argument
 DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, int N)
     : Key(Key), Val(itostr(N)) {}
 
-DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, int64_t N)
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, long N)
+    : Key(Key), Val(itostr(N)) {}
+
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, long long N)
     : Key(Key), Val(itostr(N)) {}
 
 DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, unsigned N)
     : Key(Key), Val(utostr(N)) {}
 
-DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, uint64_t N)
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key,
+                                                   unsigned long N)
+    : Key(Key), Val(utostr(N)) {}
+
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key,
+                                                   unsigned long long N)
     : Key(Key), Val(utostr(N)) {}
 
 DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, DebugLoc Loc)




More information about the llvm-commits mailing list