зеркало из https://github.com/microsoft/clang-1.git
Move definition of template <typename T> 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
This commit is contained in:
Родитель
7f88c01332
Коммит
8cf0f52037
|
@ -383,8 +383,22 @@ public:
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
void dropAttr();
|
||||
|
||||
void dropAttr() {
|
||||
if (!HasAttrs) return;
|
||||
|
||||
AttrVec &Attrs = getAttrs();
|
||||
for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) {
|
||||
if (isa<T>(Attrs[i])) {
|
||||
Attrs.erase(Attrs.begin() + i);
|
||||
--e;
|
||||
}
|
||||
else
|
||||
++i;
|
||||
}
|
||||
if (Attrs.empty())
|
||||
HasAttrs = false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
specific_attr_iterator<T> specific_attr_begin() const {
|
||||
return specific_attr_iterator<T>(attr_begin());
|
||||
|
|
|
@ -571,24 +571,6 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) {
|
|||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void Decl::dropAttr() {
|
||||
if (!HasAttrs) return;
|
||||
AttrVec &Attrs = getASTContext().getDeclAttrs(this);
|
||||
for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) {
|
||||
if (isa<T>(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<WeakImportAttr>();
|
||||
|
||||
DeclContext *Decl::castToDeclContext(const Decl *D) {
|
||||
Decl::Kind DK = D->getKind();
|
||||
switch(DK) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче