[pkg-d-commits] [ldc] 81/211: Rename `-ir2obj-cache-*` cmdline flags to `-cache-*`, because the cache can be used for more things than just ir2obj caching. Rename "ir2obj" namespace to "cache".
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:12 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.1.0
in repository ldc.
commit e0c78fa198e498cea4626172bc0abc0452fea65a
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Mon Sep 26 16:50:43 2016 +0200
Rename `-ir2obj-cache-*` cmdline flags to `-cache-*`, because the cache can be used for more things than just ir2obj caching.
Rename "ir2obj" namespace to "cache".
---
driver/cl_options.cpp | 5 +-
driver/cl_options.h | 2 +-
driver/ir2obj_cache.cpp | 46 +++++++++---------
driver/ir2obj_cache.h | 2 +-
driver/main.cpp | 2 +-
driver/toobj.cpp | 16 +++----
tests/codegen/discard_value_names_ir2obj_cache.d | 8 ++--
tests/linking/ir2obj_cache_pruning.d | 16 +++----
tests/linking/ir2obj_cache_pruning2.d | 20 ++++----
tests/linking/ir2obj_caching.d | 6 +--
tests/linking/ir2obj_caching_flags1.d | 60 ++++++++++++------------
tests/tools/ldc_prune_cache_1.d | 20 ++++----
tools/README.md | 2 +-
tools/ldc-prune-cache.d | 2 +-
14 files changed, 104 insertions(+), 103 deletions(-)
diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp
index 4c0f502..7eea979 100644
--- a/driver/cl_options.cpp
+++ b/driver/cl_options.cpp
@@ -200,8 +200,9 @@ static cl::opt<bool, true> unittest("unittest",
cl::location(global.params.useUnitTests));
cl::opt<std::string>
- ir2objCacheDir("ir2obj-cache", cl::desc("Use <cache dir> to cache object files for whole IR modules (experimental)"),
- cl::value_desc("cache dir"));
+ cacheDir("cache", cl::desc("Enable compilation cache, using <cache dir> to "
+ "store cache files (experimental)"),
+ cl::value_desc("cache dir"));
static StringsAdapter strImpPathStore("J", global.params.fileImppath);
static cl::list<std::string, StringsAdapter>
diff --git a/driver/cl_options.h b/driver/cl_options.h
index ba46f75..ef33884 100644
--- a/driver/cl_options.h
+++ b/driver/cl_options.h
@@ -59,7 +59,7 @@ extern cl::opt<std::string> hdrFile;
extern cl::list<std::string> versions;
extern cl::list<std::string> transitions;
extern cl::opt<std::string> moduleDeps;
-extern cl::opt<std::string> ir2objCacheDir;
+extern cl::opt<std::string> cacheDir;
extern cl::opt<std::string> mArch;
extern cl::opt<bool> m32bits;
diff --git a/driver/ir2obj_cache.cpp b/driver/ir2obj_cache.cpp
index c247390..670a325 100644
--- a/driver/ir2obj_cache.cpp
+++ b/driver/ir2obj_cache.cpp
@@ -52,31 +52,31 @@
namespace {
// Options for the cache pruning algorithm
-llvm::cl::opt<bool> pruneEnabled("ir2obj-cache-prune",
+llvm::cl::opt<bool> pruneEnabled("cache-prune",
llvm::cl::desc("Enable cache pruning."),
llvm::cl::ZeroOrMore);
llvm::cl::opt<unsigned long long> pruneSizeLimitInBytes(
- "ir2obj-cache-prune-maxbytes",
+ "cache-prune-maxbytes",
llvm::cl::desc("Sets the maximum cache size to <size> bytes. Implies "
- "-ir2obj-cache-prune."),
+ "-cache-prune."),
llvm::cl::value_desc("size"), llvm::cl::init(0));
llvm::cl::opt<unsigned> pruneInterval(
- "ir2obj-cache-prune-interval",
+ "cache-prune-interval",
llvm::cl::desc("Sets the cache pruning interval to <dur> seconds "
"(default: 20 min). Set to 0 to force pruning. Implies "
- "-ir2obj-cache-prune."),
+ "-cache-prune."),
llvm::cl::value_desc("dur"), llvm::cl::init(20 * 60));
llvm::cl::opt<unsigned> pruneExpiration(
- "ir2obj-cache-prune-expiration",
+ "cache-prune-expiration",
llvm::cl::desc(
"Sets the pruning expiration time of cache files to "
- "<dur> seconds (default: 1 week). Implies -ir2obj-cache-prune."),
+ "<dur> seconds (default: 1 week). Implies -cache-prune."),
llvm::cl::value_desc("dur"), llvm::cl::init(7 * 24 * 3600));
llvm::cl::opt<unsigned> pruneSizeLimitPercentage(
- "ir2obj-cache-prune-maxpercentage",
+ "cache-prune-maxpercentage",
llvm::cl::desc(
"Sets the cache size limit to <perc> percent of the available "
- "space (default: 75%). Implies -ir2obj-cache-prune."),
+ "space (default: 75%). Implies -cache-prune."),
llvm::cl::value_desc("perc"), llvm::cl::init(75));
bool isPruningEnabled() {
@@ -123,7 +123,7 @@ public:
void storeCacheFileName(llvm::StringRef cacheObjectHash,
llvm::SmallString<128> &filePath) {
- filePath = opts::ir2objCacheDir;
+ filePath = opts::cacheDir;
llvm::sys::path::append(filePath, llvm::Twine("ircache_") + cacheObjectHash +
"." + global.obj_ext);
}
@@ -186,8 +186,8 @@ void outputIR2ObjRelevantCmdlineArgs(llvm::raw_ostream &hash_os)
// "-od..." can be ignored
if (arg[1] == 'o' && arg[2] == 'd')
continue;
- // All "-ir2..." options can be ignored
- if (arg[1] == 'i' && arg[2] == 'r' && arg[3] == '2')
+ // All "-cache..." options can be ignored
+ if (strncmp(arg+1, "cache", 5) == 0)
continue;
// Ignore "-lib"
if (arg[1] == 'l' && arg[2] == 'i' && arg[3] == 'b' && !arg[4])
@@ -234,9 +234,9 @@ void outputIR2ObjRelevantEnvironmentOpts(llvm::raw_ostream &hash_os)
// There are no relevant environment options at the moment.
}
-}
+} // anonymous namespace
-namespace ir2obj {
+namespace cache {
void calculateModuleHash(llvm::Module *m, llvm::SmallString<32> &str) {
raw_hash_ostream hash_os;
@@ -257,10 +257,10 @@ void calculateModuleHash(llvm::Module *m, llvm::SmallString<32> &str) {
}
std::string cacheLookup(llvm::StringRef cacheObjectHash) {
- if (opts::ir2objCacheDir.empty())
+ if (opts::cacheDir.empty())
return "";
- if (!llvm::sys::fs::exists(opts::ir2objCacheDir)) {
+ if (!llvm::sys::fs::exists(opts::cacheDir)) {
IF_LOG Logger::println("Cache directory does not exist, no object found.");
return "";
}
@@ -278,13 +278,13 @@ std::string cacheLookup(llvm::StringRef cacheObjectHash) {
void cacheObjectFile(llvm::StringRef objectFile,
llvm::StringRef cacheObjectHash) {
- if (opts::ir2objCacheDir.empty())
+ if (opts::cacheDir.empty())
return;
- if (!llvm::sys::fs::exists(opts::ir2objCacheDir) &&
- llvm::sys::fs::create_directories(opts::ir2objCacheDir)) {
+ if (!llvm::sys::fs::exists(opts::cacheDir) &&
+ llvm::sys::fs::create_directories(opts::cacheDir)) {
error(Loc(), "Unable to create cache directory: %s",
- opts::ir2objCacheDir.c_str());
+ opts::cacheDir.c_str());
fatal();
}
@@ -342,10 +342,10 @@ void recoverObjectFile(llvm::StringRef cacheObjectHash,
}
void pruneCache() {
- if (!opts::ir2objCacheDir.empty() && isPruningEnabled()) {
- ::pruneCache(opts::ir2objCacheDir.data(), opts::ir2objCacheDir.size(),
+ if (!opts::cacheDir.empty() && isPruningEnabled()) {
+ ::pruneCache(opts::cacheDir.data(), opts::cacheDir.size(),
pruneInterval, pruneExpiration, pruneSizeLimitInBytes,
pruneSizeLimitPercentage);
}
}
-}
\ No newline at end of file
+} // namespace cache
diff --git a/driver/ir2obj_cache.h b/driver/ir2obj_cache.h
index ebfece0..a109241 100644
--- a/driver/ir2obj_cache.h
+++ b/driver/ir2obj_cache.h
@@ -18,7 +18,7 @@ class StringRef;
template <unsigned> class SmallString;
}
-namespace ir2obj {
+namespace cache {
void calculateModuleHash(llvm::Module *m, llvm::SmallString<32> &str);
std::string cacheLookup(llvm::StringRef cacheObjectHash);
diff --git a/driver/main.cpp b/driver/main.cpp
index c1cdf5b..3adfbda 100644
--- a/driver/main.cpp
+++ b/driver/main.cpp
@@ -1131,7 +1131,7 @@ void codegenModules(Modules &modules) {
}
}
- ir2obj::pruneCache();
+ cache::pruneCache();
freeRuntime();
llvm::llvm_shutdown();
diff --git a/driver/toobj.cpp b/driver/toobj.cpp
index 0dbc53f..a831a29 100644
--- a/driver/toobj.cpp
+++ b/driver/toobj.cpp
@@ -375,21 +375,21 @@ void writeModule(llvm::Module *m, std::string filename) {
global.params.targetTriple->getOS() == llvm::Triple::AIX);
// Use cached object code if possible
- bool useIR2ObjCache = !opts::ir2objCacheDir.empty();
+ bool useIR2ObjCache = !opts::cacheDir.empty();
llvm::SmallString<32> moduleHash;
if (useIR2ObjCache && global.params.output_o && !assembleExternally) {
- llvm::SmallString<128> cacheDir(opts::ir2objCacheDir.c_str());
+ llvm::SmallString<128> cacheDir(opts::cacheDir.c_str());
llvm::sys::fs::make_absolute(cacheDir);
- opts::ir2objCacheDir = cacheDir.c_str();
+ opts::cacheDir = cacheDir.c_str();
IF_LOG Logger::println("Use IR-to-Object cache in %s",
- opts::ir2objCacheDir.c_str());
+ opts::cacheDir.c_str());
LOG_SCOPE
- ir2obj::calculateModuleHash(m, moduleHash);
- std::string cacheFile = ir2obj::cacheLookup(moduleHash);
+ cache::calculateModuleHash(m, moduleHash);
+ std::string cacheFile = cache::cacheLookup(moduleHash);
if (!cacheFile.empty()) {
- ir2obj::recoverObjectFile(moduleHash, filename);
+ cache::recoverObjectFile(moduleHash, filename);
return;
}
}
@@ -479,7 +479,7 @@ void writeModule(llvm::Module *m, std::string filename) {
if (global.params.output_o && !assembleExternally) {
writeObjectFile(m, filename);
if (useIR2ObjCache) {
- ir2obj::cacheObjectFile(filename, moduleHash);
+ cache::cacheObjectFile(filename, moduleHash);
}
}
}
diff --git a/tests/codegen/discard_value_names_ir2obj_cache.d b/tests/codegen/discard_value_names_ir2obj_cache.d
index 836e39a..180f7aa 100644
--- a/tests/codegen/discard_value_names_ir2obj_cache.d
+++ b/tests/codegen/discard_value_names_ir2obj_cache.d
@@ -1,12 +1,12 @@
-// Test value name discarding in conjunction with the ir2obj cache: local variable name changes should still give a cache hit.
+// Test value name discarding in conjunction with the compile cache: local variable name changes should still give a cache hit.
// REQUIRES: atleast_llvm309
// Create and then empty the cache for correct testing when running the test multiple times.
-// RUN: %ldc %s -c -of=%t%obj -ir2obj-cache=%T/dvni2oc \
+// RUN: %ldc %s -c -of=%t%obj -cache=%T/dvni2oc \
// RUN: && %prunecache -f %T/dvni2oc --max-bytes=1 \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/dvni2oc -d-version=FIRST -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/dvni2oc -vv | FileCheck --check-prefix=MUST_HIT %s
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/dvni2oc -d-version=FIRST -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/dvni2oc -vv | FileCheck --check-prefix=MUST_HIT %s
// MUST_HIT: Cache object found!
// NO_HIT-NOT: Cache object found!
diff --git a/tests/linking/ir2obj_cache_pruning.d b/tests/linking/ir2obj_cache_pruning.d
index 3f9edad..51c1bc1 100644
--- a/tests/linking/ir2obj_cache_pruning.d
+++ b/tests/linking/ir2obj_cache_pruning.d
@@ -1,12 +1,12 @@
-// Test recognition of -ir2obj-cache-prune-* commandline flags
+// Test recognition of -cache-prune-* commandline flags
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune-interval=10 -ir2obj-cache-prune-maxbytes=10000
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune -ir2obj-cache-prune-interval=0
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune -ir2obj-cache-prune-maxbytes=10000
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune -ir2obj-cache-prune-expiration=10000
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune-maxpercentage=50
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache1 -ir2obj-cache-prune -ir2obj-cache-prune-maxpercentage=150
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune-interval=10 -cache-prune-maxbytes=10000
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune -cache-prune-interval=0
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune -cache-prune-maxbytes=10000
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune -cache-prune-expiration=10000
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune-maxpercentage=50
+// RUN: %ldc %s -cache=%T/prunecache1 -cache-prune -cache-prune-maxpercentage=150
void main()
{
diff --git a/tests/linking/ir2obj_cache_pruning2.d b/tests/linking/ir2obj_cache_pruning2.d
index 1c03436..6fea42c 100644
--- a/tests/linking/ir2obj_cache_pruning2.d
+++ b/tests/linking/ir2obj_cache_pruning2.d
@@ -1,20 +1,20 @@
-// Test ir2obj-cache pruning for size
+// Test cache pruning for size
// This test assumes that the `void main(){}` object file size is below 200_000 bytes and above 200_000/2,
// such that rebuilding with version(NEW_OBJ_FILE) will clear the cache of all but the latest object file.
-// RUN: %ldc %s -ir2obj-cache=%T/prunecache2 \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune -ir2obj-cache-prune-interval=0 -d-version=SLEEP \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune -ir2obj-cache-prune-interval=0 -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune -ir2obj-cache-prune-interval=0 -vv -d-version=NEW_OBJ_FILE | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune -ir2obj-cache-prune-interval=0 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: %ldc %s -cache=%T/prunecache2 \
+// RUN: && %ldc %s -cache=%T/prunecache2 -cache-prune -cache-prune-interval=0 -d-version=SLEEP \
+// RUN: && %ldc %s -cache=%T/prunecache2 -cache-prune -cache-prune-interval=0 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -cache=%T/prunecache2 -cache-prune -cache-prune-interval=0 -vv -d-version=NEW_OBJ_FILE | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -cache=%T/prunecache2 -cache-prune -cache-prune-interval=0 -vv | FileCheck --check-prefix=MUST_HIT %s \
// RUN: && %ldc -d-version=SLEEP -run %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune-interval=0 -ir2obj-cache-prune-maxbytes=200000 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/prunecache2 -cache-prune-interval=0 -cache-prune-maxbytes=200000 -vv | FileCheck --check-prefix=MUST_HIT %s \
// RUN: && %ldc %t%obj \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -d-version=SLEEP -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -cache=%T/prunecache2 -d-version=SLEEP -vv | FileCheck --check-prefix=NO_HIT %s \
// RUN: && %ldc -d-version=SLEEP -run %s \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune-interval=1 -ir2obj-cache-prune-maxbytes=200000 -d-version=NEW_OBJ_FILE \
-// RUN: && %ldc %s -ir2obj-cache=%T/prunecache2 -ir2obj-cache-prune -ir2obj-cache-prune-interval=0 -vv | FileCheck --check-prefix=NO_HIT %s
+// RUN: && %ldc %s -cache=%T/prunecache2 -cache-prune-interval=1 -cache-prune-maxbytes=200000 -d-version=NEW_OBJ_FILE \
+// RUN: && %ldc %s -cache=%T/prunecache2 -cache-prune -cache-prune-interval=0 -vv | FileCheck --check-prefix=NO_HIT %s
// MUST_HIT: Cache object found!
// NO_HIT-NOT: Cache object found!
diff --git a/tests/linking/ir2obj_caching.d b/tests/linking/ir2obj_caching.d
index 3b3fc59..d82af8a 100644
--- a/tests/linking/ir2obj_caching.d
+++ b/tests/linking/ir2obj_caching.d
@@ -1,7 +1,7 @@
-// Test recognition of -ir2obj-cache commandline flag
+// Test recognition of -cache commandline flag
-// RUN: %ldc -ir2obj-cache=%T/cachedirectory %s -vv | FileCheck --check-prefix=FIRST %s \
-// RUN: && %ldc -ir2obj-cache=%T/cachedirectory %s -vv | FileCheck --check-prefix=SECOND %s
+// RUN: %ldc -cache=%T/cachedirectory %s -vv | FileCheck --check-prefix=FIRST %s \
+// RUN: && %ldc -cache=%T/cachedirectory %s -vv | FileCheck --check-prefix=SECOND %s
// FIRST: Use IR-to-Object cache in {{.*}}cachedirectory
diff --git a/tests/linking/ir2obj_caching_flags1.d b/tests/linking/ir2obj_caching_flags1.d
index f55bdbc..3c13967 100644
--- a/tests/linking/ir2obj_caching_flags1.d
+++ b/tests/linking/ir2obj_caching_flags1.d
@@ -1,38 +1,38 @@
-// Test that certain cmdline flags result in different ir2obj cache objects, even though the LLVM IR may be the same.
+// Test that certain cmdline flags result in different cache objects, even though the LLVM IR may be the same.
// Note that the NO_HIT tests should change the default setting of the tested flag.
// Create and then empty the cache for correct testing when running the test multiple times.
-// RUN: %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache \
+// RUN: %ldc %s -c -of=%t%obj -cache=%T/flag1cache \
// RUN: && %prunecache -f %T/flag1cache --max-bytes=1 \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -g -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -O -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -O3 -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -O2 -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -O4 -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc -O5 %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -Os -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -Oz -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-d-passes -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-simplify-drtcalls -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-simplify-libcalls -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-gc2stack -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -enable-inlining -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -unit-at-a-time=false -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -strip-debug -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-loop-unrolling -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-loop-vectorization -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -disable-slp-vectorization -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -vectorize-loops -vv | FileCheck --check-prefix=NO_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -v -wi -d -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -D -H -I. -J. -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -d-version=Irrelevant -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -unittest -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -ir2obj-cache=%T/flag1cache -lib -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc -ir2obj-cache=%T/flag1cache -vv -run %s | FileCheck --check-prefix=COULD_HIT %s \
-// RUN: && %ldc -ir2obj-cache=%T/flag1cache -vv -run %s a b | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -g -vv | FileCheck --check-prefix=MUST_HIT %s
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -g -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -O -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -O3 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -O2 -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -O4 -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc -O5 %s -c -of=%t%obj -cache=%T/flag1cache -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -Os -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -Oz -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-d-passes -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-simplify-drtcalls -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-simplify-libcalls -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-gc2stack -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -enable-inlining -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -unit-at-a-time=false -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -strip-debug -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-loop-unrolling -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-loop-vectorization -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -disable-slp-vectorization -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -vectorize-loops -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -v -wi -d -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -D -H -I. -J. -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -d-version=Irrelevant -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -unittest -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -cache=%T/flag1cache -lib -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc -cache=%T/flag1cache -vv -run %s | FileCheck --check-prefix=COULD_HIT %s \
+// RUN: && %ldc -cache=%T/flag1cache -vv -run %s a b | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/flag1cache -g -vv | FileCheck --check-prefix=MUST_HIT %s
// The last test is a MUST_HIT test (hits with the first compile invocation), to make sure that the cache wasn't pruned somehow which could effectively disable some NO_HIT tests.
// MUST_HIT: Cache object found!
diff --git a/tests/tools/ldc_prune_cache_1.d b/tests/tools/ldc_prune_cache_1.d
index f3a9ebc..f7c9d19 100644
--- a/tests/tools/ldc_prune_cache_1.d
+++ b/tests/tools/ldc_prune_cache_1.d
@@ -3,26 +3,26 @@
// This test assumes that the `void main(){}` object file size is below 200_000 bytes and above 200_000/2,
// such that rebuilding with version(NEW_OBJ_FILE) will clear the cache of all but the latest object file.
-// RUN: %ldc %s -ir2obj-cache=%T/tempcache1 \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -d-version=SLEEP \
+// RUN: %ldc %s -cache=%T/tempcache1 \
+// RUN: && %ldc %s -cache=%T/tempcache1 -d-version=SLEEP \
// RUN: && %prunecache -f %T/tempcache1 \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -vv | FileCheck --check-prefix=MUST_HIT %s \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -vv -d-version=NEW_OBJ_FILE | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -cache=%T/tempcache1 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -cache=%T/tempcache1 -vv -d-version=NEW_OBJ_FILE | FileCheck --check-prefix=NO_HIT %s \
// RUN: && %prunecache %T/tempcache1 -f \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -cache=%T/tempcache1 -vv | FileCheck --check-prefix=MUST_HIT %s \
// RUN: && %ldc -d-version=SLEEP -run %s \
-// RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/tempcache1 -vv | FileCheck --check-prefix=MUST_HIT %s \
+// RUN: && %ldc %s -c -of=%t%obj -cache=%T/tempcache1 -vv | FileCheck --check-prefix=MUST_HIT %s \
// RUN: && %prunecache --force --max-bytes=200000 %T/tempcache1 \
// RUN: && %ldc %t%obj \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -d-version=SLEEP -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -cache=%T/tempcache1 -d-version=SLEEP -vv | FileCheck --check-prefix=NO_HIT %s \
// RUN: && %ldc -d-version=SLEEP -run %s \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -d-version=NEW_OBJ_FILE \
+// RUN: && %ldc %s -cache=%T/tempcache1 -d-version=NEW_OBJ_FILE \
// RUN: && %prunecache --interval=0 %T/tempcache1 --max-bytes=200000 \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -vv | FileCheck --check-prefix=NO_HIT %s \
+// RUN: && %ldc %s -cache=%T/tempcache1 -vv | FileCheck --check-prefix=NO_HIT %s \
// RUN: && %ldc -d-version=SLEEP -run %s \
// RUN: && %ldc -d-version=SLEEP -run %s \
// RUN: && %prunecache %T/tempcache1 -f --expiry=2 \
-// RUN: && %ldc %s -ir2obj-cache=%T/tempcache1 -vv | FileCheck --check-prefix=NO_HIT %s
+// RUN: && %ldc %s -cache=%T/tempcache1 -vv | FileCheck --check-prefix=NO_HIT %s
// MUST_HIT: Cache object found!
// NO_HIT-NOT: Cache object found!
diff --git a/tools/README.md b/tools/README.md
index e5e11ae..a27b78a 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -3,6 +3,6 @@ LDC – Tools
The `/tools` directory contains user tools that accompany LDC and that should be part of LDC packages.
-`ldc-prune-cache` helps keeping the size of LDC's object file cache (`-ir2obj-cache`) in check. See [the original PR](https://github.com/ldc-developers/ldc/pull/1753) for more details.
+`ldc-prune-cache` helps keeping the size of LDC's object file cache (`-cache`) in check. See [the original PR](https://github.com/ldc-developers/ldc/pull/1753) for more details.
`ldc-profdata` converts raw profiling data to a profile data format that can be used by LDC. The source is copied from LLVM (`llvm-profdata`), and is versioned for each LLVM version that we support because the version has to match exactly with LDC's LLVM version.
diff --git a/tools/ldc-prune-cache.d b/tools/ldc-prune-cache.d
index 9963972..3fe0f17 100644
--- a/tools/ldc-prune-cache.d
+++ b/tools/ldc-prune-cache.d
@@ -65,7 +65,7 @@ OVERVIEW: LDC-PRUNE-CACHE
USAGE: ldc-prune-cache [OPTION]... PATH
PATH should be a directory where LDC has placed its object files cache (see
- LDC's --ir2obj-cache option).
+ LDC's -cache option).
OPTIONS:
--expiration=<dur> Sets the pruning expiration time of cache files to
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git
More information about the pkg-d-commits
mailing list