clspv icon indicating copy to clipboard operation
clspv copied to clipboard

Assertion in clang when referring to a structure type that doesn't exist

Open kpet opened this issue 6 years ago • 5 comments

Trying to compile the following code:

kernel void test(global struct nope* arg) {}

leads to the following assertion

clspv: clspv/third_party/clang/lib/AST/RecordLayoutBuilder.cpp:2987: const clang::ASTRecordLayout& clang::ASTContext::getASTRecordLayout(const clang::RecordDecl*) const: Assertion `D && "Cannot get layout of forward declarations!"' failed.
Abandon

kpet avatar Apr 01 '19 18:04 kpet

This is coming from the layout checks in the frontend. If I remove those clspv aborts later in the flow.

alan-baker avatar Apr 01 '19 19:04 alan-baker

Still failing here. Why did you close this?

kpet avatar Mar 29 '23 09:03 kpet

hum, I was compiling with a clvk-like compile line, and it was not failing.

rjodinchr avatar Mar 29 '23 09:03 rjodinchr

This is passing compiling with clspv -rewrite-packed-structs

rjodinchr avatar Mar 29 '23 09:03 rjodinchr

This is because of the code in FrontendPlugin.cpp that is only checking the support for the layout when this pass is not used.

rjodinchr avatar Mar 29 '23 09:03 rjodinchr