[llvm-branch-commits] [cfe-branch] r156684 - in /cfe/branches/release_31: ./ include/clang/AST/Decl.h include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/TokenKinds.def include/clang/Parse/Parser.h include/clang/Sema/DeclSpec.h include/clang/Sema/Sema.h lib/Parse/ParseCXXInlineMethods.cpp lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseExpr.cpp lib/Parse/ParseExprCXX.cpp lib/Sema/DeclSpec.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaType.cpp test/SemaCXX/warn-unreachable.cpp

Bill Wendling isanbard at gmail.com
Fri May 11 17:32:07 PDT 2012


Author: void
Date: Fri May 11 19:32:07 2012
New Revision: 156684

URL: http://llvm.org/viewvc/llvm-project?rev=156684&view=rev
Log:
Merging r156031:
------------------------------------------------------------------------
r156031 | rsmith | 2012-05-02 15:22:32 -0700 (Wed, 02 May 2012) | 4 lines

Revert most of r154844, which was disabled in r155975. Keep around the
refactorings in that revision, and some of the subsequent bugfixes, which
seem to be relevant even without delayed exception specification parsing.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_31/   (props changed)
    cfe/branches/release_31/include/clang/AST/Decl.h
    cfe/branches/release_31/include/clang/Basic/DiagnosticParseKinds.td
    cfe/branches/release_31/include/clang/Basic/TokenKinds.def
    cfe/branches/release_31/include/clang/Parse/Parser.h
    cfe/branches/release_31/include/clang/Sema/DeclSpec.h
    cfe/branches/release_31/include/clang/Sema/Sema.h
    cfe/branches/release_31/lib/Parse/ParseCXXInlineMethods.cpp
    cfe/branches/release_31/lib/Parse/ParseDecl.cpp
    cfe/branches/release_31/lib/Parse/ParseDeclCXX.cpp
    cfe/branches/release_31/lib/Parse/ParseExpr.cpp
    cfe/branches/release_31/lib/Parse/ParseExprCXX.cpp
    cfe/branches/release_31/lib/Sema/DeclSpec.cpp
    cfe/branches/release_31/lib/Sema/SemaDecl.cpp
    cfe/branches/release_31/lib/Sema/SemaDeclCXX.cpp
    cfe/branches/release_31/lib/Sema/SemaType.cpp
    cfe/branches/release_31/test/SemaCXX/warn-unreachable.cpp   (props changed)

Propchange: cfe/branches/release_31/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 11 19:32:07 2012
@@ -1,3 +1,3 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:155076,155218,155278-155279,155289,155293,155342,155356,155424,155534-155535,155576,155608,155670,155728,155788,155803,155823,155860,155910,155975,156047,156322
+/cfe/trunk:155076,155218,155278-155279,155289,155293,155342,155356,155424,155534-155535,155576,155608,155670,155728,155788,155803,155823,155860,155910,155975,156031,156047,156322
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_31/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/AST/Decl.h?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/AST/Decl.h (original)
+++ cfe/branches/release_31/include/clang/AST/Decl.h Fri May 11 19:32:07 2012
@@ -64,9 +64,6 @@
 
   /// \brief Return the TypeLoc wrapper for the type source info.
   TypeLoc getTypeLoc() const; // implemented in TypeLoc.h
-  
-  /// \brief Override the type stored in this TypeSourceInfo. Use with caution!
-  void overrideType(QualType T) { Ty = T; }
 };
 
 /// TranslationUnitDecl - The top declaration context.

Modified: cfe/branches/release_31/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/Basic/DiagnosticParseKinds.td?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/branches/release_31/include/clang/Basic/DiagnosticParseKinds.td Fri May 11 19:32:07 2012
@@ -410,8 +410,6 @@
   "exception specification of '...' is a Microsoft extension">;
 def err_dynamic_and_noexcept_specification : Error<
   "cannot have both throw() and noexcept() clause on the same function">;
