mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Allow any type that has a mapping from Carbon to C++ to be exposed to C++ via name lookup. This also exposes the logic to export Carbon classes to C++ to apply during type mapping, which gives very slight support for passing Carbon types to C++ functions from Carbon, but not really enough to sensibly test yet. Depends on #7042.
23 lines
830 B
C++
23 lines
830 B
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_CPP_ACCESS_H_
|
|
#define CARBON_TOOLCHAIN_CHECK_CPP_ACCESS_H_
|
|
|
|
#include "toolchain/sem_ir/name_scope.h"
|
|
|
|
namespace Carbon::Check {
|
|
|
|
// Calculates the effective access kind from the given (declaration, lookup
|
|
// access) pair.
|
|
auto MapCppAccess(clang::DeclAccessPair access_pair) -> SemIR::AccessKind;
|
|
|
|
// Maps a Carbon access kind to a C++ access specifier, suitable for use when
|
|
// declaring a C++ class member with the same access. Never returns AS_none.
|
|
auto MapToCppAccess(SemIR::AccessKind access) -> clang::AccessSpecifier;
|
|
|
|
} // namespace Carbon::Check
|
|
|
|
#endif // CARBON_TOOLCHAIN_CHECK_CPP_ACCESS_H_
|