[cfe-commits] r131018 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp

Sean Hunt scshunt at csclub.uwaterloo.ca
Fri May 6 14:24:28 PDT 2011


Author: coppro
Date: Fri May  6 16:24:28 2011
New Revision: 131018

URL: http://llvm.org/viewvc/llvm-project?rev=131018&view=rev
Log:
Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.

Modified:
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=131018&r1=131017&r2=131018&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Fri May  6 16:24:28 2011
@@ -936,7 +936,7 @@
   Decl *HandleDeclarator(Scope *S, Declarator &D,
                          MultiTemplateParamsArg TemplateParameterLists,
                          bool IsFunctionDefinition,
-                         SourceLocation DefLoc = SourceLocation());
+                         SourceLocation DefaultLoc = SourceLocation());
   void RegisterLocallyScopedExternCDecl(NamedDecl *ND,
                                         const LookupResult &Previous,
                                         Scope *S);
@@ -965,7 +965,7 @@
                                      MultiTemplateParamsArg TemplateParamLists,
                                      bool IsFunctionDefinition,
                                      bool &Redeclaration,
-                                     SourceLocation DefLoc = SourceLocation());
+                                   SourceLocation DefaultLoc = SourceLocation());
   bool AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD);
   void DiagnoseHiddenVirtualMethods(CXXRecordDecl *DC, CXXMethodDecl *MD);
   void CheckFunctionDeclaration(Scope *S,
@@ -3068,7 +3068,7 @@
                                  Expr *BitfieldWidth, const VirtSpecifiers &VS,
                                  Expr *Init, bool IsDefinition,
                                  bool Deleted = false,
-                                 SourceLocation DefLoc = SourceLocation());
+                                 SourceLocation DefaultLoc = SourceLocation());
 
   MemInitResult ActOnMemInitializer(Decl *ConstructorD,
                                     Scope *S,

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=131018&r1=131017&r2=131018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri May  6 16:24:28 2011
@@ -967,9 +967,7 @@
 
       Actions.SetDeclDeleted(ThisDecl, DelLoc);
     } else if (Tok.is(tok::kw_default)) {
-      SourceLocation DefLoc = ConsumeToken();
-
-      Diag(DefLoc, diag::err_default_special_members);
+      Diag(ConsumeToken(), diag::err_default_special_members);
     } else {
       if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
         EnterScope(0);

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=131018&r1=131017&r2=131018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Fri May  6 16:24:28 2011
@@ -1648,7 +1648,7 @@
   ExprResult BitfieldSize;
   ExprResult Init;
   bool Deleted = false;
-  SourceLocation DefLoc;
+  SourceLocation DefaultLoc;
 
   while (1) {
     // member-declarator:
@@ -1683,7 +1683,7 @@
       } else if (Tok.is(tok::kw_default)) {
         if (!getLang().CPlusPlus0x)
           Diag(Tok, diag::warn_defaulted_function_accepted_as_extension);
-        DefLoc = ConsumeToken();
+        DefaultLoc = ConsumeToken();
       } else {
         Init = ParseInitializer();
         if (Init.isInvalid())
@@ -1711,8 +1711,8 @@
 
     Decl *ThisDecl = 0;
     if (DS.isFriendSpecified()) {
-      if (DefLoc.isValid())
-        Diag(DefLoc, diag::err_default_special_members);
+      if (DefaultLoc.isValid())
+        Diag(DefaultLoc, diag::err_default_special_members);
 
       // TODO: handle initializers, bitfields, 'delete'
       ThisDecl = Actions.ActOnFriendFunctionDecl(getCurScope(), DeclaratorInfo,
@@ -1725,7 +1725,7 @@
                                                   BitfieldSize.release(),
                                                   VS, Init.release(),
                                                   /*IsDefinition*/Deleted,
-                                                  Deleted, DefLoc);
+                                                  Deleted, DefaultLoc);
     }
     if (ThisDecl)
       DeclsInGroup.push_back(ThisDecl);
@@ -1752,7 +1752,7 @@
     BitfieldSize = 0;
     Init = 0;
     Deleted = false;
-    DefLoc = SourceLocation();
+    DefaultLoc = SourceLocation();
 
     // Attributes are only allowed on the second declarator.
     MaybeParseGNUAttributes(DeclaratorInfo);

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=131018&r1=131017&r2=131018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri May  6 16:24:28 2011
@@ -2915,7 +2915,7 @@
 Decl *Sema::HandleDeclarator(Scope *S, Declarator &D,
                              MultiTemplateParamsArg TemplateParamLists,
                              bool IsFunctionDefinition,
-                             SourceLocation DefLoc) {
+                             SourceLocation DefaultLoc) {
   // TODO: consider using NameInfo for diagnostic.
   DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
   DeclarationName Name = NameInfo.getName();
@@ -3116,8 +3116,8 @@
 
   bool Redeclaration = false;
   if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {
-    if (DefLoc.isValid())
-      Diag(DefLoc, diag::err_default_special_members);
+    if (DefaultLoc.isValid())
+      Diag(DefaultLoc, diag::err_default_special_members);
 
     if (TemplateParamLists.size()) {
       Diag(D.getIdentifierLoc(), diag::err_template_typedef);
@@ -3128,9 +3128,10 @@
   } else if (R->isFunctionType()) {
     New = ActOnFunctionDeclarator(S, D, DC, R, TInfo, Previous,
                                   move(TemplateParamLists),
-                                  IsFunctionDefinition, Redeclaration, DefLoc);
+                                  IsFunctionDefinition, Redeclaration,
+                                  DefaultLoc);
   } else {
-    assert(!DefLoc.isValid() && "We should have caught this in a caller");
+    assert(!DefaultLoc.isValid() && "We should have caught this in a caller");
     New = ActOnVariableDeclarator(S, D, DC, R, TInfo, Previous,
                                   move(TemplateParamLists),
                                   Redeclaration);
@@ -4003,7 +4004,7 @@
                               LookupResult &Previous,
                               MultiTemplateParamsArg TemplateParamLists,
                               bool IsFunctionDefinition, bool &Redeclaration,
-                              SourceLocation DefLoc) {
+                              SourceLocation DefaultLoc) {
   assert(R.getTypePtr()->isFunctionType());
 
   // TODO: consider using NameInfo for diagnostic.
@@ -4060,7 +4061,7 @@
   bool isFunctionTemplateSpecialization = false;
 
   if (!getLangOptions().CPlusPlus) {
-    assert(!DefLoc.isValid() && "Defaulted functions are a C++ feature");
+    assert(!DefaultLoc.isValid() && "Defaulted functions are a C++ feature");
 
     // Determine whether the function was written with a
     // prototype. This true when:
@@ -4116,13 +4117,13 @@
 
       NewFD = NewCD;
 
-      if (DefLoc.isValid()) {
+      if (DefaultLoc.isValid()) {
         if (NewCD->isDefaultConstructor() ||
             NewCD->isCopyOrMoveConstructor()) {
           NewFD->setDefaulted();
           NewFD->setExplicitlyDefaulted();
         } else {
-          Diag(DefLoc, diag::err_default_special_members);
+          Diag(DefaultLoc, diag::err_default_special_members);
         }
       }
     } else if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
@@ -4138,7 +4139,7 @@
                                           /*isImplicitlyDeclared=*/false);
         isVirtualOkay = true;
 
-        if (DefLoc.isValid()) {
+        if (DefaultLoc.isValid()) {
           NewFD->setDefaulted();
           NewFD->setExplicitlyDefaulted();
         }
@@ -4160,8 +4161,8 @@
         return 0;
       }
 
-      if (DefLoc.isValid())
-        Diag(DefLoc, diag::err_default_special_members);
+      if (DefaultLoc.isValid())
+        Diag(DefaultLoc, diag::err_default_special_members);
 
       CheckConversionDeclarator(D, R, SC);
       NewFD = CXXConversionDecl::Create(Context, cast<CXXRecordDecl>(DC),
@@ -4211,18 +4212,18 @@
 
       isVirtualOkay = !isStatic;
 
-      if (DefLoc.isValid()) {
+      if (DefaultLoc.isValid()) {
         if (NewMD->isCopyAssignmentOperator() /* ||
             NewMD->isMoveAssignmentOperator() */) {
           NewFD->setDefaulted();
           NewFD->setExplicitlyDefaulted();
         } else {
-          Diag(DefLoc, diag::err_default_special_members);
+          Diag(DefaultLoc, diag::err_default_special_members);
         }
       }
     } else {
-      if (DefLoc.isValid())
-        Diag(DefLoc, diag::err_default_special_members);
+      if (DefaultLoc.isValid())
+        Diag(DefaultLoc, diag::err_default_special_members);
 
       // Determine whether the function was written with a
       // prototype. This true when:

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=131018&r1=131017&r2=131018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri May  6 16:24:28 2011
@@ -963,7 +963,7 @@
                                MultiTemplateParamsArg TemplateParameterLists,
                                ExprTy *BW, const VirtSpecifiers &VS,
                                ExprTy *InitExpr, bool IsDefinition,
-                               bool Deleted, SourceLocation DefLoc) {
+                               bool Deleted, SourceLocation DefaultLoc) {
   const DeclSpec &DS = D.getDeclSpec();
   DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
   DeclarationName Name = NameInfo.getName();
@@ -1028,8 +1028,8 @@
   if (isInstField) {
     CXXScopeSpec &SS = D.getCXXScopeSpec();
     
-    if (DefLoc.isValid())
-      Diag(DefLoc, diag::err_default_special_members);
+    if (DefaultLoc.isValid())
+      Diag(DefaultLoc, diag::err_default_special_members);
     
     if (SS.isSet() && !SS.isInvalid()) {
       // The user provided a superfluous scope specifier inside a class
@@ -1056,7 +1056,7 @@
     assert(Member && "HandleField never returns null");
   } else {
     Member = HandleDeclarator(S, D, move(TemplateParameterLists), IsDefinition,
-                              DefLoc);
+                              DefaultLoc);
     if (!Member) {
       return 0;
     }





More information about the cfe-commits mailing list