aboutsummaryrefslogtreecommitdiff
path: root/symtab.h
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-10-01 16:07:48 -0700
committerDan Willemsen <dwillemsen@google.com>2015-10-01 16:12:36 -0700
commitb248caabf20589d5f5a3adbb1e88d2c286eaa466 (patch)
treee9f5a355e9f41e8a3bbc49e7e110419bfae46f19 /symtab.h
parenta62b02a1251a0f6c452a25fce03258f12472507f (diff)
Use ordered containers to prevent changes to ninja files
When using --gen_all_targets / --gen_all_phony_targets, we're changing the selected targets using unordered containers. This causes trivial changes to the makefiles to trigger large changes to the generated ninja files. Switch to using ordered containers so that the order is the same every time.
Diffstat (limited to 'symtab.h')
-rw-r--r--symtab.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/symtab.h b/symtab.h
index 50c7b74..6ebe027 100644
--- a/symtab.h
+++ b/symtab.h
@@ -66,6 +66,10 @@ inline bool operator==(const Symbol& x, const Symbol& y) {
return x.val() == y.val();
}
+inline bool operator<(const Symbol& x, const Symbol& y) {
+ return x.str() < y.str();
+}
+
namespace std {
template<> struct hash<Symbol> {
size_t operator()(const Symbol& s) const {