2014-12-13 01:31:24 +08:00
|
|
|
//===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
|
|
|
|
//
|
|
|
|
// The LLVM Linker
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2017-11-02 05:16:06 +08:00
|
|
|
//
|
2014-12-13 01:31:24 +08:00
|
|
|
/// \file
|
|
|
|
///
|
|
|
|
/// This file contains the class declaration for the code that parses STABS
|
|
|
|
/// debug maps that are embedded in the binaries symbol tables.
|
2017-11-02 05:16:06 +08:00
|
|
|
//
|
2014-12-13 01:31:24 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2017-11-02 05:16:06 +08:00
|
|
|
|
2014-12-13 01:31:24 +08:00
|
|
|
#ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
|
|
|
|
#define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
|
|
|
|
|
|
|
|
#include "DebugMap.h"
|
2017-11-02 05:16:06 +08:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2014-12-13 01:31:24 +08:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2017-11-02 05:16:06 +08:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2014-12-13 01:31:24 +08:00
|
|
|
#include "llvm/Support/ErrorOr.h"
|
|
|
|
#include <memory>
|
2017-11-02 05:16:06 +08:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2014-12-13 01:31:24 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace dsymutil {
|
2015-02-28 08:29:07 +08:00
|
|
|
|
|
|
|
struct LinkOptions {
|
2017-11-02 05:16:06 +08:00
|
|
|
/// Verbosity
|
|
|
|
bool Verbose = false;
|
|
|
|
|
|
|
|
/// Skip emitting output
|
|
|
|
bool NoOutput = false;
|
2015-02-28 08:29:07 +08:00
|
|
|
|
2017-11-02 05:16:06 +08:00
|
|
|
/// Do not unique types according to ODR
|
2018-02-08 18:48:54 +08:00
|
|
|
bool NoODR = false;
|
|
|
|
|
|
|
|
/// Update
|
|
|
|
bool Update = false;
|
2017-11-02 05:16:06 +08:00
|
|
|
|
2018-01-29 22:52:50 +08:00
|
|
|
/// Minimize
|
|
|
|
bool Minimize = false;
|
|
|
|
|
2017-11-02 05:16:06 +08:00
|
|
|
/// Do not check swiftmodule timestamp
|
|
|
|
bool NoTimestamp = false;
|
|
|
|
|
|
|
|
/// -oso-prepend-path
|
|
|
|
std::string PrependPath;
|
|
|
|
|
|
|
|
LinkOptions() = default;
|
2015-02-28 08:29:07 +08:00
|
|
|
};
|
|
|
|
|
2015-08-06 02:27:44 +08:00
|
|
|
/// \brief Extract the DebugMaps from the given file.
|
|
|
|
/// The file has to be a MachO object file. Multiple debug maps can be
|
|
|
|
/// returned when the file is universal (aka fat) binary.
|
2017-11-02 05:16:06 +08:00
|
|
|
ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
|
2015-08-06 06:33:28 +08:00
|
|
|
parseDebugMap(StringRef InputFile, ArrayRef<std::string> Archs,
|
|
|
|
StringRef PrependPath, bool Verbose, bool InputIsYAML);
|
2014-12-13 01:31:24 +08:00
|
|
|
|
2015-08-31 08:29:09 +08:00
|
|
|
/// \brief Dump the symbol table
|
|
|
|
bool dumpStab(StringRef InputFile, ArrayRef<std::string> Archs,
|
|
|
|
StringRef PrependPath = "");
|
|
|
|
|
2018-02-22 19:32:51 +08:00
|
|
|
/// \brief Link the Dwarf debug info as directed by the passed DebugMap
|
2014-12-13 01:31:24 +08:00
|
|
|
/// \p DM into a DwarfFile named \p OutputFilename.
|
|
|
|
/// \returns false if the link failed.
|
2017-11-16 04:55:53 +08:00
|
|
|
bool linkDwarf(raw_fd_ostream &OutFile, const DebugMap &DM,
|
2015-02-28 08:29:07 +08:00
|
|
|
const LinkOptions &Options);
|
2015-08-06 02:27:38 +08:00
|
|
|
|
2015-08-26 13:09:55 +08:00
|
|
|
void warn(const Twine &Warning, const Twine &Context);
|
|
|
|
bool error(const Twine &Error, const Twine &Context);
|
2017-11-02 05:16:06 +08:00
|
|
|
|
|
|
|
} // end namespace dsymutil
|
|
|
|
} // end namespace llvm
|
|
|
|
|
2014-12-13 01:31:24 +08:00
|
|
|
#endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
|