[PATCH] D71129: [ARM][CMSE] Implement CMSE attributes

Momchil Velikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 16:54:32 PDT 2020


chill marked 2 inline comments as done.
chill added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:3622
     bool getNoCfCheck() const { return Bits & NoCfCheckMask; }
     bool getHasRegParm() const { return (Bits >> RegParmOffset) != 0; }
 
----------------
snidertm wrote:
> chill wrote:
> > ... here.
> > 
> >    bool getHasRegParm() const { return ((Bits & RegParmMask) >> RegParmOffset) != 0;
> I don't see how this helps. If RegParmOffset is 8 and the CmseNSCall bit is set in Bits, then your proposed getHasRegParm() will return true. Given the above assignment to Bits, we don't know if the CmseNSCall bit was set by cmseNSCall or by regParm.
> 
> MIght I be missing something?
No, it will not return true, because the mask will clear all bits, except bits [8-10,13-31].
Bits [13-31] are unused/zero, and in the patch I'm preparing, the RegParmMask will be simply 0x700,
so they will be cleared anyway.
CmseNSCall is bit 12, so it will be cleared. Also RegParm + 1 is at most 7, so, it cannot overflow into
NoCfCheck of CmseNSCall.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71129





More information about the cfe-commits mailing list