mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Make VTs and UnicodeCharSet ctors constexpr if the compiler supports it.
There are static variables of this around that we really want to go into a read-only segment. Sadly compilers are not smart enough to figure that out without constexpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -161,8 +161,8 @@ namespace llvm {
|
||||
|
||||
SimpleValueType SimpleTy;
|
||||
|
||||
MVT() : SimpleTy((SimpleValueType)(INVALID_SIMPLE_VALUE_TYPE)) {}
|
||||
MVT(SimpleValueType SVT) : SimpleTy(SVT) { }
|
||||
LLVM_CONSTEXPR MVT() : SimpleTy(INVALID_SIMPLE_VALUE_TYPE) {}
|
||||
LLVM_CONSTEXPR MVT(SimpleValueType SVT) : SimpleTy(SVT) { }
|
||||
|
||||
bool operator>(const MVT& S) const { return SimpleTy > S.SimpleTy; }
|
||||
bool operator<(const MVT& S) const { return SimpleTy < S.SimpleTy; }
|
||||
|
@ -34,10 +34,9 @@ namespace llvm {
|
||||
Type *LLVMTy;
|
||||
|
||||
public:
|
||||
EVT() : V((MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE)),
|
||||
LLVMTy(nullptr) {}
|
||||
EVT(MVT::SimpleValueType SVT) : V(SVT), LLVMTy(nullptr) { }
|
||||
EVT(MVT S) : V(S), LLVMTy(nullptr) {}
|
||||
LLVM_CONSTEXPR EVT() : V(MVT::INVALID_SIMPLE_VALUE_TYPE), LLVMTy(nullptr) {}
|
||||
LLVM_CONSTEXPR EVT(MVT::SimpleValueType SVT) : V(SVT), LLVMTy(nullptr) {}
|
||||
LLVM_CONSTEXPR EVT(MVT S) : V(S), LLVMTy(nullptr) {}
|
||||
|
||||
bool operator==(EVT VT) const {
|
||||
return !(*this != VT);
|
||||
|
Reference in New Issue
Block a user