[llvm] r250946 - Use numeric_limits instead of LLONG_MAX

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 14:10:12 PDT 2015


Author: arsenm
Date: Wed Oct 21 16:10:12 2015
New Revision: 250946

URL: http://llvm.org/viewvc/llvm-project?rev=250946&view=rev
Log:
Use numeric_limits instead of LLONG_MAX

This is a build fix for configurations where LLONG_MAX is
not defined in system headers.

Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp?rev=250946&r1=250945&r2=250946&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp Wed Oct 21 16:10:12 2015
@@ -18,7 +18,7 @@
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
-#include <climits>
+#include <limits>
 using namespace llvm;
 using namespace dwarf;
 using namespace syntax;
@@ -565,7 +565,7 @@ Optional<uint64_t> DWARFFormValue::getAs
 
 Optional<int64_t> DWARFFormValue::getAsSignedConstant() const {
   if ((!isFormClass(FC_Constant) && !isFormClass(FC_Flag)) ||
-      (Form == DW_FORM_udata && uint64_t(LLONG_MAX) < Value.uval))
+      (Form == DW_FORM_udata && uint64_t(std::numeric_limits<int64_t>::max()) < Value.uval))
     return None;
   switch (Form) {
   case DW_FORM_data4:




More information about the llvm-commits mailing list