This is a followup to D152999. I don't believe this flag is needed anymore now that the recursion detection is gone. We have separate mechanisms (UpdateCompletedType, RefreshTypeCacheForClass) to deal with incomplete types and similar.
Diff Detail
Unit Tests
Event Timeline
The following miscompiles with this patch:
struct S; extern S a[10]; S(*b)[10] = &a; struct S{int x;}; int f() { return a[3].x; }
The following also behaves a bit strangely:
struct S; void f(S); void (*ff)(S) = &f; struct S {int x;}; void f2(S); void (*ff2)(S) = &f2;
With your patch, the signature of f2() changes. Granted, not sure how important that is; with opaque pointers, we don't actually use the signatures of function declarations for anything.
clang/lib/CodeGen/CodeGenTypes.cpp | ||
---|---|---|
272 | FunctionsBeingProcessed can probably also be killed off? With opaque pointers, a function signature can never refer to another function type. (Only calls and functions declarations involve function types.) |
I've added the first test case in https://github.com/llvm/llvm-project/commit/e98cbb95b8b96d3908a808bbcd639680a5197428, to make sure this doesn't regress.
Going to abandon this patch, as we clearly can't drop SkippedLayout, or at least not entirely.
We can probably make this a bit more readable/efficient by adding a mechanism for function/array types similar to RecordsWithOpaqueMemberPointers.
FunctionsBeingProcessed can probably also be killed off? With opaque pointers, a function signature can never refer to another function type. (Only calls and functions declarations involve function types.)