chromium/v8/src/flags/flags-impl.h

// Copyright 2024 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.

#ifndef V8_FLAGS_FLAGS_IMPL_H_
#define V8_FLAGS_FLAGS_IMPL_H_

#include <optional>
#include <unordered_set>

#include "src/base/macros.h"
#include "src/base/vector.h"
#include "src/flags/flags.h"

namespace v8::internal {

class V8_EXPORT_PRIVATE FlagHelpers {};

struct Flag;
Flag* FindFlagByPointer(const void* ptr);
V8_EXPORT_PRIVATE Flag* FindFlagByName(const char* name);
V8_EXPORT_PRIVATE Flag* FindImplicationFlagByName(const char* name);

V8_EXPORT_PRIVATE base::Vector<Flag> Flags();

// Helper struct for printing normalized flag names.
struct FlagName {};

std::ostream& operator<<(std::ostream& os, FlagName flag_name);

// This structure represents a single entry in the flag system, with a pointer
// to the actual flag, default value, comment, etc.  This is designed to be POD
// initialized as to avoid requiring static constructors.
struct Flag {};

}  // namespace v8::internal

#endif  // V8_FLAGS_FLAGS_IMPL_H_