summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorThiago Farina <tfarina@chromium.org>2011-12-24 01:03:57 (GMT)
committerThiago Farina <tfarina@chromium.org>2011-12-24 01:03:57 (GMT)
commit32bf74f0e94bbe26bd6a8befe55241f8dc1440e2 (patch)
treed64d51777b0b7da0ca718013c1d46a1611107e65 /src/graph.h
parente9ffd8dfbadcf9eb0963e30be3f989b7ef70d01d (diff)
downloadNinja-32bf74f0e94bbe26bd6a8befe55241f8dc1440e2.zip
Ninja-32bf74f0e94bbe26bd6a8befe55241f8dc1440e2.tar.gz
Ninja-32bf74f0e94bbe26bd6a8befe55241f8dc1440e2.tar.bz2
Fix the TODO in Rule class.
Move various data members to private section and provide accessors for them. Signed-off-by: Thiago Farina <tfarina@chromium.org>
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/graph.h b/src/graph.h
index 067d90e..fe102d2 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -104,21 +104,23 @@ struct Rule {
bool generator() const { return generator_; }
bool restat() const { return restat_; }
-private:
+ const EvalString& command() const { return command_; }
+ const EvalString& description() const { return description_; }
+ const EvalString& depfile() const { return depfile_; }
+
+ private:
+ // Allow the parsers to reach into this object and fill out its fields.
+ friend class ManifestParser;
+ friend class ParserTest;
+
string name_;
- // TODO: make these private. But various tests want to reach into them...
-public:
+ bool generator_;
+ bool restat_;
+
EvalString command_;
EvalString description_;
EvalString depfile_;
-
-private:
- bool generator_, restat_;
-
- // Allow the parsers to reach into this object and fill out its fields.
- friend class ManifestParser;
- friend class ParserTest;
};
struct BuildLog;
@@ -130,9 +132,9 @@ struct Edge {
Edge() : rule_(NULL), env_(NULL), outputs_ready_(false), implicit_deps_(0),
order_only_deps_(0) {}
- /// Examine inputs, outputs, and command lines to judge whether this edge needs
- /// to be re-run, and update outputs_ready_ and each outputs' dirty_ state
- /// accordingly.
+ /// Examine inputs, outputs, and command lines to judge whether this edge
+ /// needs to be re-run, and update outputs_ready_ and each outputs' |dirty_|
+ /// state accordingly.
/// Returns false on failure.
bool RecomputeDirty(State* state, DiskInterface* disk_interface, string* err);