mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:50:14 +01:00
I'd excluded these initially just because I was thinking towards copies, but under the current model I'm trying to catch all the decl types just for consistency. Note references will still be a TODO error (LazyImportRef is already tested for this, it just didn't feel necessary to add individual tests while I try to sort out behavior). Fixes an oversight where declarations in an entity's scope were being added to the list of exports. Note I'm trimming some Import API arguments as now-unused.
31 lines
1.0 KiB
C++
31 lines
1.0 KiB
C++
|
|
// 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_CHECK_SCOPE_INDEX_H_
|
|
#define CARBON_TOOLCHAIN_CHECK_SCOPE_INDEX_H_
|
|
|
|
#include "toolchain/base/index_base.h"
|
|
|
|
namespace Carbon::Check {
|
|
|
|
// An index for a pushed scope. This may correspond to a permanent scope with a
|
|
// corresponding `NameScope`, in which case a different index will be assigned
|
|
// each time the scope is entered. Alternatively, it may be a temporary scope
|
|
// such as is created for a block, and will only be entered once.
|
|
//
|
|
// `ScopeIndex` values are comparable. Lower `ScopeIndex` values correspond to
|
|
// scopes entered earlier in the file.
|
|
struct ScopeIndex : public IndexBase, public Printable<ScopeIndex> {
|
|
static const ScopeIndex Package;
|
|
|
|
using IndexBase::IndexBase;
|
|
};
|
|
|
|
constexpr ScopeIndex ScopeIndex::Package = ScopeIndex(0);
|
|
|
|
} // namespace Carbon::Check
|
|
|
|
#endif // CARBON_TOOLCHAIN_CHECK_SCOPE_INDEX_H_
|