Open CarlosAlbertoEnciso opened 4 years ago
Guessing this might be not lambda specific, maybe try the non-lambda equivalent:
struct t1 { template
void f1(T) { } }; int main() { t1().f1(1); }
May be a requirement for CodeView type descriptions to be consistent in every use - in which case putting declarations of member function template specializations wouldn't be compatible - because you don't know how many/which specializations exist. (what does MSVC do?)
Thanks for your comments and test case.
I have included the logical views generated by llvm-diva for your case:
Logical View:
[000] {File} 'template_dw.o' -> elf64-x86-64
[001] {CompileUnit} 'template.cpp'
[002] {Producer} 'clang version 11.0.0'
[002] 3 {Function} extern not_inlined 'f1
Logical View:
[000] {File} 'template_cv.o' -> COFF-x86-64
[001] {CompileUnit} 'template.cpp'
[002] {Producer} 'clang version 11.0.0'
[002] {Function} extern not_inlined 'f1
Logical View:
[000] {File} 'template_ms.o' -> COFF-i386
[001] {CompileUnit} 'template.cpp'
[002] {Producer} 'Microsoft (R) Optimizing Compiler'
[002] {Function} extern not_inlined 'f1
MSVC and Clang on CodeView produces basically the same view. Except for parameter information in the MSVC (flags to indicate parameter or variable).
Guessing this might be not lambda specific, maybe try the non-lambda equivalent:
struct t1 {
template
int main() { t1().f1(1); }
May be a requirement for CodeView type descriptions to be consistent in every use - in which case putting declarations of member function template specializations wouldn't be compatible - because you don't know how many/which specializations exist. (what does MSVC do?)
This is the output from llvm-diva (Sony's tool under development).
llvm-diva --print=scopes,symbols,types lambda_dw.o lambda_cv.o lambda_ms.o --attribute=level,format
[000] {File} 'lambda_dw.o' -> elf64-x86-64
[001] {CompileUnit} 'lambda.cpp'
[002] {Producer} 'clang version 11.0.0'
[002] 2 {Function} extern not_inlined 'operator()
[000] {File} 'lambda_cv.o' -> COFF-x86-64
[001] {CompileUnit} 'lambda.cpp'
[002] {Producer} 'clang version 11.0.0'
[002] {Function} not_inlined 'operator()
[000] {File} 'lambda_ms.o' -> COFF-i386
[001] {CompileUnit} 'lambda.cpp'
[002] {Producer} 'Microsoft (R) Optimizing Compiler'
[002] {Function} not_inlined 'operator()
Extended Description
Given the following test case:
Using the command line to generate debug info CodeView:
clang -c -g -O0 lambda.cpp -o lambda-cv.o -gcodeview --target=x86_64-windows
The output generated by llvm-pdbutil, shows the definition for a member function (operator ()), but it does not include its declaration in the class associated with the lambda:
Class associated with lambda
operator() definition
Using MSVC on the same test, the output looks like: