summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-02 08:47:38 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-02 08:47:38 +0000
commit3d988d9042ffcbb1777182ba3bc8cb595c20b76b (patch)
tree7a016b7c07c0ca439ce6be35f2cba708d9b8e76b /clang/lib/AST
parente7fe5b2613ca9785eafbb69983415bffb5cccf7b (diff)
downloadbcm5719-llvm-3d988d9042ffcbb1777182ba3bc8cb595c20b76b.tar.gz
bcm5719-llvm-3d988d9042ffcbb1777182ba3bc8cb595c20b76b.zip
r90313, in which OverloadedFunctionDecl is removed and never spoken of again.
llvm-svn: 90313
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/DeclBase.cpp1
-rw-r--r--clang/lib/AST/DeclCXX.cpp58
-rw-r--r--clang/lib/AST/DeclPrinter.cpp6
-rw-r--r--clang/lib/AST/Expr.cpp4
-rw-r--r--clang/lib/AST/StmtProfile.cpp7
5 files changed, 1 insertions, 75 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 2dcd80b01fc..f276faf1bee 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -190,7 +190,6 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) {
case CXXConstructor:
case CXXDestructor:
case CXXConversion:
- case OverloadedFunction:
case Typedef:
case EnumConstant:
case Var:
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 40019880074..d850e4fd0a2 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -797,64 +797,6 @@ CXXConversionDecl::Create(ASTContext &C, CXXRecordDecl *RD,
return new (C) CXXConversionDecl(RD, L, N, T, DInfo, isInline, isExplicit);
}
-OverloadedFunctionDecl *
-OverloadedFunctionDecl::Create(ASTContext &C, DeclContext *DC,
- DeclarationName N) {
- return new (C) OverloadedFunctionDecl(DC, N);
-}
-
-OverloadIterator::OverloadIterator(NamedDecl *ND) : D(0) {
- if (!ND)
- return;
-
- if (isa<FunctionDecl>(ND) || isa<FunctionTemplateDecl>(ND))
- D = ND;
- else if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(ND)) {
- if (Ovl->size() != 0) {
- D = ND;
- Iter = Ovl->function_begin();
- }
- }
-}
-
-void OverloadedFunctionDecl::addOverload(AnyFunctionDecl F) {
- Functions.push_back(F);
- this->setLocation(F.get()->getLocation());
-}
-
-OverloadIterator::reference OverloadIterator::operator*() const {
- if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
- return FD;
-
- if (FunctionTemplateDecl *FTD = dyn_cast<FunctionTemplateDecl>(D))
- return FTD;
-
- assert(isa<OverloadedFunctionDecl>(D));
- return *Iter;
-}
-
-OverloadIterator &OverloadIterator::operator++() {
- if (isa<FunctionDecl>(D) || isa<FunctionTemplateDecl>(D)) {
- D = 0;
- return *this;
- }
-
- if (++Iter == cast<OverloadedFunctionDecl>(D)->function_end())
- D = 0;
-
- return *this;
-}
-
-bool OverloadIterator::Equals(const OverloadIterator &Other) const {
- if (!D || !Other.D)
- return D == Other.D;
-
- if (D != Other.D)
- return false;
-
- return !isa<OverloadedFunctionDecl>(D) || Iter == Other.Iter;
-}
-
FriendDecl *FriendDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L,
FriendUnion Friend,
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index a5982cfd97f..2c3b927e436 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -52,7 +52,6 @@ namespace {
void VisitVarDecl(VarDecl *D);
void VisitParmVarDecl(ParmVarDecl *D);
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
- void VisitOverloadedFunctionDecl(OverloadedFunctionDecl *D);
void VisitNamespaceDecl(NamespaceDecl *D);
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
@@ -488,11 +487,6 @@ void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
//----------------------------------------------------------------------------
// C++ declarations
//----------------------------------------------------------------------------
-void DeclPrinter::VisitOverloadedFunctionDecl(OverloadedFunctionDecl *D) {
- assert(false &&
- "OverloadedFunctionDecls aren't really decls and are never printed");
-}
-
void DeclPrinter::VisitNamespaceDecl(NamespaceDecl *D) {
Out << "namespace " << D->getNameAsString() << " {\n";
VisitDeclContext(D);
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 624a620b9fb..28f1bd92f3e 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -118,7 +118,6 @@ DeclRefExpr::DeclRefExpr(NestedNameSpecifier *Qualifier,
(Qualifier? HasQualifierFlag : 0) |
(TemplateArgs ? HasExplicitTemplateArgumentListFlag : 0)),
Loc(NameLoc) {
- assert(!isa<OverloadedFunctionDecl>(D));
if (Qualifier) {
NameQualifier *NQ = getNameQualifier();
NQ->NNS = Qualifier;
@@ -944,8 +943,7 @@ static bool DeclCanBeLvalue(const NamedDecl *Decl, ASTContext &Ctx) {
return isa<VarDecl>(Decl) || isa<FieldDecl>(Decl) ||
// C++ 3.10p2: An lvalue refers to an object or function.
(Ctx.getLangOptions().CPlusPlus &&
- (isa<FunctionDecl>(Decl) || isa<OverloadedFunctionDecl>(Decl) ||
- isa<FunctionTemplateDecl>(Decl)));
+ (isa<FunctionDecl>(Decl) || isa<FunctionTemplateDecl>(Decl)));
}
/// isLvalue - C99 6.3.2.1: an lvalue is an expression with an object type or an
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 1b6b022901e..e2d772b7dd1 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -659,13 +659,6 @@ void StmtProfiler::VisitDecl(Decl *D) {
ID.AddInteger(TTP->getIndex());
return;
}
-
- if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(D)) {
- // The Itanium C++ ABI mangles references to a set of overloaded
- // functions using just the function name, so we do the same here.
- VisitName(Ovl->getDeclName());
- return;
- }
}
ID.AddPointer(D? D->getCanonicalDecl() : 0);
OpenPOWER on IntegriCloud