<div dir="ltr">Reverted in r243888.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 1, 2015 at 12:23 PM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">ValID move contructor may be causing a compilation failure:<br></div><div dir="ltr"><br></div><div dir="ltr"> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_builders_clang-2Dx86-2Dwin2008-2Dselfhost_builds_2195_steps_build-2520stage-25202_logs_stdio&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=4J10aigkxdAi9hxhWEo1NVVu16QrCspBzJ_Ex41wYIw&s=IvQkVSBDca1aPEQf9CXXQx9UTOAWUg2v2YbtDts973M&e=" target="_blank">http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/2195/steps/build%20stage%202/logs/stdio</a><br></div><div dir="ltr"><br></div><div dir="ltr"><pre style="font-family:'Courier New',courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span>C:\buildbot\slave-config\clang-x86-win2008-selfhost\llvm\lib\AsmParser/LLParser.h(70,5) : note: copy constructor is implicitly deleted because 'ValID' has a user-declared move constructor
ValID(ValID &&RHS)
^</span></pre></div><span class="HOEnZb"><font color="#888888"><div dir="ltr">Yaron<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-08-01 8:10 GMT+03:00 David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Sat Aug 1 00:10:40 2015<br>
New Revision: 243824<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D243824-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=4J10aigkxdAi9hxhWEo1NVVu16QrCspBzJ_Ex41wYIw&s=HlEgmAomodYXc_3vu1TFy5qA1cxdA1XKI00o0CHT_MA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=243824&view=rev</a><br>
Log:<br>
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11<br>
<br>
Modified:<br>
llvm/trunk/lib/AsmParser/LLParser.cpp<br>
llvm/trunk/lib/AsmParser/LLParser.h<br>
<br>
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_AsmParser_LLParser.cpp-3Frev-3D243824-26r1-3D243823-26r2-3D243824-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=4J10aigkxdAi9hxhWEo1NVVu16QrCspBzJ_Ex41wYIw&s=obprrmTcZ8ztrM0E9qkv61K_GiFpZU7cAtC0bF1lj1Q&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=243824&r1=243823&r2=243824&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)<br>
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Sat Aug 1 00:10:40 2015<br>
@@ -13,6 +13,7 @@<br>
<br>
#include "LLParser.h"<br>
#include "llvm/ADT/SmallPtrSet.h"<br>
+#include "llvm/ADT/STLExtras.h"<br>
#include "llvm/AsmParser/SlotMapping.h"<br>
#include "llvm/IR/AutoUpgrade.h"<br>
#include "llvm/IR/CallingConv.h"<br>
@@ -2441,9 +2442,10 @@ bool LLParser::ParseValID(ValID &ID, Per<br>
ParseToken(lltok::rbrace, "expected end of struct constant"))<br>
return true;<br>
<br>
- ID.ConstantStructElts = new Constant*[Elts.size()];<br>
+ ID.ConstantStructElts = make_unique<Constant *[]>(Elts.size());<br>
ID.UIntVal = Elts.size();<br>
- memcpy(ID.ConstantStructElts, Elts.data(), Elts.size()*sizeof(Elts[0]));<br>
+ memcpy(ID.ConstantStructElts.get(), Elts.data(),<br>
+ Elts.size() * sizeof(Elts[0]));<br>
ID.Kind = ValID::t_ConstantStruct;<br>
return false;<br>
}<br>
@@ -2462,8 +2464,9 @@ bool LLParser::ParseValID(ValID &ID, Per<br>
return true;<br>
<br>
if (isPackedStruct) {<br>
- ID.ConstantStructElts = new Constant*[Elts.size()];<br>
- memcpy(ID.ConstantStructElts, Elts.data(), Elts.size()*sizeof(Elts[0]));<br>
+ ID.ConstantStructElts = make_unique<Constant *[]>(Elts.size());<br>
+ memcpy(ID.ConstantStructElts.get(), Elts.data(),<br>
+ Elts.size() * sizeof(Elts[0]));<br>
ID.UIntVal = Elts.size();<br>
ID.Kind = ValID::t_PackedConstantStruct;<br>
return false;<br>
@@ -4067,8 +4070,8 @@ bool LLParser::ConvertValIDToValue(Type<br>
return Error(ID.Loc, "element " + Twine(i) +<br>
" of struct initializer doesn't match struct element type");<br>
<br>
- V = ConstantStruct::get(ST, makeArrayRef(ID.ConstantStructElts,<br>
- ID.UIntVal));<br>
+ V = ConstantStruct::get(<br>
+ ST, makeArrayRef(ID.ConstantStructElts.get(), ID.UIntVal));<br>
} else<br>
return Error(ID.Loc, "constant expression type mismatch");<br>
return false;<br>
<br>
Modified: llvm/trunk/lib/AsmParser/LLParser.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_AsmParser_LLParser.h-3Frev-3D243824-26r1-3D243823-26r2-3D243824-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=4J10aigkxdAi9hxhWEo1NVVu16QrCspBzJ_Ex41wYIw&s=L9k847iW1SwHw7AmQzqHEz8enXdmVK7IQS-cqgMSQuo&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.h?rev=243824&r1=243823&r2=243824&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/AsmParser/LLParser.h (original)<br>
+++ llvm/trunk/lib/AsmParser/LLParser.h Sat Aug 1 00:10:40 2015<br>
@@ -55,22 +55,24 @@ namespace llvm {<br>
t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal.<br>
t_ConstantStruct, // Value in ConstantStructElts.<br>
t_PackedConstantStruct // Value in ConstantStructElts.<br>
- } Kind;<br>
+ } Kind = t_LocalID;<br>
<br>
LLLexer::LocTy Loc;<br>
unsigned UIntVal;<br>
FunctionType *FTy;<br>
std::string StrVal, StrVal2;<br>
APSInt APSIntVal;<br>
- APFloat APFloatVal;<br>
+ APFloat APFloatVal{0.0};<br>
Constant *ConstantVal;<br>
- Constant **ConstantStructElts;<br>
+ std::unique_ptr<Constant *[]> ConstantStructElts;<br>
<br>
- ValID() : Kind(t_LocalID), APFloatVal(0.0) {}<br>
- ~ValID() {<br>
- if (Kind == t_ConstantStruct || Kind == t_PackedConstantStruct)<br>
- delete [] ConstantStructElts;<br>
- }<br>
+ ValID() = default;<br>
+ ValID(ValID &&RHS)<br>
+ : Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy),<br>
+ StrVal(std::move(RHS.StrVal)), StrVal2(std::move(RHS.StrVal2)),<br>
+ APSIntVal(std::move(RHS.APSIntVal)),<br>
+ APFloatVal(std::move(RHS.APFloatVal)), ConstantVal(RHS.ConstantVal),<br>
+ ConstantStructElts(std::move(RHS.ConstantStructElts)) {}<br>
<br>
bool operator<(const ValID &RHS) const {<br>
if (Kind == t_LocalID || Kind == t_GlobalID)<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>