diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-10-21 16:13:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-10-21 16:13:35 +0000 |
commit | 8e9bebdea69c590dedfbf27374114cb76fe12fbd (patch) | |
tree | a23d60f1da3648dcff20b6db034b2f5bf30ac50f /lib/AST/DeclBase.cpp | |
parent | 6d34893fc886f4153f104de8880876764981cb7f (diff) |
Preliminary support for function overloading
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 75d6bc6ce9..686aba2460 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -31,6 +31,7 @@ static unsigned nCXXSUC = 0; static unsigned nEnumConst = 0; static unsigned nEnumDecls = 0; static unsigned nNamespaces = 0; +static unsigned nOverFuncs = 0; static unsigned nTypedef = 0; static unsigned nFieldDecls = 0; static unsigned nCXXFieldDecls = 0; @@ -63,6 +64,7 @@ const char *Decl::getDeclKindName() const { switch (DeclKind) { default: assert(0 && "Unknown decl kind!"); case Namespace: return "Namespace"; + case OverloadedFunction: return "OverloadedFunction"; case Typedef: return "Typedef"; case Function: return "Function"; case Var: return "Var"; @@ -93,10 +95,13 @@ void Decl::PrintStats() { int(nFuncs+nVars+nParmVars+nFieldDecls+nSUC+nCXXFieldDecls+nCXXSUC+ nEnumDecls+nEnumConst+nTypedef+nInterfaceDecls+nClassDecls+ nMethodDecls+nProtocolDecls+nCategoryDecls+nIvarDecls+ - nAtDefsFieldDecls+nNamespaces)); + nAtDefsFieldDecls+nNamespaces+nOverFuncs)); fprintf(stderr, " %d namespace decls, %d each (%d bytes)\n", nNamespaces, (int)sizeof(NamespaceDecl), int(nNamespaces*sizeof(NamespaceDecl))); + fprintf(stderr, " %d overloaded function decls, %d each (%d bytes)\n", + nOverFuncs, (int)sizeof(OverloadedFunctionDecl), + int(nOverFuncs*sizeof(OverloadedFunctionDecl))); fprintf(stderr, " %d function decls, %d each (%d bytes)\n", nFuncs, (int)sizeof(FunctionDecl), int(nFuncs*sizeof(FunctionDecl))); fprintf(stderr, " %d variable decls, %d each (%d bytes)\n", @@ -192,13 +197,15 @@ void Decl::PrintStats() { nObjCPropertyImplDecl*sizeof(ObjCPropertyImplDecl)+ nLinkageSpecDecl*sizeof(LinkageSpecDecl)+ nFileScopeAsmDecl*sizeof(FileScopeAsmDecl)+ - nNamespaces*sizeof(NamespaceDecl))); + nNamespaces*sizeof(NamespaceDecl)+ + nOverFuncs*sizeof(OverloadedFunctionDecl))); } void Decl::addDeclKind(Kind k) { switch (k) { case Namespace: nNamespaces++; break; + case OverloadedFunction: nOverFuncs++; break; case Typedef: nTypedef++; break; case Function: nFuncs++; break; case Var: nVars++; break; |