[llvm] fb2cc9b - [Analysis] 'static' function 'shortenFileName' should be declared 'static inline' (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 14 05:11:28 PST 2024


Author: Jie Fu
Date: 2024-01-14T21:08:01+08:00
New Revision: fb2cc9b9fc5ae5a544e3009ae153f5ae83c5a89c

URL: https://github.com/llvm/llvm-project/commit/fb2cc9b9fc5ae5a544e3009ae153f5ae83c5a89c
DIFF: https://github.com/llvm/llvm-project/commit/fb2cc9b9fc5ae5a544e3009ae153f5ae83c5a89c.diff

LOG: [Analysis] 'static' function 'shortenFileName' should be declared 'static inline' (NFC)

llvm-project/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h:89:13:
 error: 'static' function 'shortenFileName' declared in header file should be declared 'static inline' [-Werror,-Wunneeded-internal-declaration]
  static void shortenFileName(std::string &FN, unsigned char len = 250) {

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/DOTGraphTraitsPass.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 182cc118670425..da72fb511f82d8 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -86,7 +86,7 @@ struct DOTGraphTraitsViewer
   StringRef Name;
 };
 
-static void shortenFileName(std::string &FN, unsigned char len = 250) {
+static inline void shortenFileName(std::string &FN, unsigned char len = 250) {
 
   FN = FN.substr(0, len);
 


        


More information about the llvm-commits mailing list