1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Removes unnecessary code.

This commit is contained in:
Markus Schorn 2007-11-28 08:56:20 +00:00
parent a087fe8745
commit d658efa830
2 changed files with 8 additions and 11 deletions

View file

@ -50,7 +50,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionTryBlockDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
@ -288,8 +287,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
}
// skip the rest of this node if the selection is outside of its bounds
// TODO take out fix below for bug 86993 check for: !(node instanceof ICPPASTLinkageSpecification)
if (node instanceof ASTNode && !(node instanceof ICPPASTLinkageSpecification) &&
if (node instanceof ASTNode &&
offset > ((ASTNode)node).getOffset() + ((ASTNode)node).getLength())
return PROCESS_SKIP;
@ -299,8 +297,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
public int visit(IASTDeclaration declaration) {
// use declarations to determine if the search has gone past the offset (i.e. don't know the order the visitor visits the nodes)
// TODO take out fix below for bug 86993 check for: !(declaration instanceof ICPPASTLinkageSpecification)
if (declaration instanceof ASTNode && !(declaration instanceof ICPPASTLinkageSpecification) && ((ASTNode)declaration).getOffset() > offset)
if (declaration instanceof ASTNode && ((ASTNode)declaration).getOffset() > offset)
return PROCESS_ABORT;
return processNode(declaration);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2006 IBM Corporation and others.
* Copyright (c) 2005, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.cdt.ui.tests.DOMAST;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
@ -35,13 +37,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionTryBlockDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.parser.scanner2.LocationMap.ASTInclusionStatement;
import org.eclipse.core.runtime.IProgressMonitor;
/**
* @author dsteffle
@ -91,8 +92,7 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate
if (node == null) return new DOMASTNodeLeafContinue(null);
// only do length check for ASTNode (getNodeLocations on PreprocessorStatements is very expensive)
if (!(node instanceof ICPPASTLinkageSpecification) &&
node instanceof ASTNode && ((ASTNode)node).getLength() <= 0)
if (node instanceof ASTNode && ((ASTNode)node).getLength() <= 0)
return new DOMASTNodeLeafContinue(null);
DOMASTNodeParent parent = null;