-def err_except_spec_unparsed : Error<
-  "unexpected end of exception specification">;
 def warn_cxx98_compat_noexcept_decl : Warning<
   "noexcept specifications are incompatible with C++98">,
   InGroup<CXX98Compat>, DefaultIgnore;

Modified: cfe/branches/release_31/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/Basic/TokenKinds.def?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/Basic/TokenKinds.def (original)
+++ cfe/branches/release_31/include/clang/Basic/TokenKinds.def Fri May 11 19:32:07 2012
@@ -105,7 +105,6 @@
                          // directive).
 TOK(code_completion)     // Code completion marker
 TOK(cxx_defaultarg_end)  // C++ default argument end marker
-TOK(cxx_exceptspec_end)  // C++ exception-specification end marker
 
 // C99 6.4.9: Comments.
 TOK(comment)             // Comment (only in -E -C[C] mode)

Modified: cfe/branches/release_31/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/Parse/Parser.h?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/Parse/Parser.h (original)
+++ cfe/branches/release_31/include/clang/Parse/Parser.h Fri May 11 19:32:07 2012
@@ -1429,12 +1429,10 @@
   ExprResult ParseThrowExpression();
 
   ExceptionSpecificationType tryParseExceptionSpecification(
-                    bool Delayed,
                     SourceRange &SpecificationRange,
                     SmallVectorImpl<ParsedType> &DynamicExceptions,
                     SmallVectorImpl<SourceRange> &DynamicExceptionRanges,
-                    ExprResult &NoexceptExpr,
-                    CachedTokens *&ExceptionSpecTokens);
+                    ExprResult &NoexceptExpr);
 
   // EndLoc is filled with the location of the last token of the specification.
   ExceptionSpecificationType ParseDynamicExceptionSpecification(

Modified: cfe/branches/release_31/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/Sema/DeclSpec.h?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/Sema/DeclSpec.h (original)
+++ cfe/branches/release_31/include/clang/Sema/DeclSpec.h Fri May 11 19:32:07 2012
@@ -1150,10 +1150,6 @@
       /// \brief Pointer to the expression in the noexcept-specifier of this
       /// function, if it has one.
       Expr *NoexceptExpr;
-  
-      /// \brief Pointer to the cached tokens for an exception-specification
-      /// that has not yet been parsed.
-      CachedTokens *ExceptionSpecTokens;
     };
 
     /// TrailingReturnType - If this isn't null, it's the trailing return type
@@ -1176,8 +1172,6 @@
         delete[] ArgInfo;
       if (getExceptionSpecType() == EST_Dynamic)
         delete[] Exceptions;
-      else if (getExceptionSpecType() == EST_Delayed)
-        delete ExceptionSpecTokens;
     }
 
     /// isKNRPrototype - Return true if this is a K&R style identifier list,
@@ -1353,7 +1347,6 @@
                                      SourceRange *ExceptionRanges,
                                      unsigned NumExceptions,
                                      Expr *NoexceptExpr,
-                                     CachedTokens *ExceptionSpecTokens,
                                      SourceLocation LocalRangeBegin,
                                      SourceLocation LocalRangeEnd,
                                      Declarator &TheDeclarator,

Modified: cfe/branches/release_31/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/Sema/Sema.h?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/Sema/Sema.h (original)
+++ cfe/branches/release_31/include/clang/Sema/Sema.h Fri May 11 19:32:07 2012
@@ -3154,16 +3154,6 @@
                                    llvm::SmallVectorImpl<QualType> &Exceptions,
                                    FunctionProtoType::ExtProtoInfo &EPI);
 
-  /// \brief Add an exception-specification to the given member function
-  /// (or member function template). The exception-specification was parsed
-  /// after the method itself was declared.
-  void actOnDelayedExceptionSpecification(Decl *Method,
-         ExceptionSpecificationType EST,
-         SourceRange SpecificationRange,
-         ArrayRef<ParsedType> DynamicExceptions,
-         ArrayRef<SourceRange> DynamicExceptionRanges,
-         Expr *NoexceptExpr);
-
   /// \brief Determine if a special member function should have a deleted
   /// definition when it is defaulted.
   bool ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM,

