diff options
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/Decl.cpp | 10 | ||||
-rw-r--r-- | lib/AST/DumpXML.cpp | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 433ce100cf..bd7579996f 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1847,6 +1847,16 @@ void FunctionDecl::setParams(ASTContext &C, } } +void FunctionDecl::setDeclsInPrototypeScope(llvm::ArrayRef<NamedDecl *> NewDecls) { + assert(DeclsInPrototypeScope.empty() && "Already has prototype decls!"); + + if (!NewDecls.empty()) { + NamedDecl **A = new (getASTContext()) NamedDecl*[NewDecls.size()]; + std::copy(NewDecls.begin(), NewDecls.end(), A); + DeclsInPrototypeScope = llvm::ArrayRef<NamedDecl*>(A, NewDecls.size()); + } +} + /// getMinRequiredArguments - Returns the minimum number of arguments /// needed to call this function. This may be fewer than the number of /// function parameters, if some of the parameters have default diff --git a/lib/AST/DumpXML.cpp b/lib/AST/DumpXML.cpp index b4038ddaf9..b180e808ab 100644 --- a/lib/AST/DumpXML.cpp +++ b/lib/AST/DumpXML.cpp @@ -497,6 +497,10 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>, for (FunctionDecl::param_iterator I = D->param_begin(), E = D->param_end(); I != E; ++I) dispatch(*I); + for (llvm::ArrayRef<NamedDecl*>::iterator + I = D->getDeclsInPrototypeScope().begin(), E = D->getDeclsInPrototypeScope().end(); + I != E; ++I) + dispatch(*I); if (D->doesThisDeclarationHaveABody()) dispatch(D->getBody()); } |