Skip to content

Commit c36d01c

Browse files
committed
gen/dibuilder.cpp: use the newer debug record API
1 parent 3f5b268 commit c36d01c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

gen/dibuilder.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,14 +1137,13 @@ void DIBuilder::EmitValue(llvm::Value *val, VarDeclaration *vd) {
11371137
if (!mustEmitFullDebugInfo() || !debugVariable)
11381138
return;
11391139

1140-
llvm::Instruction *instr = DBuilder.insertDbgValueIntrinsic(
1140+
auto instr = DBuilder.insertDbgValueIntrinsic(
11411141
val, debugVariable, DBuilder.createExpression(),
1142-
IR->ir->getCurrentDebugLocation(), IR->scopebb())
1143-
#if LDC_LLVM_VER >= 1901
1144-
.dyn_cast<llvm::Instruction *>()
1142+
IR->ir->getCurrentDebugLocation(), IR->scopebb());
1143+
#if LDC_LLVM_VER >= 1900
1144+
llvm::cast<llvm::DbgRecord *>
11451145
#endif
1146-
;
1147-
instr->setDebugLoc(IR->ir->getCurrentDebugLocation());
1146+
(instr)->setDebugLoc(IR->ir->getCurrentDebugLocation());
11481147
}
11491148

11501149
void DIBuilder::EmitLocalVariable(llvm::Value *ll, VarDeclaration *vd,

0 commit comments

Comments
 (0)