diff options
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index d8f213a973..a1ec7d9930 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -626,21 +626,24 @@ Sema::ActOnBreakStmt(SourceLocation BreakLoc, Scope *CurScope) { Action::StmtResult Sema::ActOnReturnStmt(SourceLocation ReturnLoc, ExprTy *rex) { Expr *RetValExp = static_cast<Expr *>(rex); - QualType FnRetType = CurFunctionDecl ? CurFunctionDecl->getResultType() : - CurMethodDecl->getResultType(); + QualType FnRetType = + getCurFunctionDecl() ? getCurFunctionDecl()->getResultType() : + getCurMethodDecl()->getResultType(); if (FnRetType->isVoidType()) { if (RetValExp) // C99 6.8.6.4p1 (ext_ since GCC warns) Diag(ReturnLoc, diag::ext_return_has_expr, - (CurFunctionDecl ? CurFunctionDecl->getIdentifier()->getName() : - CurMethodDecl->getSelector().getName()), + ( getCurFunctionDecl() ? + getCurFunctionDecl()->getIdentifier()->getName() : + getCurMethodDecl()->getSelector().getName() ), RetValExp->getSourceRange()); return new ReturnStmt(ReturnLoc, RetValExp); } else { if (!RetValExp) { - const char *funcName = CurFunctionDecl ? - CurFunctionDecl->getIdentifier()->getName() : - CurMethodDecl->getSelector().getName().c_str(); + const char *funcName = + getCurFunctionDecl() ? + getCurFunctionDecl()->getIdentifier()->getName() : + getCurMethodDecl()->getSelector().getName().c_str(); if (getLangOptions().C99) // C99 6.8.6.4p1 (ext_ since GCC warns) Diag(ReturnLoc, diag::ext_return_missing_expr, funcName); else // C90 6.6.6.4p4 @@ -816,5 +819,3 @@ Sema::ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc, ExprTy *SynchExpr, static_cast<Stmt*>(SynchExpr), static_cast<Stmt*>(SynchBody)); return SS; } - - |