[compiler] Fix the gcc build
Broken by crrev.com/c/3129420 error: ‘CompilationDependency::AsTransition() const’ defined but not used. Bug: v8:7790 Change-Id: I06839c4d33d3a52909e0e5a276c567eca83e910f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3133147 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/main@{#76623}
This commit is contained in:
parent
4e1baf132b
commit
b1bdde9168
@ -7,13 +7,15 @@
|
||||
|
||||
#include "include/v8config.h"
|
||||
|
||||
// Annotate a using ALLOW_UNUSED_TYPE = or function indicating it's ok if it's
|
||||
// not used. Use like:
|
||||
// using Bar = Foo;
|
||||
// Annotation to silence compiler warnings about unused
|
||||
// types/functions/variables. Use like:
|
||||
//
|
||||
// using V8_ALLOW_UNUSED Bar = Foo;
|
||||
// V8_ALLOW_UNUSED void foo() {}
|
||||
#if V8_HAS_ATTRIBUTE_UNUSED
|
||||
#define ALLOW_UNUSED_TYPE __attribute__((unused))
|
||||
#define V8_ALLOW_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ALLOW_UNUSED_TYPE
|
||||
#define V8_ALLOW_UNUSED
|
||||
#endif
|
||||
|
||||
// Tell the compiler a function is using a printf-style format string.
|
||||
|
@ -89,39 +89,39 @@ class Flags final {
|
||||
mask_type mask_;
|
||||
};
|
||||
|
||||
#define DEFINE_OPERATORS_FOR_FLAGS(Type) \
|
||||
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \
|
||||
Type::flag_type lhs, Type::flag_type rhs) { \
|
||||
return Type(lhs) & rhs; \
|
||||
} \
|
||||
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \
|
||||
Type::flag_type lhs, const Type& rhs) { \
|
||||
return rhs & lhs; \
|
||||
} \
|
||||
ALLOW_UNUSED_TYPE inline void operator&(Type::flag_type lhs, \
|
||||
Type::mask_type rhs) {} \
|
||||
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \
|
||||
Type::flag_type lhs, Type::flag_type rhs) { \
|
||||
return Type(lhs) | rhs; \
|
||||
} \
|
||||
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \
|
||||
Type::flag_type lhs, const Type& rhs) { \
|
||||
return rhs | lhs; \
|
||||
} \
|
||||
ALLOW_UNUSED_TYPE inline void operator|(Type::flag_type lhs, \
|
||||
Type::mask_type rhs) {} \
|
||||
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \
|
||||
Type::flag_type lhs, Type::flag_type rhs) { \
|
||||
return Type(lhs) ^ rhs; \
|
||||
} \
|
||||
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \
|
||||
Type::flag_type lhs, const Type& rhs) { \
|
||||
return rhs ^ lhs; \
|
||||
} \
|
||||
ALLOW_UNUSED_TYPE inline void operator^(Type::flag_type lhs, \
|
||||
Type::mask_type rhs) {} \
|
||||
ALLOW_UNUSED_TYPE inline constexpr Type operator~(Type::flag_type val) { \
|
||||
return ~Type(val); \
|
||||
#define DEFINE_OPERATORS_FOR_FLAGS(Type) \
|
||||
V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \
|
||||
Type::flag_type lhs, Type::flag_type rhs) { \
|
||||
return Type(lhs) & rhs; \
|
||||
} \
|
||||
V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \
|
||||
Type::flag_type lhs, const Type& rhs) { \
|
||||
return rhs & lhs; \
|
||||
} \
|
||||
V8_ALLOW_UNUSED inline void operator&(Type::flag_type lhs, \
|
||||
Type::mask_type rhs) {} \
|
||||
V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \
|
||||
Type::flag_type lhs, Type::flag_type rhs) { \
|
||||
return Type(lhs) | rhs; \
|
||||
} \
|
||||
V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \
|
||||
Type::flag_type lhs, const Type& rhs) { \
|
||||
return rhs | lhs; \
|
||||
} \
|
||||
V8_ALLOW_UNUSED inline void operator|(Type::flag_type lhs, \
|
||||
Type::mask_type rhs) {} \
|
||||
V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \
|
||||
Type::flag_type lhs, Type::flag_type rhs) { \
|
||||
return Type(lhs) ^ rhs; \
|
||||
} \
|
||||
V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \
|
||||
Type::flag_type lhs, const Type& rhs) { \
|
||||
return rhs ^ lhs; \
|
||||
} \
|
||||
V8_ALLOW_UNUSED inline void operator^(Type::flag_type lhs, \
|
||||
Type::mask_type rhs) {} \
|
||||
V8_ALLOW_UNUSED inline constexpr Type operator~(Type::flag_type val) { \
|
||||
return ~Type(val); \
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
@ -75,7 +75,7 @@ class CompilationDependency : public ZoneObject {
|
||||
#ifdef DEBUG
|
||||
#define V(Name) \
|
||||
bool Is##Name() const { return kind == k##Name; } \
|
||||
const Name##Dependency* As##Name() const;
|
||||
V8_ALLOW_UNUSED const Name##Dependency* As##Name() const;
|
||||
DEPENDENCY_LIST(V)
|
||||
#undef V
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user