diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-01-16 23:21:32 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-01-16 23:21:32 +0000 |
commit | 7d9669e4329cc9b6a0956e2a288ff2950ce23ba1 (patch) | |
tree | 4dd34ae0084481e8721448f3d044952fc1ffbf57 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | f157e901350ae2bf2b9e16c315f0d876b46a3149 (diff) | |
download | bcm5719-llvm-7d9669e4329cc9b6a0956e2a288ff2950ce23ba1.tar.gz bcm5719-llvm-7d9669e4329cc9b6a0956e2a288ff2950ce23ba1.zip |
Simplify code. No functionality change.
llvm-svn: 172673
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index efeafa697f6..5f9516f70ee 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1370,25 +1370,6 @@ static void handleOwnershipAttr(Sema &S, Decl *D, const AttributeList &AL) { start, size)); } -/// Whether this declaration has internal linkage for the purposes of -/// things that want to complain about things not have internal linkage. -static bool hasEffectivelyInternalLinkage(NamedDecl *D) { - switch (D->getLinkage()) { - case NoLinkage: - case InternalLinkage: - return true; - - // Template instantiations that go from external to unique-external - // shouldn't get diagnosed. - case UniqueExternalLinkage: - return true; - - case ExternalLinkage: - return false; - } - llvm_unreachable("unknown linkage kind!"); -} - static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) { // Check the attribute arguments. if (Attr.getNumArgs() > 1) { @@ -1439,7 +1420,7 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) { // This looks like a bug in gcc. We reject that for now. We should revisit // it if this behaviour is actually used. - if (!hasEffectivelyInternalLinkage(nd)) { + if (nd->getLinkage() == ExternalLinkage) { S.Diag(Attr.getLoc(), diag::err_attribute_weakref_not_static); return; } |