1//===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
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///
11/// This file contains the class declaration for the code that parses STABS
12/// debug maps that are embedded in the binaries symbol tables.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
17#define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
18
19#include "BinaryHolder.h"
20#include "DebugMap.h"
21#include "LinkUtils.h"
22#include "llvm/ADT/ArrayRef.h"
23#include "llvm/ADT/StringRef.h"
24#include "llvm/ADT/StringSet.h"
25#include "llvm/Support/Compiler.h"
26#include "llvm/Support/ErrorOr.h"
27#include <memory>
28#include <optional>
29#include <string>
30#include <vector>
31
32namespace llvm {
33namespace dsymutil {
34
35enum ObjectFilterType { Allow, Disallow };
36
37/// Extract the DebugMaps from the given file.
38/// The file has to be a MachO object file. Multiple debug maps can be
39/// returned when the file is universal (aka fat) binary.
40ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
41parseDebugMap(BinaryHolder &BinHolder, StringRef InputFile,
42 ArrayRef<std::string> Archs,
43 ArrayRef<std::string> DSYMSearchPaths, StringRef PrependPath,
44 StringRef VariantSuffix, bool Verbose, bool InputIsYAML,
45 const std::optional<StringSet<>> &ObjectFilter = std::nullopt,
46 ObjectFilterType ObjectFilterType = ObjectFilterType::Allow);
47
48/// Dump the symbol table.
49bool dumpStab(BinaryHolder &BinHolder, StringRef InputFile,
50 ArrayRef<std::string> Archs,
51 ArrayRef<std::string> DSYMSearchPaths, StringRef PrependPath = "",
52 StringRef VariantSuffix = "");
53
54} // end namespace dsymutil
55} // end namespace llvm
56
57#endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
58