diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-18 16:11:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-18 16:11:24 +0000 |
commit | 68584ed35ad819a1668e3f527ba7f5dd4ae6a333 (patch) | |
tree | f92e4dc8a0ad0128f011a81e4ef954ff1ea7311c /lib/AST/Decl.cpp | |
parent | 0adea828ec9db09bf54ca4efa54b2a2f688726b5 (diff) |
Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index a3e406b245..b2b643a64f 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -380,13 +380,14 @@ bool FunctionDecl::isExternC(ASTContext &Context) const { // In C, any non-static, non-overloadable function has external // linkage. if (!Context.getLangOptions().CPlusPlus) - return getStorageClass() != Static && !getAttr<OverloadableAttr>(); + return getStorageClass() != Static && !getAttr<OverloadableAttr>(Context); for (const DeclContext *DC = getDeclContext(); !DC->isTranslationUnit(); DC = DC->getParent()) { if (const LinkageSpecDecl *Linkage = dyn_cast<LinkageSpecDecl>(DC)) { if (Linkage->getLanguage() == LinkageSpecDecl::lang_c) - return getStorageClass() != Static && !getAttr<OverloadableAttr>(); + return getStorageClass() != Static && + !getAttr<OverloadableAttr>(Context); break; } @@ -451,7 +452,7 @@ unsigned FunctionDecl::getBuiltinID(ASTContext &Context) const { if (isa<LinkageSpecDecl>(getDeclContext()) && cast<LinkageSpecDecl>(getDeclContext())->getLanguage() == LinkageSpecDecl::lang_c && - !getAttr<OverloadableAttr>()) + !getAttr<OverloadableAttr>(Context)) return BuiltinID; // Not a builtin @@ -496,25 +497,25 @@ unsigned FunctionDecl::getMinRequiredArguments() const { return NumRequiredArgs; } -bool FunctionDecl::hasActiveGNUInlineAttribute() const { - if (!isInline() || !hasAttr<GNUInlineAttr>()) +bool FunctionDecl::hasActiveGNUInlineAttribute(ASTContext &Context) const { + if (!isInline() || !hasAttr<GNUInlineAttr>(Context)) return false; for (const FunctionDecl *FD = getPreviousDeclaration(); FD; FD = FD->getPreviousDeclaration()) { - if (FD->isInline() && !FD->hasAttr<GNUInlineAttr>()) + if (FD->isInline() && !FD->hasAttr<GNUInlineAttr>(Context)) return false; } return true; } -bool FunctionDecl::isExternGNUInline() const { - if (!hasActiveGNUInlineAttribute()) +bool FunctionDecl::isExternGNUInline(ASTContext &Context) const { + if (!hasActiveGNUInlineAttribute(Context)) return false; for (const FunctionDecl *FD = this; FD; FD = FD->getPreviousDeclaration()) - if (FD->getStorageClass() == Extern && FD->hasAttr<GNUInlineAttr>()) + if (FD->getStorageClass() == Extern && FD->hasAttr<GNUInlineAttr>(Context)) return true; return false; |