diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-04 23:50:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-04 23:50:19 +0000 |
commit | 371f258e61e1365b951b17931a3c5ac1530fd1a0 (patch) | |
tree | 41095e9a128c4e4f966f33753e4317749853ef74 /lib/Sema/SemaChecking.cpp | |
parent | ae0ee03fd9d36446ee70e502fdaf5ed5acec269f (diff) |
change getCurFunctionDecl to skip through Block contexts to find
the containing block. Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places. This fixes rdar://6405429.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index bbc50d6bac..0c7da0edb0 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -184,8 +184,8 @@ bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) { // FIXME: This isn't correct for methods (results in bogus warning). // Get the last formal in the current function. const ParmVarDecl *LastArg; - if (getCurFunctionDecl()) - LastArg = *(getCurFunctionDecl()->param_end()-1); + if (FunctionDecl *FD = getCurFunctionDecl()) + LastArg = *(FD->param_end()-1); else LastArg = *(getCurMethodDecl()->param_end()-1); SecondArgIsLastNamedArgument = PV == LastArg; |