I did hesitate while adding "android" to isEABI as well.<br><br>The problem I am facing is that I wish isEABI("arm-linux-android") == true,<br>isEABI("i686-unknown-linux-android") == false.  After some consideration,<br>
I thought it is strange to check isEABI() on non-ARM architecture, thus I<br>chose to add "android".<br><br>BTW, I'm afraid that adding a new different environment type won't help.<br>Because we want "-android" considered as EABI on ARM, but not on X86.<br>
<br>If we should exclude non-ARM architecture, how about changing the code into:<br><br><span style="font-family:courier new,monospace">bool isEABI() const {<br>  const llvm::Triple& TT = getContext().getTargetInfo().getTriple();<br>
  StringRef Env = TT.getEnvironmentName();<br>  return (Env == "gnueabi" || Env == "eabi" || Env == "androideabi" ||<br>          ((TT.getArch() == llvm::Triple::arm ||<br>            TT.getArch() == llvm::Triple::thumb)) && Env == "android"));<br>
}</span><br><br>Or do you have better suggestion?  Thanks for your review.<br><br>Sincerely,<br>Logan<br><br><br>On Mon, Sep 3, 2012 at 4:16 PM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The following chunk looks weird to me.<br>
<br>
   bool isEABI() const {<br>
     StringRef Env =<br>
       getContext().getTargetInfo().getTriple().getEnvironmentName();<br>
-    return (Env == "gnueabi" || Env == "eabi" || Env == "androideabi");<br>
+    return (Env == "gnueabi" || Env == "eabi" ||<br>
+            Env == "android" || Env == "androideabi");<br>
   }<br>
<br>
Now we have isEABI() == true for i686-linux-android.<br>
I'd rather we kept more information about the original triple by<br>
having both android and androideabi environments, and a helper<br>
function isAndroid() somewhere.<br>
<div><div class="h5"><br>
On Sun, Sep 2, 2012 at 1:48 PM, Logan Chien <<a href="mailto:tzuhsiang.chien@gmail.com">tzuhsiang.chien@gmail.com</a>> wrote:<br>
> Thanks.  Commited as r163087, r163088.<br>
> -Logan<br>
><br>
><br>
><br>
> On Fri, Aug 31, 2012 at 5:25 PM, Anton Korobeynikov<br>
> <<a href="mailto:anton@korobeynikov.info">anton@korobeynikov.info</a>> wrote:<br>
>><br>
>> > This is because that we are using "StartsWith" to translate environment<br>
>> > name<br>
>> > (eg. andriodeabi, android, gnueabi, ...etc) into<br>
>> > Triple::EnvironmentType.<br>
>> > Thus,<br>
>> > I believe it won't case backward compatibility issue.  :-)<br>
>> Ok. LGTM then :)<br>
>><br>
>> --<br>
>> With best regards, Anton Korobeynikov<br>
>> Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
</blockquote></div><br>