Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Applied [HEAD] Re: type cache fix for 69872


I cannot apply this to 2.0.1 yet until I push the parser performance work in the next couple of weeks.  
Be sure to ping me again if I forget to move this as well.

JohnC
www.eclipse.org/cdt


Chris Wiebe <cwiebe@xxxxxxx> wrote on 07/22/2004 01:24:26 PM:

> That actually was a .txt attachment.  Hoda has had the same problem with
> text attachments getting inlined for some reason - apparently it's a
> notes server configuration issue?  Pretty sure it's not on my end (using
> Thunderbird) since I've had no trouble sending patches to others.
>
> Resending as a zip.
>
> -Chris
>
>
> John Camelon wrote:
>
> >
> > Please send me the patch as an attachment, things get screwed up here in
> > Lotus-notes land.
> >
> > Thanks
> > JohnC
> > www.eclipse.org/cdt
> >
> > Chris Wiebe <cwiebe@xxxxxxx> wrote on 07/22/2004 10:16:40 AM:
> >
> >  > This updates the type cache to use the new IParser.cancel() mechanism.
> >  >
> >  > John, can you make sure this gets applied to HEAD and 2.0.1 as
> > appropriate?
> >  >
> >  > Thanks
> >  > -Chris
> >  >
> >  > Index:
> > browser/org/eclipse/cdt/internal/core/browser/cache/TypeParser.java
> >  > ===================================================================
> >  > RCS file: /home/tools/org.eclipse.cdt.
> >  >
> > core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeParser.java,v
> >  > retrieving revision 1.10
> >  > diff -u -r1.10 TypeParser.java
> >  > --- browser/org/eclipse/cdt/internal/core/browser/cache/TypeParser.
> >  > java   21 Jul 2004 17:57:56 -0000   1.10
> >  > +++ browser/org/eclipse/cdt/internal/core/browser/cache/TypeParser.
> >  > java   22 Jul 2004 14:06:33 -0000
> >  > @@ -121,6 +121,7 @@
> >  >     private ITypeInfo fSuperTypeToFind;
> >  >     private Set fProcessedTypes = new HashSet();
> >  >     private boolean fFoundType;
> >  > +   IParser fParser = null;
> >  >  
> >  >     public TypeParser(ITypeCache typeCache, IWorkingCopyProvider
> > provider) {
> >  >        fTypeCache = typeCache;
> >  > @@ -501,8 +502,8 @@
> >  >           fProgressMonitor = progressMonitor;
> >  >           IScanner scanner = ParserFactory.createScanner(reader,
> > scanInfo,
> >  >                 ParserMode.STRUCTURAL_PARSE, language, this,
> >  > ParserUtil.getScannerLogService(), null);
> >  > -         IParser parser = ParserFactory.createParser(scanner, this,
> >  > ParserMode.STRUCTURAL_PARSE, language, ParserUtil.getParserLogService());
> >  > -         parser.parse();
> >  > +         fParser = ParserFactory.createParser(scanner, this,
> >  > ParserMode.STRUCTURAL_PARSE, language, ParserUtil.getParserLogService());
> >  > +         fParser.parse();
> >  >        } catch (ParserFactoryError e) {
> >  >           CCorePlugin.log(e);
> >  >        } catch (ParseError e) {
> >  > @@ -514,6 +515,7 @@
> >  >           CCorePlugin.log(e);
> >  >        } finally {
> >  >           fProgressMonitor = null;
> >  > +         fParser = null;
> >  >        }
> >  >     }
> >  >  
> >  > @@ -770,14 +772,16 @@
> >  >              if ((fTypeToFind.getCElementType() == nodeInfo.type ||
> >  > fTypeToFind.isUndefinedType()) && nodeInfo.name.equals(fTypeToFind.
> >  > getName())) {
> >  >                 QualifiedTypeName qualifiedName = new
> >  > QualifiedTypeName(nodeInfo.name, nodeInfo.enclosingNames);
> >  >                 if (qualifiedName.equals(fTypeToFind.
> >  > getQualifiedTypeName())) {
> >  > -                  fFoundType = true;
> >  > -
> >  >                    // add types to cache
> >  >                    ITypeInfo newType = addType(nodeInfo.type,
> >  > qualifiedName, originalLocation, resolvedLocation);
> >  >                    if (newType != null && node instanceof
> >  > IASTClassSpecifier) {
> >  >                       addSuperClasses(newType, (IASTClassSpecifier)
> >  > node, originalLocation, fProcessedTypes);
> >  >                    }
> >  >                    fProgressMonitor.worked(1);
> >  > +
> >  > +                  fFoundType = true;
> >  > +                  // terminate the parser
> >  > +                  fParser.cancel();
> >  >                 }
> >  >              }
> >  >           } else {
> >  > @@ -896,17 +900,5 @@
> >  >      */
> >  >     public CodeReader createReader(String finalPath, Iterator
> > workingCopies) {
> >  >        return ParserUtil.createReader(finalPath, workingCopies);
> >  > -   }
> >  > -
> >  > -   /* (non-Javadoc)
> >  > -    * @see org.eclipse.cdt.core.parser.
> >  > ISourceElementRequestor#parserTimeout()
> >  > -    */
> >  > -   public boolean parserTimeout() {
> >  > -      //TODO - Chris Wiebe - Need to resturcture how you cancel the
> >  > parser now that
> >  > -      //IParser.cancel() is available, this method is no longer
> > being called.
> >  > -      if (fFoundType || fProgressMonitor.isCanceled())
> >  > -         return true;
> >  > -
> >  > -      return false;
> >  >     }
> >  >  }
> [attachment "TypeParser-org.eclipse.cdt.core-patch.zip" deleted by
> John Camelon/Ottawa/IBM]

Back to the top