From c6ffb1e515253b3284ddfd63eebfa0383a690075 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sat, 25 Jan 2014 23:51:36 +0000 Subject: [PATCH] Rename getResultLoc() too Follow up to r200082. Spotted by Dmitri git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200105 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DataRecursiveASTVisitor.h | 6 +++--- include/clang/AST/RecursiveASTVisitor.h | 6 +++--- include/clang/AST/TypeLoc.h | 2 +- lib/AST/Comment.cpp | 4 ++-- lib/Sema/SemaDecl.cpp | 4 ++-- lib/Sema/SemaDeclAttr.cpp | 2 +- lib/Sema/SemaDeclCXX.cpp | 4 ++-- lib/Sema/SemaExpr.cpp | 2 +- lib/Sema/SemaLambda.cpp | 2 +- lib/Sema/SemaStmt.cpp | 2 +- lib/Sema/TreeTransform.h | 6 +++--- tools/libclang/CIndex.cpp | 6 +++--- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/clang/AST/DataRecursiveASTVisitor.h b/include/clang/AST/DataRecursiveASTVisitor.h index ae1be931bf..068fe08cfd 100644 --- a/include/clang/AST/DataRecursiveASTVisitor.h +++ b/include/clang/AST/DataRecursiveASTVisitor.h @@ -1093,12 +1093,12 @@ DEF_TRAVERSE_TYPELOC(ExtVectorType, { }) DEF_TRAVERSE_TYPELOC(FunctionNoProtoType, { - TRY_TO(TraverseTypeLoc(TL.getResultLoc())); + TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); }) // FIXME: location of exception specifications (attributes?) DEF_TRAVERSE_TYPELOC(FunctionProtoType, { - TRY_TO(TraverseTypeLoc(TL.getResultLoc())); + TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); const FunctionProtoType *T = TL.getTypePtr(); @@ -2194,7 +2194,7 @@ bool DataRecursiveASTVisitor::TraverseLambdaExpr(LambdaExpr *S) { TRY_TO(TraverseDecl(Proto.getParam(I))); } } else { - TRY_TO(TraverseTypeLoc(Proto.getResultLoc())); + TRY_TO(TraverseTypeLoc(Proto.getReturnLoc())); } } } diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index c5300d158b..75774451c8 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -1174,12 +1174,12 @@ DEF_TRAVERSE_TYPELOC(ExtVectorType, { }) DEF_TRAVERSE_TYPELOC(FunctionNoProtoType, { - TRY_TO(TraverseTypeLoc(TL.getResultLoc())); + TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); }) // FIXME: location of exception specifications (attributes?) DEF_TRAVERSE_TYPELOC(FunctionProtoType, { - TRY_TO(TraverseTypeLoc(TL.getResultLoc())); + TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); const FunctionProtoType *T = TL.getTypePtr(); @@ -2218,7 +2218,7 @@ bool RecursiveASTVisitor::TraverseLambdaExpr(LambdaExpr *S) { TRY_TO(TraverseDecl(Proto.getParam(I))); } } else { - TRY_TO(TraverseTypeLoc(Proto.getResultLoc())); + TRY_TO(TraverseTypeLoc(Proto.getReturnLoc())); } } } diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 633089dccc..a54aee8703 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -1224,7 +1224,7 @@ public: ParmVarDecl *getParam(unsigned i) const { return getParmArray()[i]; } void setParam(unsigned i, ParmVarDecl *VD) { getParmArray()[i] = VD; } - TypeLoc getResultLoc() const { + TypeLoc getReturnLoc() const { return getInnerTypeLoc(); } diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index b736b4825e..b0b2351074 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -281,7 +281,7 @@ void DeclInfo::fill() { ArrayRef Params = FTL.getParams(); ParamVars = ArrayRef(Params.data(), Params.size()); - ReturnType = FTL.getResultLoc().getType(); + ReturnType = FTL.getReturnLoc().getType(); break; } if (TemplateSpecializationTypeLoc STL = @@ -302,7 +302,7 @@ void DeclInfo::fill() { ArrayRef Params = FTL.getParams(); ParamVars = ArrayRef(Params.data(), Params.size()); - ReturnType = FTL.getResultLoc().getType(); + ReturnType = FTL.getReturnLoc().getType(); } break; } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index d4be61a227..a70bece3e8 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -7652,7 +7652,7 @@ static SourceRange getResultSourceRange(const FunctionDecl *FD) { if (!FunctionTL) return SourceRange(); - TypeLoc ResultTL = FunctionTL.getResultLoc(); + TypeLoc ResultTL = FunctionTL.getReturnLoc(); if (ResultTL.getUnqualifiedLoc().getAs()) return ResultTL.getSourceRange(); @@ -9732,7 +9732,7 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, } else { // Substitute 'void' for the 'auto' in the type. TypeLoc ResultType = FD->getTypeSourceInfo()->getTypeLoc(). - IgnoreParens().castAs().getResultLoc(); + IgnoreParens().castAs().getReturnLoc(); Context.adjustDeducedFunctionResultType( FD, SubstAutoType(ResultType.getType(), Context.VoidTy)); } diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 0845194a78..c6e8f3490a 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3015,7 +3015,7 @@ static void handleGlobalAttr(Sema &S, Decl *D, const AttributeList &Attr) { if (FunctionTypeLoc FTL = TL.getAs()) { S.Diag(FD->getTypeSpecStartLoc(), diag::err_kern_type_not_void_return) << FD->getType() - << FixItHint::CreateReplacement(FTL.getResultLoc().getSourceRange(), + << FixItHint::CreateReplacement(FTL.getReturnLoc().getSourceRange(), "void"); } else { S.Diag(FD->getTypeSpecStartLoc(), diag::err_kern_type_not_void_return) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index ad8b1b2ba5..cde6d9dc75 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -4246,7 +4246,7 @@ struct CheckAbstractUsage { } void Check(FunctionProtoTypeLoc TL, Sema::AbstractDiagSelID Sel) { - Visit(TL.getResultLoc(), Sema::AbstractReturnType); + Visit(TL.getReturnLoc(), Sema::AbstractReturnType); for (unsigned I = 0, E = TL.getNumParams(); I != E; ++I) { if (!TL.getParam(I)) continue; @@ -12656,7 +12656,7 @@ bool Sema::checkThisInStaticMemberFunctionType(CXXMethodDecl *Method) { // If the return type came after the cv-qualifier-seq, check it now. if (Proto->hasTrailingReturn() && - !Finder.TraverseTypeLoc(ProtoTL.getResultLoc())) + !Finder.TraverseTypeLoc(ProtoTL.getReturnLoc())) return true; // Check the exception specification. diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index e4e0052424..be169b6ecd 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -10308,7 +10308,7 @@ void Sema::ActOnBlockArguments(SourceLocation CaretLoc, Declarator &ParamInfo, ExplicitSignature.getLocalRangeEnd()) { // This would be much cheaper if we stored TypeLocs instead of // TypeSourceInfos. - TypeLoc Result = ExplicitSignature.getResultLoc(); + TypeLoc Result = ExplicitSignature.getReturnLoc(); unsigned Size = Result.getFullDataSize(); Sig = Context.CreateTypeSourceInfo(Result.getType(), Size); Sig->getTypeLoc().initializeFullCopy(Result, Size); diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index ac3f2efb5b..5d282cb6fc 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -1210,7 +1210,7 @@ static void addFunctionPointerConversion(Sema &S, ConvTSI->getTypeLoc().getAs(); // Get the result of the conversion function which is a pointer-to-function. PointerTypeLoc PtrToFunctionTL = - ConvTL.getResultLoc().getAs(); + ConvTL.getReturnLoc().getAs(); // Do the same for the TypeSourceInfo that is used to name the conversion // operator. PointerTypeLoc ConvNamePtrToFunctionTL = diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 554535dcf2..65ce405c55 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -2712,7 +2712,7 @@ bool Sema::DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD, Expr *&RetExpr, AutoType *AT) { TypeLoc OrigResultType = FD->getTypeSourceInfo()->getTypeLoc(). - IgnoreParens().castAs().getResultLoc(); + IgnoreParens().castAs().getReturnLoc(); QualType Deduced; if (RetExpr && isa(RetExpr)) { diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 37f6bb79ec..93cb483321 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -4368,13 +4368,13 @@ TreeTransform::TransformFunctionProtoType(TypeLocBuilder &TLB, // declarator. Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, ThisTypeQuals); - ResultType = getDerived().TransformType(TLB, TL.getResultLoc()); + ResultType = getDerived().TransformType(TLB, TL.getReturnLoc()); if (ResultType.isNull()) return QualType(); } } else { - ResultType = getDerived().TransformType(TLB, TL.getResultLoc()); + ResultType = getDerived().TransformType(TLB, TL.getReturnLoc()); if (ResultType.isNull()) return QualType(); @@ -4413,7 +4413,7 @@ QualType TreeTransform::TransformFunctionNoProtoType( TypeLocBuilder &TLB, FunctionNoProtoTypeLoc TL) { const FunctionNoProtoType *T = TL.getTypePtr(); - QualType ResultType = getDerived().TransformType(TLB, TL.getResultLoc()); + QualType ResultType = getDerived().TransformType(TLB, TL.getReturnLoc()); if (ResultType.isNull()) return QualType(); diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 407051de1c..d1b02c4b65 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -769,7 +769,7 @@ bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) { // If we have a function declared directly (without the use of a typedef), // visit just the return type. Otherwise, just visit the function's type // now. - if ((FTL && !isa(ND) && Visit(FTL.getResultLoc())) || + if ((FTL && !isa(ND) && Visit(FTL.getReturnLoc())) || (!FTL && Visit(TL))) return true; @@ -1517,7 +1517,7 @@ bool CursorVisitor::VisitAttributedTypeLoc(AttributedTypeLoc TL) { bool CursorVisitor::VisitFunctionTypeLoc(FunctionTypeLoc TL, bool SkipResultType) { - if (!SkipResultType && Visit(TL.getResultLoc())) + if (!SkipResultType && Visit(TL.getReturnLoc())) return true; for (unsigned I = 0, N = TL.getNumParams(); I != N; ++I) @@ -2442,7 +2442,7 @@ bool CursorVisitor::RunVisitorWorkList(VisitorWorkList &WL) { return true; } else { // Visit result type. - if (Visit(Proto.getResultLoc())) + if (Visit(Proto.getReturnLoc())) return true; } } -- 2.40.0