Enhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst
[oota-llvm.git] / lib / Analysis / StratifiedSets.h
index 72f67a5f49bbf1c894d8f2e5a4e9c2908516b742..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 LLVM_CONSTEXPR 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;
       }