[PATCH] D37715: Mark static member functions as static in CodeViewDebug

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 17:09:12 PDT 2017


amccarth marked 5 inline comments as done.
amccarth added a comment.

Good tip on the lowering.  Extra test coming momentarily.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1560-1564
   TypeIndex ThisTypeIndex = TypeIndex::Void();
   if (!ArgTypeIndices.empty()) {
     ThisTypeIndex = ArgTypeIndices.front();
     ArgTypeIndices = ArgTypeIndices.drop_front();
   }
----------------
rnk wrote:
> If we had a bool `IsInstanceMethod` or something here we could skip this `drop_front()` dance and that would fix our parameters.
Ah yes, this fixes the Type field for static methods as well.  I'll extend the test to show that.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1625
 
-  // FIXME: Get Clang to mark DISubprogram as static and do something with it.
+  if (SP->getFlags() & DINode::FlagStaticMember)
+    return MethodKind::Static;
----------------
rnk wrote:
> I'd do this check first, since static methods can't be virtual.
And virtual methods can't be static, so I'm not sure the order really matters.  But done because it's not worth a debate.


https://reviews.llvm.org/D37715





More information about the llvm-commits mailing list