diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-02-17 20:21:51 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-02-17 20:21:51 +0000 |
commit | 13c9cc8b3702a1bcb5675a1b0e6e963838c2c2de (patch) | |
tree | 4726d4ec8b85efa2d712e482fc81882de77ee446 /clang/lib/Sema/IdentifierResolver.h | |
parent | 0cf6625ff848d67569e7db9f13fa97c9a680c588 (diff) | |
download | bcm5719-llvm-13c9cc8b3702a1bcb5675a1b0e6e963838c2c2de.tar.gz bcm5719-llvm-13c9cc8b3702a1bcb5675a1b0e6e963838c2c2de.zip |
Now that ObjC decls have DeclContexts too, remove an ugly hack from IdentifierResolver.
llvm-svn: 64802
Diffstat (limited to 'clang/lib/Sema/IdentifierResolver.h')
-rw-r--r-- | clang/lib/Sema/IdentifierResolver.h | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/clang/lib/Sema/IdentifierResolver.h b/clang/lib/Sema/IdentifierResolver.h index 50b894a7259..067900eac1c 100644 --- a/clang/lib/Sema/IdentifierResolver.h +++ b/clang/lib/Sema/IdentifierResolver.h @@ -28,58 +28,6 @@ namespace clang { /// implements efficent decl lookup based on a declaration name. class IdentifierResolver { - /// LookupContext - A wrapper for DeclContext. DeclContext is only part of - /// Decls, LookupContext can be used with all decls (assumes - /// translation unit context for non Decls). - class LookupContext { - const DeclContext *Ctx; - - /// TUCtx - Provides a common value for translation unit context for all - /// decls. - /// FIXME: When (if ?) all decls can point to their translation unit context - /// remove this hack. - static inline DeclContext *TUCtx() { - return reinterpret_cast<DeclContext*>(-1); - } - - /// getContext - Returns translation unit context for non Decls and - /// for EnumConstantDecls returns the parent context of their EnumDecl. - static DeclContext *getContext(Decl *D); - - public: - LookupContext(Decl *D) { - Ctx = getContext(D); - } - LookupContext(const DeclContext *DC) { - if (!DC || isa<TranslationUnitDecl>(DC)) - Ctx = TUCtx(); - else - Ctx = DC; - } - - bool isTU() const { - return (Ctx == TUCtx()); - } - - /// getParent - Returns the parent context. This should not be called for - /// a translation unit context. - LookupContext getParent() const { - assert(!isTU() && "TU has no parent!"); - return LookupContext(Ctx->getParent()); - } - - /// isEqOrContainedBy - Returns true of the given context is the same or a - /// parent of this one. - bool isEqOrContainedBy(const LookupContext &PC) const; - - bool operator==(const LookupContext &RHS) const { - return Ctx == RHS.Ctx; - } - bool operator!=(const LookupContext &RHS) const { - return Ctx != RHS.Ctx; - } - }; - /// IdDeclInfo - Keeps track of information about decls associated /// to a particular declaration name. IdDeclInfos are lazily /// constructed and assigned to a declaration name the first time a |