[clang] [analysis][NFC] clean unittest log (PR #123758)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 21 06:43:38 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Congcong Cai (HerrCai0907)
<details>
<summary>Changes</summary>
1. clean llvm::errs ouput
2. add -Wno-everything option to suppress clang warning during test
---
Full diff: https://github.com/llvm/llvm-project/pull/123758.diff
2 Files Affected:
- (modified) clang/unittests/Analysis/CFGBuildResult.h (+2-2)
- (modified) clang/unittests/Analysis/CFGTest.cpp (-1)
``````````diff
diff --git a/clang/unittests/Analysis/CFGBuildResult.h b/clang/unittests/Analysis/CFGBuildResult.h
index 72ad1cc7ce4011..0d5539005840dc 100644
--- a/clang/unittests/Analysis/CFGBuildResult.h
+++ b/clang/unittests/Analysis/CFGBuildResult.h
@@ -65,8 +65,8 @@ class CFGCallback : public ast_matchers::MatchFinder::MatchCallback {
template <typename FuncMatcherT = ast_matchers::internal::TrueMatcher>
BuildResult BuildCFG(const char *Code, CFG::BuildOptions Options = {},
FuncMatcherT FuncMatcher = ast_matchers::anything()) {
- std::vector<std::string> Args = {"-std=c++11",
- "-fno-delayed-template-parsing"};
+ const std::vector<std::string> Args = {
+ "-std=c++11", "-fno-delayed-template-parsing", "-Wno-everything"};
std::unique_ptr<ASTUnit> AST = tooling::buildASTFromCodeWithArgs(Code, Args);
if (!AST)
return BuildResult::ToolFailed;
diff --git a/clang/unittests/Analysis/CFGTest.cpp b/clang/unittests/Analysis/CFGTest.cpp
index 2b27da00814250..46a6751391cf58 100644
--- a/clang/unittests/Analysis/CFGTest.cpp
+++ b/clang/unittests/Analysis/CFGTest.cpp
@@ -195,7 +195,6 @@ TEST(CFG, ElementRefIterator) {
// Reverse, non-const version
Index = MainBlockSize;
for (CFGBlock::CFGElementRef ElementRef : MainBlock->rrefs()) {
- llvm::errs() << Index << '\n';
EXPECT_EQ(ElementRef.getParent(), MainBlock);
EXPECT_EQ(ElementRef.getIndexInBlock(), Index);
EXPECT_TRUE(ElementRef->getAs<CFGStmt>());
``````````
</details>
https://github.com/llvm/llvm-project/pull/123758
More information about the cfe-commits
mailing list