Path: blob/main/contrib/llvm-project/clang/lib/Basic/ASTSourceDescriptor.cpp
35233 views
//===- ASTSourceDescriptor.cpp -------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8/// Defines the clang::ASTSourceDescriptor class, which abstracts clang modules9/// and precompiled header files10//11//===----------------------------------------------------------------------===//1213#include "clang/Basic/ASTSourceDescriptor.h"1415namespace clang {1617ASTSourceDescriptor::ASTSourceDescriptor(Module &M)18: Signature(M.Signature), ClangModule(&M) {19if (M.Directory)20Path = M.Directory->getName();21if (auto File = M.getASTFile())22ASTFile = File->getName();23}2425std::string ASTSourceDescriptor::getModuleName() const {26if (ClangModule)27return ClangModule->Name;28else29return std::string(PCHModuleName);30}3132} // namespace clang333435