[PATCH] D100388: [BROKEN][clang] Try to fix thunk function types

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 12 11:41:40 PDT 2021


efriedma added a comment.

> Would it be reasonable to instead start with a stopgap measure of not adding attributes for this/return of thunks?

You mean, add align attributes to "this" on regular methods, but not thunks?  I can't see how that could do any harm.



================
Comment at: clang/lib/CodeGen/CGVTables.cpp:467
+  if (!CalleeMD->isDefined()) {
+    CGM.ErrorUnsupported(ThunkGD.getDecl(), "thunk for forward declaration");
+    return;
----------------
"IsUnprototyped" means that we have to generate a thunk, but we don't have the proper types. We emit some special IR with known incorrect types, and mark it with the "thunk" attribute to let the optimizer know what we're doing.

It should be fine to continue using a fake type on the IsUnprototyped codepath.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100388/new/

https://reviews.llvm.org/D100388



More information about the cfe-commits mailing list