Path: blob/main/contrib/llvm-project/llvm/lib/Debuginfod/BuildIDFetcher.cpp
35234 views
//===- llvm/DebugInfod/BuildIDFetcher.cpp - Build ID fetcher --------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file defines a DIFetcher implementation for obtaining debug info10/// from debuginfod.11///12//===----------------------------------------------------------------------===//1314#include "llvm/Debuginfod/BuildIDFetcher.h"1516#include "llvm/Debuginfod/Debuginfod.h"1718using namespace llvm;1920std::optional<std::string>21DebuginfodFetcher::fetch(ArrayRef<uint8_t> BuildID) const {22if (std::optional<std::string> Path = BuildIDFetcher::fetch(BuildID))23return std::move(*Path);2425Expected<std::string> PathOrErr = getCachedOrDownloadDebuginfo(BuildID);26if (PathOrErr)27return *PathOrErr;28consumeError(PathOrErr.takeError());29return std::nullopt;30}313233