[pkg-d-commits] [ldc] 61/211: ir2obj: Ignore the compiler executable filepath (first arg) for the hash.
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:10 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 d68eb90974c0380e2e9fd7479c7ce87f7f24bbe8
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Thu Oct 6 11:57:18 2016 +0200
ir2obj: Ignore the compiler executable filepath (first arg) for the hash.
---
driver/ir2obj_cache.cpp | 8 +++++++-
tests/linking/ir2obj_caching_flags1.d | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/driver/ir2obj_cache.cpp b/driver/ir2obj_cache.cpp
index a84f4de..f012d48 100644
--- a/driver/ir2obj_cache.cpp
+++ b/driver/ir2obj_cache.cpp
@@ -142,7 +142,13 @@ void outputIR2ObjRelevantCmdlineArgs(llvm::raw_ostream &hash_os)
// IR, which simplifies the code here.
// The code does not deal well with options specified without equals sign, and
// will add those to the hash, resulting in missed cache opportunities.
- for (const char *arg : opts::allArguments) {
+
+ auto it = opts::allArguments.begin();
+ auto end_it = opts::allArguments.end();
+ // The first argument is the compiler executable filename: we can skip it.
+ ++it;
+ for (; it != end_it; ++it) {
+ const char *arg = *it;
if (!arg || !arg[0])
continue;
diff --git a/tests/linking/ir2obj_caching_flags1.d b/tests/linking/ir2obj_caching_flags1.d
index 06022fb..f55bdbc 100644
--- a/tests/linking/ir2obj_caching_flags1.d
+++ b/tests/linking/ir2obj_caching_flags1.d
@@ -11,7 +11,7 @@
// 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 %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -O5 -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 \
--
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