Bug 71530

Summary: [Scanner] CModel Line Numbers are incorrect w/Scanner2
Product: [Tools] CDT Reporter: John Camelon <john.camelon>
Component: cdt-parserAssignee: John Camelon <john.camelon>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: aniefer, dave.daoust
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description John Camelon CLA 2004-08-05 18:11:38 EDT
I'm raising this defect as a placeholder for the regression that our new 
Scanner migration has created.  

Both our CModelElementsTest (Quick & Structural) have the body of 
checkLineNumbers() commented out.  These tests fail regularily.
Comment 1 John Camelon CLA 2004-08-16 15:34:30 EDT
I haven't committed this fix yet, as it negatively affects performance.  

Attempt 1 (where we keep track of \n's throughout the scanner) yielded 
incorrect results.  

Attempt 2 (where we figure it out as we go without storing information) hurt 
our performance by an order of magnitude ... ~41 seconds to parse the trilogy. 

Attempt 3 (where we store some meta-data to help us take shortcuts in figuring 
out line numbers) yield 30% degradation over what is currently in 2.0.1 
branch/HEAD.  

I'll keep plowing away at this with further optimizations.  
Since we do not need line numbers for content assist, I plan to short-circuit 
this code in COMPLETION_PARSE mode.  The same can go for handleProblem() since 
Content Assist cares not for IProblem.  
Comment 2 John Camelon CLA 2004-08-16 15:58:01 EDT
I've managed to find a solution which adds only a couple of milliseconds 
overhead to parsing the trilogy.  

Fix applied to HEAD and 2_0 branch.