Migrate deprecated DebugLoc::get to DILocation::get

This migrates all LLVM (except Kaleidoscope and
CodeGen/StackProtector.cpp) DebugLoc::get to DILocation::get.

The CodeGen/StackProtector.cpp usage may have a nullptr Scope
and can trigger an assertion failure, so I don't migrate it.

Reviewed By: #debug-info, dblaikie

Differential Revision: https://reviews.llvm.org/D93087
This commit is contained in:
Fangrui Song
2020-12-11 12:45:22 -08:00
parent 7ea37d2f94
commit b5ad32ef5c
14 changed files with 32 additions and 24 deletions

View File

@@ -1443,8 +1443,8 @@ static DebugLoc inlineDebugLoc(DebugLoc OrigDL, DILocation *InlinedAt,
LLVMContext &Ctx,
DenseMap<const MDNode *, MDNode *> &IANodes) {
auto IA = DebugLoc::appendInlinedAt(OrigDL, InlinedAt, Ctx, IANodes);
return DebugLoc::get(OrigDL.getLine(), OrigDL.getCol(), OrigDL.getScope(),
IA);
return DILocation::get(Ctx, OrigDL.getLine(), OrigDL.getCol(),
OrigDL.getScope(), IA);
}
/// Update inlined instructions' line numbers to