summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
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