Commit b1bdde91 authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

[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: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76623}
parent 4e1baf13
...@@ -7,13 +7,15 @@ ...@@ -7,13 +7,15 @@
#include "include/v8config.h" #include "include/v8config.h"
// Annotate a using ALLOW_UNUSED_TYPE = or function indicating it's ok if it's // Annotation to silence compiler warnings about unused
// not used. Use like: // types/functions/variables. Use like:
// using Bar = Foo; //
// using V8_ALLOW_UNUSED Bar = Foo;
// V8_ALLOW_UNUSED void foo() {}
#if V8_HAS_ATTRIBUTE_UNUSED #if V8_HAS_ATTRIBUTE_UNUSED
#define ALLOW_UNUSED_TYPE __attribute__((unused)) #define V8_ALLOW_UNUSED __attribute__((unused))
#else #else
#define ALLOW_UNUSED_TYPE #define V8_ALLOW_UNUSED
#endif #endif
// Tell the compiler a function is using a printf-style format string. // Tell the compiler a function is using a printf-style format string.
......
...@@ -89,39 +89,39 @@ class Flags final { ...@@ -89,39 +89,39 @@ class Flags final {
mask_type mask_; mask_type mask_;
}; };
#define DEFINE_OPERATORS_FOR_FLAGS(Type) \ #define DEFINE_OPERATORS_FOR_FLAGS(Type) \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \ V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \
Type::flag_type lhs, Type::flag_type rhs) { \ Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) & rhs; \ return Type(lhs) & rhs; \
} \ } \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \ V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator&( \
Type::flag_type lhs, const Type& rhs) { \ Type::flag_type lhs, const Type& rhs) { \
return rhs & lhs; \ return rhs & lhs; \
} \ } \
ALLOW_UNUSED_TYPE inline void operator&(Type::flag_type lhs, \ V8_ALLOW_UNUSED inline void operator&(Type::flag_type lhs, \
Type::mask_type rhs) {} \ Type::mask_type rhs) {} \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \ V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \
Type::flag_type lhs, Type::flag_type rhs) { \ Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) | rhs; \ return Type(lhs) | rhs; \
} \ } \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \ V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator|( \
Type::flag_type lhs, const Type& rhs) { \ Type::flag_type lhs, const Type& rhs) { \
return rhs | lhs; \ return rhs | lhs; \
} \ } \
ALLOW_UNUSED_TYPE inline void operator|(Type::flag_type lhs, \ V8_ALLOW_UNUSED inline void operator|(Type::flag_type lhs, \
Type::mask_type rhs) {} \ Type::mask_type rhs) {} \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \ V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \
Type::flag_type lhs, Type::flag_type rhs) { \ Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) ^ rhs; \ return Type(lhs) ^ rhs; \
} \ } \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \ V8_ALLOW_UNUSED V8_WARN_UNUSED_RESULT inline constexpr Type operator^( \
Type::flag_type lhs, const Type& rhs) { \ Type::flag_type lhs, const Type& rhs) { \
return rhs ^ lhs; \ return rhs ^ lhs; \
} \ } \
ALLOW_UNUSED_TYPE inline void operator^(Type::flag_type lhs, \ V8_ALLOW_UNUSED inline void operator^(Type::flag_type lhs, \
Type::mask_type rhs) {} \ Type::mask_type rhs) {} \
ALLOW_UNUSED_TYPE inline constexpr Type operator~(Type::flag_type val) { \ V8_ALLOW_UNUSED inline constexpr Type operator~(Type::flag_type val) { \
return ~Type(val); \ return ~Type(val); \
} }
} // namespace base } // namespace base
......
...@@ -75,7 +75,7 @@ class CompilationDependency : public ZoneObject { ...@@ -75,7 +75,7 @@ class CompilationDependency : public ZoneObject {
#ifdef DEBUG #ifdef DEBUG
#define V(Name) \ #define V(Name) \
bool Is##Name() const { return kind == k##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) DEPENDENCY_LIST(V)
#undef V #undef V
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment