Page MenuHomePhabricator

[Clang][CodeGen] fix failed assertion

Authored by nickdesaulniers on Oct 23 2020, 1:07 PM.



Ensure we can emit symbol aliases via function attribute
even when function signatures contain incomplete types.

Via bugreport:

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2020, 1:07 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nickdesaulniers requested review of this revision.Oct 23 2020, 1:07 PM
erichkeane added inline comments.

I'd suggest making this just 'else', that way you don't have to do the assert below. The first line of getFunctionLinkage does the cast to FunctionDecl, so that part is already taken care of.

aaron.ballman added inline comments.Oct 24 2020, 6:45 AM

Rather than isa<> followed by cast<>, this should be using dyn_cast<>. e.g.,

if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl()))
  • dyn_cast, else
nickdesaulniers marked 2 inline comments as done.
nickdesaulniers removed a subscriber: erichkeane.
erichkeane accepted this revision.Oct 26 2020, 10:43 AM

Please make sure the commit message is significantly more descriptive here than what is on the review.

This revision is now accepted and ready to land.Oct 26 2020, 10:43 AM
nickdesaulniers edited the summary of this revision. (Show Details)Oct 26 2020, 11:05 AM
This revision was landed with ongoing or failed builds.Oct 26 2020, 11:38 AM
This revision was automatically updated to reflect the committed changes.