<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">That doesn't help me. I need to set the PIC flag with direct object emissions regardless of whether llvm-mc or just llc is used.<br>
<br>
Or have I misunderstood? <br>
<br>
Anyway, AsmPrinter is initialized using TargetMachine and that is where it is getting Subtarget. It is in my eye the same thing as I was doing, but I am good with just using Subtarget.<br>
<br>
The non-direct object AsmPrinter is suppose to know if it is PIC or not  in order to print out ".option pic0" for non-shared (which we are failing to do btw - bug)? I can just catch the pic'ness when MipsAsmPrinter is created or better yet when Subtarget is
 created.<br>
<br>
Jack<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF72550"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Jim Grosbach [grosbach@apple.com]<br>
<b>Sent:</b> Monday, December 03, 2012 12:38 PM<br>
<b>To:</b> Carter, Jack<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [PATCH] Review request: MC access to target and subtarget machine info<br>
</font><br>
</div>
<div></div>
<div>
<div>PIC vs. non-PIC is a different sort of thing. Often, that sort of thing for .o file flags are handled via assembler directives (see, for example, the .cpu and .fpu directives in ARM, for example).</div>
<div><br>
</div>
<div>The whole ARMAsmPrinter::emitAttributes() may be a useful example, as what it's doing seems pretty similar to what you're looking for. It uses the MCSubtargetInfo for lots of its information, but not all of it.</div>
<div><br>
</div>
<div>-Jim</div>
<br>
<div>
<div>On Dec 3, 2012, at 12:31 PM, "Carter, Jack" <<a href="mailto:jcarter@mips.com" target="_blank">jcarter@mips.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; direction:ltr; font-family:Tahoma; font-size:10pt">
<div style="font-family:'Times New Roman'; font-size:16px"><br class="Apple-interchange-newline">
<hr tabindex="-1">
<div id="divRpF151893" style="direction:ltr"><font face="Tahoma" size="2">So<font size="2"><span class="Apple-converted-space"> </span>you are saying<span class="Apple-converted-space"> </span><font size="2">is that SubT<font size="2">argetInfo is OK and an<font size="2">ything
 that such as PIC<font size="2">/CPIC that I ne<font size="2">ed would just get added to that?<span class="Apple-converted-space"> </span><br>
<br>
<font size="2">Yes, I need to<span class="Apple-converted-space"> </span><font size="2">know and mark e_flags with EF_MIPS_PIC i<font size="2">f<span class="Apple-converted-space"> </span><font size="2">we<span class="Apple-converted-space"> </span><font size="2">are
 not compil<font size="2">ing static (non-shared).<span class="Apple-converted-space"> </span><br>
<br>
<font size="2">I would be good with that.<font size="2"><font size="2"><span class="Apple-converted-space"> </span></font></font></font><br>
<br>
<font size="2">Jack</font><br>
<font size="2"></font><br>
</font></font></font></font></font></font></font></font></font></font></font></font></font><b><br>
From:</b><span class="Apple-converted-space"> </span>Jim Grosbach [<a href="mailto:grosbach@apple.com" target="_blank">grosbach@apple.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Monday, December 03, 2012 12:04 PM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Carter, Jack<br>
<b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [PATCH] Review request: MC access to target and subtarget machine info<br>
<br>
</div>
<div></div>
<div>Hi Jack,
<div><br>
</div>
<div>TargetMachine is deliberately not available in any MC layer code, as it's part of the CodeGen layer.</div>
<div><br>
</div>
<div>You probably want something along the lines of the features bit mask in MCSubtargetInfo. The ARM assembler has some examples of using that for related things.</div>
<div><br>
</div>
<div>-Jim</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>