mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
0ef4b3cef4
commit
3d171d4f73
2 files changed
+19
-14
No files matched your search
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "LLParser.h"
|
#include "LLParser.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/AsmParser/SlotMapping.h"
|
#include "llvm/AsmParser/SlotMapping.h"
|
||||||
#include "llvm/IR/AutoUpgrade.h"
|
#include "llvm/IR/AutoUpgrade.h"
|
||||||
#include "llvm/IR/CallingConv.h"
|
#include "llvm/IR/CallingConv.h"
|
||||||
@@ -2441,9 +2442,10 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
|||||||
ParseToken(lltok::rbrace, "expected end of struct constant"))
|
ParseToken(lltok::rbrace, "expected end of struct constant"))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
ID.ConstantStructElts = new Constant*[Elts.size()];
|
ID.ConstantStructElts = make_unique<Constant *[]>(Elts.size());
|
||||||
ID.UIntVal = Elts.size();
|
ID.UIntVal = Elts.size();
|
||||||
memcpy(ID.ConstantStructElts, Elts.data(), Elts.size()*sizeof(Elts[0]));
|
memcpy(ID.ConstantStructElts.get(), Elts.data(),
|
||||||
|
Elts.size() * sizeof(Elts[0]));
|
||||||
ID.Kind = ValID::t_ConstantStruct;
|
ID.Kind = ValID::t_ConstantStruct;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2462,8 +2464,9 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (isPackedStruct) {
|
if (isPackedStruct) {
|
||||||
ID.ConstantStructElts = new Constant*[Elts.size()];
|
ID.ConstantStructElts = make_unique<Constant *[]>(Elts.size());
|
||||||
memcpy(ID.ConstantStructElts, Elts.data(), Elts.size()*sizeof(Elts[0]));
|
memcpy(ID.ConstantStructElts.get(), Elts.data(),
|
||||||
|
Elts.size() * sizeof(Elts[0]));
|
||||||
ID.UIntVal = Elts.size();
|
ID.UIntVal = Elts.size();
|
||||||
ID.Kind = ValID::t_PackedConstantStruct;
|
ID.Kind = ValID::t_PackedConstantStruct;
|
||||||
return false;
|
return false;
|
||||||
@@ -4067,8 +4070,8 @@ bool LLParser::ConvertValIDToValue(Type *Ty, ValID &ID, Value *&V,
|
|||||||
return Error(ID.Loc, "element " + Twine(i) +
|
return Error(ID.Loc, "element " + Twine(i) +
|
||||||
" of struct initializer doesn't match struct element type");
|
" of struct initializer doesn't match struct element type");
|
||||||
|
|
||||||
V = ConstantStruct::get(ST, makeArrayRef(ID.ConstantStructElts,
|
V = ConstantStruct::get(
|
||||||
ID.UIntVal));
|
ST, makeArrayRef(ID.ConstantStructElts.get(), ID.UIntVal));
|
||||||
} else
|
} else
|
||||||
return Error(ID.Loc, "constant expression type mismatch");
|
return Error(ID.Loc, "constant expression type mismatch");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -55,22 +55,24 @@ namespace llvm {
|
|||||||
t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal.
|
t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal.
|
||||||
t_ConstantStruct, // Value in ConstantStructElts.
|
t_ConstantStruct, // Value in ConstantStructElts.
|
||||||
t_PackedConstantStruct // Value in ConstantStructElts.
|
t_PackedConstantStruct // Value in ConstantStructElts.
|
||||||
} Kind;
|
} Kind = t_LocalID;
|
||||||
|
|
||||||
LLLexer::LocTy Loc;
|
LLLexer::LocTy Loc;
|
||||||
unsigned UIntVal;
|
unsigned UIntVal;
|
||||||
FunctionType *FTy;
|
FunctionType *FTy;
|
||||||
std::string StrVal, StrVal2;
|
std::string StrVal, StrVal2;
|
||||||
APSInt APSIntVal;
|
APSInt APSIntVal;
|
||||||
APFloat APFloatVal;
|
APFloat APFloatVal{0.0};
|
||||||
Constant *ConstantVal;
|
Constant *ConstantVal;
|
||||||
Constant **ConstantStructElts;
|
std::unique_ptr<Constant *[]> ConstantStructElts;
|
||||||
|
|
||||||
ValID() : Kind(t_LocalID), APFloatVal(0.0) {}
|
ValID() = default;
|
||||||
~ValID() {
|
ValID(ValID &&RHS)
|
||||||
if (Kind == t_ConstantStruct || Kind == t_PackedConstantStruct)
|
: Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy),
|
||||||
delete [] ConstantStructElts;
|
StrVal(std::move(RHS.StrVal)), StrVal2(std::move(RHS.StrVal2)),
|
||||||
}
|
APSIntVal(std::move(RHS.APSIntVal)),
|
||||||
|
APFloatVal(std::move(RHS.APFloatVal)), ConstantVal(RHS.ConstantVal),
|
||||||
|
ConstantStructElts(std::move(RHS.ConstantStructElts)) {}
|
||||||
|
|
||||||
bool operator<(const ValID &RHS) const {
|
bool operator<(const ValID &RHS) const {
|
||||||
if (Kind == t_LocalID || Kind == t_GlobalID)
|
if (Kind == t_LocalID || Kind == t_GlobalID)
|
||||||
|
|||||||
Reference in new issue
Block a user