1 //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 /// This file contains the class declaration for the code that parses STABS
13 /// debug maps that are embedded in the binaries symbol tables.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
18 #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/Support/Compiler.h"
24 #include "llvm/Support/ErrorOr.h"
36 /// Skip emitting output
37 bool NoOutput
= false;
39 /// Do not unique types according to ODR
42 /// Do not check swiftmodule timestamp
43 bool NoTimestamp
= false;
46 std::string PrependPath
;
48 LinkOptions() = default;
51 /// \brief Extract the DebugMaps from the given file.
52 /// The file has to be a MachO object file. Multiple debug maps can be
53 /// returned when the file is universal (aka fat) binary.
54 ErrorOr
<std::vector
<std::unique_ptr
<DebugMap
>>>
55 parseDebugMap(StringRef InputFile
, ArrayRef
<std::string
> Archs
,
56 StringRef PrependPath
, bool Verbose
, bool InputIsYAML
);
58 /// \brief Dump the symbol table
59 bool dumpStab(StringRef InputFile
, ArrayRef
<std::string
> Archs
,
60 StringRef PrependPath
= "");
62 /// \brief Link the Dwarf debuginfo as directed by the passed DebugMap
63 /// \p DM into a DwarfFile named \p OutputFilename.
64 /// \returns false if the link failed.
65 bool linkDwarf(raw_fd_ostream
&OutFile
, const DebugMap
&DM
,
66 const LinkOptions
&Options
);
68 void warn(const Twine
&Warning
, const Twine
&Context
);
69 bool error(const Twine
&Error
, const Twine
&Context
);
71 } // end namespace dsymutil
72 } // end namespace llvm
74 #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H