diff options
author | John McCall <rjmccall@apple.com> | 2009-10-01 00:25:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-01 00:25:31 +0000 |
commit | 4fa53427585ceea6e5e947bc19e7cfbce17bb4fa (patch) | |
tree | 0bad8cf4cb2935a36ae940f4db40ae6e0ceab28c /clang/lib/AST/DeclBase.cpp | |
parent | e0709cfc9247239ea4e083c2b8f0a6e570bd3666 (diff) | |
download | bcm5719-llvm-4fa53427585ceea6e5e947bc19e7cfbce17bb4fa.tar.gz bcm5719-llvm-4fa53427585ceea6e5e947bc19e7cfbce17bb4fa.zip |
Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.
llvm-svn: 83184
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 5f639d807dc..224bf877ad2 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -157,6 +157,17 @@ void Decl::setLexicalDeclContext(DeclContext *DC) { } } +bool Decl::isInAnonymousNamespace() const { + const DeclContext *DC = getDeclContext(); + do { + if (const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(DC)) + if (ND->isAnonymousNamespace()) + return true; + } while ((DC = DC->getParent())); + + return false; +} + TranslationUnitDecl *Decl::getTranslationUnitDecl() { if (TranslationUnitDecl *TUD = dyn_cast<TranslationUnitDecl>(this)) return TUD; |