getStorageClass() == SC_PrivateExtern;
}
+ /// hasExternalStorageAsWritten - Returns true if a variable was written
+ /// with extern or __private_extern__ storage.
+ bool hasExternalStorageAsWritten() const {
+ return getStorageClassAsWritten() == SC_Extern ||
+ getStorageClassAsWritten() == SC_PrivateExtern;
+ }
+
/// hasGlobalStorage - Returns true for all variables that do not
/// have local storage. This includs all global variables as well
/// as static variables declared within a function.
}
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();
// 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)