mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 21:32:38 +00:00
* Move `Sema` access from `CppFile` into `CppContext`. * Move the mangle context from `SemIR::File` into `CppContext`. * Move source location mapping state from `Context` into `CppContext`. Also factor out the `GenerateAst` function that builds the `CppContext` and `CppFile` into its own file.
27 lines
1022 B
C++
27 lines
1022 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_GENERATE_AST_H_
|
|
#define CARBON_TOOLCHAIN_CHECK_CPP_GENERATE_AST_H_
|
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
|
#include "llvm/Support/VirtualFileSystem.h"
|
|
#include "toolchain/check/context.h"
|
|
|
|
namespace Carbon::Check {
|
|
|
|
// Generates a Clang AST for the given C++ imports and sets it as the context's
|
|
// `cpp_context` and the SemIR's `cpp_file`. Returns a bool that represents
|
|
// whether compilation was successful.
|
|
auto GenerateAst(Context& context,
|
|
llvm::ArrayRef<Parse::Tree::PackagingNames> imports,
|
|
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs,
|
|
std::shared_ptr<clang::CompilerInvocation> base_invocation)
|
|
-> bool;
|
|
|
|
} // namespace Carbon::Check
|
|
|
|
#endif // CARBON_TOOLCHAIN_CHECK_CPP_GENERATE_AST_H_
|