Skip to content
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
19 changes: 8 additions & 11 deletions llvm/lib/Transforms/Utils/Debugify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,30 +214,27 @@ bool llvm::applyDebugifyMetadata(
return true;
}

static bool
applyDebugify(Function &F,
enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
DebugInfoPerPass *DebugInfoBeforePass = nullptr,
StringRef NameOfWrappedPass = "") {
static bool applyDebugify(Function &F, enum DebugifyMode Mode,
DebugInfoPerPass *DebugInfoBeforePass,
StringRef NameOfWrappedPass = "") {
Module &M = *F.getParent();
auto FuncIt = F.getIterator();
if (Mode == DebugifyMode::SyntheticDebugInfo)
return applyDebugifyMetadata(M, make_range(FuncIt, std::next(FuncIt)),
"FunctionDebugify: ", /*ApplyToMF*/ nullptr);
assert(DebugInfoBeforePass);
assert(DebugInfoBeforePass && "Missing debug info metadata");
return collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass,
"FunctionDebugify (original debuginfo)",
NameOfWrappedPass);
}

static bool
applyDebugify(Module &M,
enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
DebugInfoPerPass *DebugInfoBeforePass = nullptr,
StringRef NameOfWrappedPass = "") {
static bool applyDebugify(Module &M, enum DebugifyMode Mode,
DebugInfoPerPass *DebugInfoBeforePass,
StringRef NameOfWrappedPass = "") {
if (Mode == DebugifyMode::SyntheticDebugInfo)
return applyDebugifyMetadata(M, M.functions(),
"ModuleDebugify: ", /*ApplyToMF*/ nullptr);
assert(DebugInfoBeforePass && "Missing debug info metadata");
return collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass,
"ModuleDebugify (original debuginfo)",
NameOfWrappedPass);
Expand Down