DIFetcher.cpp 930 B

12345678910111213141516171819202122232425262728
  1. //===- llvm/DebugInfod/DIFetcher.cpp - Debug info fetcher -----------------===//
  2. //
  3. // 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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. ///
  9. /// \file
  10. /// This file defines a DIFetcher implementation for obtaining debug info
  11. /// from debuginfod.
  12. ///
  13. //===----------------------------------------------------------------------===//
  14. #include "llvm/Debuginfod/DIFetcher.h"
  15. #include "llvm/Debuginfod/Debuginfod.h"
  16. using namespace llvm;
  17. Optional<std::string>
  18. DebuginfodDIFetcher::fetchBuildID(ArrayRef<uint8_t> BuildID) const {
  19. Expected<std::string> PathOrErr = getCachedOrDownloadDebuginfo(BuildID);
  20. if (PathOrErr)
  21. return *PathOrErr;
  22. consumeError(PathOrErr.takeError());
  23. return None;
  24. }