IPDBInjectedSource.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- IPDBInjectedSource.h - base class for PDB injected file --*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
  14. #define LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
  15. #include <cstdint>
  16. #include <string>
  17. namespace llvm {
  18. namespace pdb {
  19. /// IPDBInjectedSource defines an interface used to represent source files
  20. /// which were injected directly into the PDB file during the compilation
  21. /// process. This is used, for example, to add natvis files to a PDB, but
  22. /// in theory could be used to add arbitrary source code.
  23. class IPDBInjectedSource {
  24. public:
  25. virtual ~IPDBInjectedSource();
  26. virtual uint32_t getCrc32() const = 0;
  27. virtual uint64_t getCodeByteSize() const = 0;
  28. virtual std::string getFileName() const = 0;
  29. virtual std::string getObjectFileName() const = 0;
  30. virtual std::string getVirtualFileName() const = 0;
  31. // The returned value depends on the PDB producer,
  32. // but 0 is guaranteed to mean "no compression".
  33. // The enum PDB_SourceCompression lists known return values.
  34. virtual uint32_t getCompression() const = 0;
  35. virtual std::string getCode() const = 0;
  36. };
  37. } // namespace pdb
  38. } // namespace llvm
  39. #endif // LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
  40. #ifdef __GNUC__
  41. #pragma GCC diagnostic pop
  42. #endif