diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-02-17 18:23:02 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-02-17 18:23:02 +0000 |
commit | 06bd44b3e80c8b72657bebc7d79c7ceb7522fa9c (patch) | |
tree | 50c6e8ca5042c734ddaaefb5ef72f018f34fe98c | |
parent | ff4ac8a6e72a416d348199fa8b77ed2884dab6ec (diff) | |
download | bcm5719-llvm-06bd44b3e80c8b72657bebc7d79c7ceb7522fa9c.tar.gz bcm5719-llvm-06bd44b3e80c8b72657bebc7d79c7ceb7522fa9c.zip |
Forcing it to be an error when there is no Documentation list specified for an attribute. This is a bit of a (harmless) hack, but the FIXME explains why and when this hack can be removed. It's a justified hack because this prevents attribute authors from forgetting to add documentation when they add a new attribute.
llvm-svn: 201524
-rw-r--r-- | clang/utils/TableGen/ClangAttrEmitter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index c6b12d7fc4b..39d815eae7f 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -1383,6 +1383,17 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) { for (std::vector<Record*>::iterator i = Attrs.begin(), e = Attrs.end(); i != e; ++i) { Record &R = **i; + + // FIXME: Currently, documentation is generated as-needed due to the fact + // that there is no way to allow a generated project "reach into" the docs + // directory (for instance, it may be an out-of-tree build). However, we want + // to ensure that every attribute has a Documentation field, and produce an + // error if it has been neglected. Otherwise, the on-demand generation which + // happens server-side will fail. This code is ensuring that functionality, + // even though this Emitter doesn't technically need the documentation. + // When attribute documentation can be generated as part of the build + // itself, this code can be removed. + (void)R.getValueAsListOfDefs("Documentation"); if (!R.getValueAsBit("ASTNode")) continue; |