<div dir="ltr"><div><div>You are supposed to pass the target options to CreateTargetInfo. If you want the target info to have different option different, create a new one, with the "right" values for your types. <br><br></div>You can get a reference to  target options with <a href="https://clang.llvm.org/doxygen/classclang_1_1TargetInfo.html#af46e41c7c724fb238952a87f92eb0557" class="gmail-code">getTargetOpts</a> to, and I do believe your can even modify the members of that and get the desired effect, but it's not, as far as I understand, how it's meant to work. <br><br></div><div>However, I have only worked on code dealing with targets and target options a tiny bit, so I could be wrong.<br><br>--<br></div><div>Mats<br></div><div><a href="https://clang.llvm.org/doxygen/classclang_1_1TargetInfo.html#af46e41c7c724fb238952a87f92eb0557" class="gmail-code"></a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 April 2017 at 15:42, Thomas Karos via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everybody,<br>
<br>
I plan to use clang for some code analysis. Because of that, I was looking on how one can make clang use a custom ABI (overwrite some sizes, keep reasonable defaults for everything else).<br>
But then I found Targets.cpp and now I got stuck.<br>
<br>
The issue is as follows:<br>
To get some instance of TargetInfo in which I can change things (lets say IntWidth), I need to derive from it. But then, I still cannot set the private member TargetOpts which is only set in CreateTargetInfo(). But this function I cannot use because I want to access protected fields. Not settings the pointer at all doesn't seem to be an option as well (asserts).<br>
<br>
Is this intended and I am overseeing something? Or is there a way to do this?<br>
Why is the TargetInfo stuff encapsulated that much anyway?<br>
<br>
Thanks<br>
Thomas<br>
<br>
------------------------------<wbr>------------------------------<wbr>--------<br>
Thomas Karos<br>
AbsInt Angewandte Informatik GmbH<br>
Science Park 1<br>
66123 Saarbrücken<br>
GERMANY<br>
------------------------------<wbr>------------------------------<wbr>--------<br>
Geschäftsführung: Dr.-Ing. Christian Ferdinand<br>
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>