mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
![]() The test case in the previous commit was invalid. The test case did not modify the binding that was referenced by the name and it was checking for the wrong binding after reading the reference from the Database. Further, the test case had a hole where the type of binding that was being used happens to have same node type in both the C and C++ linkages. I've fixed the test case as follows: 1) The test type is now an enum which has a different nodeType in the C and C++ linkages. The test case will now be able to catch cases where the wrong linkage is used when reading the binding. 2) The test case now changes the name to reference a binding in a different linkage. This means the later code (in the test case) is expected to actually load a binding from a different linkage. 3) The test case now checks that the loaded binding really did come from the other linkage. The previous implementation of the test case was using the wrong binding for the checks. I've also updated the implementation so that the updated test case passes. As an aside, during this update we (Doug and I) noticed that PDOMNames unnecessarily store a PDOMLinkage. Bindings come from languages, and therefore need a PDOMLinkage (so that the proper type can be loaded). Names reference bindings and therefore should not have a linkage. The motivating example is that there should be one binding for the printf function, but it could be referenced using names that are created by different parsers. This can be fixed in a later change. The major change to implementation is that PDOMNode now stores an identifier for the factory to use when loading the node. PDOMNode was already using an int to store the nodeType. I've split this to store the factoryId as a short and the nodeType as a short. The highest nodeType currently in use is 58 -- a short should provide ample room for expansion. Since PDOMNode is now able to pick the proper factory for loading, we no longer need the PDOMLinkage.getNode(long) method and I've marked it deprecated. Instead there is a new method PDOMNode.load(PDOM, long). Nodes read their factoryId from the database, so the PDOMLinkage is not needed. Later commits should cleanup the following: a) Remove PDOMLinkage from PDOMNode (and related) b) Change return type of PDOMNode.getNodeType to short c) Replace deprecated calls to PDOMLinkage.getNode Among these changes, (a) should allow removal of the external references list. If names can be loaded without a linkage, then there would be no reason to store the linkage when storing the name. Change-Id: Ife2b21cb21ed1ac6d6c361d0ffb8c7434832c79c Signed-off-by: Andrew Eidsness <eclipse@jfront.com> Reviewed-on: https://git.eclipse.org/r/19377 Tested-by: Hudson CI Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> |
||
---|---|---|
.. | ||
org.eclipse.cdt.alltests | ||
org.eclipse.cdt.core | ||
org.eclipse.cdt.core.aix | ||
org.eclipse.cdt.core.linux | ||
org.eclipse.cdt.core.linux.ia64 | ||
org.eclipse.cdt.core.linux.ppc | ||
org.eclipse.cdt.core.linux.ppc64 | ||
org.eclipse.cdt.core.linux.x86 | ||
org.eclipse.cdt.core.linux.x86_64 | ||
org.eclipse.cdt.core.macosx | ||
org.eclipse.cdt.core.qnx | ||
org.eclipse.cdt.core.solaris | ||
org.eclipse.cdt.core.tests | ||
org.eclipse.cdt.core.win32 | ||
org.eclipse.cdt.core.win32.x86 | ||
org.eclipse.cdt.core.win32.x86_64 | ||
org.eclipse.cdt.ui | ||
org.eclipse.cdt.ui.tests |