32 changes: 0 additions & 32 deletions llvm/test/tools/dsymutil/X86/papertrail-warnings.test

This file was deleted.

1 change: 0 additions & 1 deletion llvm/test/tools/dsymutil/cmdline.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CHECK: -object-prefix-map <prefix=remapped>
CHECK: -oso-prepend-path <path>
CHECK: -out <filename>
CHECK: {{-o <filename>}}
CHECK: -papertrail
CHECK: -remarks-drop-without-debug
CHECK: -remarks-output-format <format>
CHECK: -remarks-prepend-path <path>
Expand Down
4 changes: 1 addition & 3 deletions llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ DwarfLinkerForBinary::loadObject(const DebugMapObject &Obj,
});
}),
std::make_unique<AddressesMap>(*this, *ErrorOrObj, Obj),
Obj.empty() ? Obj.getWarnings() : EmptyWarnings,
[&](StringRef FileName) { BinHolder.eraseObjectEntry(FileName); });

Error E = RL.link(*ErrorOrObj);
Expand Down Expand Up @@ -791,8 +790,7 @@ bool DwarfLinkerForBinary::linkImpl(
OnCUDieLoaded);
} else {
ObjectsForLinking.push_back(std::make_unique<OutDwarfFile>(
Obj->getObjectFilename(), nullptr, nullptr,
Obj->empty() ? Obj->getWarnings() : EmptyWarnings));
Obj->getObjectFilename(), nullptr, nullptr));
GeneralLinker->addObjectFile(*ObjectsForLinking.back());
}
}
Expand Down
20 changes: 4 additions & 16 deletions llvm/tools/dsymutil/MachODebugMapParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ class MachODebugMapParser {
public:
MachODebugMapParser(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
StringRef BinaryPath, ArrayRef<std::string> Archs,
StringRef PathPrefix = "",
bool PaperTrailWarnings = false, bool Verbose = false)
StringRef PathPrefix = "", bool Verbose = false)
: BinaryPath(std::string(BinaryPath)), Archs(Archs.begin(), Archs.end()),
PathPrefix(std::string(PathPrefix)),
PaperTrailWarnings(PaperTrailWarnings), BinHolder(VFS, Verbose),
PathPrefix(std::string(PathPrefix)), BinHolder(VFS, Verbose),
CurrentDebugMapObject(nullptr), SkipDebugMapObject(false) {}

/// Parses and returns the DebugMaps of the input binary. The binary contains
Expand All @@ -50,7 +48,6 @@ class MachODebugMapParser {
std::string BinaryPath;
SmallVector<StringRef, 1> Archs;
std::string PathPrefix;
bool PaperTrailWarnings;

/// Owns the MemoryBuffer for the main binary.
BinaryHolder BinHolder;
Expand Down Expand Up @@ -137,13 +134,6 @@ class MachODebugMapParser {
<< MachOUtils::getArchName(
Result->getTriple().getArchName())
<< ") " << File << " " << Msg << "\n";

if (PaperTrailWarnings) {
if (!File.empty())
Result->addDebugMapObject(File, sys::TimePoint<std::chrono::seconds>());
if (Result->end() != Result->begin())
(*--Result->end())->addWarning(Msg.str());
}
}
};

