diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp index e47a6ce6e9205..e6b5e267d192b 100644 --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/llvm/lib/Transforms/Utils/Debugify.cpp @@ -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);