summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Larin <slarin@codeaurora.org>2012-11-15 17:45:50 +0000
committerSergei Larin <slarin@codeaurora.org>2012-11-15 17:45:50 +0000
commit009cf9e9a3a386f89db2686a105736481aed10ca (patch)
tree8704ee3df5d82124d6408f31e06cbb95839bfea1 /include
parent79c07d2a36282b09b9c5d0aa65ebf4bff017621b (diff)
downloadllvm-009cf9e9a3a386f89db2686a105736481aed10ca.tar.gz
llvm-009cf9e9a3a386f89db2686a105736481aed10ca.tar.bz2
llvm-009cf9e9a3a386f89db2686a105736481aed10ca.tar.xz
Fix indeterminism in MI scheduler DAG construction.
Similarly to several recent fixes throughout the code replace std::map use with the MapVector. Add find() method to the MapVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/MapVector.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/ADT/MapVector.h b/include/llvm/ADT/MapVector.h
index 6aacca5a6f..42f8e553d4 100644
--- a/include/llvm/ADT/MapVector.h
+++ b/include/llvm/ADT/MapVector.h
@@ -83,6 +83,18 @@ public:
typename MapType::const_iterator Pos = Map.find(Key);
return Pos == Map.end()? 0 : 1;
}
+
+ iterator find(const KeyT &Key) {
+ typename MapType::const_iterator Pos = Map.find(Key);
+ return Pos == Map.end()? Vector.end() :
+ (Vector.begin() + Pos->second);
+ }
+
+ const_iterator find(const KeyT &Key) const {
+ typename MapType::const_iterator Pos = Map.find(Key);
+ return Pos == Map.end()? Vector.end() :
+ (Vector.begin() + Pos->second);
+ }
};
}