<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 19, 2010, at 10:53 AM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 19, 2010, at 10:16 AM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: fjahanian<br>Date: Fri Nov 19 12:16:46 2010<br>New Revision: 119813<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=119813&view=rev">http://llvm.org/viewvc/llvm-project?rev=119813&view=rev</a><br>Log:<br>objc_msgSend is not a builtin type in non-objc mode.<br>Fixes //rdar://8686888<br><br>Added:<br>    cfe/trunk/test/SemaCXX/builtin_objc_msgSend.cpp<br>Modified:<br>    cfe/trunk/lib/Sema/SemaExpr.cpp<br><br>Modified: cfe/trunk/lib/Sema/SemaExpr.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=119813&r1=119812&r2=119813&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=119813&r1=119812&r2=119813&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Nov 19 12:16:46 2010<br>@@ -4295,8 +4295,13 @@<br>     if (CheckFunctionCall(FDecl, TheCall))<br>       return ExprError();<br><br>-    if (unsigned BuiltinID = FDecl->getBuiltinID())<br>-      return CheckBuiltinFunctionCall(BuiltinID, TheCall);<br>+    if (unsigned BuiltinID = FDecl->getBuiltinID()) {<br>+      // When not in Objective-C mode, there is no builtin 'id' type.<br>+      // We won't have pre-defined library functions which use this type.<br>+      if (getLangOptions().ObjC1 ||<br>+          Context.BuiltinInfo.GetTypeString(BuiltinID)[0] != 'G')<br>+        return CheckBuiltinFunctionCall(BuiltinID, TheCall);<br>+    }<br>   } else if (NDecl) {<br>     if (CheckBlockCall(NDecl, TheCall))<br>       return ExprError();<br></div></blockquote></div><br><div>This feels a little hackish; could we instead mark this as an Objective-C-specific builtin, e.g., by extending Builtins.def? The best approach would be to have some kind of language flags for LIBBUILTIN/BUILTIN, as we do for language keywords, e.g.,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">LIBBUILTIN(objc_msgSend, </span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><span style="color: #d02f1b">"GGH."</span></span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">,   </span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><span style="color: #d02f1b">"f"</span></span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">,     </span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><span style="color: #d02f1b">"objc/message.h", KEYOBJC</span></span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">)</span></div></div></blockquote><div><br></div>It is in r120429. Thanks for good feedbacks.</div><div><br></div><div>- Fariborz</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></div></blockquote></div><br></body></html>