Files
carbon-lang/toolchain/check/cpp/domain.cpp
T
Richard SmithandChristopher Di Bella 9bcee64b32 Add some encapsulation to CppDomain (#7579)
Start tracking the domain within `CppContext`s instead of having them
duplicate its fields. This allows us to remove the shared ownership of
the clang parser.

---------

Co-authored-by: Christopher Di Bella <cjdb.ns@gmail.com>
2026-07-31 18:08:13 +00:00

23 lines
772 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
#include "toolchain/check/cpp/domain.h"
#include "clang/Parse/Parser.h"
namespace Carbon::Check {
CppDomain::CppDomain(std::shared_ptr<clang::CompilerInstance> clang_instance,
std::unique_ptr<clang::Parser> parser,
clang::CodeGenerator* code_generator,
llvm::LLVMContext* llvm_context)
: clang_instance_(std::move(clang_instance)),
parser_(std::move(parser)),
code_generator_(code_generator),
llvm_context_(llvm_context) {}
CppDomain::~CppDomain() = default;
} // namespace Carbon::Check