This is an archive of the discontinued LLVM Phabricator instance.

[clang][WebAssembly] Loosen restriction on `main` symbol mangling
ClosedPublic

Authored by sbc100 on Jun 15 2022, 11:33 AM.

Details

Summary

Remove the hasPrototype() restriction so that old style K&R
declarations of main work too.

For example the following has two params but no prototype.

int main(argc, argv)
    int argc;
    char *argv[];
{
  return 0;
}

Also, use getNumParams() over param_size() which seems to be a more
direct way to get at the same information.

Diff Detail

Event Timeline

sbc100 created this revision.Jun 15 2022, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 11:33 AM
sbc100 requested review of this revision.Jun 15 2022, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 11:33 AM
sbc100 edited the summary of this revision. (Show Details)Jun 15 2022, 11:33 AM
sbc100 added a reviewer: sunfish.
sbc100 edited the summary of this revision. (Show Details)Jun 15 2022, 11:42 AM
sbc100 updated this revision to Diff 437272.Jun 15 2022, 11:42 AM
sbc100 edited the summary of this revision. (Show Details)

add tests

sunfish accepted this revision.Jun 15 2022, 11:46 AM
This revision is now accepted and ready to land.Jun 15 2022, 11:46 AM
This revision was landed with ongoing or failed builds.Jun 15 2022, 1:56 PM
This revision was automatically updated to reflect the committed changes.