// Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #ifndef CARBON_TOOLCHAIN_SEMANTICS_META_NODE_BLOCK_H_ #define CARBON_TOOLCHAIN_SEMANTICS_META_NODE_BLOCK_H_ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "toolchain/semantics/meta_node.h" namespace Carbon::Semantics { // The standard structure for declaration and statement blocks. template struct MetaNodeBlock { public: MetaNodeBlock(llvm::SmallVector nodes, llvm::StringMap name_lookup) : nodes_(std::move(nodes)), name_lookup_(std::move(name_lookup)) {} auto nodes() const -> llvm::ArrayRef { return nodes_; } auto name_lookup() const -> const llvm::StringMap& { return name_lookup_; } protected: llvm::SmallVector nodes_; llvm::StringMap name_lookup_; }; using DeclarationBlock = MetaNodeBlock; using StatementBlock = MetaNodeBlock; } // namespace Carbon::Semantics #endif // CARBON_TOOLCHAIN_SEMANTICS_META_NODE_BLOCK_H_