Skip to content

Commit cf86a12

Browse files
committed
[flang] Use integer as a place holder type.
The previous placeholder type was basic type with DW_ATE_address encoding. When variables are added, it started causing assertions in the llvm debug info generation logic for some types. It has been changed to an integer type.
1 parent 70b1452 commit cf86a12

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ DebugTypeGenerator::DebugTypeGenerator(mlir::ModuleOp m)
2424
LLVM_DEBUG(llvm::dbgs() << "DITypeAttr generator\n");
2525
}
2626

27-
static mlir::LLVM::DITypeAttr genPlaceholderType(mlir::MLIRContext *context) {
28-
return mlir::LLVM::DIBasicTypeAttr::get(
29-
context, llvm::dwarf::DW_TAG_base_type, "void", 32, 1);
30-
}
31-
3227
static mlir::LLVM::DITypeAttr genBasicType(mlir::MLIRContext *context,
3328
mlir::StringAttr name,
3429
unsigned bitSize,
@@ -37,6 +32,11 @@ static mlir::LLVM::DITypeAttr genBasicType(mlir::MLIRContext *context,
3732
context, llvm::dwarf::DW_TAG_base_type, name, bitSize, decoding);
3833
}
3934

35+
static mlir::LLVM::DITypeAttr genPlaceholderType(mlir::MLIRContext *context) {
36+
return genBasicType(context, mlir::StringAttr::get(context, "integer"), 32,
37+
llvm::dwarf::DW_ATE_signed);
38+
}
39+
4040
mlir::LLVM::DITypeAttr
4141
DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr,
4242
mlir::LLVM::DIScopeAttr scope,

0 commit comments

Comments
 (0)