Extension/replacement of PDOMCLinkage [message #1708011] |
Fri, 11 September 2015 12:52 |
|
I am currently trying to add support for resolving members of nested anonymous unions/structs (like supported by IAR compilers). The PDOMCLinkage already handles this case properly for members of top-level anonymous composite types within createBinding(PDOMNode, IBinding, long), where it adds respective bindings to the enclosing scope. However, it does not handle the case of members in nested anonymous composite types:
volatile union {
unsigned short a;
struct {
union {
unsigned short b;
};
union {
unsigned short c;
};
};
};
void Init(void) {
a = 1; // handled by PDOMCLinkage, thus resolvable
b = 2; // not handled by PDOMCLinkage, thus not resolvable
}
I could easily add support by adjusting the PDOMCLinkage to also handle the above case. However, registering an alternative IPDOMLinkageFactory for the "C" linkage via the extension point does not work (a contribution in a client bundle will be loaded first, so the contribution in org.eclipse.cdt.core will overwrite it).
As I already have created an own language, I also thought of defining an own linkage ID (and to register a modified PCOMCLinkage for that linkage ID). However, it seems such a linkage will never be considered by the index as PDOMManager has its own static list of linkages to use for the index (IDS_FOR_LINKAGES_TO_INDEX). Also the list of linkages defined in Linkage cannot be extended.
What would be the appropriate way to handle this case?
[Updated on: Fri, 11 September 2015 12:53] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02809 seconds