[llvm] r276032 - Attempt to appease MSVC buildbots.
George Burgess IV via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 14:35:48 PDT 2016
Author: gbiv
Date: Tue Jul 19 16:35:47 2016
New Revision: 276032
URL: http://llvm.org/viewvc/llvm-project?rev=276032&view=rev
Log:
Attempt to appease MSVC buildbots.
Broken by r276026.
Modified:
llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp?rev=276032&r1=276031&r2=276032&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp Tue Jul 19 16:35:47 2016
@@ -107,12 +107,14 @@ enum class MatchState : uint8_t {
};
typedef std::bitset<7> StateSet;
-LLVM_CONSTEXPR StateSet ReadOnlyStateMask =
- (1 << static_cast<uint8_t>(MatchState::FlowFromReadOnly)) |
- (1 << static_cast<uint8_t>(MatchState::FlowFromMemAliasReadOnly));
-LLVM_CONSTEXPR StateSet WriteOnlyStateMask =
- (1 << static_cast<uint8_t>(MatchState::FlowToWriteOnly)) |
- (1 << static_cast<uint8_t>(MatchState::FlowToMemAliasWriteOnly));
+// N.B. These are unsigned instead of StateSets because some MSVC versions
+// apparently lack constexpr bitset ctors.
+LLVM_CONSTEXPR unsigned ReadOnlyStateMask =
+ (1U << static_cast<uint8_t>(MatchState::FlowFromReadOnly)) |
+ (1U << static_cast<uint8_t>(MatchState::FlowFromMemAliasReadOnly));
+LLVM_CONSTEXPR unsigned WriteOnlyStateMask =
+ (1U << static_cast<uint8_t>(MatchState::FlowToWriteOnly)) |
+ (1U << static_cast<uint8_t>(MatchState::FlowToMemAliasWriteOnly));
// We use ReachabilitySet to keep track of value aliases (The nonterminal "V" in
// the paper) during the analysis.
@@ -249,11 +251,11 @@ public:
};
static bool hasReadOnlyState(StateSet Set) {
- return (Set & ReadOnlyStateMask).any();
+ return (Set & StateSet(ReadOnlyStateMask)).any();
}
static bool hasWriteOnlyState(StateSet Set) {
- return (Set & WriteOnlyStateMask).any();
+ return (Set & StateSet(WriteOnlyStateMask)).any();
}
static Optional<InterfaceValue>
More information about the llvm-commits
mailing list