Expand Down Expand Up @@ -704,13 +694,11 @@ namespace dsymutil {
llvm::ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
parseDebugMap(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
StringRef InputFile, ArrayRef<std::string> Archs,
StringRef PrependPath, bool PaperTrailWarnings, bool Verbose,
bool InputIsYAML) {
StringRef PrependPath, bool Verbose, bool InputIsYAML) {
if (InputIsYAML)
return DebugMap::parseYAMLDebugMap(InputFile, PrependPath, Verbose);

MachODebugMapParser Parser(VFS, InputFile, Archs, PrependPath,
PaperTrailWarnings, Verbose);
MachODebugMapParser Parser(VFS, InputFile, Archs, PrependPath, Verbose);
return Parser.parse();
}

Expand Down
4 changes: 0 additions & 4 deletions llvm/tools/dsymutil/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ def yaml_input: Flag<["-", "--"], "y">,
HelpText<"Treat the input file is a YAML debug map rather than a binary.">,
Group<grp_general>;

def papertrail: F<"papertrail">,
HelpText<"Embed warnings in the linked DWARF debug info.">,
Group<grp_general>;

def assembly: Flag<["-", "--"], "S">,
HelpText<"Output textual assembly instead of a binary dSYM companion file.">,
Group<grp_general>;
Expand Down
14 changes: 2 additions & 12 deletions llvm/tools/dsymutil/dsymutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ struct DsymutilOptions {
bool DumpStab = false;
bool Flat = false;
bool InputIsYAMLDebugMap = false;
bool PaperTrailWarnings = false;
bool ForceKeepFunctionForStatic = false;
std::string SymbolMap;
std::string OutputFile;
Expand Down Expand Up @@ -198,11 +197,6 @@ static Error verifyOptions(const DsymutilOptions &Options) {
"cannot use -o with multiple inputs in flat mode.",
errc::invalid_argument);

if (Options.PaperTrailWarnings && Options.InputIsYAMLDebugMap)
return make_error<StringError>(
"paper trail warnings are not supported for YAML input.",
errc::invalid_argument);

if (!Options.ReproducerPath.empty() &&
Options.ReproMode != ReproducerMode::Use)
return make_error<StringError>(
Expand Down Expand Up @@ -304,7 +298,6 @@ static Expected<DsymutilOptions> getOptions(opt::InputArgList &Args) {
Options.DumpStab = Args.hasArg(OPT_symtab);
Options.Flat = Args.hasArg(OPT_flat);
Options.InputIsYAMLDebugMap = Args.hasArg(OPT_yaml_input);
Options.PaperTrailWarnings = Args.hasArg(OPT_papertrail);

if (Expected<DWARFVerify> Verify = getVerifyKind(Args)) {
Options.Verify = *Verify;
Expand Down Expand Up @@ -390,9 +383,6 @@ static Expected<DsymutilOptions> getOptions(opt::InputArgList &Args) {
if (Options.DumpDebugMap || Options.LinkOpts.Verbose)
Options.LinkOpts.Threads = 1;

if (getenv("RC_DEBUG_OPTIONS"))
Options.PaperTrailWarnings = true;

if (opt::Arg *RemarksPrependPath = Args.getLastArg(OPT_remarks_prepend_path))
Options.LinkOpts.RemarksPrependPath = RemarksPrependPath->getValue();

Expand Down Expand Up @@ -687,8 +677,8 @@ int dsymutil_main(int argc, char **argv, const llvm::ToolContext &) {

auto DebugMapPtrsOrErr =
parseDebugMap(Options.LinkOpts.VFS, InputFile, Options.Archs,
Options.LinkOpts.PrependPath, Options.PaperTrailWarnings,
Options.LinkOpts.Verbose, Options.InputIsYAMLDebugMap);
Options.LinkOpts.PrependPath, Options.LinkOpts.Verbose,
Options.InputIsYAMLDebugMap);

if (auto EC = DebugMapPtrsOrErr.getError()) {
WithColor::error() << "cannot parse the debug map for '" << InputFile
Expand Down
3 changes: 1 addition & 2 deletions llvm/tools/dsymutil/dsymutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ namespace dsymutil {
ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
parseDebugMap(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
StringRef InputFile, ArrayRef<std::string> Archs,
StringRef PrependPath, bool PaperTrailWarnings, bool Verbose,
bool InputIsYAML);
StringRef PrependPath, bool Verbose, bool InputIsYAML);

/// Dump the symbol table.
bool dumpStab(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
Expand Down
6 changes: 2 additions & 4 deletions llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ Error linkDebugInfoImpl(object::ObjectFile &File, const Options &Options,
DebugInfoLinker->setUpdateIndexTablesOnly(!Options.DoGarbageCollection);

std::vector<std::unique_ptr<OutDwarfFile>> ObjectsForLinking(1);
std::vector<std::string> EmptyWarnings;

// Add object files to the DWARFLinker.
std::unique_ptr<DWARFContext> Context = DWARFContext::create(
Expand All @@ -354,9 +353,8 @@ Error linkDebugInfoImpl(object::ObjectFile &File, const Options &Options,
std::make_unique<ObjFileAddressMap<AddressMapBase>>(*Context, Options,
File));

ObjectsForLinking[0] =
std::make_unique<OutDwarfFile>(File.getFileName(), std::move(Context),
std::move(AddressesMap), EmptyWarnings);
ObjectsForLinking[0] = std::make_unique<OutDwarfFile>(
File.getFileName(), std::move(Context), std::move(AddressesMap));

uint16_t MaxDWARFVersion = 0;
std::function<void(const DWARFUnit &Unit)> OnCUDieLoaded =
Expand Down