[C++] Add .KATI_RESTAT builtin target

This is an experimental kati-specific expansion for GNU make.
Targets specified by this will have "restat = 1" in generated
ninja files.

Even with this change, kati should be still compatible with
GNU make. GNU make will ignore this but this only means GNU
make will do some extra unnecessary builds. This different
should not change the final output as long as .KATI_RESTAT is
used appropriately.

TODO: Implement the same feature in exec.cc and add a test.
diff --git a/dep.cc b/dep.cc
index 6f4fc11..c1e9fcf 100644
--- a/dep.cc
+++ b/dep.cc
@@ -100,11 +100,12 @@
 
 }  // namespace
 
-DepNode::DepNode(Symbol o, bool p)
+DepNode::DepNode(Symbol o, bool p, bool r)
     : output(o),
       has_rule(false),
-      is_phony(p),
       is_default_target(false),
+      is_phony(p),
+      is_restat(r),
       rule_vars(NULL),
       output_pattern(Symbol::IsUninitialized()) {
   g_dep_node_pool->push_back(this);
@@ -131,6 +132,12 @@
         phony_.insert(input);
       }
     }
+    found = rules_.find(Intern(".KATI_RESTAT"));
+    if (found != rules_.end()) {
+      for (Symbol input : found->second->inputs) {
+        restat_.insert(input);
+      }
+    }
   }
 
   ~DepBuilder() {
@@ -446,7 +453,9 @@
       return found->second;
     }
 
-    DepNode* n = new DepNode(output, phony_.count(output));
+    DepNode* n = new DepNode(output,
+                             phony_.count(output),
+                             restat_.count(output));
     done_[output] = n;
 
     shared_ptr<Rule> rule;
@@ -535,6 +544,7 @@
   shared_ptr<Rule> first_rule_;
   unordered_map<Symbol, DepNode*> done_;
   unordered_set<Symbol> phony_;
+  unordered_set<Symbol> restat_;
 };
 
 void MakeDep(Evaluator* ev,