[llvm] r306129 - Make the size specification for cache_size_bytes case insensitive.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 10:13:52 PDT 2017
Author: pcc
Date: Fri Jun 23 12:13:51 2017
New Revision: 306129
URL: http://llvm.org/viewvc/llvm-project?rev=306129&view=rev
Log:
Make the size specification for cache_size_bytes case insensitive.
Modified:
llvm/trunk/lib/Support/CachePruning.cpp
llvm/trunk/unittests/Support/CachePruningTest.cpp
Modified: llvm/trunk/lib/Support/CachePruning.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CachePruning.cpp?rev=306129&r1=306128&r2=306129&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CachePruning.cpp (original)
+++ llvm/trunk/lib/Support/CachePruning.cpp Fri Jun 23 12:13:51 2017
@@ -94,7 +94,7 @@ llvm::parseCachePruningPolicy(StringRef
Policy.MaxSizePercentageOfAvailableSpace = Size;
} else if (Key == "cache_size_bytes") {
uint64_t Mult = 1;
- switch (Value.back()) {
+ switch (tolower(Value.back())) {
case 'k':
Mult = 1024;
Value = Value.drop_back();
Modified: llvm/trunk/unittests/Support/CachePruningTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CachePruningTest.cpp?rev=306129&r1=306128&r2=306129&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/CachePruningTest.cpp (original)
+++ llvm/trunk/unittests/Support/CachePruningTest.cpp Fri Jun 23 12:13:51 2017
@@ -59,7 +59,7 @@ TEST(CachePruningPolicyParser, MaxSizeBy
ASSERT_TRUE(bool(P));
EXPECT_EQ(75u, P->MaxSizePercentageOfAvailableSpace);
EXPECT_EQ(3u * 1024u * 1024u, P->MaxSizeBytes);
- P = parseCachePruningPolicy("cache_size_bytes=4g");
+ P = parseCachePruningPolicy("cache_size_bytes=4G");
ASSERT_TRUE(bool(P));
EXPECT_EQ(75u, P->MaxSizePercentageOfAvailableSpace);
EXPECT_EQ(4ull * 1024ull * 1024ull * 1024ull, P->MaxSizeBytes);
More information about the llvm-commits
mailing list