OSDN Git Service

[dsymutil] Move abstractions into separate files (NFC)
[android-x86/external-llvm.git] / tools / dsymutil / dsymutil.h
1 //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file
11 ///
12 /// This file contains the class declaration for the code that parses STABS
13 /// debug maps that are embedded in the binaries symbol tables.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
18 #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
19
20 #include "DebugMap.h"
21 #include "LinkUtils.h"
22 #include "llvm/ADT/ArrayRef.h"
23 #include "llvm/ADT/StringRef.h"
24 #include "llvm/Support/Compiler.h"
25 #include "llvm/Support/ErrorOr.h"
26 #include <memory>
27 #include <string>
28 #include <vector>
29
30 namespace llvm {
31 namespace dsymutil {
32
33 /// Extract the DebugMaps from the given file.
34 /// The file has to be a MachO object file. Multiple debug maps can be
35 /// returned when the file is universal (aka fat) binary.
36 ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
37 parseDebugMap(StringRef InputFile, ArrayRef<std::string> Archs,
38               StringRef PrependPath, bool PaperTrailWarnings, bool Verbose,
39               bool InputIsYAML);
40
41 /// Dump the symbol table
42 bool dumpStab(StringRef InputFile, ArrayRef<std::string> Archs,
43               StringRef PrependPath = "");
44
45 /// Link the Dwarf debug info as directed by the passed DebugMap \p DM into a
46 /// DwarfFile named \p OutputFilename. \returns false if the link failed.
47 bool linkDwarf(raw_fd_ostream &OutFile, const DebugMap &DM,
48                const LinkOptions &Options);
49
50 } // end namespace dsymutil
51 } // end namespace llvm
52
53 #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H