summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-23 16:18:44 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-23 16:18:44 +0000
commitbe5a4416ff7c85f0b7edb3f425721a583f26354c (patch)
treefdf7debe5adb20c0126a2b9b01f8ff4137ce1658 /clang/lib/AST/DeclBase.cpp
parente2456536b5e1699734c60051f41b7cb4020fdfed (diff)
downloadbcm5719-llvm-be5a4416ff7c85f0b7edb3f425721a583f26354c.tar.gz
bcm5719-llvm-be5a4416ff7c85f0b7edb3f425721a583f26354c.zip
Remove weak_import attribute on new declaration.
// rdar://9538608 llvm-svn: 133721
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 1766d39c140..c183e61df85 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud