clang
20.0.0git
lib
Basic
ASTSourceDescriptor.cpp
Go to the documentation of this file.
1
//===- ASTSourceDescriptor.cpp -------------------------------------===//
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
/// Defines the clang::ASTSourceDescriptor class, which abstracts clang modules
10
/// and precompiled header files
11
//
12
//===----------------------------------------------------------------------===//
13
14
#include "
clang/Basic/ASTSourceDescriptor.h
"
15
16
namespace
clang
{
17
18
ASTSourceDescriptor::ASTSourceDescriptor
(
Module
&M)
19
: Signature(M.Signature), ClangModule(&M) {
20
if
(M.
Directory
)
21
Path = M.
Directory
->
getName
();
22
if
(
auto
File
= M.
getASTFile
())
23
ASTFile =
File
->getName();
24
}
25
26
std::string
ASTSourceDescriptor::getModuleName
()
const
{
27
if
(ClangModule)
28
return
ClangModule->
Name
;
29
else
30
return
std::string(PCHModuleName);
31
}
32
33
}
// namespace clang
ASTSourceDescriptor.h
Defines the clang::ASTSourceDescriptor class, which abstracts clang modules and precompiled header fi...
clang::ASTSourceDescriptor::ASTSourceDescriptor
ASTSourceDescriptor()=default
clang::ASTSourceDescriptor::getModuleName
std::string getModuleName() const
Definition:
ASTSourceDescriptor.cpp:26
clang::DirectoryEntryRef::getName
StringRef getName() const
Definition:
DirectoryEntry.h:52
clang::Module
Describes a module or submodule.
Definition:
Module.h:105
clang::Module::Name
std::string Name
The name of this module.
Definition:
Module.h:108
clang::Module::Directory
OptionalDirectoryEntryRef Directory
The build directory of this module.
Definition:
Module.h:159
clang::Module::getASTFile
OptionalFileEntryRef getASTFile() const
The serialized AST file for this module, if one was created.
Definition:
Module.h:681
clang
The JSON file list parser is used to communicate input to InstallAPI.
Definition:
CalledOnceCheck.h:17
clang::SourceLocIdentKind::File
@ File
Generated on Tue Dec 17 2024 13:28:56 for clang by
1.9.6