Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 162217

Summary: change PDOM binding records to be constructed from binding objects not the AST
Product: [Tools] CDT Reporter: Andrew Ferguson <andrew.ferguson>
Component: cdt-coreAssignee: Project Inbox <cdt-core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cdtdoug, mschorn.eclipse
Version: 4.0   
Target Milestone: 4.0 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
have pdom records constructed from bindings, rather than AST information cdtdoug: iplog+

Description Andrew Ferguson CLA 2006-10-25 10:06:47 EDT
hi,
 
 I'd like to have change the PDOMBinding subclass constructors work only from a corresponding IBinding rather than look at the AST. The motivations are

(1) For adding a binding to a pdom that mirrors a binding in another pdom (offline/composite indexes)
(2) For allowing out-of-order name addition to the PDOM. (This is where names from a source file are added /before/ names from a header included at the start of the source TU)

I've got this working locally, and will post a patch shortly, but was not sure if there are any reasons not to do this?

thanks,
Andrew
Comment 1 Markus Schorn CLA 2006-10-25 11:58:40 EDT
I don't see a problem with that.
Comment 2 Andrew Ferguson CLA 2006-10-26 06:24:31 EDT
Created attachment 52729 [details]
have pdom records constructed from bindings, rather than AST information

please find attached a patch for making these changes. I've re-run the unit tests and they are all passing. I've returned the overloadesWithinCommonHeader tests to be non-failing.

This patch is enough to partially address out-of-order name addition to the pdom. You can divide out-of-order name addition in to two parts
 (i) out-of-order within a contributing-part of a translation unit (i.e. dividing the final TU into its source and header parts)
 (ii) out-of-order between contributing-parts (but in AST occurrence order within the contributing-parts)

This patch fixes (ii). For example, previously when a reference to a resolved function was used as the basis of constructing a PDOMCPPFunction object, since the AST context was not a declaration, parameter information was skipped. This meant that everytime that function was met (as a reference), the search would not find it and a new record was added to the pdom.
Comment 3 Markus Schorn CLA 2006-10-27 06:03:56 EDT
Thanks Andrew, I have applied the patch.
fixed in 4.0 > 20061027