Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: src/base/logging.cc

Issue 2524093002: [base] Pass scalar arguments by value in CHECK/DCHECK (Closed)
Patch Set: Remove unneeded const Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/logging.h" 5 #include "src/base/logging.h"
6 6
7 #include <cstdio> 7 #include <cstdio>
8 #include <cstdlib> 8 #include <cstdlib>
9 9
10 #include "src/base/debug/stack_trace.h" 10 #include "src/base/debug/stack_trace.h"
11 #include "src/base/platform/platform.h" 11 #include "src/base/platform/platform.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace base { 14 namespace base {
15 15
16 // Explicit instantiations for commonly used comparisons. 16 // Explicit instantiations for commonly used comparisons.
17 #define DEFINE_MAKE_CHECK_OP_STRING(type) \ 17 #define DEFINE_MAKE_CHECK_OP_STRING(type) \
18 template std::string* MakeCheckOpString<type, type>( \ 18 template std::string* MakeCheckOpString<type, type>(type, type, char const*);
19 type const&, type const&, char const*);
20 DEFINE_MAKE_CHECK_OP_STRING(int) 19 DEFINE_MAKE_CHECK_OP_STRING(int)
21 DEFINE_MAKE_CHECK_OP_STRING(long) // NOLINT(runtime/int) 20 DEFINE_MAKE_CHECK_OP_STRING(long) // NOLINT(runtime/int)
22 DEFINE_MAKE_CHECK_OP_STRING(long long) // NOLINT(runtime/int) 21 DEFINE_MAKE_CHECK_OP_STRING(long long) // NOLINT(runtime/int)
23 DEFINE_MAKE_CHECK_OP_STRING(unsigned int) 22 DEFINE_MAKE_CHECK_OP_STRING(unsigned int)
24 DEFINE_MAKE_CHECK_OP_STRING(unsigned long) // NOLINT(runtime/int) 23 DEFINE_MAKE_CHECK_OP_STRING(unsigned long) // NOLINT(runtime/int)
25 DEFINE_MAKE_CHECK_OP_STRING(unsigned long long) // NOLINT(runtime/int) 24 DEFINE_MAKE_CHECK_OP_STRING(unsigned long long) // NOLINT(runtime/int)
26 DEFINE_MAKE_CHECK_OP_STRING(char const*) 25 DEFINE_MAKE_CHECK_OP_STRING(char const*)
27 DEFINE_MAKE_CHECK_OP_STRING(void const*) 26 DEFINE_MAKE_CHECK_OP_STRING(void const*)
28 #undef DEFINE_MAKE_CHECK_OP_STRING 27 #undef DEFINE_MAKE_CHECK_OP_STRING
29 28
30 29
31 // Explicit instantiations for floating point checks. 30 // Explicit instantiations for floating point checks.
32 #define DEFINE_CHECK_OP_IMPL(NAME) \ 31 #define DEFINE_CHECK_OP_IMPL(NAME) \
33 template std::string* Check##NAME##Impl<float, float>( \ 32 template std::string* Check##NAME##Impl<float, float>(float lhs, float rhs, \
34 float const& lhs, float const& rhs, char const* msg); \ 33 char const* msg); \
35 template std::string* Check##NAME##Impl<double, double>( \ 34 template std::string* Check##NAME##Impl<double, double>( \
36 double const& lhs, double const& rhs, char const* msg); 35 double lhs, double rhs, char const* msg);
37 DEFINE_CHECK_OP_IMPL(EQ) 36 DEFINE_CHECK_OP_IMPL(EQ)
38 DEFINE_CHECK_OP_IMPL(NE) 37 DEFINE_CHECK_OP_IMPL(NE)
39 DEFINE_CHECK_OP_IMPL(LE) 38 DEFINE_CHECK_OP_IMPL(LE)
40 DEFINE_CHECK_OP_IMPL(LT) 39 DEFINE_CHECK_OP_IMPL(LT)
41 DEFINE_CHECK_OP_IMPL(GE) 40 DEFINE_CHECK_OP_IMPL(GE)
42 DEFINE_CHECK_OP_IMPL(GT) 41 DEFINE_CHECK_OP_IMPL(GT)
43 #undef DEFINE_CHECK_OP_IMPL 42 #undef DEFINE_CHECK_OP_IMPL
44 43
45 } // namespace base 44 } // namespace base
46 } // namespace v8 45 } // namespace v8
(...skipping 12 matching lines...) Expand all
59 v8::base::OS::PrintError("\n#\n"); 58 v8::base::OS::PrintError("\n#\n");
60 59
61 v8::base::debug::StackTrace trace; 60 v8::base::debug::StackTrace trace;
62 trace.Print(); 61 trace.Print();
63 62
64 fflush(stderr); 63 fflush(stderr);
65 // Avoid dumping stack trace on abort signal. 64 // Avoid dumping stack trace on abort signal.
66 v8::base::debug::DisableSignalStackDump(); 65 v8::base::debug::DisableSignalStackDump();
67 v8::base::OS::Abort(); 66 v8::base::OS::Abort();
68 } 67 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698