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

@@ -3959,7 +3959,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
if (!IA)
return error("Invalid record");
}
LastLoc = DebugLoc::get(Line, Col, Scope, IA, isImplicitCode);
LastLoc = DILocation::get(Scope->getContext(), Line, Col, Scope, IA,
isImplicitCode);
I->setDebugLoc(LastLoc);
I = nullptr;
continue;