Skip to content

Commit 3487f18

Browse files
committed
Handle review comments.
Fixed nits and move IR tests to Integration folder.
1 parent 94aecb0 commit 3487f18

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

flang/lib/Optimizer/Transforms/AddDebugInfo.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ mlir::LLVM::DIModuleAttr AddDebugInfoPass::getOrCreateModuleAttr(
117117
mlir::LLVM::DIScopeAttr scope, unsigned line, bool decl) {
118118
mlir::MLIRContext *context = &getContext();
119119
mlir::LLVM::DIModuleAttr modAttr;
120-
if (auto iter{moduleMap.find(name)}; iter != moduleMap.end())
120+
if (auto iter{moduleMap.find(name)}; iter != moduleMap.end()) {
121121
modAttr = iter->getValue();
122-
else {
122+
} else {
123123
modAttr = mlir::LLVM::DIModuleAttr::get(
124124
context, fileAttr, scope, mlir::StringAttr::get(context, name),
125-
mlir::StringAttr(), mlir::StringAttr(), mlir::StringAttr(), line, decl);
125+
/* configMacros */ mlir::StringAttr(), /* includePath */mlir::StringAttr(),
126+
/* apinotes */ mlir::StringAttr(), line, decl);
126127
moduleMap[name] = modAttr;
127128
}
128129
return modAttr;
@@ -136,7 +137,7 @@ void AddDebugInfoPass::handleGlobalOp(fir::GlobalOp globalOp,
136137
fir::DebugTypeGenerator typeGen(module);
137138
mlir::OpBuilder builder(context);
138139

139-
auto result = fir::NameUniquer::deconstruct(globalOp.getSymName());
140+
std::pair result = fir::NameUniquer::deconstruct(globalOp.getSymName());
140141
if (result.first != fir::NameUniquer::NameKind::VARIABLE)
141142
return;
142143

@@ -161,7 +162,7 @@ void AddDebugInfoPass::handleGlobalOp(fir::GlobalOp globalOp,
161162
scope = getOrCreateModuleAttr(result.second.modules[0], fileAttr, scope,
162163
line - 1, !globalOp.isInitialized());
163164

164-
auto diType = typeGen.convertType(globalOp.getType(), fileAttr, scope,
165+
mlir::LLVM::DITypeAttr diType = typeGen.convertType(globalOp.getType(), fileAttr, scope,
165166
globalOp.getLoc());
166167
auto gvAttr = mlir::LLVM::DIGlobalVariableAttr::get(
167168
context, scope, mlir::StringAttr::get(context, result.second.name),

0 commit comments

Comments
 (0)