summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-02-17 18:23:02 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-02-17 18:23:02 +0000
commitbb61aa3ab695b1f17a902aefb4d09859e74e1377 (patch)
tree7efc4e44395c0b375821ad63be53d149a56c1030 /utils
parentc0e27313d25f28bf8e1724536e2a7a12f4daf55b (diff)
downloadclang-bb61aa3ab695b1f17a902aefb4d09859e74e1377.tar.gz
clang-bb61aa3ab695b1f17a902aefb4d09859e74e1377.tar.bz2
clang-bb61aa3ab695b1f17a902aefb4d09859e74e1377.tar.xz
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
index c6b12d7fc4..39d815eae7 100644
--- a/utils/TableGen/ClangAttrEmitter.cpp
+++ b/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;