diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-12 00:17:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-12 00:17:51 +0000 |
commit | 48a83b5e7ae4051c7c11680ac00c1fa02d610a62 (patch) | |
tree | 67768c87edafe6ba7eb591e81184571540fd57de /lib/AST/Decl.cpp | |
parent | af3280fadbdab6305581955c973e1229970958eb (diff) |
Remove unnecessary ASTContext parameters from isMain and isExternC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 66f20364a6..ab8de1d5fe 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -117,7 +117,8 @@ void VarDecl::setInit(ASTContext &C, Expr *I) { Init = I; } -bool VarDecl::isExternC(ASTContext &Context) const { +bool VarDecl::isExternC() const { + ASTContext &Context = getASTContext(); if (!Context.getLangOptions().CPlusPlus) return (getDeclContext()->isTranslationUnit() && getStorageClass() != Static) || @@ -444,13 +445,15 @@ void FunctionDecl::setBody(Stmt *B) { EndRangeLoc = B->getLocEnd(); } -bool FunctionDecl::isMain(ASTContext &Context) const { +bool FunctionDecl::isMain() const { + ASTContext &Context = getASTContext(); return !Context.getLangOptions().Freestanding && getDeclContext()->getLookupContext()->isTranslationUnit() && getIdentifier() && getIdentifier()->isStr("main"); } -bool FunctionDecl::isExternC(ASTContext &Context) const { +bool FunctionDecl::isExternC() const { + ASTContext &Context = getASTContext(); // In C, any non-static, non-overloadable function has external // linkage. if (!Context.getLangOptions().CPlusPlus) |