summaryrefslogtreecommitdiffstats
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-03-03 17:28:16 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-03-03 17:28:16 +0000
commitdf90325d4c0a65ee64d2dae3ed9b5b34f7418533 (patch)
treee1a885aadfd80632f5bd70d4bd2d37e715e35a79 /lib/AST/DeclBase.cpp
parentfd035e6496665b1f1197868e21cb0a4594e8db6e (diff)
downloadFreeBSD-src-df90325d4c0a65ee64d2dae3ed9b5b34f7418533.zip
FreeBSD-src-df90325d4c0a65ee64d2dae3ed9b5b34f7418533.tar.gz
Update clang to 97654.
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 863a1cb..47b7e7e 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -194,6 +194,24 @@ ASTContext &Decl::getASTContext() const {
return getTranslationUnitDecl()->getASTContext();
}
+bool Decl::isUsed() const {
+ if (Used)
+ return true;
+
+ // Check for used attribute.
+ if (hasAttr<UsedAttr>())
+ return true;
+
+ // Check redeclarations for used attribute.
+ for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
+ if (I->hasAttr<UsedAttr>() || I->Used)
+ return true;
+ }
+
+ return false;
+}
+
+
unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) {
switch (DeclKind) {
case Function:
@@ -418,7 +436,8 @@ void Decl::CheckAccessDeclContext() const {
// FunctionDecl)
// 4. the context is not a record
if (isa<TranslationUnitDecl>(this) ||
- !isa<CXXRecordDecl>(getDeclContext()))
+ !isa<CXXRecordDecl>(getDeclContext()) ||
+ isInvalidDecl())
return;
assert(Access != AS_none &&
OpenPOWER on IntegriCloud