[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / lib / Debuginfod / DIFetcher.cpp
blobf0c134654534ff47d046a53179084327876dfe80
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 //===----------------------------------------------------------------------===//
15 #include "llvm/Debuginfod/DIFetcher.h"
17 #include "llvm/Debuginfod/Debuginfod.h"
19 using namespace llvm;
21 Optional<std::string>
22 DebuginfodDIFetcher::fetchBuildID(ArrayRef<uint8_t> BuildID) const {
23 Expected<std::string> PathOrErr = getCachedOrDownloadDebuginfo(BuildID);
24 if (PathOrErr)
25 return *PathOrErr;
26 consumeError(PathOrErr.takeError());
27 return None;