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

Side by Side Diff: src/base/flags.h

Issue 613143004: Changes to ALLOW_UNUSED to match upcoming changes to the Chromium trunk: (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Missed one Created 6 years, 2 months 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
« no previous file with comments | « src/base/compiler-specific.h ('k') | src/base/macros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_BASE_FLAGS_H_ 5 #ifndef V8_BASE_FLAGS_H_
6 #define V8_BASE_FLAGS_H_ 6 #define V8_BASE_FLAGS_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 operator mask_type() const { return mask_; } 59 operator mask_type() const { return mask_; }
60 bool operator!() const { return !mask_; } 60 bool operator!() const { return !mask_; }
61 61
62 private: 62 private:
63 mask_type mask_; 63 mask_type mask_;
64 }; 64 };
65 65
66 66
67 #define DEFINE_OPERATORS_FOR_FLAGS(Type) \ 67 #define DEFINE_OPERATORS_FOR_FLAGS(Type) \
68 inline Type operator&(Type::flag_type lhs, \ 68 inline Type operator&(Type::flag_type lhs, Type::flag_type rhs) \
69 Type::flag_type rhs)ALLOW_UNUSED WARN_UNUSED_RESULT; \ 69 ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
70 inline Type operator&(Type::flag_type lhs, Type::flag_type rhs) { \ 70 inline Type operator&(Type::flag_type lhs, Type::flag_type rhs) { \
71 return Type(lhs) & rhs; \ 71 return Type(lhs) & rhs; \
72 } \ 72 } \
73 inline Type operator&(Type::flag_type lhs, \ 73 inline Type operator&(Type::flag_type lhs, \
74 const Type& rhs)ALLOW_UNUSED WARN_UNUSED_RESULT; \ 74 const Type& rhs) ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
75 inline Type operator&(Type::flag_type lhs, const Type& rhs) { \ 75 inline Type operator&(Type::flag_type lhs, const Type& rhs) { \
76 return rhs & lhs; \ 76 return rhs & lhs; \
77 } \ 77 } \
78 inline void operator&(Type::flag_type lhs, Type::mask_type rhs)ALLOW_UNUSED; \ 78 inline void operator&(Type::flag_type lhs, \
79 Type::mask_type rhs) ALLOW_UNUSED_TYPE; \
79 inline void operator&(Type::flag_type lhs, Type::mask_type rhs) {} \ 80 inline void operator&(Type::flag_type lhs, Type::mask_type rhs) {} \
80 inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) \ 81 inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) \
81 ALLOW_UNUSED WARN_UNUSED_RESULT; \ 82 ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
82 inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) { \ 83 inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) { \
83 return Type(lhs) | rhs; \ 84 return Type(lhs) | rhs; \
84 } \ 85 } \
85 inline Type operator|(Type::flag_type lhs, const Type& rhs) \ 86 inline Type operator|(Type::flag_type lhs, const Type& rhs) \
86 ALLOW_UNUSED WARN_UNUSED_RESULT; \ 87 ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
87 inline Type operator|(Type::flag_type lhs, const Type& rhs) { \ 88 inline Type operator|(Type::flag_type lhs, const Type& rhs) { \
88 return rhs | lhs; \ 89 return rhs | lhs; \
89 } \ 90 } \
90 inline void operator|(Type::flag_type lhs, Type::mask_type rhs) \ 91 inline void operator|(Type::flag_type lhs, \
91 ALLOW_UNUSED; \ 92 Type::mask_type rhs) ALLOW_UNUSED_TYPE; \
92 inline void operator|(Type::flag_type lhs, Type::mask_type rhs) {} \ 93 inline void operator|(Type::flag_type lhs, Type::mask_type rhs) {} \
93 inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) \ 94 inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) \
94 ALLOW_UNUSED WARN_UNUSED_RESULT; \ 95 ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
95 inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) { \ 96 inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) { \
96 return Type(lhs) ^ rhs; \ 97 return Type(lhs) ^ rhs; \
97 } inline Type operator^(Type::flag_type lhs, const Type& rhs) \ 98 } inline Type operator^(Type::flag_type lhs, const Type& rhs) \
98 ALLOW_UNUSED WARN_UNUSED_RESULT; \ 99 ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
99 inline Type operator^(Type::flag_type lhs, const Type& rhs) { \ 100 inline Type operator^(Type::flag_type lhs, const Type& rhs) { \
100 return rhs ^ lhs; \ 101 return rhs ^ lhs; \
101 } inline void operator^(Type::flag_type lhs, Type::mask_type rhs) \ 102 } inline void operator^(Type::flag_type lhs, \
102 ALLOW_UNUSED; \ 103 Type::mask_type rhs) ALLOW_UNUSED_TYPE; \
103 inline void operator^(Type::flag_type lhs, Type::mask_type rhs) {} 104 inline void operator^(Type::flag_type lhs, Type::mask_type rhs) {}
104 105
105 } // namespace base 106 } // namespace base
106 } // namespace v8 107 } // namespace v8
107 108
108 #endif // V8_BASE_FLAGS_H_ 109 #endif // V8_BASE_FLAGS_H_
OLDNEW
« no previous file with comments | « src/base/compiler-specific.h ('k') | src/base/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698