[PATCH] Remove static initializers from MCSchedModel

Chandler Carruth chandlerc at google.com
Tue Sep 2 09:57:40 PDT 2014


On Fri, Aug 29, 2014 at 3:07 PM, Pete Cooper <peter_cooper at apple.com> wrote:

> Still not sure why its better to make all of this public…
>
> Ultimately it was because tablegen couldn’t set the values of the private
> fields when it used the ‘x = { … }’ syntax.


So, I'll ask a question in complete ignorance because I don't understand
how tablegen works. Please don't hold anything up based on this question,
just hoping you'll enlighten me.

If there is a static method to return a local variable constructed with the
correct defaults, and/or a default constructor which provides them, why
can't TableGen produce that? I'm imagining TableGen emitting the "return
Blah(X, Y, Z, ...);" statement.

That seems better than having a global at all, even if it is {} initialized
as an aggregate.... But there is probably a reason why this can't be done.
=]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140902/52056d05/attachment.html>


More information about the llvm-commits mailing list