Modified: cfe/branches/release_31/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Parse/ParseCXXInlineMethods.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/branches/release_31/lib/Parse/ParseCXXInlineMethods.cpp Fri May 11 19:32:07 2012
@@ -348,77 +348,7 @@
       LM.DefaultArgs[I].Toks = 0;
     }
   }
-  
-  // Parse a delayed exception-specification, if there is one.
-  if (CachedTokens *Toks = LM.ExceptionSpecTokens) {
-    // Save the current token position.
-    SourceLocation origLoc = Tok.getLocation();
-    
-    // Parse the default argument from its saved token stream.
-    Toks->push_back(Tok); // So that the current token doesn't get lost
-    PP.EnterTokenStream(&Toks->front(), Toks->size(), true, false);
-    
-    // Consume the previously-pushed token.
-    ConsumeAnyToken();
-    
-    // C++11 [expr.prim.general]p3:
-    //   If a declaration declares a member function or member function 
-    //   template of a class X, the expression this is a prvalue of type 
-    //   "pointer to cv-qualifier-seq X" between the optional cv-qualifer-seq
-    //   and the end of the function-definition, member-declarator, or 
-    //   declarator.
-    CXXMethodDecl *Method;
-    if (FunctionTemplateDecl *FunTmpl
-          = dyn_cast<FunctionTemplateDecl>(LM.Method))
-      Method = cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
-    else
-      Method = cast<CXXMethodDecl>(LM.Method);
-    
-    Sema::CXXThisScopeRAII ThisScope(Actions, Method->getParent(),
-                                     Method->getTypeQualifiers(),
-                                     getLangOpts().CPlusPlus0x);
-
-    // Parse the exception-specification.
-    SourceRange SpecificationRange;
-    SmallVector<ParsedType, 4> DynamicExceptions;
-    SmallVector<SourceRange, 4> DynamicExceptionRanges;
-    ExprResult NoexceptExpr;
-    CachedTokens *ExceptionSpecTokens;
-    
-    ExceptionSpecificationType EST
-      = tryParseExceptionSpecification(/*Delayed=*/false, SpecificationRange,
-                                       DynamicExceptions,
-                                       DynamicExceptionRanges, NoexceptExpr,
-                                       ExceptionSpecTokens);
-
-    // Clean up the remaining tokens.
-    if (Tok.is(tok::cxx_exceptspec_end))
-      ConsumeToken();
-    else if (EST != EST_None)
-      Diag(Tok.getLocation(), diag::err_except_spec_unparsed);
 
-    // Attach the exception-specification to the method.
-    if (EST != EST_None)
-      Actions.actOnDelayedExceptionSpecification(LM.Method, EST,
-                                                 SpecificationRange,
-                                                 DynamicExceptions,
-                                                 DynamicExceptionRanges,
-                                                 NoexceptExpr.isUsable()?
-                                                   NoexceptExpr.get() : 0);
-          
-    assert(!PP.getSourceManager().isBeforeInTranslationUnit(origLoc,
-                                                            Tok.getLocation()) &&
-           "tryParseExceptionSpecification went over the exception tokens!");
-        
-    // There could be leftover tokens (e.g. because of an error).
-    // Skip through until we reach the original token position.
-    while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof))
-      ConsumeAnyToken();
-    
-    delete LM.ExceptionSpecTokens;
-    LM.ExceptionSpecTokens = 0;    
-  }
-  
   PrototypeScope.Exit();
 
   // Finish the delayed C++ method declaration.

