[cfe-commits] r66010 - /cfe/trunk/lib/CodeGen/CGDecl.cpp

Daniel Dunbar daniel at zuster.org
Sat Mar 14 23:18:00 PDT 2009


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?

 - Daniel

On Tue, Mar 3, 2009 at 9:23 PM, Eli Friedman <eli.friedman at gmail.com> wrote:

> Author: efriedma
> Date: Tue Mar  3 22:22:58 2009
> New Revision: 66010
>
> URL: http://llvm.org/viewvc/llvm-project?rev=66010&view=rev
> Log:
> Comment fix: change a question to an answer.
>
>
> Modified:
>    cfe/trunk/lib/CodeGen/CGDecl.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=66010&r1=66009&r2=66010&view=diff
>
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Mar  3 22:22:58 2009
> @@ -127,11 +127,9 @@
>         GenerateStaticCXXBlockVarDeclInit(D, GV);
>     } else {
>       // The initializer may differ in type from the global. Rewrite
> -      // the global to match the initializer!?
> -      //
> -      // FIXME: This matches what we have been doing historically, but
> -      // it seems bad. Shouldn't the init expression have the right
> -      // type?
> +      // the global to match the initializer.  (We have to do this
> +      // because some types, like unions, can't be completely represented
> +      // in the LLVM type system.)
>       if (GV->getType() != Init->getType()) {
>         llvm::GlobalVariable *OldGV = GV;
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090314/48250554/attachment.html>


More information about the cfe-commits mailing list