ispc/ispc — pull request #777 by ifilippov (2014-04-02 12:03:55+00:00)
Title: Fix of debug_info

These changes fix problem with debug info in LLVM 3.4 with structs and enums.

The reason of problem is that ISPC generates debugInfo type of struct (or enum)
in the scope, where the variable of this type appears.

Ctx.cpp:1586
llvm::DIScope scope = GetDIScope();
llvm::DIType diType = sym->type->GetDIType(scope);

It is always Lexical_Block in some function. It is not right because type can
be declared global or in some function or in some namespace. Struct and enums
are failing because they don't reduce to atomic types. The "Big" fix is to save
declaration place in Type class. But now ISPC doesn't know about it,
for example this doesn't emit an error:

void function_1() { struct Foo {float x;}; uniform Foo myFoo;}
void function_2() { uniform Foo myFoo;}

So now all type declarations are global and we can simply change scope
parameter to the current file.

The "Big" fix will be after integration with clang.