<div dir="ltr">Hello Andy,<div><br></div><div>thank you very much for your reply. And while it does not solve my immediate problem, it at least limits the solution space. So, it is a useful answer.</div><div><br></div><div>
I will go back to the drawing board and explore your suggestions and try to map it to the problem at hand. I am trying to implement a scripting pass akin to Shang for the 3.4 release.</div><div><br></div><div>In any case, I was wondering if anyone is actively looking into such a scripting pass.</div>
<div><br></div><div>Thanks again,</div><div><br></div><div>/Dirk</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Oct 5, 2013 at 6:34 AM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Sep 30, 2013, at 10:11 PM, Dirk Schroetter <<a href="mailto:dschroetter@googlemail.com">dschroetter@googlemail.com</a>> wrote:<br>
<br>
> Folks,<br>
><br>
> I did read the documentation but I am at a loss still.<br>
><br>
> I do have the following:<br>
><br>
> Pass *createFooPass (char *foo1) {<br>
>  return new FooPass (foo1);<br>
> }<br>
><br>
> static RegisterPass<FooPass> X("foo-pass", "foo", false, true);<br>
><br>
> Where exactly do I supply the non-default crore in this example ?<br>
<br>
</div></div>Sorry for the non-answer, but AFAIK the pass registry can’t understand a non-default ctor. I personally don’t like non-default pass ctors anyway. You have at least three better options<br>
- If you have different versions of a pass, just make them different passes that share implementation.<br>
- If you have a pass that can be configured in different modes, get the mode from the current context within the pass. Maybe a Function attribute can be used, or ask TargetMachine/TargetOptions within backend passes.<br>

- Get what you need from an existing ImmutablePass, like TargetTransformInfo, TargetPassConfig, or create your own Immutable pass.<br>
<br>
-Andy</blockquote></div><br></div>