snidertm 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; }
 
----------------
chill wrote:
> 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.
Got it, ok.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71129



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to