Page MenuHomePhabricator

Sema: Properly perform lookup when acting on fields for desig inits

Authored by majnemer on Aug 9 2014, 8:13 PM.



Clang used a custom implementation of lookup when handling designated
initializers. The custom code was not particularly optimized and relied
on standard lookup for typo-correction anyway.

This custom code has to go, it doesn't properly support MSVC-style
anonymous structs embedded inside other records; replace it with the
typo-correction path.

This has the side effect of speeding up semantic handling of the fields
for a designated initializer while simplifying the code at the same

This fixes PR20573.

Diff Detail

Event Timeline

majnemer updated this revision to Diff 12329.Aug 9 2014, 8:13 PM
majnemer retitled this revision from to Sema: Properly perform lookup when acting on fields for desig inits.
majnemer updated this object.
majnemer added a reviewer: rsmith.
majnemer added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Aug 9 2014, 10:16 PM

This looks to be unreachable now.

I think you should rearrange this a little: if lookup found something, but didn't find a field, then issue this diagnostic. Otherwise, fall through to here and do typo correction.


This comment doesn't make sense any more.

majnemer updated this revision to Diff 12342.Aug 11 2014, 1:20 AM
  • Address review comments
rsmith accepted this revision.Aug 11 2014, 11:03 AM
rsmith edited edge metadata.



Assign directly to KnownField here and remove ReplacementField.


Maybe else?

This revision is now accepted and ready to land.Aug 11 2014, 11:03 AM
majnemer closed this revision.Aug 11 2014, 11:43 AM
majnemer updated this revision to Diff 12360.

Closed by commit rL215372 (authored by @majnemer).