mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:21:04 +01:00
Reverse interop support for type aliases. (#7043)
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.
This commit is contained in:
@@ -44,4 +44,15 @@ auto MapCppAccess(clang::DeclAccessPair access_pair) -> SemIR::AccessKind {
|
||||
}
|
||||
}
|
||||
|
||||
auto MapToCppAccess(SemIR::AccessKind access) -> clang::AccessSpecifier {
|
||||
switch (access) {
|
||||
case SemIR::AccessKind::Public:
|
||||
return clang::AS_public;
|
||||
case SemIR::AccessKind::Protected:
|
||||
return clang::AS_protected;
|
||||
case SemIR::AccessKind::Private:
|
||||
return clang::AS_private;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
Reference in New Issue
Block a user