diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-23 16:18:44 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-23 16:18:44 +0000 |
commit | 8785d115ebaf1a850f5e581e4acd2dbfb2b843cb (patch) | |
tree | 03dec2ad03bad2e6f2c37628185fe1f19558aebd /lib/AST/DeclBase.cpp | |
parent | 89bb6146a8eca177b63fbcbc03c68f9012666023 (diff) |
Remove weak_import attribute on new declaration.
// rdar://9538608
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 1766d39c14..c183e61df8 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -520,6 +520,20 @@ void Decl::dropAttrs() { getASTContext().eraseDeclAttrs(this); } +void Decl::dropWeakImportAttr() { + if (!HasAttrs) return; + AttrVec &Attrs = getASTContext().getDeclAttrs(this); + for (llvm::SmallVectorImpl<Attr*>::iterator A = Attrs.begin(); + A != Attrs.end(); ++A) { + if (isa<WeakImportAttr>(*A)) { + Attrs.erase(A); + break; + } + } + if (Attrs.empty()) + HasAttrs = false; +} + const AttrVec &Decl::getAttrs() const { assert(HasAttrs && "No attrs to get!"); return getASTContext().getDeclAttrs(this); |