diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-08-03 20:08:41 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-08-03 20:08:41 +0000 |
commit | adbda4b94c51fafa12471ee81a4d0d8767f2572b (patch) | |
tree | cecf4514d7cdb4f47652f8129fa4d9dbf343c200 /llvm/lib/AsmParser/LLParser.h | |
parent | 646386e77974f678f67df689349fcc45bc65119d (diff) | |
download | bcm5719-llvm-adbda4b94c51fafa12471ee81a4d0d8767f2572b.tar.gz bcm5719-llvm-adbda4b94c51fafa12471ee81a4d0d8767f2572b.zip |
Recommit r243824: -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
This reverts commit r243888, recommitting r243824.
This broke the Windows build due to a difference in the C++ standard
library implementation. Using emplace/forward_as_tuple should ensure
there's no need to copy ValIDs.
llvm-svn: 243896
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.h')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h index 0990e090b7c..acbf6f9e5b8 100644 --- a/llvm/lib/AsmParser/LLParser.h +++ b/llvm/lib/AsmParser/LLParser.h @@ -55,22 +55,24 @@ namespace llvm { t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal. t_ConstantStruct, // Value in ConstantStructElts. t_PackedConstantStruct // Value in ConstantStructElts. - } Kind; + } Kind = t_LocalID; LLLexer::LocTy Loc; unsigned UIntVal; FunctionType *FTy; std::string StrVal, StrVal2; APSInt APSIntVal; - APFloat APFloatVal; + APFloat APFloatVal{0.0}; Constant *ConstantVal; - Constant **ConstantStructElts; - - ValID() : Kind(t_LocalID), APFloatVal(0.0) {} - ~ValID() { - if (Kind == t_ConstantStruct || Kind == t_PackedConstantStruct) - delete [] ConstantStructElts; - } + std::unique_ptr<Constant *[]> ConstantStructElts; + + ValID() = default; + ValID(ValID &&RHS) + : Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy), + 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 { if (Kind == t_LocalID || Kind == t_GlobalID) |