[clang] [analysis][NFC] clean unittest log (PR #123758)
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 21 06:43:02 PST 2025
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/123758
1. clean llvm::errs ouput
2. add -Wno-everything option to suppress clang warning during test
>From e98964cb134d16f26dc2156b28997b0e80a2fb62 Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0907 at 163.com>
Date: Tue, 21 Jan 2025 22:42:32 +0800
Subject: [PATCH] [analysis][NFC] clean unittest log
1. clean llvm::errs ouput
2. add -Wno-everything option to suppress clang warning during test
---
clang/unittests/Analysis/CFGBuildResult.h | 4 ++--
clang/unittests/Analysis/CFGTest.cpp | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
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>());
More information about the cfe-commits
mailing list