Better documentation / restrictions on enum values for Declaration IDs

David Nolden zwabel at googlemail.com
Mon Jun 14 13:20:21 UTC 2010


Yes I guess we should document it. However clashing IDs should lead to
an assertion very early, in the exact moment that the declaration is
registered to the DUChain (which usually is done during static
initialization), so at least the problem is not hard to debug.

The problem is that, for efficiency reasons, the values shouldn't
become too high, as currently KDevelop uses a simple array to map
declaration-ids to their factories, and using something slower like a
hash-map in that very frequently accessed place would suck.

So maybe we should just enumerate all the languages that come into our
mind, and give each language a range of 10 IDs. Should it ever be
required, we can then assign additional ranges, but we should manage
them centrally to prevent clashes.




More information about the KDevelop-devel mailing list