BuildIDFetcher.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/DebugInfod/BuildIDFetcher.h - Build ID fetcher ------*- 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. ///
  14. /// \file
  15. /// This file declares a Build ID fetcher implementation for obtaining debug
  16. /// info from debuginfod.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_DEBUGINFOD_DIFETCHER_H
  20. #define LLVM_DEBUGINFOD_DIFETCHER_H
  21. #include "llvm/Object/BuildID.h"
  22. #include <optional>
  23. namespace llvm {
  24. class DebuginfodFetcher : public object::BuildIDFetcher {
  25. public:
  26. DebuginfodFetcher(std::vector<std::string> DebugFileDirectories)
  27. : BuildIDFetcher(std::move(DebugFileDirectories)) {}
  28. virtual ~DebuginfodFetcher() = default;
  29. /// Fetches the given Build ID using debuginfod and returns a local path to
  30. /// the resulting file.
  31. std::optional<std::string> fetch(object::BuildIDRef BuildID) const override;
  32. };
  33. } // namespace llvm
  34. #endif // LLVM_DEBUGINFOD_DIFETCHER_H
  35. #ifdef __GNUC__
  36. #pragma GCC diagnostic pop
  37. #endif