cmGeneratorTarget: Protect macro code layout from clang-format

The `IMPLEMENT_VISIT_IMPL` macro must preserve a space before the `>`
character in case the `DATATYPE` is a template type ending in `>`.
Manually format the macro layout as clang-format would except for this
space.  Then add markup to tell clang-format not to format this macro.
This commit is contained in:
Brad King 2016-05-16 14:44:13 -04:00
parent d082810949
commit c7006d2ef1
1 changed files with 12 additions and 12 deletions

View File

@ -559,18 +559,18 @@ static void handleSystemIncludesDep(cmLocalGenerator *lg,
} }
} }
#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \ /* clang-format off */
{ \ #define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \
std::vector<cmSourceFile*> sourceFiles; \ { \
this->GetSourceFiles(sourceFiles, config); \ std::vector<cmSourceFile*> sourceFiles; \
TagVisitor< DATA##Tag DATATYPE > visitor(this, data); \ this->GetSourceFiles(sourceFiles, config); \
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \ TagVisitor< DATA##Tag DATATYPE > visitor(this, data); \
si != sourceFiles.end(); ++si) \ for (std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
{ \ si != sourceFiles.end(); ++si) { \
visitor.Accept(*si); \ visitor.Accept(*si); \
} \ } \
} \ }
/* clang-format on */
#define IMPLEMENT_VISIT(DATA) \ #define IMPLEMENT_VISIT(DATA) \
IMPLEMENT_VISIT_IMPL(DATA, EMPTY) \ IMPLEMENT_VISIT_IMPL(DATA, EMPTY) \