Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:48

0001 //===- ASTSourceDescriptor.h -----------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 /// \file
0010 /// Defines the clang::ASTSourceDescriptor class, which abstracts clang modules
0011 /// and precompiled header files
0012 //
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
0016 #define LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H
0017 
0018 #include "clang/Basic/Module.h"
0019 #include "llvm/ADT/StringRef.h"
0020 #include <string>
0021 #include <utility>
0022 
0023 namespace clang {
0024 
0025 /// Abstracts clang modules and precompiled header files and holds
0026 /// everything needed to generate debug info for an imported module
0027 /// or PCH.
0028 class ASTSourceDescriptor {
0029   StringRef PCHModuleName;
0030   StringRef Path;
0031   StringRef ASTFile;
0032   ASTFileSignature Signature;
0033   Module *ClangModule = nullptr;
0034 
0035 public:
0036   ASTSourceDescriptor() = default;
0037   ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile,
0038                       ASTFileSignature Signature)
0039       : PCHModuleName(std::move(Name)), Path(std::move(Path)),
0040         ASTFile(std::move(ASTFile)), Signature(Signature) {}
0041   ASTSourceDescriptor(Module &M);
0042 
0043   std::string getModuleName() const;
0044   StringRef getPath() const { return Path; }
0045   StringRef getASTFile() const { return ASTFile; }
0046   ASTFileSignature getSignature() const { return Signature; }
0047   Module *getModuleOrNull() const { return ClangModule; }
0048 };
0049 
0050 } // namespace clang
0051 
0052 #endif // LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H