<div dir="ltr">Why the change from using setter functions to direct assignment?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 3, 2018 at 5:06 AM Bruno Ricci via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: brunoricci<br>
Date: Mon Dec 3 05:04:10 2018<br>
New Revision: 348131<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=348131&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=348131&view=rev</a><br>
Log:<br>
[AST] Fix an uninitialized bug in the bits of FunctionDecl<br>
<br>
FunctionDeclBits.IsCopyDeductionCandidate was not initialized.<br>
This caused a warning with valgrind.<br>
<br>
<br>
Modified:<br>
cfe/trunk/lib/AST/Decl.cpp<br>
<br>
Modified: cfe/trunk/lib/AST/Decl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=348131&r1=348130&r2=348131&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=348131&r1=348130&r2=348131&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/Decl.cpp (original)<br>
+++ cfe/trunk/lib/AST/Decl.cpp Mon Dec 3 05:04:10 2018<br>
@@ -2653,27 +2653,29 @@ FunctionDecl::FunctionDecl(Kind DK, ASTC<br>
DeclContext(DK), redeclarable_base(C), ODRHash(0),<br>
EndRangeLoc(NameInfo.getEndLoc()), DNLoc(NameInfo.getInfo()) {<br>
assert(T.isNull() || T->isFunctionType());<br>
- setStorageClass(S);<br>
- setInlineSpecified(isInlineSpecified);<br>
- setExplicitSpecified(false);<br>
- setVirtualAsWritten(false);<br>
- setPure(false);<br>
- setHasInheritedPrototype(false);<br>
- setHasWrittenPrototype(true);<br>
- setDeletedAsWritten(false);<br>
- setTrivial(false);<br>
- setTrivialForCall(false);<br>
- setDefaulted(false);<br>
- setExplicitlyDefaulted(false);<br>
- setHasImplicitReturnZero(false);<br>
- setLateTemplateParsed(false);<br>
- setConstexpr(isConstexprSpecified);<br>
- setInstantiationIsPending(false);<br>
- setUsesSEHTry(false);<br>
- setHasSkippedBody(false);<br>
- setWillHaveBody(false);<br>
- setIsMultiVersion(false);<br>
- setHasODRHash(false);<br>
+ FunctionDeclBits.SClass = S;<br>
+ FunctionDeclBits.IsInline = isInlineSpecified;<br>
+ FunctionDeclBits.IsInlineSpecified = isInlineSpecified;<br>
+ FunctionDeclBits.IsExplicitSpecified = false;<br>
+ FunctionDeclBits.IsVirtualAsWritten = false;<br>
+ FunctionDeclBits.IsPure = false;<br>
+ FunctionDeclBits.HasInheritedPrototype = false;<br>
+ FunctionDeclBits.HasWrittenPrototype = true;<br>
+ FunctionDeclBits.IsDeleted = false;<br>
+ FunctionDeclBits.IsTrivial = false;<br>
+ FunctionDeclBits.IsTrivialForCall = false;<br>
+ FunctionDeclBits.IsDefaulted = false;<br>
+ FunctionDeclBits.IsExplicitlyDefaulted = false;<br>
+ FunctionDeclBits.HasImplicitReturnZero = false;<br>
+ FunctionDeclBits.IsLateTemplateParsed = false;<br>
+ FunctionDeclBits.IsConstexpr = isConstexprSpecified;<br>
+ FunctionDeclBits.InstantiationIsPending = false;<br>
+ FunctionDeclBits.UsesSEHTry = false;<br>
+ FunctionDeclBits.HasSkippedBody = false;<br>
+ FunctionDeclBits.WillHaveBody = false;<br>
+ FunctionDeclBits.IsMultiVersion = false;<br>
+ FunctionDeclBits.IsCopyDeductionCandidate = false;<br>
+ FunctionDeclBits.HasODRHash = false;<br>
}<br>
<br>
void FunctionDecl::getNameForDiagnostic(<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>