Enhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst
[oota-llvm.git] / lib / Analysis / StratifiedSets.h
index 8a04bb302bff247b77bf54bb9687c3cac100a82e..fd3fbc0d86ad631fc2a413c35bc7dfec8a965dc0 100644 (file)
@@ -54,8 +54,7 @@ struct StratifiedLink {
   // Optional<StratifiedIndex> because Optional<StratifiedIndex> would
   // eat up a considerable amount of extra memory, after struct
   // padding/alignment is taken into account.
-  static const auto SetSentinel =
-    std::numeric_limits<StratifiedIndex>::max();
+  static const StratifiedIndex SetSentinel;
 
   // \brief The index for the set "above" current
   StratifiedIndex Above;
@@ -364,7 +363,7 @@ template <typename T> class StratifiedSetsBuilder {
     SmallSet<StratifiedIndex, 16> Visited;
     for (unsigned I = 0, E = Links.size(); I < E; ++I) {
       auto CurrentIndex = getHighestParentAbove(I);
-      if (!Visited.insert(CurrentIndex)) {
+      if (!Visited.insert(CurrentIndex).second) {
         continue;
       }