blob: 6ee6c7cc8fc1d2c0e95c52c3dfa38483a5060f6f [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- IPDBInjectedSource.h - base class for PDB injected file --*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
10#define LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
11
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020012#include <cstdint>
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010013#include <string>
14
15namespace llvm {
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010016namespace pdb {
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010017/// IPDBInjectedSource defines an interface used to represent source files
18/// which were injected directly into the PDB file during the compilation
19/// process. This is used, for example, to add natvis files to a PDB, but
20/// in theory could be used to add arbitrary source code.
21class IPDBInjectedSource {
22public:
23 virtual ~IPDBInjectedSource();
24
25 virtual uint32_t getCrc32() const = 0;
26 virtual uint64_t getCodeByteSize() const = 0;
27 virtual std::string getFileName() const = 0;
28 virtual std::string getObjectFileName() const = 0;
29 virtual std::string getVirtualFileName() const = 0;
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020030 // The returned value depends on the PDB producer,
31 // but 0 is guaranteed to mean "no compression".
32 // The enum PDB_SourceCompression lists known return values.
33 virtual uint32_t getCompression() const = 0;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010034 virtual std::string getCode() const = 0;
35};
36} // namespace pdb
37} // namespace llvm
38
39#endif // LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H