aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-28 06:07:14 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-28 06:07:14 +0000
commit53d0ea5f5bfa647ec23418bf3a3b7c183b51e4bd (patch)
tree588340921cc284ce356556588d0916c8f422d298 /lib/Sema/SemaChecking.cpp
parent0d52da1812bfc70fd7a577966104c1c9d03143f6 (diff)
Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 7c0ff47a60..9008884909 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -151,11 +151,11 @@ bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) {
// Determine whether the current function is variadic or not.
bool isVariadic;
- if (CurFunctionDecl)
+ if (getCurFunctionDecl())
isVariadic =
- cast<FunctionTypeProto>(CurFunctionDecl->getType())->isVariadic();
+ cast<FunctionTypeProto>(getCurFunctionDecl()->getType())->isVariadic();
else
- isVariadic = CurMethodDecl->isVariadic();
+ isVariadic = getCurMethodDecl()->isVariadic();
if (!isVariadic) {
Diag(Fn->getLocStart(), diag::err_va_start_used_in_non_variadic_function);
@@ -172,10 +172,10 @@ 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 (CurFunctionDecl)
- LastArg = *(CurFunctionDecl->param_end()-1);
+ if (getCurFunctionDecl())
+ LastArg = *(getCurFunctionDecl()->param_end()-1);
else
- LastArg = *(CurMethodDecl->param_end()-1);
+ LastArg = *(getCurMethodDecl()->param_end()-1);
SecondArgIsLastNamedArgument = PV == LastArg;
}
}