mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:31:04 +01:00
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>
This commit is contained in:
co-authored by
Christopher Di Bella
parent
9b8a2124b9
commit
9bcee64b32
@@ -0,0 +1,22 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user