[PATCH] D86334: [analyzer] Remove redundant output errs
Yang Fan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 21 00:50:03 PDT 2020
nullptr.cpp created this revision.
Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a project: clang.
nullptr.cpp requested review of this revision.
No need to output errs if already have NDEBUG defined.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86334
Files:
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
Index: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -3154,8 +3154,9 @@
#ifndef NDEBUG
std::string Filename = DumpGraph(trim);
llvm::DisplayGraph(Filename, false, llvm::GraphProgram::DOT);
-#endif
+#else
llvm::errs() << "Warning: viewing graph requires assertions" << "\n";
+#endif
}
@@ -3163,8 +3164,9 @@
#ifndef NDEBUG
std::string Filename = DumpGraph(Nodes);
llvm::DisplayGraph(Filename, false, llvm::GraphProgram::DOT);
-#endif
+#else
llvm::errs() << "Warning: viewing graph requires assertions" << "\n";
+#endif
}
std::string ExprEngine::DumpGraph(bool trim, StringRef Filename) {
@@ -3207,9 +3209,10 @@
/*Title=*/"Trimmed Exploded Graph",
/*Filename=*/std::string(Filename));
}
-#endif
+#else
llvm::errs() << "Warning: dumping graph requires assertions" << "\n";
return "";
+#endif
}
void *ProgramStateTrait<ReplayWithoutInlining>::GDMIndex() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86334.286960.patch
Type: text/x-patch
Size: 1119 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200821/592d96d6/attachment.bin>
More information about the cfe-commits
mailing list