diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-05-15 14:09:55 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-05-15 14:09:55 +0000 |
| commit | 7f90b7d4c29d560b57f6026f886adbf4d7ab4382 (patch) | |
| tree | 8deceb9b6521e1a8548a310c67e57b17ac102e9d /clang/utils | |
| parent | ab5edc3e89901f822fd27c98613afad493cfd041 (diff) | |
| download | bcm5719-llvm-7f90b7d4c29d560b57f6026f886adbf4d7ab4382.tar.gz bcm5719-llvm-7f90b7d4c29d560b57f6026f886adbf4d7ab4382.zip | |
Fix our handling of visibility in explicit template instantiations.
* Don't copy the visibility attribute during instantiations. We have to be able
to distinguish
struct HIDDEN foo {};
template<class T>
DEFAULT void bar() {}
template DEFAULT void bar<foo>();
from
struct HIDDEN foo {};
template<class T>
DEFAULT void bar() {}
template void bar<foo>();
* If an instantiation has an attribute, it takes precedence over an attribute
in the template.
* With instantiation attributes handled with the above logic, we can now
select the minimum visibility when looking at template arguments.
llvm-svn: 156821
Diffstat (limited to 'clang/utils')
| -rw-r--r-- | clang/utils/TableGen/ClangAttrEmitter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index 772fc2f526f..8a8987720ef 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -1004,6 +1004,14 @@ void ClangAttrTemplateInstantiateEmitter::run(raw_ostream &OS) { continue; OS << " case attr::" << R.getName() << ": {\n"; + bool ShouldClone = R.getValueAsBit("Clone"); + + if (!ShouldClone) { + OS << " return NULL;\n"; + OS << " }\n"; + continue; + } + OS << " const " << R.getName() << "Attr *A = cast<" << R.getName() << "Attr>(At);\n"; bool TDependent = R.getValueAsBit("TemplateDependent"); |

