clang 22.0.0git
ASTSourceDescriptor.h
Go to the documentation of this file.
1//===- ASTSourceDescriptor.h -----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Defines the clang::ASTSourceDescriptor class, which abstracts clang modules
11/// and precompiled header files
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
16#define LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
17
18#include "clang/Basic/Module.h"
19#include "llvm/ADT/StringRef.h"
20#include <string>
21#include <utility>
22
23namespace clang {
24
25/// Abstracts clang modules and precompiled header files and holds
26/// everything needed to generate debug info for an imported module
27/// or PCH.
29 StringRef PCHModuleName;
30 StringRef Path;
31 StringRef ASTFile;
32 ASTFileSignature Signature;
33 Module *ClangModule = nullptr;
34
35public:
37 ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile,
38 ASTFileSignature Signature)
39 : PCHModuleName(std::move(Name)), Path(std::move(Path)),
40 ASTFile(std::move(ASTFile)), Signature(Signature) {}
42
43 std::string getModuleName() const;
44 StringRef getPath() const { return Path; }
45 StringRef getASTFile() const { return ASTFile; }
46 ASTFileSignature getSignature() const { return Signature; }
47 Module *getModuleOrNull() const { return ClangModule; }
48};
49
50} // namespace clang
51
52#endif // LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
Defines the clang::Module class, which describes a module in the source code.
ASTFileSignature getSignature() const
ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile, ASTFileSignature Signature)
Describes a module or submodule.
Definition Module.h:144
The JSON file list parser is used to communicate input to InstallAPI.
The signature of a module, which is a hash of the AST content.
Definition Module.h:58