diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:34:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:34:44 +0000 |
commit | 40b598eea1310ec9ed554d56ce3e25b34c585458 (patch) | |
tree | 8e2c3592f8ed4ac239504747ebffb388d5b170d6 /lib/AST/Decl.cpp | |
parent | e4f2142d00fa5fdb580c4e2413da91882d955381 (diff) |
Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.
This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 77fb20c400..89b87652d5 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -412,14 +412,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>(Context); + return getStorageClass() != Static && !getAttr<OverloadableAttr>(); 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>(Context); + !getAttr<OverloadableAttr>(); break; } @@ -484,7 +484,7 @@ unsigned FunctionDecl::getBuiltinID(ASTContext &Context) const { if (isa<LinkageSpecDecl>(getDeclContext()) && cast<LinkageSpecDecl>(getDeclContext())->getLanguage() == LinkageSpecDecl::lang_c && - !getAttr<OverloadableAttr>(Context)) + !getAttr<OverloadableAttr>()) return BuiltinID; // Not a builtin @@ -535,12 +535,12 @@ unsigned FunctionDecl::getMinRequiredArguments() const { } bool FunctionDecl::hasActiveGNUInlineAttribute(ASTContext &Context) const { - if (!isInline() || !hasAttr<GNUInlineAttr>(Context)) + if (!isInline() || !hasAttr<GNUInlineAttr>()) return false; for (const FunctionDecl *FD = getPreviousDeclaration(); FD; FD = FD->getPreviousDeclaration()) { - if (FD->isInline() && !FD->hasAttr<GNUInlineAttr>(Context)) + if (FD->isInline() && !FD->hasAttr<GNUInlineAttr>()) return false; } @@ -552,7 +552,7 @@ bool FunctionDecl::isExternGNUInline(ASTContext &Context) const { return false; for (const FunctionDecl *FD = this; FD; FD = FD->getPreviousDeclaration()) - if (FD->getStorageClass() == Extern && FD->hasAttr<GNUInlineAttr>(Context)) + if (FD->getStorageClass() == Extern && FD->hasAttr<GNUInlineAttr>()) return true; return false; |