[CFLAA] constexpr -> LLVM_CONSTEXPR
authorHal Finkel <hfinkel@anl.gov>
Tue, 2 Sep 2014 22:13:00 +0000 (22:13 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 2 Sep 2014 22:13:00 +0000 (22:13 +0000)
Attempt to fix the MSVC build by not using constexpr.

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

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

index 4fdacd33df71a2978bdc90b89a7d0d38cb28d4c5..da0264ec1df02d9fcb6f44b0f926fb8ab9aac1f0 100644 (file)
@@ -42,6 +42,7 @@
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 #include <cassert>
@@ -75,15 +76,15 @@ static bool hasUsefulEdges(Instruction *);
 namespace {
 // StratifiedInfo Attribute things.
 typedef unsigned StratifiedAttr;
-constexpr unsigned MaxStratifiedAttrIndex = NumStratifiedAttrs;
-constexpr unsigned AttrAllIndex = 0;
-constexpr unsigned AttrGlobalIndex = 1;
-constexpr unsigned AttrFirstArgIndex = 2;
-constexpr unsigned AttrLastArgIndex = MaxStratifiedAttrIndex;
-constexpr unsigned AttrMaxNumArgs = AttrLastArgIndex - AttrFirstArgIndex;
+LLVM_CONSTEXPR unsigned MaxStratifiedAttrIndex = NumStratifiedAttrs;
+LLVM_CONSTEXPR unsigned AttrAllIndex = 0;
+LLVM_CONSTEXPR unsigned AttrGlobalIndex = 1;
+LLVM_CONSTEXPR unsigned AttrFirstArgIndex = 2;
+LLVM_CONSTEXPR unsigned AttrLastArgIndex = MaxStratifiedAttrIndex;
+LLVM_CONSTEXPR unsigned AttrMaxNumArgs = AttrLastArgIndex - AttrFirstArgIndex;
 
-constexpr StratifiedAttr AttrNone = 0;
-constexpr StratifiedAttr AttrAll = ~AttrNone;
+LLVM_CONSTEXPR StratifiedAttr AttrNone = 0;
+LLVM_CONSTEXPR StratifiedAttr AttrAll = ~AttrNone;
 
 // \brief StratifiedSets call for knowledge of "direction", so this is how we
 // represent that locally.
@@ -341,8 +342,8 @@ public:
   tryInterproceduralAnalysis(const SmallVectorImpl<Function *> &Fns,
                              Value *FuncValue,
                              const iterator_range<User::op_iterator> &Args) {
-    constexpr unsigned ExpectedMaxArgs = 8;
-    constexpr unsigned MaxSupportedArgs = 50;
+    LLVM_CONSTEXPR unsigned ExpectedMaxArgs = 8;
+    LLVM_CONSTEXPR unsigned MaxSupportedArgs = 50;
     assert(Fns.size() > 0);
 
     // I put this here to give us an upper bound on time taken by IPA. Is it
@@ -535,7 +536,7 @@ public:
   typedef std::size_t Node;
 
 private:
-  constexpr static Node StartNode = Node(0);
+  LLVM_CONSTEXPR static Node StartNode = Node(0);
 
   struct Edge {
     EdgeTypeT Weight;
index 5fac3978ffe69ce0e583b21ae10ab0877cb37fd0..c03abe3c678bf20b67185e6fb1ad3941c5008ec8 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <bitset>
 #include <cassert>
 #include <cmath>
@@ -37,7 +38,7 @@ struct StratifiedInfo {
 // The number of attributes that StratifiedAttrs should contain. Attributes are
 // described below, and 32 was an arbitrary choice because it fits nicely in 32
 // bits (because we use a bitset for StratifiedAttrs).
-static constexpr unsigned NumStratifiedAttrs = 32;
+static LLVM_CONSTEXPR unsigned NumStratifiedAttrs = 32;
 
 // These are attributes that the users of StratifiedSets/StratifiedSetBuilders
 // may use for various purposes. These also have the special property of that
@@ -52,7 +53,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 constexpr auto SetSentinel =
+  static LLVM_CONSTEXPR auto SetSentinel =
       std::numeric_limits<StratifiedIndex>::max();
 
   // \brief The index for the set "above" current