[llvm] a30f5fd - CachePruning.h - reduce StringRef.h to Optional.h include. NFC

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 06:07:12 PDT 2020


Author: Simon Pilgrim
Date: 2020-05-08T14:06:53+01:00
New Revision: a30f5fd94dedaa900d9b50d4460924d9cd6ac48b

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

LOG: CachePruning.h - reduce StringRef.h to Optional.h include. NFC

We only need to include Optional.h, forward declare StringRef and move the StringRef.h include down to CachePruning.cpp.

Added: 
    

Modified: 
    llvm/include/llvm/Support/CachePruning.h
    llvm/lib/Support/CachePruning.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index a72a86439f6a..10d6372f9163 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,12 +14,13 @@
 #ifndef LLVM_SUPPORT_CACHE_PRUNING_H
 #define LLVM_SUPPORT_CACHE_PRUNING_H
 
-#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Optional.h"
 #include <chrono>
 
 namespace llvm {
 
 template <typename T> class Expected;
+class StringRef;
 
 /// Policy for the pruneCache() function. A default constructed
 /// CachePruningPolicy provides a reasonable default policy.

diff  --git a/llvm/lib/Support/CachePruning.cpp b/llvm/lib/Support/CachePruning.cpp
index 7a2f6c53435a..7663644db558 100644
--- a/llvm/lib/Support/CachePruning.cpp
+++ b/llvm/lib/Support/CachePruning.cpp
@@ -11,7 +11,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/CachePruning.h"
-
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/Error.h"


        


More information about the llvm-commits mailing list