mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
add IScope.flushCache()
This commit is contained in:
parent
a88eb122a2
commit
b3cfc78c05
9 changed files with 44 additions and 4 deletions
|
@ -100,4 +100,10 @@ public interface IScope {
|
|||
* @return
|
||||
*/
|
||||
public boolean isFullyCached() throws DOMException;
|
||||
|
||||
/**
|
||||
* clear the name cache in this scope
|
||||
* @throws DOMException
|
||||
*/
|
||||
public void flushCache() throws DOMException;
|
||||
}
|
||||
|
|
|
@ -187,4 +187,7 @@ public class ProblemBinding implements IProblemBinding, IType, IScope {
|
|||
public boolean isSameType( IType type ) {
|
||||
return type == this;
|
||||
}
|
||||
|
||||
public void flushCache() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,4 +198,10 @@ public class CScope implements ICScope {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void flushCache() {
|
||||
bindings[0].clear();
|
||||
bindings[1].clear();
|
||||
isFullyCached = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -233,4 +233,10 @@ public class CPPClassInstanceScope implements ICPPClassScope {
|
|||
|
||||
isFullyCached = false;
|
||||
}
|
||||
|
||||
public void flushCache() {
|
||||
if( bindings != null )
|
||||
bindings.clear();
|
||||
isFullyCached = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -263,4 +263,14 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
|
|||
super.removeBinding( binding );
|
||||
}
|
||||
}
|
||||
|
||||
public void flushCache() {
|
||||
constructorNames.clear();
|
||||
for( int i = constructorBindings.size() - 1; i >= 0; i-- ){
|
||||
IBinding binding = (IBinding) constructorBindings.keyAt(i);
|
||||
if( !(binding instanceof CPPImplicitConstructor) )
|
||||
constructorBindings.remove( binding );
|
||||
}
|
||||
super.flushCache();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,4 +123,9 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void flushCache() {
|
||||
labels.clear();
|
||||
super.flushCache();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
*/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||
|
@ -46,7 +45,7 @@ public class CPPNamespaceScope extends CPPScope implements ICPPNamespaceScope{
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPScope#getScopeName()
|
||||
*/
|
||||
public IASTName getScopeName() throws DOMException {
|
||||
public IASTName getScopeName() {
|
||||
IASTNode node = getPhysicalNode();
|
||||
if( node instanceof ICPPASTNamespaceDefinition ){
|
||||
return ((ICPPASTNamespaceDefinition)node).getName();
|
||||
|
|
|
@ -173,4 +173,10 @@ abstract public class CPPScope implements ICPPScope{
|
|||
public IBinding[] find(String name) throws DOMException {
|
||||
return CPPSemantics.findBindings( this, name, false );
|
||||
}
|
||||
|
||||
public void flushCache() {
|
||||
isfull = false;
|
||||
if( bindings != null )
|
||||
bindings.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
*/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||
|
@ -35,7 +34,7 @@ public class CPPTemplateScope extends CPPScope implements ICPPTemplateScope {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope#getTemplateDefinition()
|
||||
*/
|
||||
public ICPPTemplateDefinition getTemplateDefinition() throws DOMException {
|
||||
public ICPPTemplateDefinition getTemplateDefinition() {
|
||||
// if( primaryDefinition == null ){
|
||||
// //primaryDefinition = CPPTemplates.getTemplateDefinition( this );
|
||||
// ICPPASTTemplateDeclaration template = (ICPPASTTemplateDeclaration) getPhysicalNode();
|
||||
|
|
Loading…
Add table
Reference in a new issue