Skip to content

Commit ec36b6d

Browse files
committed
Handle review comments.
Add an assert to check that DIGlobalVariableExpression does not already have a valid expression.
1 parent 66744a0 commit ec36b6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5184,6 +5184,8 @@ static void updateDebugInfoForDeclareTargetVariables(
51845184
ExprBuilder.append<llvm::DIOp::Arg>(0u, ptrTy);
51855185
ExprBuilder.append<llvm::DIOp::Deref>(GV->getType());
51865186
for (auto *GVE : GVEs) {
5187+
llvm::DIExpression *Old = GVE->getExpression();
5188+
assert((Old == nullptr) || (Old->getNumElements() == 0));
51875189
auto *newGVE = llvm::DIGlobalVariableExpression::get(
51885190
M->getContext(), GVE->getVariable(), ExprBuilder.intoExpression());
51895191
GV->addDebugInfo(newGVE);

0 commit comments

Comments
 (0)