LLVM 22.0.0git
BuildID.h
Go to the documentation of this file.
1//===- llvm/Object/BuildID.h - Build ID -------------------------*- C++ -*-===//
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 declares a library for handling Build IDs and using them to find
11/// debug info.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_DEBUGINFO_OBJECT_BUILDID_H
16#define LLVM_DEBUGINFO_OBJECT_BUILDID_H
17
18#include "llvm/ADT/ArrayRef.h"
21
22namespace llvm {
23namespace object {
24
25/// A build ID in binary form.
27
28/// A reference to a BuildID in binary form.
30
31class ObjectFile;
32
33/// Parses a build ID from a hex string.
35
36/// Returns the build ID, if any, contained in the given object file.
38
39/// BuildIDFetcher searches local cache directories for debug info.
41public:
42 BuildIDFetcher(std::vector<std::string> DebugFileDirectories)
43 : DebugFileDirectories(std::move(DebugFileDirectories)) {}
44 virtual ~BuildIDFetcher() = default;
45
46 /// Returns the path to the debug file with the given build ID.
47 virtual std::optional<std::string> fetch(BuildIDRef BuildID) const;
48
49private:
50 const std::vector<std::string> DebugFileDirectories;
51};
52
53} // namespace object
54} // namespace llvm
55
56#endif // LLVM_DEBUGINFO_OBJECT_BUILDID_H
#define LLVM_ABI
Definition: Compiler.h:213
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1197
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
BuildIDFetcher searches local cache directories for debug info.
Definition: BuildID.h:40
BuildIDFetcher(std::vector< std::string > DebugFileDirectories)
Definition: BuildID.h:42
virtual ~BuildIDFetcher()=default
This class is the base class for all object file types.
Definition: ObjectFile.h:231
SmallVector< uint8_t, 10 > BuildID
A build ID in binary form.
Definition: BuildID.h:26
LLVM_ABI BuildIDRef getBuildID(const ObjectFile *Obj)
Returns the build ID, if any, contained in the given object file.
Definition: BuildID.cpp:56
LLVM_ABI BuildID parseBuildID(StringRef Str)
Parses a build ID from a hex string.
Definition: BuildID.cpp:47
ArrayRef< uint8_t > BuildIDRef
A reference to a BuildID in binary form.
Definition: BuildID.h:29
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1886
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:856