<div dir="ltr"><div>@@ -929,9 +929,8 @@ static RValue EmitNewDeleteCall(CodeGenFunction &CGF,</div><div>   ///   to a replaceable global allocation function.</div><div>   ///</div><div>   /// We model such elidable calls with the 'builtin' attribute.</div>
<div>-  llvm::Function *Fn = dyn_cast<llvm::Function>(CalleeAddr);</div><div>   if (Callee->isReplaceableGlobalAllocationFunction() &&</div><div>-      Fn && Fn->hasFnAttribute(llvm::Attribute::NoBuiltin)) {</div>
<div>+      !Callee->hasAttr<AliasAttr>()) {</div><div><br></div>What's the purpose of this change? Was the previous code broken by deferring the emission of aliases?<div><br><div><br></div><div><div>+  llvm::GlobalValue *GV = dyn_cast<llvm::GlobalValue>(Aliasee);</div>
<div>+  if (!GV) {</div><div>+    llvm::ConstantExpr *CE = cast<llvm::ConstantExpr>(Aliasee);</div><div>+    GV = cast<llvm::GlobalValue>(CE->getOperand(0));</div><div><br></div><div>Hm, what kinds of ConstantExpr can appear here? This would be more self-documenting if you asserted that you'd got the right kind of ConstantExpr.</div>
</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 1:25 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The attached patch causes clang to reject alias attributes that point<br>
to undefined names. For example, with this patch we now reject<br>
<br>
void f1(void) __attribute__((alias("g1")));<br>
<br>
Unlike the previous patch this one is implemented in CodeGen. It is<br>
quiet a bit simpler. The downside is that the errors only fire during<br>
-emit-llvm.<br>
<br>
Cheers,<br>
Rafael<br>
<br>_______________________________________________<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></div>