Modified: cfe/branches/release_31/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Parse/ParseDecl.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Parse/ParseDecl.cpp (original)
+++ cfe/branches/release_31/lib/Parse/ParseDecl.cpp Fri May 11 19:32:07 2012
@@ -4197,7 +4197,6 @@
   SmallVector<ParsedType, 2> DynamicExceptions;
   SmallVector<SourceRange, 2> DynamicExceptionRanges;
   ExprResult NoexceptExpr;
-  CachedTokens *ExceptionSpecTokens = 0;
   ParsedAttributes FnAttrs(AttrFactory);
   ParsedType TrailingReturnType;
 
@@ -4264,7 +4263,7 @@
                                dyn_cast<CXXRecordDecl>(Actions.CurContext),
                                DS.getTypeQualifiers(),
                                IsCXX11MemberFunction);
-      
+
       // Parse exception-specification[opt].
       // FIXME: Remove the code to perform delayed parsing of exception
       //        specifications.
@@ -4280,8 +4279,7 @@
                                                  ESpecRange,
                                                  DynamicExceptions,
                                                  DynamicExceptionRanges,
-                                                 NoexceptExpr,
-                                                 ExceptionSpecTokens);
+                                                 NoexceptExpr);
       if (ESpecType != EST_None)
         EndLoc = ESpecRange.getEnd();
 
@@ -4316,7 +4314,6 @@
                                              DynamicExceptions.size(),
                                              NoexceptExpr.isUsable() ?
                                                NoexceptExpr.get() : 0,
-                                             ExceptionSpecTokens,
                                              Tracker.getOpenLocation(), 
                                              EndLoc, D,
                                              TrailingReturnType),

Modified: cfe/branches/release_31/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Parse/ParseDeclCXX.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/release_31/lib/Parse/ParseDeclCXX.cpp Fri May 11 19:32:07 2012
@@ -1535,34 +1535,16 @@
 }
 
 /// \brief If the given declarator has any parts for which parsing has to be
