aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2016-09-20 12:49:16 +0900
committerGitHub <noreply@github.com>2016-09-20 12:49:15 +0900
commitfa58b6f65e84fea9a67a8c251f59435e242b1379 (patch)
tree1b492b856aceb95330b50497d0ad8c57580ad449
parent6d3dd63e986e9b72cfc6b0184109fee0ecdcd583 (diff)
parentf6486ce40716ecb5ef30886b156d9f9bf0876a18 (diff)
Merge pull request #91 from danw/regen_debug
Add --regen_debug
-rw-r--r--flags.cc3
-rw-r--r--flags.h1
-rw-r--r--regen.cc10
3 files changed, 9 insertions, 5 deletions
diff --git a/flags.cc b/flags.cc
index 1ed9afd..3ad8e3c 100644
--- a/flags.cc
+++ b/flags.cc
@@ -86,10 +86,13 @@ void Flags::Parse(int argc, char** argv) {
} else if (!strcmp(arg, "--regen")) {
// TODO: Make this default.
regen = true;
+ } else if (!strcmp(arg, "--regen_debug")) {
+ regen_debug = true;
} else if (!strcmp(arg, "--regen_ignoring_kati_binary")) {
regen_ignoring_kati_binary = true;
} else if (!strcmp(arg, "--dump_kati_stamp")) {
dump_kati_stamp = true;
+ regen_debug = true;
} else if (!strcmp(arg, "--detect_android_echo")) {
detect_android_echo = true;
} else if (!strcmp(arg, "--detect_depfiles")) {
diff --git a/flags.h b/flags.h
index a0c6a3b..d22d0cd 100644
--- a/flags.h
+++ b/flags.h
@@ -36,6 +36,7 @@ struct Flags {
bool is_silent_mode;
bool is_syntax_check_only;
bool regen;
+ bool regen_debug;
bool regen_ignoring_kati_binary;
bool use_find_emulator;
const char* goma_dir;
diff --git a/regen.cc b/regen.cc
index c72bfb6..f5ed50a 100644
--- a/regen.cc
+++ b/regen.cc
@@ -132,7 +132,7 @@ class StampChecker {
const string& stamp_filename = GetNinjaStampFilename();
FILE* fp = fopen(stamp_filename.c_str(), "rb");
if (!fp) {
- if (g_flags.dump_kati_stamp)
+ if (g_flags.regen_debug)
printf("%s: %s\n", stamp_filename.c_str(), strerror(errno));
return true;
}
@@ -145,7 +145,7 @@ class StampChecker {
fprintf(stderr, "incomplete kati_stamp, regenerating...\n");
RETURN_TRUE;
}
- if (g_flags.dump_kati_stamp)
+ if (g_flags.regen_debug)
printf("Generated time: %f\n", gen_time);
string s, s2;
@@ -163,7 +163,7 @@ class StampChecker {
}
}
if (ShouldIgnoreDirty(s)) {
- if (g_flags.dump_kati_stamp)
+ if (g_flags.regen_debug)
printf("file %s: ignored (%f)\n", s.c_str(), ts);
continue;
}
@@ -325,7 +325,7 @@ class StampChecker {
bool CheckShellResult(const ShellResult* sr, string* err) {
if (!ShouldRunCommand(sr)) {
- if (g_flags.dump_kati_stamp)
+ if (g_flags.regen_debug)
printf("shell %s: clean (no rerun)\n", sr->cmd.c_str());
return false;
}
@@ -351,7 +351,7 @@ class StampChecker {
//*err += StringPrintf("%s => %s\n", expected.c_str(), result.c_str());
}
return true;
- } else if (g_flags.dump_kati_stamp) {
+ } else if (g_flags.regen_debug) {
printf("shell %s: clean (rerun)\n", sr->cmd.c_str());
}
return false;