From 78b1a72c3222d79efa19207eeca11e12cee60e8b Mon Sep 17 00:00:00 2001 From: qiaojbao Date: Mon, 13 May 2024 16:41:53 +0800 Subject: [PATCH] Fix the cache_creator build error. --- tools/cache_creator/cache_creator.cpp | 8 +++++++- tools/cache_creator/cache_info.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/cache_creator/cache_creator.cpp b/tools/cache_creator/cache_creator.cpp index 99b51f5b..d964fe1b 100644 --- a/tools/cache_creator/cache_creator.cpp +++ b/tools/cache_creator/cache_creator.cpp @@ -22,6 +22,12 @@ * SOFTWARE. * **********************************************************************************************************************/ + +/* + *********************************************************************************************************************** + * Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. + **********************************************************************************************************************/ + #include "cache_creator.h" #include "palPlatformKey.h" #include "llvm/ADT/STLExtras.h" @@ -259,7 +265,7 @@ llvm::Expected getElfLlpcCacheInfo(llvm::MemoryBufferRef elfBu llvm::consumeError(std::move(err)); continue; } - if (!sectionNameOrErr->startswith(".note")) + if (!sectionNameOrErr->starts_with(".note")) continue; llvm::Error notesError(llvm::Error::success()); diff --git a/tools/cache_creator/cache_info.cpp b/tools/cache_creator/cache_info.cpp index 2d56f9a8..ff65a87c 100644 --- a/tools/cache_creator/cache_info.cpp +++ b/tools/cache_creator/cache_info.cpp @@ -22,6 +22,12 @@ * SOFTWARE. * **********************************************************************************************************************/ + +/* + *********************************************************************************************************************** + * Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. + **********************************************************************************************************************/ + #include "cache_info.h" #include "cache_creator.h" #include "llvm/Support/FileSystem.h" @@ -253,7 +259,7 @@ llvm::StringMap mapMD5SumsToElfFilePath(llvm::Twine dir) { std::error_code ec{}; for (fs::recursive_directory_iterator it{dir, ec}, e{}; it != e && !ec; it.increment(ec)) { const std::string &path(it->path()); - if (!llvm::StringRef(path).endswith(".elf") || fs::is_directory(path)) + if (!llvm::StringRef(path).ends_with(".elf") || fs::is_directory(path)) continue; llvm::ErrorOr elfMD5OrErr = fs::md5_contents(path);