diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-04-29 16:49:01 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-04-29 16:49:01 +0000 |
| commit | 186a0743464a94024e68b550a2978ff6bb787300 (patch) | |
| tree | 1703209d638a1ca5fdc47f4f1c244ccea40f64e3 /clang/lib/AST | |
| parent | 8af4f40f4a26c872843226f5bafd0a87a47dbb9f (diff) | |
| download | bcm5719-llvm-186a0743464a94024e68b550a2978ff6bb787300.tar.gz bcm5719-llvm-186a0743464a94024e68b550a2978ff6bb787300.zip | |
Add FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl::isVariadic().
Do some minor refactoring along the way.
llvm-svn: 102635
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 62420de7a7d..fc805451cba 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -906,6 +906,12 @@ void FunctionDecl::getNameForDiagnostic(std::string &S, } +bool FunctionDecl::isVariadic() const { + if (const FunctionProtoType *FT = getType()->getAs<FunctionProtoType>()) + return FT->isVariadic(); + return false; +} + Stmt *FunctionDecl::getBody(const FunctionDecl *&Definition) const { for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) { if (I->Body) { |

