clang 20.0.0 (based on r547379) from build 12806354. Bug: http://b/379133546 Test: N/A Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
//===- ASTSourceDescriptor.h -----------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
/// \file
|
|
/// Defines the clang::ASTSourceDescriptor class, which abstracts clang modules
|
|
/// and precompiled header files
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
|
|
#define LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
|
|
|
|
#include "clang/Basic/Module.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
namespace clang {
|
|
|
|
/// Abstracts clang modules and precompiled header files and holds
|
|
/// everything needed to generate debug info for an imported module
|
|
/// or PCH.
|
|
class ASTSourceDescriptor {
|
|
StringRef PCHModuleName;
|
|
StringRef Path;
|
|
StringRef ASTFile;
|
|
ASTFileSignature Signature;
|
|
Module *ClangModule = nullptr;
|
|
|
|
public:
|
|
ASTSourceDescriptor() = default;
|
|
ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile,
|
|
ASTFileSignature Signature)
|
|
: PCHModuleName(std::move(Name)), Path(std::move(Path)),
|
|
ASTFile(std::move(ASTFile)), Signature(Signature) {}
|
|
ASTSourceDescriptor(Module &M);
|
|
|
|
std::string getModuleName() const;
|
|
StringRef getPath() const { return Path; }
|
|
StringRef getASTFile() const { return ASTFile; }
|
|
ASTFileSignature getSignature() const { return Signature; }
|
|
Module *getModuleOrNull() const { return ClangModule; }
|
|
};
|
|
|
|
} // namespace clang
|
|
|
|
#endif // LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
|