Skip to content

Quadratic scaling in processing of designated initializers #136568

@amonakov

Description

@amonakov
printf 'x(%d)\n' $(seq 10000) > x10000.h
struct S {
#define x(n) int m##n;
#include "x10000.h"
#undef x
} s = {
#define x(n) .m##n = n,
#include "x10000.h"
#undef x
};

needs more than a second to compile, and scales quadratically with the number of fields. perf report shows 42% in CheckDesignatedInitializer, 34% in CheckStructUnionTypes and 17.5% in FieldDecl::getCanonicalDecl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"slow-compile

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions