Files
carbon-lang/toolchain/check/cpp/context.cpp
T
Richard Smith c4d162e5f5 Switch from clang::ASTUnit to clang::CompilerInstance. (#6483)
This gives us a lot more control over how the compiler is built and
invoked. But no functionality changes are intended in this PR.
2025-12-10 21:54:51 +00:00

24 lines
677 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/context.h"
#include "clang/AST/Mangle.h"
namespace Carbon::Check {
CppContext::CppContext(std::unique_ptr<clang::FrontendAction> action)
: action_(std::move(action)) {}
CppContext::~CppContext() = default;
auto CppContext::clang_mangle_context() -> clang::MangleContext& {
if (!clang_mangle_context_) {
clang_mangle_context_.reset(ast_context().createMangleContext());
}
return *clang_mangle_context_;
}
} // namespace Carbon::Check