[PATCH] D22045: [X86] Support of no_caller_saved_registers attribute (Clang part)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 11:38:51 PDT 2016


ABataev added inline comments.


================
Comment at: include/clang/AST/Type.h:2934
     ExtInfo(bool noReturn, bool hasRegParm, unsigned regParm, CallingConv cc,
-            bool producesResult) {
+            bool producesResult, bool noCallerSavedRegs) {
       assert((!hasRegParm || regParm < 7) && "Invalid regparm value");
----------------
s/noCallerSavedRegs/NoCallerSavedRegs/g


================
Comment at: include/clang/AST/Type.h:2987
 
+    ExtInfo withNoCallerSavedRegs(bool noCallerSavedRegs) const {
+      if (noCallerSavedRegs)
----------------
s/noCallerSavedRegs/NoCallerSavedRegs/g


================
Comment at: include/clang/AST/Type.h:2990-2991
+        return ExtInfo(Bits | NoCallerSavedRegsMask);
+      else
+        return ExtInfo(Bits & ~NoCallerSavedRegsMask);
+    }
----------------
Remove `else`, just return


================
Comment at: lib/Sema/SemaDecl.cpp:2885
+      NewTypeInfo.getNoCallerSavedRegs()) {
+    NewTypeInfo = NewTypeInfo.withNoCallerSavedRegs(true);
+    RequiresAdjustment = true;
----------------
Add a comment with the name of parameter for `true` argument


================
Comment at: lib/Sema/SemaDeclAttr.cpp:1693
+static void handleNoCallerSavedRegsAttr(Sema &S, Decl *D,
+                                        const AttributeList &attr) {
+  if (S.CheckNoCallerSavedRegsAttr(attr))
----------------
`attr` does follow rules of LLVM Coding standard. Must be `Attr`


================
Comment at: lib/Sema/SemaDeclAttr.cpp:1710
 
+bool Sema::CheckNoCallerSavedRegsAttr(const AttributeList &attr) {
+  if (!checkAttributeNumArgs(*this, attr, 0)) {
----------------
s/attr/Attr/g


================
Comment at: lib/Sema/SemaDeclAttr.cpp:1710
 
+bool Sema::CheckNoCallerSavedRegsAttr(const AttributeList &attr) {
+  if (!checkAttributeNumArgs(*this, attr, 0)) {
----------------
ABataev wrote:
> s/attr/Attr/g
s/CheckNoCallerSavedRegsAttr/checkNoCallerSavedRegsAttr/g


https://reviews.llvm.org/D22045





More information about the cfe-commits mailing list