Skip to content

[dsymutil] Only set a translation lambda if the translator is valid #987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion llvm/tools/dsymutil/DwarfLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2777,7 +2777,11 @@ bool DwarfLinker::link(const DebugMap &Map) {
// This Dwarf string pool which is used for emission. It must be used
// serially as the order of calling getStringOffset matters for
// reproducibility.
OffsetsStringPool OffsetsStringPool(Options.Translator, true);
std::function<StringRef(StringRef)> TranslationLambda =
Options.Translator
? [&](StringRef Input) { return Options.Translator(Input); }
: static_cast<std::function<StringRef(StringRef)>>(nullptr);
OffsetsStringPool OffsetsStringPool(TranslationLambda, true);

// ODR Contexts for the link.
DeclContextTree ODRContexts;
Expand Down