From 5929ef2ee7c94dba046007065a198003bfcadd40 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 28 Feb 2012 23:39:14 +0000 Subject: Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. llvm-svn: 151667 --- clang/lib/AST/Decl.cpp | 10 ---------- clang/lib/AST/DumpXML.cpp | 4 ---- 2 files changed, 14 deletions(-) (limited to 'clang/lib/AST') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index bd7579996f4..433ce100cfd 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1847,16 +1847,6 @@ void FunctionDecl::setParams(ASTContext &C, } } -void FunctionDecl::setDeclsInPrototypeScope(llvm::ArrayRef 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(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/clang/lib/AST/DumpXML.cpp b/clang/lib/AST/DumpXML.cpp index b180e808ab4..b4038ddaf95 100644 --- a/clang/lib/AST/DumpXML.cpp +++ b/clang/lib/AST/DumpXML.cpp @@ -497,10 +497,6 @@ struct XMLDumper : public XMLDeclVisitor, for (FunctionDecl::param_iterator I = D->param_begin(), E = D->param_end(); I != E; ++I) dispatch(*I); - for (llvm::ArrayRef::iterator - I = D->getDeclsInPrototypeScope().begin(), E = D->getDeclsInPrototypeScope().end(); - I != E; ++I) - dispatch(*I); if (D->doesThisDeclarationHaveABody()) dispatch(D->getBody()); } -- cgit v1.2.3