[CFLAA] More cleanup for MSVC
authorHal Finkel <hfinkel@anl.gov>
Tue, 2 Sep 2014 23:29:48 +0000 (23:29 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 2 Sep 2014 23:29:48 +0000 (23:29 +0000)
Remove more initializer lists, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFLAliasAnalysis.cpp
lib/Analysis/StratifiedSets.h

index 398ee020aefb6d51aa1a3ed8988c7d48d6234a15..e942529176d84e8b6752e5cb4c8b78791ce019d6 100644 (file)
@@ -343,13 +343,13 @@ public:
   tryInterproceduralAnalysis(const SmallVectorImpl<Function *> &Fns,
                              Value *FuncValue,
                              const iterator_range<User::op_iterator> &Args) {
-    LLVM_CONSTEXPR unsigned ExpectedMaxArgs = 8;
-    LLVM_CONSTEXPR unsigned MaxSupportedArgs = 50;
+    const unsigned ExpectedMaxArgs = 8;
+    const unsigned MaxSupportedArgs = 50;
     assert(Fns.size() > 0);
 
     // I put this here to give us an upper bound on time taken by IPA. Is it
     // really (realistically) needed? Keep in mind that we do have an n^2 algo.
-    if (std::distance(Args.begin(), Args.end()) > MaxSupportedArgs)
+    if (std::distance(Args.begin(), Args.end()) > (int) MaxSupportedArgs)
       return false;
 
     // Exit early if we'll fail anyway
@@ -400,8 +400,8 @@ public:
           }
         }
         if (AddEdge)
-          Output.push_back({FuncValue, ArgVal, EdgeType::Assign,
-                            StratifiedAttrs().flip()});
+          Output.push_back(Edge(FuncValue, ArgVal, EdgeType::Assign,
+                            StratifiedAttrs().flip()));
       }
 
       if (Parameters.size() != Arguments.size())
@@ -537,12 +537,15 @@ public:
   typedef std::size_t Node;
 
 private:
-  LLVM_CONSTEXPR static Node StartNode = Node(0);
+  const static Node StartNode = Node(0);
 
   struct Edge {
     EdgeTypeT Weight;
     Node Other;
 
+    Edge(const EdgeTypeT &W, const Node &N)
+      : Weight(W), Other(N) {}
+
     bool operator==(const Edge &E) const {
       return Weight == E.Weight && Other == E.Other;
     }
@@ -620,7 +623,7 @@ public:
 
   // ----- Actual graph-related things ----- //
 
-  WeightedBidirectionalGraph() = default;
+  WeightedBidirectionalGraph() {}
 
   WeightedBidirectionalGraph(WeightedBidirectionalGraph<EdgeTypeT> &&Other)
       : NodeImpls(std::move(Other.NodeImpls)) {}
@@ -644,8 +647,8 @@ public:
     assert(inbounds(To));
     auto &FromNode = getNode(From);
     auto &ToNode = getNode(To);
-    FromNode.Edges.push_back(Edge{Weight, To});
-    ToNode.Edges.push_back(Edge{ReverseWeight, From});
+    FromNode.Edges.push_back(Edge(Weight, To));
+    ToNode.Edges.push_back(Edge(ReverseWeight, From));
   }
 
   EdgeIterable edgesFor(const Node &N) const {
index 72f67a5f49bbf1c894d8f2e5a4e9c2908516b742..8a04bb302bff247b77bf54bb9687c3cac100a82e 100644 (file)
@@ -54,8 +54,8 @@ 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 auto SetSentinel =
+    std::numeric_limits<StratifiedIndex>::max();
 
   // \brief The index for the set "above" current
   StratifiedIndex Above;