From: Fariborz Jahanian Date: Thu, 23 Jun 2011 20:24:38 +0000 (+0000) Subject: Move definition of template void Decl::dropAttr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cf0f52037e0c4bf656953ae63a07e8156aeb5fb;p=clang Move definition of template void Decl::dropAttr to its header to avoid an explicit instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133753 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index d39ad72bd7..8b2ef2a81a 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -383,8 +383,22 @@ public: } template - void dropAttr(); - + void dropAttr() { + if (!HasAttrs) return; + + AttrVec &Attrs = getAttrs(); + for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) { + if (isa(Attrs[i])) { + Attrs.erase(Attrs.begin() + i); + --e; + } + else + ++i; + } + if (Attrs.empty()) + HasAttrs = false; + } + template specific_attr_iterator specific_attr_begin() const { return specific_attr_iterator(attr_begin()); diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 575b82d9af..1766d39c14 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -571,24 +571,6 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) { } } -template -void Decl::dropAttr() { - if (!HasAttrs) return; - AttrVec &Attrs = getASTContext().getDeclAttrs(this); - for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) { - if (isa(Attrs[i])) { - Attrs.erase(Attrs.begin() + i); - --e; - } - else - ++i; - } - if (Attrs.empty()) - HasAttrs = false; -} -// Force instantiation for WeakImportAttr which gets used. -template void Decl::dropAttr(); - DeclContext *Decl::castToDeclContext(const Decl *D) { Decl::Kind DK = D->getKind(); switch(DK) {