[PATCH] D75215: [DebugInfo] Fix for adding "returns cxx udt" option to functions in CodeView.
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 28 17:37:13 PST 2020
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm!
So, presumably we still do the wrong thing in the non-method type cases. I came up with this, where we differ with MSVC:
struct NonTrivial {
NonTrivial();
NonTrivial(const NonTrivial &o);
~NonTrivial();
int x;
};
struct Foo {
NonTrivial (*fp)(NonTrivial &o);
};
Foo gv;
MSVC marks the LF_PROCEDURE with the flag, but clang doesn't.
It looks like it NonTrivial is incomplete (we have a fwd decl DICompositeType), MSVC just marks it with CxxReturnUdt:
struct NonTrivial;
struct Foo {
NonTrivial (*fp)(NonTrivial &o);
};
Foo gv;
$ cl -c t.cpp -Z7 && llvm-pdbutil dump -types t.obj | grep -A3 PROCEDU
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28315 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
t.cpp
0x1003 | LF_PROCEDURE [size = 16]
return type = 0x1000, # args = 1, param list = 0x1002
calling conv = cdecl, options = returns cxx udt
Now that I've gone this far... maybe we should just say `isNonTrivial() || isFwdDecl()` -> mark it CxxReturnUdt. Something like that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75215/new/
https://reviews.llvm.org/D75215
More information about the llvm-commits
mailing list