MCPcopy Create free account
hub / github.com/KDE/kdevelop / applySpecialization

Method applySpecialization

kdevplatform/language/duchain/specializationstore.cpp:55–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55Declaration* SpecializationStore::applySpecialization(Declaration* declaration, TopDUContext* source,
56 bool recursive)
57{
58 if (!declaration)
59 return nullptr;
60
61 IndexedInstantiationInformation specialization = get(declaration->id());
62 if (specialization.index())
63 return declaration->specialize(specialization, source);
64
65 if (declaration->context() && recursive) {
66 //Find a parent that has a specialization, and specialize this with the info and required depth
67 int depth = 0;
68 DUContext* ctx = declaration->context();
69 IndexedInstantiationInformation specialization;
70 while (ctx && !specialization.index()) {
71 if (ctx->owner())
72 specialization = get(ctx->owner()->id());
73 ++depth;
74 ctx = ctx->parentContext();
75 }
76
77 if (specialization.index())
78 return declaration->specialize(specialization, source, depth);
79 }
80
81 return declaration;
82}
83
84DUContext* SpecializationStore::applySpecialization(DUContext* context, TopDUContext* source,
85 bool recursive)

Callers 2

Calls 7

idMethod · 0.45
indexMethod · 0.45
specializeMethod · 0.45
contextMethod · 0.45
ownerMethod · 0.45
parentContextMethod · 0.45
internalContextMethod · 0.45

Tested by

no test coverage detected