summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-20 01:17:11 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-20 01:17:11 +0000
commit6e6ad602e578dd178453d0008fe47ef13f629e24 (patch)
tree697316433686f85f3013558cdaee8f88663ff09d /clang/lib/Sema/SemaOverload.cpp
parentc59945b4bdfd8887bf9efb1a69171084910acf14 (diff)
downloadbcm5719-llvm-6e6ad602e578dd178453d0008fe47ef13f629e24.tar.gz
bcm5719-llvm-6e6ad602e578dd178453d0008fe47ef13f629e24.zip
Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 61c22d43bef..9441ea5f166 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -2193,20 +2193,17 @@ void Sema::AddOperatorCandidates(OverloadedOperatorKind Op, Scope *S,
// operator names can only be ordinary identifiers.
// Ignore member functions.
- if (ScopedDecl *SD = dyn_cast<ScopedDecl>(*I)) {
- if (SD->getDeclContext()->isRecord())
- continue;
- }
+ if ((*I)->getDeclContext()->isRecord())
+ continue;
// We found something with this name. We're done.
break;
}
- if (I != IEnd && isa<ScopedDecl>(*I)) {
- ScopedDecl *FirstDecl = cast<ScopedDecl>(*I);
+ if (I != IEnd) {
+ Decl *FirstDecl = *I;
for (; I != IEnd; ++I) {
- ScopedDecl *SD = cast<ScopedDecl>(*I);
- if (FirstDecl->getDeclContext() != SD->getDeclContext())
+ if (FirstDecl->getDeclContext() != (*I)->getDeclContext())
break;
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(*I))
OpenPOWER on IntegriCloud