From 00d93ec2af9cda23c1be18ef9c0742be04ce0597 Mon Sep 17 00:00:00 2001 From: yangliping Date: Mon, 21 Jul 2025 17:35:33 +0800 Subject: [PATCH] fix warning Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICNRT6?from=project-issue Signed-off-by: yangliping --- ecmascript/compiler/aot_compiler_preprocessor.cpp | 7 +++---- ecmascript/compiler/aot_file/an_file_data_manager.cpp | 4 +--- ecmascript/compiler/aot_file/an_file_info.cpp | 5 ++--- ecmascript/compiler/aot_file/stub_file_info.cpp | 3 +-- ecmascript/compiler/file_generators.cpp | 8 ++++---- ecmascript/compiler/pass_manager.cpp | 4 ++-- ecmascript/pgo_profiler/pgo_profiler_manager.cpp | 4 ++-- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/ecmascript/compiler/aot_compiler_preprocessor.cpp b/ecmascript/compiler/aot_compiler_preprocessor.cpp index f9b9411d6c..55ecf5e3fa 100644 --- a/ecmascript/compiler/aot_compiler_preprocessor.cpp +++ b/ecmascript/compiler/aot_compiler_preprocessor.cpp @@ -307,13 +307,12 @@ std::shared_ptr AotCompilerPreprocessor::CreateAndVerifyJSPandaFile jsPandaFile = jsPandaFileManager->OpenJSPandaFile(fileName.c_str()); } if (jsPandaFile == nullptr) { - LOG_ECMA(ERROR) << "open file " << fileName << " error"; + LOG_ECMA(ERROR) << "open file error!"; return nullptr; } if (!jsPandaFile->IsNewVersion()) { - LOG_COMPILER(ERROR) << "AOT only support panda file with new ISA, while the '" << - fileName << "' file is the old version"; + LOG_COMPILER(ERROR) << "AOT only support panda file with new ISA, while the file is the old version"; return nullptr; } @@ -494,7 +493,7 @@ bool AotCompilerPreprocessor::ForbidenRebuildAOT(std::string &fileName) const { std::string realPath; if (!RealPath(fileName, realPath, false)) { - LOG_COMPILER(ERROR) << "Fail to get realPath: " << fileName; + LOG_COMPILER(ERROR) << "Fail to get realPath."; return true; } if (FileExist(realPath.c_str())) { diff --git a/ecmascript/compiler/aot_file/an_file_data_manager.cpp b/ecmascript/compiler/aot_file/an_file_data_manager.cpp index 9518c24072..3c6dedbd43 100644 --- a/ecmascript/compiler/aot_file/an_file_data_manager.cpp +++ b/ecmascript/compiler/aot_file/an_file_data_manager.cpp @@ -267,9 +267,7 @@ bool AnFileDataManager::UnsafeCheckFilenameToChecksum(const CString &fileName, u if (fileName == fileNameToChecksumPair.first) { if (fileNameToChecksumPair.second == static_cast(-1) || fileNameToChecksumPair.second != checksum) { - LOG_COMPILER(ERROR) << "an file verify checksum fail: checksum is invalid or different. FileName: " - << fileName << " old checksum: " << fileNameToChecksumPair.second - << " provided new checksum " << checksum; + LOG_COMPILER(ERROR) << "an file verify checksum fail, checksum is invalid or different!"; return false; } else { return true; diff --git a/ecmascript/compiler/aot_file/an_file_info.cpp b/ecmascript/compiler/aot_file/an_file_info.cpp index 7ab7498f11..666a5fd0ea 100644 --- a/ecmascript/compiler/aot_file/an_file_info.cpp +++ b/ecmascript/compiler/aot_file/an_file_info.cpp @@ -105,8 +105,7 @@ bool AnFileInfo::Load(const std::string &filename) { std::string realPath; if (!RealPath(filename, realPath, false)) { - LOG_COMPILER(ERROR) << "Can not load aot file from path [ " << filename << " ], " - << "please execute ark_aot_compiler with options --aot-file."; + LOG_COMPILER(ERROR) << "Can not load aot file, please execute ark_aot_compiler with options --aot-file."; return false; } if (!FileExist(realPath.c_str())) { @@ -152,7 +151,7 @@ bool AnFileInfo::TryRemoveAnFile(const char *filename) return true; } if (Unlink(filename) == -1) { - LOG_COMPILER(ERROR) << "remove " << filename << " failed and errno is " << errno; + LOG_COMPILER(ERROR) << "remove file failed and errno is " << errno; return false; } return true; diff --git a/ecmascript/compiler/aot_file/stub_file_info.cpp b/ecmascript/compiler/aot_file/stub_file_info.cpp index a52d91f36f..79d54545ef 100644 --- a/ecmascript/compiler/aot_file/stub_file_info.cpp +++ b/ecmascript/compiler/aot_file/stub_file_info.cpp @@ -68,8 +68,7 @@ bool StubFileInfo::MmapLoad(const std::string &fileName) std::string filename = fileName.empty() ? STUB_AN_FILE : fileName; std::string realPath; if (!RealPath(filename, realPath, false)) { - LOG_COMPILER(ERROR) << "Can not load stub file from path [ " << filename << " ], " - << "please execute ark_stub_compiler with options --stub-file."; + LOG_COMPILER(ERROR) << "Can not load stub file, please execute ark_stub_compiler with options --stub-file."; return false; } diff --git a/ecmascript/compiler/file_generators.cpp b/ecmascript/compiler/file_generators.cpp index dbdbe5a770..cccaa898fc 100644 --- a/ecmascript/compiler/file_generators.cpp +++ b/ecmascript/compiler/file_generators.cpp @@ -637,7 +637,7 @@ bool AOTFileGenerator::CreateDirIfNotExist(const std::string &filename) } std::string path = realPath.substr(0, index); if (!panda::ecmascript::ForceCreateDirectory(path)) { - LOG_COMPILER(ERROR) << "Fail to make dir: " << path; + LOG_COMPILER(ERROR) << "Fail to make dir!"; return false; } return panda::ecmascript::SetDirModeAsDefault(path); @@ -662,7 +662,7 @@ bool AOTFileGenerator::SaveAOTFile(const std::string &filename, const std::strin return false; } if (!panda::ecmascript::SetFileModeAsDefault(filename)) { - LOG_COMPILER(ERROR) << "Fail to set an file mode:" << filename; + LOG_COMPILER(ERROR) << "Fail to set an file mode!"; return false; } SetSecurityLabel(filename); @@ -673,7 +673,7 @@ bool AOTFileGenerator::SaveAOTFile(const std::string &filename, const std::strin void AOTFileGenerator::SaveEmptyAOTFile(const std::string& filename, const std::string& appSignature, bool isAnFile) { if (!CreateDirIfNotExist(filename)) { - LOG_COMPILER(ERROR) << "Fail to access dir: " << filename; + LOG_COMPILER(ERROR) << "Fail to access dir!"; return; } std::string realPath; @@ -846,7 +846,7 @@ std::string AOTFileGenerator::GenAotCodeCommentFileName(const std::string &filen bool AOTFileGenerator::CreateAOTCodeCommentFile(const std::string &filename) { if (!CreateDirIfNotExist(filename)) { - LOG_COMPILER(ERROR) << "Fail to access dir: " << filename; + LOG_COMPILER(ERROR) << "Fail to access dir!"; return false; } diff --git a/ecmascript/compiler/pass_manager.cpp b/ecmascript/compiler/pass_manager.cpp index 280589e152..e2e75bd673 100644 --- a/ecmascript/compiler/pass_manager.cpp +++ b/ecmascript/compiler/pass_manager.cpp @@ -257,8 +257,8 @@ bool PassManager::Compile(JSPandaFile *jsPandaFile, const std::string &fileName, // Checking released/debuggable pandafile uses method literals, which are initialized in BytecodeInfoCollector, // should after it. if (!IsReleasedPandaFile(jsPandaFile)) { - LOG_COMPILER(ERROR) << "The input panda file [" << fileName - << "] of AOT Compiler is debuggable version, do not use for performance test!"; + LOG_COMPILER(ERROR) << "The input panda file of AOT Compiler is debuggable version, + do not use for performance test!"; } LOptions lOptions(optLevel_, FPFlag::RESERVE_FP, relocMode_); CompilationDriver cmpDriver(profilerDecoder_, diff --git a/ecmascript/pgo_profiler/pgo_profiler_manager.cpp b/ecmascript/pgo_profiler/pgo_profiler_manager.cpp index a18dffe0b3..a72c5af588 100644 --- a/ecmascript/pgo_profiler/pgo_profiler_manager.cpp +++ b/ecmascript/pgo_profiler/pgo_profiler_manager.cpp @@ -50,7 +50,7 @@ bool PGOProfilerManager::MergeApFiles(const std::string& inFiles, for (const auto& fileName: apFileNames) { LOG_ECMA(INFO) << "merge ap file: " << fileName; if (!base::StringHelper::EndsWith(fileName, ".ap")) { - LOG_ECMA(ERROR) << "The file path (" << fileName << ") does not end with .ap"; + LOG_ECMA(ERROR) << "The file path does not end with .ap"; continue; } PGOProfilerDecoder decoder(fileName, hotnessThreshold); @@ -494,7 +494,7 @@ bool PGOProfilerManager::ResetOutPath(const std::string& fileName) bool PGOProfilerManager::ResetOutPath(const std::string& path, std::string& realPath, const std::string& fileName) { if (!RealPath(path, realPath, false)) { - LOG_PGO(ERROR) << "get real path failed, outDir: " << path; + LOG_PGO(ERROR) << "get real path failed!"; return false; } -- Gitee