<div dir="ltr">Okay cool, thanks!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 3:39 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@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=""><br>
> On Jun 26, 2014, at 3:03 PM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
><br>
> Hey Greg,<br>
><br>
> On Thu, Jun 26, 2014 at 2:52 PM, Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br>
> A few things with respect to triple comparison:<br>
><br>
> The strings really shouldn't be compared, but the arch/vendor/os enums should be. You might also have a "unspecified 'unknown'" or a "specified 'unknown'".<br>
><br>
> For example if you type:<br>
><br>
> (lldb) file --arch x86_64 ...<br>
><br>
> The triple will be:<br>
><br>
> arch = x86_64<br>
> vendor = "unspecified 'unknown'"<br>
> os = "unspecified 'unknown'"<br>
><br>
> But if you type:<br>
><br>
><br>
> (lldb) file --arch x86_64-unknown-unknown ...<br>
><br>
> The triple will be:<br>
><br>
> arch = x86_64<br>
> vendor = "specified 'unknown'"<br>
> os = "specified 'unknown'"<br>
><br>
> Is there a way to mark just the vendor portion as "unspecified 'unknown'" without having to use the string form?<br>
<br>
</div>Yes<br>
<br>
llvm::Triple t;<br>
<br>
<br>
t.setArchName("x86_64")<br>
t.setVendor(llvm::Triple::Unknown); // Don't set it by string if you want "unspecified 'unknown'<br>
t.setOSName("freebsd9.1)<br>
<div class=""><br>
>  I have a code path where I want to literally clear it meaning "I really don't know what it is, but I know it's not what it is currently set to..."<br>
<br>
</div>You might also be able to set to the empty string and it might keep the string value empty (check that "t.getVendorName()" returns the empty string and the "t.getVendor()" returns llvm::Triple::Unknown).<br>

<div class="HOEnZb"><div class="h5"><br>
<br>
> (I hit that when the arch was defaulting to x86_64-apple-{something} but I was refining the vendor idea of a Linux x86_64 elf file based on note content).<br>
><br>
><br>
><br>
><br>
> --<br>
> Todd Fiala |   Software Engineer |     <a href="mailto:tfiala@google.com">tfiala@google.com</a> |     <a href="tel:650-943-3180" value="+16509433180">650-943-3180</a><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>