I still don't completely get this. Can you show me an example? I haven't looked closely, but where are we accomodating for the mismatch when we lookup the global decl, and it doesn't have the type which matches the global type? Or does this just not matter in the cases where we do this?<br>
<br> - Daniel<br><br><div class="gmail_quote">On Tue, Mar 3, 2009 at 9:23 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Author: efriedma<br>
Date: Tue Mar  3 22:22:58 2009<br>
New Revision: 66010<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=66010&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=66010&view=rev</a><br>
Log:<br>
Comment fix: change a question to an answer.<br>
<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGDecl.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=66010&r1=66009&r2=66010&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=66010&r1=66009&r2=66010&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Mar  3 22:22:58 2009<br>
@@ -127,11 +127,9 @@<br>
         GenerateStaticCXXBlockVarDeclInit(D, GV);<br>
     } else {<br>
       // The initializer may differ in type from the global. Rewrite<br>
-      // the global to match the initializer!?<br>
-      //<br>
-      // FIXME: This matches what we have been doing historically, but<br>
-      // it seems bad. Shouldn't the init expression have the right<br>
-      // type?<br>
+      // the global to match the initializer.  (We have to do this<br>
+      // because some types, like unions, can't be completely represented<br>
+      // in the LLVM type system.)<br>
       if (GV->getType() != Init->getType()) {<br>
         llvm::GlobalVariable *OldGV = GV;<br>
<br>
<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>
</blockquote></div><br>