Skip to content

Commit f55d34f

Browse files
committed
[restore module in module-codegen event *name* directly too]
1 parent 897b80a commit f55d34f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

driver/main.cpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,10 @@ void codegenModules(Modules &modules) {
12611261
const auto atCompute = hasComputeAttr(m);
12621262
if (atCompute == DComputeCompileFor::hostOnly ||
12631263
atCompute == DComputeCompileFor::hostAndDevice) {
1264-
dmd::TimeTraceScope timeScope(TimeTraceEventType::codegenModule,
1265-
nullptr, m->toChars(), m->loc);
1264+
dmd::TimeTraceScope timeScope(
1265+
TimeTraceEventType::codegenModule,
1266+
(llvm::Twine("Codegen: module ") + m->toChars()).str().c_str(),
1267+
m->toChars(), m->loc);
12661268
#if LDC_MLIR_ENABLED
12671269
if (global.params.output_mlir == OUTPUTFLAGset)
12681270
cg.emitMLIR(m);
@@ -1290,9 +1292,12 @@ void codegenModules(Modules &modules) {
12901292
if (!computeModules.empty()) {
12911293
dmd::TimeTraceScope timeScope("Codegen DCompute device modules");
12921294
for (auto &mod : computeModules) {
1293-
dmd::TimeTraceScope timeScope(TimeTraceEventType::codegenModule,
1294-
"Codegen DCompute: device module",
1295-
mod->toChars(), mod->loc);
1295+
dmd::TimeTraceScope timeScope(
1296+
TimeTraceEventType::codegenModule,
1297+
(llvm::Twine("Codegen DCompute: device module ") + mod->toChars())
1298+
.str()
1299+
.c_str(),
1300+
mod->toChars(), mod->loc);
12961301
dccg.emit(mod);
12971302
}
12981303
}

tests/dmd/compilable/ftimetrace.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TEST_OUTPUT:
66
Code generation,
77
Codegen: function add, object.add
88
Codegen: function fun, object.fun
9-
Codegen: module , object
9+
Codegen: module object, object
1010
Ctfe: add(4, 8), add(4, 8)
1111
Ctfe: call add, object.add(4, 8)
1212
Generate IR, object

0 commit comments

Comments
 (0)