[PATCH] D28271: [Sema] Get rid of unused default argument to Sema::CheckCallingConvAttr.

Justin Lebar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 18:09:31 PST 2017


jlebar created this revision.
jlebar added a reviewer: rnk.
jlebar added a subscriber: cfe-commits.

All callers of CheckCallingConvAttr passed FD == nullptr, so just get
rid of the aspirational function arg.


https://reviews.llvm.org/D28271

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaDeclAttr.cpp


Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -3869,7 +3869,7 @@
   // Diagnostic is emitted elsewhere: here we store the (valid) Attr
   // in the Decl node for syntactic reasoning, e.g., pretty-printing.
   CallingConv CC;
-  if (S.CheckCallingConvAttr(Attr, CC, /*FD*/nullptr))
+  if (S.CheckCallingConvAttr(Attr, CC))
     return;
 
   if (!isa<ObjCMethodDecl>(D)) {
@@ -3964,8 +3964,7 @@
   }
 }
 
-bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC, 
-                                const FunctionDecl *FD) {
+bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC) {
   if (attr.isInvalid())
     return true;
 
@@ -4030,12 +4029,8 @@
 
     // This convention is not valid for the target. Use the default function or
     // method calling convention.
-    bool IsCXXMethod = false, IsVariadic = false;
-    if (FD) {
-      IsCXXMethod = FD->isCXXInstanceMember();
-      IsVariadic = FD->isVariadic();
-    }
-    CC = Context.getDefaultCallingConvention(IsVariadic, IsCXXMethod);
+    CC = Context.getDefaultCallingConvention(/*IsVariadic=*/false,
+                                             /*IsCXXMethod=*/false);
   }
 
   attr.setProcessingCache((unsigned) CC);
Index: clang/include/clang/Sema/Sema.h
===================================================================
--- clang/include/clang/Sema/Sema.h
+++ clang/include/clang/Sema/Sema.h
@@ -3070,8 +3070,7 @@
   bool isValidPointerAttrType(QualType T, bool RefOkay = false);
 
   bool CheckRegparmAttr(const AttributeList &attr, unsigned &value);
-  bool CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC,
-                            const FunctionDecl *FD = nullptr);
+  bool CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC);
   bool CheckNoReturnAttr(const AttributeList &attr);
   bool checkStringLiteralArgumentAttr(const AttributeList &Attr,
                                       unsigned ArgNum, StringRef &Str,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28271.82987.patch
Type: text/x-patch
Size: 2102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170104/7f95f977/attachment.bin>


More information about the cfe-commits mailing list