[turboshaft] fix gcov build

The uninstantiable hack doesn't seem to work on GCC.

Change-Id: I8a5ce9446cf3462a521b4e9ad6a1af4e09eeb4f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3932175
Commit-Queue: Adam Klein <adamk@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83521}
This commit is contained in:
Tobias Tebbi 2022-10-04 16:49:40 +02:00 committed by V8 LUCI CQ
parent 7dd7eea5a9
commit 386568538d
5 changed files with 7 additions and 18 deletions

View File

@ -412,7 +412,7 @@ class AssemblerInterface : public Superclass {
return Word64Constant(static_cast<uint64_t>(value));
}
OpIndex WordConstant(uint64_t value, WordRepresentation rep) {
switch (rep) {
switch (rep.value()) {
case WordRepresentation::Word32():
DCHECK(value <= WordRepresentation::Word32().MaxUnsignedValue());
return Word32Constant(static_cast<uint32_t>(value));
@ -427,7 +427,7 @@ class AssemblerInterface : public Superclass {
return subclass().Constant(ConstantOp::Kind::kFloat64, value);
}
OpIndex FloatConstant(double value, FloatRepresentation rep) {
switch (rep) {
switch (rep.value()) {
case FloatRepresentation::Float32():
return Float32Constant(static_cast<float>(value));
case FloatRepresentation::Float64():

View File

@ -119,7 +119,7 @@ std::ostream& operator<<(std::ostream& os, FloatUnaryOp::Kind kind) {
// static
bool FloatUnaryOp::IsSupported(Kind kind, FloatRepresentation rep) {
switch (rep) {
switch (rep.value()) {
case FloatRepresentation::Float32():
switch (kind) {
case Kind::kRoundDown:

View File

@ -175,7 +175,7 @@ void ScheduleBuilder::ProcessOperation(const Operation& op) {
Node* ScheduleBuilder::ProcessOperation(const WordBinopOp& op) {
using Kind = WordBinopOp::Kind;
const Operator* o;
switch (op.rep) {
switch (op.rep.value()) {
case WordRepresentation::Word32():
switch (op.kind) {
case Kind::kAdd:
@ -264,7 +264,7 @@ Node* ScheduleBuilder::ProcessOperation(const WordBinopOp& op) {
Node* ScheduleBuilder::ProcessOperation(const FloatBinopOp& op) {
using Kind = FloatBinopOp::Kind;
const Operator* o;
switch (op.rep) {
switch (op.rep.value()) {
case FloatRepresentation::Float32():
switch (op.kind) {
case Kind::kAdd:
@ -330,7 +330,7 @@ Node* ScheduleBuilder::ProcessOperation(const FloatBinopOp& op) {
Node* ScheduleBuilder::ProcessOperation(const OverflowCheckedBinopOp& op) {
const Operator* o;
switch (op.rep) {
switch (op.rep.value()) {
case WordRepresentation::Word32():
switch (op.kind) {
case OverflowCheckedBinopOp::Kind::kSignedAdd:

View File

@ -178,12 +178,9 @@ class WordRepresentation : public RegisterRepresentation {
return static_cast<Enum>(RegisterRepresentation::value());
}
constexpr operator Enum() const { return value(); }
// Hide the superclass implicit conversion with an uninstantiable template.
template <Uninstantiable&>
explicit constexpr operator RegisterRepresentation::Enum() const;
constexpr uint64_t MaxUnsignedValue() const {
switch (*this) {
switch (this->value()) {
case Word32():
return std::numeric_limits<uint32_t>::max();
case Word64():
@ -210,9 +207,6 @@ class FloatRepresentation : public RegisterRepresentation {
return static_cast<Enum>(RegisterRepresentation::value());
}
constexpr operator Enum() const { return value(); }
// Hide the superclass implicit conversion with an uninstantiable template.
template <Uninstantiable&>
explicit constexpr operator RegisterRepresentation::Enum() const;
private:
explicit constexpr FloatRepresentation(Enum value)

View File

@ -86,11 +86,6 @@ std::ostream& operator<<(std::ostream& os, all_of<Ts...> all) {
return all.PrintTo(os, std::index_sequence_for<Ts...>{});
}
class Uninstantiable {
private:
constexpr Uninstantiable() = default;
};
} // namespace v8::internal::compiler::turboshaft
#endif // V8_COMPILER_TURBOSHAFT_UTILS_H_