<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""></div><div class=""><br class=""></div><div class="">I’m totally unfamiliar with clang options passing and parsing, so I’d appreciate any corrections here. E.g. I chose ‘f_Group’ for the option almost at random:)</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Michael</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 5, 2015, at 10:09 AM, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class=""><div class="gmail_quote">On Thu, Mar 5, 2015 at 9:02 AM <<a href="mailto:aschwaighofer@apple.com" class="">aschwaighofer@apple.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class=""><br class="">On 03/05/15, Hal Finkel   wrote:<br class="">> Okay, unfortunately, this specifically does not work for me. I need to control the triple used for compilation in cross-compiling environments, and whether or not calls to some particular library might be generated does not belong there.<br class="">><br class="">> Currently, TLI is constructed by the frontend like this (to copy from Clang):<br class="">><br class="">>  // Figure out TargetLibraryInfo.<br class="">>  Triple TargetTriple(TheModule-><u class=""></u>getTargetTriple());<br class="">>  PMBuilder.LibraryInfo = createTLI(TargetTriple, CodeGenOpts);<br class="">><br class="">> and this information needs to be passed in from the frontend (so that it can be easily controlled using frontend command-line flags). We should define some enum with the different library types being targeted, and probably stick that into CodeGenOpts, and use it in TLI as appropriate. The backend might also generate calls into such a library, so CodeGenOpts is really the right place for this.<br class=""><br class="">Works for me.<br class=""><br class=""><br class="">I viewed using the environment as a stringly typed version of what you suggest until we have some real users of this. I must admit I have not researched deeply into whether the frontend could have set the triple in TheModule->getTargetTriple() from " "x86-apple-darwin” to "x86-apple-darwin-accelerate".<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">FWIW you can do this, but ... let's not :)</div><div class=""><br class=""></div><div class="">CodeGenOpts is how you pass this sort of stuff down. </div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">-eric</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class="">That said this would have been a hack in the frontend and using a enum or alternatively just setting the set of functions in the frontend is cleaner.</blockquote></div></div></div></blockquote></div><br class=""></div></body></html>