[PATCH] D45123: [CodeView] Emit function options for subprogram and member functions
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 20 14:27:13 PDT 2018
rnk added a comment.
It might be best to limit the scope of the patch to just CxxReturnUdt and we can fix the other flags incrementally.
================
Comment at: CodeGen/AsmPrinter/CodeViewDebug.cpp:334
+
+static bool hasVirtualBase(const DICompositeType *DCTy) {
+ for (auto *Element : DCTy->getElements()) {
----------------
This isn't going to work. The frontend is going to need to tag classes with the information you want. Consider this example:
```
struct A {};
struct B : virtual A {
B();
};
struct C : B {
C();
};
C::C() {}
```
Clang will only emit a forward declaration for B, so you won't be able to walk the whole class hierarchy.
================
Comment at: CodeGen/AsmPrinter/CodeViewDebug.cpp:373
+ // DISubroutineType is unnamed. Use DISubprogram's i.e. SPName in comparison.
+ if (ClassTy && !isTrivial(ClassTy) && SPName == ClassTy->getName()) {
+ FO |= FunctionOptions::Constructor;
----------------
For constructors, what's the purpose of checking if the class is trivial?
Repository:
rL LLVM
https://reviews.llvm.org/D45123
More information about the llvm-commits
mailing list