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

Todd Snider via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 15:45:47 PDT 2020


snidertm added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:3604
+             (noCallerSavedRegs ? NoCallerSavedRegsMask : 0) |
+             (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) |
+             (NoCfCheck ? NoCfCheckMask : 0) |
----------------
Wouldn't this overwrite the CmseNSCallMask bit if hasRegParm is true and ((regParm + 1) & 1) is non-zero?


================
Comment at: clang/include/clang/AST/Type.h:3622
     bool getNoCfCheck() const { return Bits & NoCfCheckMask; }
     bool getHasRegParm() const { return (Bits >> RegParmOffset) != 0; }
 
----------------
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?


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