Skip to content

Commit

Permalink
[Kaleidoscope] Migrate DebugInfo::get to DILocation::get
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Dec 12, 2020
1 parent e9987ad commit 3b3bc5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/examples/Kaleidoscope/Chapter9/toy.cpp
Expand Up @@ -848,8 +848,8 @@ void DebugInfo::emitLocation(ExprAST *AST) {
Scope = TheCU;
else
Scope = LexicalBlocks.back();
Builder->SetCurrentDebugLocation(
DebugLoc::get(AST->getLine(), AST->getCol(), Scope));
Builder->SetCurrentDebugLocation(DILocation::get(
Scope->getContext(), AST->getLine(), AST->getCol(), Scope));
}

static DISubroutineType *CreateFunctionType(unsigned NumArgs, DIFile *Unit) {
Expand Down Expand Up @@ -1277,7 +1277,7 @@ Function *FunctionAST::codegen() {
true);

DBuilder->insertDeclare(Alloca, D, DBuilder->createExpression(),
DebugLoc::get(LineNo, 0, SP),
DILocation::get(SP->getContext(), LineNo, 0, SP),
Builder->GetInsertBlock());

// Store the initial value into the alloca.
Expand Down

0 comments on commit 3b3bc5d

Please sign in to comment.