.. so .loc directives referring to those files work correctly.
Details
Diff Detail
Event Timeline
We do not have any tests for debug support, since it was never properly implemented. We have plenty of tests for other parts of the NVPTX AsmPrinter. Or are you referring to something else?
As for the review, the change looks good, but a test should be included.
Looks good - but please simplify the test a bit further and include the basic C code that produced the IR (I realize the IR is fairly simple, but it's handy to have what the code is modelling, the metadata format we have currently is still fairly verbose/hard to read)
The test could be simplier if it were C rather than C++ (no name mangling) and just void functions taking no parameters, I would imagine.
void foo() { } #line 1 other.c void bar() { }
Something like that, I would imagine.
Separately, this code seems strange - why does NVPTXAsmPrinter::recordAndEmitFilenames exist? It seems insufficient (what about file names on types? (DW_AT_decl_file on a user-defined type) why doesn't code like this exist for any other target? etc)
I'll simplify the test case.
Separately, this code seems strange - why does NVPTXAsmPrinter::recordAndEmitFilenames exist? It seems insufficient (what about file names on types? (DW_AT_decl_file on a user-defined type) why doesn't code like this exist for any other target? etc)
At the moment NVPTX only supports emitting line info and never produces any other debugging directives or data. I guess recordAndEmitFilenames() was the bare minimum needed to get line info working.