chromium/v8/src/wasm/wasm-features.h

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif  // !V8_ENABLE_WEBASSEMBLY

#ifndef V8_WASM_WASM_FEATURES_H_
#define V8_WASM_WASM_FEATURES_H_

#include <iosfwd>
#include <string>

#include "src/base/small-vector.h"
#include "src/common/globals.h"
// The feature flags are declared in their own header.
#include "src/wasm/wasm-feature-flags.h"

// Features that are always enabled and do not have a flag.
#define FOREACH_WASM_NON_FLAG_FEATURE(V)

// All features, including features that do not have flags.
#define FOREACH_WASM_FEATURE(V)

namespace v8::internal::wasm {

enum class WasmEnabledFeature {};

enum class WasmDetectedFeature {};

// Set of enabled features. This only includes features that have a flag.
class WasmEnabledFeatures : public base::EnumSet<WasmEnabledFeature> {};

// Set of detected features. This includes features that have a flag plus
// features in FOREACH_WASM_NON_FLAG_FEATURE.
class WasmDetectedFeatures : public base::EnumSet<WasmDetectedFeature> {};

inline constexpr const char* name(WasmEnabledFeature feature) {}

inline std::ostream& operator<<(std::ostream& os, WasmEnabledFeature feature) {}

inline constexpr const char* name(WasmDetectedFeature feature) {}

inline std::ostream& operator<<(std::ostream& os, WasmDetectedFeature feature) {}

enum class CompileTimeImport {};

inline std::ostream& operator<<(std::ostream& os, CompileTimeImport imp) {}

CompileTimeImportFlags;

class CompileTimeImports {};

}  // namespace v8::internal::wasm

#endif  // V8_WASM_WASM_FEATURES_H_