diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-03-07 01:42:44 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-03-07 01:42:44 +0000 |
commit | 377830097aec41c0cd80ef5972b4e850b44afefd (patch) | |
tree | d0c8e8d79093e982035a89ce13e415d8fad67055 /lib/AST/Decl.cpp | |
parent | 58bd77f6132e56dbf7659b1c436ba20b973e6ef9 (diff) |
Add a hasExternalStorageAsWritten helper. No functionality change.
It is possible that some of the current uses of
"getStorageClassAsWritten() == SC_Extern" should use this but I don't know
enough about SC_PrivateExtern to change and test them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index b8439cae74..257e59c237 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1049,8 +1049,7 @@ static LinkageInfo getLVForLocalDecl(const NamedDecl *D, } if (const VarDecl *Var = dyn_cast<VarDecl>(D)) { - if (Var->getStorageClassAsWritten() == SC_Extern || - Var->getStorageClassAsWritten() == SC_PrivateExtern) { + if (Var->hasExternalStorageAsWritten()) { if (Var->isInAnonymousNamespace() && !Var->getDeclContext()->isExternCContext()) return LinkageInfo::uniqueExternal(); @@ -1600,9 +1599,8 @@ VarDecl::DefinitionKind VarDecl::isThisDeclarationADefinition( // AST for 'extern "C" int foo;' is annotated with 'extern'. if (hasExternalStorage()) return DeclarationOnly; - - if (getStorageClassAsWritten() == SC_Extern || - getStorageClassAsWritten() == SC_PrivateExtern) { + + if (hasExternalStorageAsWritten()) { for (const VarDecl *PrevVar = getPreviousDecl(); PrevVar; PrevVar = PrevVar->getPreviousDecl()) { if (PrevVar->getLinkage() == InternalLinkage) |