This is an archive of the discontinued LLVM Phabricator instance.

Fix the check for regparm in FunctionType::ExtInfo
ClosedPublic

Authored by chill on Apr 1 2020, 4:56 PM.

Details

Summary

getHasRegParm() was working under the assumption that the RegParm bits are the
last field, which is no longer true, after adding the NoCfCheck and CmseNSCall
fields.

This causes a spurious "regparm 0" attribute to appear when a function type is
declared with either __attribute__((nocf_check)) or
__attribute__((cmse_nonsecure_call)).

Diff Detail

Event Timeline

chill created this revision.Apr 1 2020, 4:56 PM
snidertm accepted this revision.Apr 1 2020, 11:45 PM

Looks good to me. Sorry about my confusion over this code in the CMSE attributes review. ~ Todd

clang/include/clang/AST/Type.h
3522

I misread the big ~(flag1 | flag2 | etc) calculation of the mask before. This makes it obvious.

This revision is now accepted and ready to land.Apr 1 2020, 11:45 PM
chill updated this revision to Diff 254445.Apr 2 2020, 1:30 AM

Added a REQUIRES line to the test.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 8:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript