diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/Sema.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 12 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 8c79d822cf..6239172a09 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -360,7 +360,7 @@ static bool ShouldRemoveFromUnused(Sema *SemaRef, const DeclaratorDecl *D) { return !SemaRef->ShouldWarnIfUnusedFileScopedDecl(DeclToCheck); } - if (D->getLinkage() == ExternalLinkage) + if (D->hasExternalLinkage()) return true; return false; @@ -402,13 +402,13 @@ void Sema::getUndefinedButUsed( if (FunctionDecl *FD = dyn_cast<FunctionDecl>(ND)) { if (FD->isDefined()) continue; - if (FD->getLinkage() == ExternalLinkage && + if (FD->hasExternalLinkage() && !FD->getMostRecentDecl()->isInlined()) continue; } else { if (cast<VarDecl>(ND)->hasDefinition() != VarDecl::DeclarationOnly) continue; - if (ND->getLinkage() == ExternalLinkage) + if (ND->hasExternalLinkage()) continue; } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 78f1784ad1..82d216ee01 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1223,7 +1223,7 @@ bool Sema::ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const { } // Only warn for unused decls internal to the translation unit. - if (D->getLinkage() == ExternalLinkage) + if (D->hasExternalLinkage()) return false; return true; @@ -1584,7 +1584,7 @@ static void filterNonConflictingPreviousDecls(ASTContext &context, return; // If this declaration has external - bool hasExternalLinkage = (decl->getLinkage() == ExternalLinkage); + bool hasExternalLinkage = decl->hasExternalLinkage(); LookupResult::Filter filter = previous.makeFilter(); while (filter.hasNext()) { @@ -4577,7 +4577,7 @@ static void checkAttributesAfterMerging(Sema &S, NamedDecl &ND) { } } if (WeakRefAttr *Attr = ND.getAttr<WeakRefAttr>()) { - if (ND.getLinkage() == ExternalLinkage) { + if (ND.hasExternalLinkage()) { S.Diag(Attr->getLocation(), diag::err_attribute_weakref_not_static); ND.dropAttr<WeakRefAttr>(); } @@ -6388,7 +6388,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, // If there's a #pragma GCC visibility in scope, and this isn't a class // member, set the visibility of this function. - if (NewFD->getLinkage() == ExternalLinkage && !DC->isRecord()) + if (NewFD->hasExternalLinkage() && !DC->isRecord()) AddPushedVisibilityAttribute(NewFD); // If there's a #pragma clang arc_cf_code_audited in scope, consider @@ -7782,7 +7782,7 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { } if (var->isThisDeclarationADefinition() && - var->getLinkage() == ExternalLinkage && + var->hasExternalLinkage() && getDiagnostics().getDiagnosticLevel( diag::warn_missing_variable_declarations, var->getLocation())) { @@ -7880,7 +7880,7 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) { const DeclContext *DC = VD->getDeclContext(); // If there's a #pragma GCC visibility in scope, and this isn't a class // member, set the visibility of this variable. - if (VD->getLinkage() == ExternalLinkage && !DC->isRecord()) + if (VD->hasExternalLinkage() && !DC->isRecord()) AddPushedVisibilityAttribute(VD); if (VD->isFileVarDecl()) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 46010e4bdb..22a31e0af5 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -11364,7 +11364,7 @@ bool Sema::DefineUsedVTables() { Consumer.HandleVTable(Class, VTablesUsed[Canonical]); // Optionally warn if we're emitting a weak vtable. - if (Class->getLinkage() == ExternalLinkage && + if (Class->hasExternalLinkage() && Class->getTemplateSpecializationKind() != TSK_ImplicitInstantiation) { const FunctionDecl *KeyFunctionDef = 0; if (!KeyFunction || |