-/// delayed, e.g., default arguments or an exception-specification, create a
-/// late-parsed method declaration record to handle the parsing at the end of
-/// the class definition.
+/// delayed, e.g., default arguments, create a late-parsed method declaration
+/// record to handle the parsing at the end of the class definition.
 void Parser::HandleMemberFunctionDeclDelays(Declarator& DeclaratorInfo,
                                             Decl *ThisDecl) {
   // We just declared a member function. If this member function
-  // has any default arguments or an exception-specification, we'll need to
-  // parse them later.
+  // has any default arguments, we'll need to parse them later.
   LateParsedMethodDeclaration *LateMethod = 0;
   DeclaratorChunk::FunctionTypeInfo &FTI
     = DeclaratorInfo.getFunctionTypeInfo();
-  
-  // If there was a delayed exception-specification, hold onto its tokens.
-  if (FTI.getExceptionSpecType() == EST_Delayed) {
-    // Push this method onto the stack of late-parsed method
-    // declarations.
-    LateMethod = new LateParsedMethodDeclaration(this, ThisDecl);
-    getCurrentClass().LateParsedDeclarations.push_back(LateMethod);
-    LateMethod->TemplateScope = getCurScope()->isTemplateParamScope();
-
-    // Stash the exception-specification tokens in the late-pased mthod.
-    LateMethod->ExceptionSpecTokens = FTI.ExceptionSpecTokens;
-    FTI.ExceptionSpecTokens = 0;
 
-    // Reserve space for the parameters.
-    LateMethod->DefaultArgs.reserve(FTI.NumArgs);
-  }
-  
   for (unsigned ParamIdx = 0; ParamIdx < FTI.NumArgs; ++ParamIdx) {
     if (LateMethod || FTI.ArgInfo[ParamIdx].DefaultArgTokens) {
       if (!LateMethod) {
@@ -1846,7 +1828,7 @@
 
     // Parse the first declarator.
     ParseDeclarator(DeclaratorInfo);
-    // Error parsin g the declarator?
+    // Error parsing the declarator?
     if (!DeclaratorInfo.hasName()) {
       // If so, skip until the semi-colon or a }.
       SkipUntil(tok::r_brace, true, true);
@@ -2358,7 +2340,7 @@
 
   // C++11 [class.mem]p2:
   //   Within the class member-specification, the class is regarded as complete
-  //   within function bodies, default arguments, exception-specifications, and
+  //   within function bodies, default arguments, and
   //   brace-or-equal-initializers for non-static data members (including such
   //   things in nested classes).
   if (TagDecl && NonNestedClass) {
@@ -2559,63 +2541,13 @@
 ///         'noexcept'
 ///         'noexcept' '(' constant-expression ')'
 ExceptionSpecificationType
-Parser::tryParseExceptionSpecification(bool Delayed,
+Parser::tryParseExceptionSpecification(
                     SourceRange &SpecificationRange,
                     SmallVectorImpl<ParsedType> &DynamicExceptions,
                     SmallVectorImpl<SourceRange> &DynamicExceptionRanges,
-                    ExprResult &NoexceptExpr,
-                    CachedTokens *&ExceptionSpecTokens) {
+                    ExprResult &NoexceptExpr) {
   ExceptionSpecificationType Result = EST_None;
-  ExceptionSpecTokens = 0;
-  
-  // Handle delayed parsing of exception-specifications.
-  if (Delayed) {
-    if (Tok.isNot(tok::kw_throw) && Tok.isNot(tok::kw_noexcept))
-      return EST_None;
-
-    // Consume and cache the starting token.
-    bool IsNoexcept = Tok.is(tok::kw_noexcept);
-    Token StartTok = Tok;
-    SpecificationRange = SourceRange(ConsumeToken());
-
-    // Check for a '('.
-    if (!Tok.is(tok::l_paren)) {
-      // If this is a bare 'noexcept', we're done.
-      if (IsNoexcept) {
-        Diag(Tok, diag::warn_cxx98_compat_noexcept_decl);
-        NoexceptExpr = 0;
-        return EST_BasicNoexcept;
-      }
-      
-      Diag(Tok, diag::err_expected_lparen_after) << "throw";
-      return EST_DynamicNone;
-    }
-    
-    // Cache the tokens for the exception-specification.
-    ExceptionSpecTokens = new CachedTokens;
-    ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept'
-    ExceptionSpecTokens->push_back(Tok); // '('
-    SpecificationRange.setEnd(ConsumeParen()); // '('
-    
-    if (!ConsumeAndStoreUntil(tok::r_paren, *ExceptionSpecTokens,
-                              /*StopAtSemi=*/true,
-                              /*ConsumeFinalToken=*/true)) {
-      NoexceptExpr = 0;
-      delete ExceptionSpecTokens;
-      ExceptionSpecTokens = 0;
-      return IsNoexcept? EST_BasicNoexcept : EST_DynamicNone;
-    }
-    SpecificationRange.setEnd(Tok.getLocation());
-    
-    // Add the 'stop' token.
-    Token End;
-    End.startToken();
-    End.setKind(tok::cxx_exceptspec_end);
-    End.setLocation(Tok.getLocation());
-    ExceptionSpecTokens->push_back(End);
-    return EST_Delayed;
-  }
-  
+
   // See if there's a dynamic specification.
   if (Tok.is(tok::kw_throw)) {
     Result = ParseDynamicExceptionSpecification(SpecificationRange,

Modified: cfe/branches/release_31/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Parse/ParseExpr.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Parse/ParseExpr.cpp (original)
+++ cfe/branches/release_31/lib/Parse/ParseExpr.cpp Fri May 11 19:32:07 2012
@@ -2392,7 +2392,7 @@
                                                        SourceLocation(),
                                                        EST_None,
                                                        SourceLocation(),
-                                                       0, 0, 0, 0, 0,
+                                                       0, 0, 0, 0,
                                                        CaretLoc, CaretLoc,
                                                        ParamInfo),
                           attrs, CaretLoc);

Modified: cfe/branches/release_31/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Parse/ParseExprCXX.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/branches/release_31/lib/Parse/ParseExprCXX.cpp Fri May 11 19:32:07 2012
@@ -780,13 +780,10 @@
     llvm::SmallVector<ParsedType, 2> DynamicExceptions;
     llvm::SmallVector<SourceRange, 2> DynamicExceptionRanges;
     ExprResult NoexceptExpr;
-    CachedTokens *ExceptionSpecTokens;
-    ESpecType = tryParseExceptionSpecification(/*Delayed=*/false,
-                                               ESpecRange,
+    ESpecType = tryParseExceptionSpecification(ESpecRange,
                                                DynamicExceptions,
                                                DynamicExceptionRanges,
-                                               NoexceptExpr,
-                                               ExceptionSpecTokens);
+                                               NoexceptExpr);
 
     if (ESpecType != EST_None)
       DeclEndLoc = ESpecRange.getEnd();
@@ -821,7 +818,6 @@
                                            DynamicExceptions.size(),
                                            NoexceptExpr.isUsable() ?
                                              NoexceptExpr.get() : 0,
-                                           0,
                                            DeclLoc, DeclEndLoc, D,
                                            TrailingReturnType),
                   Attr, DeclEndLoc);
@@ -867,7 +863,6 @@
                      /*ExceptionRanges=*/0,
                      /*NumExceptions=*/0,
                      /*NoexceptExpr=*/0,
-                     /*ExceptionSpecTokens=*/0,
                      DeclLoc, DeclEndLoc, D,
                      TrailingReturnType),
                   Attr, DeclEndLoc);

Modified: cfe/branches/release_31/lib/Sema/DeclSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Sema/DeclSpec.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Sema/DeclSpec.cpp (original)
+++ cfe/branches/release_31/lib/Sema/DeclSpec.cpp Fri May 11 19:32:07 2012
@@ -162,7 +162,6 @@
                                              SourceRange *ExceptionRanges,
                                              unsigned NumExceptions,
                                              Expr *NoexceptExpr,
-                                             CachedTokens *ExceptionSpecTokens,
                                              SourceLocation LocalRangeBegin,
                                              SourceLocation LocalRangeEnd,
                                              Declarator &TheDeclarator,
@@ -227,10 +226,6 @@
   case EST_ComputedNoexcept:
     I.Fun.NoexceptExpr = NoexceptExpr;
     break;
-      
-  case EST_Delayed:
-    I.Fun.ExceptionSpecTokens = ExceptionSpecTokens;
-    break;
   }
   return I;
 }

Modified: cfe/branches/release_31/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Sema/SemaDecl.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/release_31/lib/Sema/SemaDecl.cpp Fri May 11 19:32:07 2012
@@ -7635,7 +7635,7 @@
                                              SourceLocation(), SourceLocation(),
                                              SourceLocation(),
                                              EST_None, SourceLocation(),
-                                             0, 0, 0, 0, 0, Loc, Loc, D),
+                                             0, 0, 0, 0, Loc, Loc, D),
                 DS.getAttributes(),
                 SourceLocation());
   D.SetIdentifier(&II, Loc);

