<div dir="ltr">So, if this is just the pattern we use with all of the bits here, I'm OK with that I guess... but it seems to make the the interface much more ugly:<div><br></div><div><div>+// For unknown processors.</div>
<div>+MCSchedModel MCSchedModel::DefaultSchedModel = {</div><div>+  MCSchedModel::DefaultIssueWidth,</div><div>+  DefaultMicroOpBufferSize,</div><div>+  DefaultLoopMicroOpBufferSize,</div><div>+  DefaultLoadLatency,</div>
<div>+  DefaultHighLatency,</div><div>+  DefaultMispredictPenalty,</div><div>+  false,</div><div>+  true,</div><div>+  0,</div><div>+  nullptr,</div><div>+  nullptr,</div><div>+  0,</div><div>+  0,</div><div>+  nullptr</div>
<div>+};</div><div><br></div></div><div>I found the old hiding of private members and use of a constructor much easier to read.</div><div><br></div><div>Would it work to do this with the same technique that Chris used in some of his patches where MCSchedModel has a static method that returns an object with the defaults set appropriately?</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 29, 2014 at 9:38 AM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all<br>
<br>
Please review this patch to change MCSchedModel to avoid static initializers.  This makes it behavior match other structs with similar uses, e.g., MCWriteProcResEntry and MCProcResourceDesc.<br>
<br>
This is part of the work to remove all the static initializers from LLVM.<br>
<br>
Thanks,<br>
Pete<br>
<br>
<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" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>