r220053 - Sema: address post-commit review comment

Saleem Abdulrasool compnerd at compnerd.org
Fri Oct 17 10:20:33 PDT 2014


Author: compnerd
Date: Fri Oct 17 12:20:33 2014
New Revision: 220053

URL: http://llvm.org/viewvc/llvm-project?rev=220053&view=rev
Log:
Sema: address post-commit review comment

Hoist the IgnoreParens so that we ignore it around attributes as well in order
to future-proof the code.  Addresses Richard's comments for SVN r219974.

Modified:
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=220053&r1=220052&r2=220053&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Fri Oct 17 12:20:33 2014
@@ -2756,10 +2756,10 @@ bool LocalTypedefNameReferencer::VisitRe
 }
 
 TypeLoc Sema::getReturnTypeLoc(FunctionDecl *FD) const {
-  TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc();
+  TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc().IgnoreParens();
   while (auto ATL = TL.getAs<AttributedTypeLoc>())
     TL = ATL.getModifiedLoc().IgnoreParens();
-  return TL.IgnoreParens().castAs<FunctionProtoTypeLoc>().getReturnLoc();
+  return TL.castAs<FunctionProtoTypeLoc>().getReturnLoc();
 }
 
 /// Deduce the return type for a function from a returned expression, per





More information about the cfe-commits mailing list