[llvm-commits] [llvm-gcc-4.2] r60908 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-debug.cpp llvm-debug.h llvm-linker-hack.cpp

Evan Cheng echeng at apple.com
Thu Dec 11 19:10:27 PST 2008


Awesome! Is it all done now?

On Dec 11, 2008, at 3:22 PM, Devang Patel wrote:

>  // Check to see if the compile unit already has created this type.
> -  TypeDesc *Slot = TypeCache[type];
> -  if (Slot && !(Slot->isForwardDecl() && TYPE_SIZE(type) != 0))
> -    // FIXME: If previously created type is just a forward  
> declaration, emit
> -    // a new descriptor for the type definition. The correct fix is  
> to *fix*
> -    // up the llvm ir (since MMI may have already been converted to  
> llvm). But
> -    // that's correctly not doable. We'll fix this when we convert  
> to the new
> -    // API in DebugInfo.h
> +  DIType &Slot = TypeCache[type];
> +  if (!Slot.isNull())
>     return Slot;

How do you solve this? It's a type that was previously a forward  
declaration but it's now defined:

struct ST;

void foo(struct ST *x) {
}

struct ST {
   int a;
};

typedef struct ST STtype;
STtype X;

void bar() {
   X.a = 1;
}

Evan



More information about the llvm-commits mailing list