diff --git a/lib/Analysis/AliasAnalysisSummary.cpp b/lib/Analysis/AliasAnalysisSummary.cpp index 567405d0972..09a6b8217a0 100644 --- a/lib/Analysis/AliasAnalysisSummary.cpp +++ b/lib/Analysis/AliasAnalysisSummary.cpp @@ -7,25 +7,24 @@ namespace llvm { namespace cflaa { namespace { -LLVM_CONSTEXPR unsigned AttrEscapedIndex = 0; -LLVM_CONSTEXPR unsigned AttrUnknownIndex = 1; -LLVM_CONSTEXPR unsigned AttrGlobalIndex = 2; -LLVM_CONSTEXPR unsigned AttrCallerIndex = 3; -LLVM_CONSTEXPR unsigned AttrFirstArgIndex = 4; -LLVM_CONSTEXPR unsigned AttrLastArgIndex = NumAliasAttrs; -LLVM_CONSTEXPR unsigned AttrMaxNumArgs = AttrLastArgIndex - AttrFirstArgIndex; +const unsigned AttrEscapedIndex = 0; +const unsigned AttrUnknownIndex = 1; +const unsigned AttrGlobalIndex = 2; +const unsigned AttrCallerIndex = 3; +const unsigned AttrFirstArgIndex = 4; +const unsigned AttrLastArgIndex = NumAliasAttrs; +const unsigned AttrMaxNumArgs = AttrLastArgIndex - AttrFirstArgIndex; // NOTE: These aren't AliasAttrs because bitsets don't have a constexpr // ctor for some versions of MSVC that we support. We could maybe refactor, // but... using AliasAttr = unsigned; -LLVM_CONSTEXPR AliasAttr AttrNone = 0; -LLVM_CONSTEXPR AliasAttr AttrEscaped = 1 << AttrEscapedIndex; -LLVM_CONSTEXPR AliasAttr AttrUnknown = 1 << AttrUnknownIndex; -LLVM_CONSTEXPR AliasAttr AttrGlobal = 1 << AttrGlobalIndex; -LLVM_CONSTEXPR AliasAttr AttrCaller = 1 << AttrCallerIndex; -LLVM_CONSTEXPR AliasAttr ExternalAttrMask = - AttrEscaped | AttrUnknown | AttrGlobal; +const AliasAttr AttrNone = 0; +const AliasAttr AttrEscaped = 1 << AttrEscapedIndex; +const AliasAttr AttrUnknown = 1 << AttrUnknownIndex; +const AliasAttr AttrGlobal = 1 << AttrGlobalIndex; +const AliasAttr AttrCaller = 1 << AttrCallerIndex; +const AliasAttr ExternalAttrMask = AttrEscaped | AttrUnknown | AttrGlobal; } AliasAttrs getAttrNone() { return AttrNone; } diff --git a/lib/Analysis/AliasAnalysisSummary.h b/lib/Analysis/AliasAnalysisSummary.h index 18ca3a9feef..51a85f4e706 100644 --- a/lib/Analysis/AliasAnalysisSummary.h +++ b/lib/Analysis/AliasAnalysisSummary.h @@ -99,7 +99,7 @@ AliasAttrs getExternallyVisibleAttrs(AliasAttrs); //===----------------------------------------------------------------------===// /// The maximum number of arguments we can put into a summary. -LLVM_CONSTEXPR static unsigned MaxSupportedArgsInSummary = 50; +static const unsigned MaxSupportedArgsInSummary = 50; /// We use InterfaceValue to describe parameters/return value, as well as /// potential memory locations that are pointed to by parameters/return value, @@ -137,7 +137,7 @@ inline bool operator>=(InterfaceValue LHS, InterfaceValue RHS) { // We use UnknownOffset to represent pointer offsets that cannot be determined // at compile time. Note that MemoryLocation::UnknownSize cannot be used here // because we require a signed value. -static LLVM_CONSTEXPR int64_t UnknownOffset = INT64_MAX; +static const int64_t UnknownOffset = INT64_MAX; inline int64_t addOffset(int64_t LHS, int64_t RHS) { if (LHS == UnknownOffset || RHS == UnknownOffset) diff --git a/lib/Analysis/CFLAndersAliasAnalysis.cpp b/lib/Analysis/CFLAndersAliasAnalysis.cpp index d85121283cc..b33938889de 100644 --- a/lib/Analysis/CFLAndersAliasAnalysis.cpp +++ b/lib/Analysis/CFLAndersAliasAnalysis.cpp @@ -107,12 +107,10 @@ enum class MatchState : uint8_t { }; typedef std::bitset<7> StateSet; -// N.B. These are unsigned instead of StateSets because some MSVC versions -// apparently lack constexpr bitset ctors. -LLVM_CONSTEXPR unsigned ReadOnlyStateMask = +const unsigned ReadOnlyStateMask = (1U << static_cast(MatchState::FlowFromReadOnly)) | (1U << static_cast(MatchState::FlowFromMemAliasReadOnly)); -LLVM_CONSTEXPR unsigned WriteOnlyStateMask = +const unsigned WriteOnlyStateMask = (1U << static_cast(MatchState::FlowToWriteOnly)) | (1U << static_cast(MatchState::FlowToMemAliasWriteOnly)); diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp index f23477622be..d7fcb0fccb8 100644 --- a/lib/Analysis/MemoryBuiltins.cpp +++ b/lib/Analysis/MemoryBuiltins.cpp @@ -114,7 +114,7 @@ static Optional getAllocationData(const Value *V, AllocType AllocTy, // MallocLike is chosen here because allocsize makes no guarantees about the // nullness of the result of the function, nor does it deal with strings, nor // does it require that the memory returned is zeroed out. - LLVM_CONSTEXPR auto AllocSizeAllocTy = MallocLike; + const AllocType AllocSizeAllocTy = MallocLike; if ((AllocTy & AllocSizeAllocTy) == AllocSizeAllocTy && Callee->hasFnAttribute(Attribute::AllocSize)) { Attribute Attr = Callee->getFnAttribute(Attribute::AllocSize); diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d2fb6fe8e38..307782245a6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -196,7 +196,7 @@ const DIType *DbgVariable::getType() const { return Ty; } -static LLVM_CONSTEXPR DwarfAccelTable::Atom TypeAtoms[] = { +static const DwarfAccelTable::Atom TypeAtoms[] = { DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4), DwarfAccelTable::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2), DwarfAccelTable::Atom(dwarf::DW_ATOM_type_flags, dwarf::DW_FORM_data1)}; diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp index 93b3d2885be..95ddc3628a0 100644 --- a/lib/IR/Attributes.cpp +++ b/lib/IR/Attributes.cpp @@ -38,7 +38,7 @@ using namespace llvm; // // In order to do this, we need to reserve one value of the second (optional) // allocsize argument to signify "not present." -LLVM_CONSTEXPR static unsigned AllocSizeNumElemsNotPresent = -1; +static const unsigned AllocSizeNumElemsNotPresent = -1; static uint64_t packAllocSizeArgs(unsigned ElemSizeArg, const Optional &NumElemsArg) { diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 31ffffcf603..318ce10ceaf 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -1495,7 +1495,7 @@ static void KnuthDiv(unsigned *u, unsigned *v, unsigned *q, unsigned* r, assert(n>1 && "n must be > 1"); // b denotes the base of the number system. In our case b is 2^32. - LLVM_CONSTEXPR uint64_t b = uint64_t(1) << 32; + const uint64_t b = uint64_t(1) << 32; DEBUG(dbgs() << "KnuthDiv: m=" << m << " n=" << n << '\n'); DEBUG(dbgs() << "KnuthDiv: original:"); diff --git a/lib/Target/AArch64/AArch64InstrInfo.cpp b/lib/Target/AArch64/AArch64InstrInfo.cpp index e3afa8924e1..3b1006fc35b 100644 --- a/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -29,7 +29,7 @@ using namespace llvm; #define GET_INSTRINFO_CTOR_DTOR #include "AArch64GenInstrInfo.inc" -static LLVM_CONSTEXPR MachineMemOperand::Flags MOSuppressPair = +static const MachineMemOperand::Flags MOSuppressPair = MachineMemOperand::MOTargetFlag1; static cl::opt