Modified: cfe/branches/release_31/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Sema/SemaDeclCXX.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/release_31/lib/Sema/SemaDeclCXX.cpp Fri May 11 19:32:07 2012
@@ -11298,70 +11298,6 @@
   }
 }
 
-void Sema::actOnDelayedExceptionSpecification(Decl *MethodD,
-             ExceptionSpecificationType EST,
-             SourceRange SpecificationRange,
-             ArrayRef<ParsedType> DynamicExceptions,
-             ArrayRef<SourceRange> DynamicExceptionRanges,
-             Expr *NoexceptExpr) {
-  if (!MethodD)
-    return;
-  
-  // Dig out the method we're referring to.
-  CXXMethodDecl *Method = 0;
-  if (FunctionTemplateDecl *FunTmpl = dyn_cast<FunctionTemplateDecl>(MethodD))
-    Method = dyn_cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
-  else
-    Method = dyn_cast<CXXMethodDecl>(MethodD);
-  
-  if (!Method)
-    return;
-  
-  // Dig out the prototype, looking through only parens. This should never fail.
-  const FunctionProtoType *Proto
-    = cast<FunctionProtoType>(Method->getType().IgnoreParens());
-  
-  // Check the exception specification.
-  llvm::SmallVector<QualType, 4> Exceptions;
-  FunctionProtoType::ExtProtoInfo EPI = Proto->getExtProtoInfo();
-  checkExceptionSpecification(EST, DynamicExceptions, DynamicExceptionRanges,
-                              NoexceptExpr, Exceptions, EPI);
-  
-  // Rebuild the function type.
-  QualType T = Context.getFunctionType(Proto->getResultType(),
-                                       Proto->arg_type_begin(),
-                                       Proto->getNumArgs(),
-                                       EPI);
-
-  // Rebuild any parens around the function type.
-  for (const ParenType *PT = dyn_cast<ParenType>(Method->getType()); PT;
-       PT = dyn_cast<ParenType>(PT->getInnerType()))
-    T = Context.getParenType(T);
-
-  if (TypeSourceInfo *TSInfo = Method->getTypeSourceInfo()) {
-    // FIXME: When we get proper type location information for exceptions,
-    // we'll also have to rebuild the TypeSourceInfo. For now, we just patch
-    // up the TypeSourceInfo;
-    assert(TypeLoc::getFullDataSizeForType(T)
-             == TypeLoc::getFullDataSizeForType(Method->getType()) &&
-           "TypeLoc size mismatch with delayed exception specification");
-    TSInfo->overrideType(T);
-  }
-
-  Method->setType(T);
-  
-  if (Method->isStatic())
-    checkThisInStaticMemberFunctionExceptionSpec(Method);
-  
-  if (Method->isVirtual()) {
-    // Check overrides, which we previously had to delay.
-    for (CXXMethodDecl::method_iterator O = Method->begin_overridden_methods(),
-                                     OEnd = Method->end_overridden_methods();
-         O != OEnd; ++O)
-      CheckOverridingFunctionExceptionSpec(Method, *O);
-  }
-}
-
 /// IdentifyCUDATarget - Determine the CUDA compilation target for this function
 Sema::CUDAFunctionTarget Sema::IdentifyCUDATarget(const FunctionDecl *D) {
   // Implicitly declared functions (e.g. copy constructors) are

Modified: cfe/branches/release_31/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/lib/Sema/SemaType.cpp?rev=156684&r1=156683&r2=156684&view=diff
==============================================================================
--- cfe/branches/release_31/lib/Sema/SemaType.cpp (original)
+++ cfe/branches/release_31/lib/Sema/SemaType.cpp Fri May 11 19:32:07 2012
@@ -561,7 +561,7 @@
                              /*const qualifier*/SourceLocation(),
                              /*volatile qualifier*/SourceLocation(),
                              /*mutable qualifier*/SourceLocation(),
-                             /*EH*/ EST_None, SourceLocation(), 0, 0, 0, 0, 0,
+                             /*EH*/ EST_None, SourceLocation(), 0, 0, 0, 0,
                              /*parens*/ loc, loc,
                              declarator));
 

Propchange: cfe/branches/release_31/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 11 19:32:07 2012
@@ -1,2 +1,2 @@
 /cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,155076,155218,155278-155279,155289,155293,155342,155356,155424,155534-155535,155576,155608,155670,155728,155788,155803,155823,155860,155910,155975,156047
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,155076,155218,155278-155279,155289,155293,155342,155356,155424,155534-155535,155576,155608,155670,155728,155788,155803,155823,155860,155910,155975,156031,156047





More information about the llvm-branch-commits mailing list