summaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-01-18 09:15:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-01-18 09:16:04 +0100
commit9539761ff634d25462c795d99c3e6f5e380029b8 (patch)
tree11f2f3b1c9721108dbbec5010a9f34b8c94dd6ae /clang
parent56a2ee6abd297e6c9eff46f085aa03a1a95f45eb (diff)
clang: avoid yaml header/footer for empty output in find-unprefixed-members
Diffstat (limited to 'clang')
-rw-r--r--clang/find-unprefixed-members.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/find-unprefixed-members.cxx b/clang/find-unprefixed-members.cxx
index 677966a0..d3d65b36 100644
--- a/clang/find-unprefixed-members.cxx
+++ b/clang/find-unprefixed-members.cxx
@@ -260,8 +260,8 @@ public:
const std::vector<RenameResult>& rResults = aVisitor.getResults();
// Ignore missing prefixes in structs without member functions.
bool bFound = false;
- if (m_rContext.getYaml())
- std::cerr << "---" << std::endl;
+ // Will this be the first YAML line?
+ bool bFirst = true;
for (const std::string& rFunction : rFunctions)
{
for (const RenameResult& rResult : rResults)
@@ -270,6 +270,12 @@ public:
{
if (m_rContext.getYaml())
{
+ if (bFirst)
+ {
+ bFirst = false;
+ if (m_rContext.getYaml())
+ std::cerr << "---" << std::endl;
+ }
std::cerr << "- QualifiedName: " << rResult.m_aScope
<< "::" << rResult.m_aOldName << std::endl;
std::cerr << " NewName: " << rResult.m_aNewName << std::endl;
@@ -281,7 +287,8 @@ public:
}
}
}
- if (m_rContext.getYaml())
+ if (!bFirst && m_rContext.getYaml())
+ // There were some YAML lines.
std::cerr << "..." << std::endl;
if (bFound)
exit(1);