// Construct a location that has a valid scope, but no line info.
assert(!DI->LexicalBlockStack.empty());
- CGF->Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(
- 0, 0, DI->LexicalBlockStack.back(), DI->getInlinedAt()));
+ CGF->Builder.SetCurrentDebugLocation(
+ llvm::DILocation::get(DI->LexicalBlockStack.back()->getContext(), 0, 0,
+ DI->LexicalBlockStack.back(), DI->getInlinedAt()));
}
ApplyDebugLocation::ApplyDebugLocation(CodeGenFunction &CGF, const Expr *E)
return;
llvm::MDNode *Scope = LexicalBlockStack.back();
- Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(
- getLineNumber(CurLoc), getColumnNumber(CurLoc), Scope, CurInlinedAt));
+ Builder.SetCurrentDebugLocation(
+ llvm::DILocation::get(CGM.getLLVMContext(), getLineNumber(CurLoc),
+ getColumnNumber(CurLoc), Scope, CurInlinedAt));
}
void CGDebugInfo::CreateLexicalBlock(SourceLocation Loc) {
setLocation(Loc);
// Emit a line table change for the current location inside the new scope.
- Builder.SetCurrentDebugLocation(
- llvm::DebugLoc::get(getLineNumber(Loc), getColumnNumber(Loc),
- LexicalBlockStack.back(), CurInlinedAt));
+ Builder.SetCurrentDebugLocation(llvm::DILocation::get(
+ CGM.getLLVMContext(), getLineNumber(Loc), getColumnNumber(Loc),
+ LexicalBlockStack.back(), CurInlinedAt));
if (DebugKind <= codegenoptions::DebugLineTablesOnly)
return;
Flags | llvm::DINode::FlagArtificial, FieldAlign);
// Insert an llvm.dbg.declare into the current block.
- DBuilder.insertDeclare(
- Storage, D, DBuilder.createExpression(Expr),
- llvm::DebugLoc::get(Line, Column, Scope, CurInlinedAt),
- Builder.GetInsertBlock());
+ DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(Expr),
+ llvm::DILocation::get(CGM.getLLVMContext(), Line,
+ Column, Scope,
+ CurInlinedAt),
+ Builder.GetInsertBlock());
}
}
}
// Insert an llvm.dbg.declare into the current block.
DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(Expr),
- llvm::DebugLoc::get(Line, Column, Scope, CurInlinedAt),
+ llvm::DILocation::get(CGM.getLLVMContext(), Line,
+ Column, Scope, CurInlinedAt),
Builder.GetInsertBlock());
return D;
// Insert an llvm.dbg.label into the current block.
DBuilder.insertLabel(L,
- llvm::DebugLoc::get(Line, Column, Scope, CurInlinedAt),
+ llvm::DILocation::get(CGM.getLLVMContext(), Line, Column,
+ Scope, CurInlinedAt),
Builder.GetInsertBlock());
}
Line, Ty, false, llvm::DINode::FlagZero, Align);
// Insert an llvm.dbg.declare into the current block.
- auto DL =
- llvm::DebugLoc::get(Line, Column, LexicalBlockStack.back(), CurInlinedAt);
+ auto DL = llvm::DILocation::get(CGM.getLLVMContext(), Line, Column,
+ LexicalBlockStack.back(), CurInlinedAt);
auto *Expr = DBuilder.createExpression(addr);
if (InsertPoint)
DBuilder.insertDeclare(Storage, D, Expr, DL, InsertPoint);
// Insert an llvm.dbg.declare into the current block.
DBuilder.insertDeclare(Alloca, debugVar, DBuilder.createExpression(),
- llvm::DebugLoc::get(line, column, scope, CurInlinedAt),
+ llvm::DILocation::get(CGM.getLLVMContext(), line,
+ column, scope, CurInlinedAt),
Builder.GetInsertBlock());
}
return llvm::DebugLoc();
llvm::MDNode *Scope = LexicalBlockStack.back();
- return llvm::DebugLoc::get(getLineNumber(Loc), getColumnNumber(Loc), Scope);
+ return llvm::DILocation::get(CGM.getLLVMContext(), getLineNumber(Loc),
+ getColumnNumber(Loc), Scope);
}
llvm::DINode::DIFlags CGDebugInfo::getCallSiteRelatedAttrs() const {