mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Cosmetics.
Change-Id: Ie36a0936b72f053fe557b4ae6e57bf52ee4aa8f4
This commit is contained in:
parent
f1bcff300c
commit
744765be6f
12 changed files with 35 additions and 32 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2010 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2015 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
|
||||
|
@ -18,7 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
|||
* This interface represents a class template partial specialization. A partial specialization is
|
||||
* a class template in its own right.
|
||||
*
|
||||
* e.g.:
|
||||
* E.g.:
|
||||
* template <class T> class A {}; // the primary class template
|
||||
* template <class T> class A<T*> {}; // a partial specialization of the primary class template
|
||||
*
|
||||
|
@ -26,10 +26,14 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
|||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface ICPPClassTemplatePartialSpecialization extends ICPPClassTemplate {
|
||||
public static final ICPPClassTemplatePartialSpecialization[] EMPTY_PARTIAL_SPECIALIZATION_ARRAY = {};
|
||||
/** @since 5.12 */
|
||||
public static final ICPPClassTemplatePartialSpecialization[] EMPTY_ARRAY = {};
|
||||
/** @deprecated Use {@link #EMPTY_ARRAY} */
|
||||
@Deprecated
|
||||
public static final ICPPClassTemplatePartialSpecialization[] EMPTY_PARTIAL_SPECIALIZATION_ARRAY = EMPTY_ARRAY;
|
||||
|
||||
/**
|
||||
* Returns the ICPPTemplateDefinition which this is a specialization of
|
||||
* Returns the ICPPTemplateDefinition which this is a specialization of.
|
||||
*/
|
||||
public ICPPClassTemplate getPrimaryClassTemplate();
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public class CPPClassTemplatePartialSpecializationSpecialization extends CPPClas
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -202,7 +202,7 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,7 +51,7 @@ public class CPPTemplateTemplateParameterSpecialization extends CPPTemplateParam
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,11 +49,11 @@ public class CompositeCPPClassTemplate extends CompositeCPPClassType
|
|||
}
|
||||
|
||||
return ArrayUtil.addAll(
|
||||
ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY,
|
||||
ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY,
|
||||
cf.getCompositeBindings(preresult));
|
||||
} catch (CoreException ce) {
|
||||
CCorePlugin.log(ce);
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class CompositeCPPClassTemplatePartialSpecializationSpecialization extend
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -102,7 +102,7 @@ public class CompositeCPPTemplateTemplateParameter extends CompositeCPPBinding
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||
|
||||
|
@ -16,12 +16,11 @@ import org.eclipse.cdt.internal.core.pdom.dom.IPDOMBinding;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
/**
|
||||
* Interface for partial specializations in the pdom.
|
||||
* Interface for partial specializations in the PDOM.
|
||||
*/
|
||||
interface IPDOMPartialSpecialization extends ICPPClassTemplatePartialSpecialization, IPDOMBinding {
|
||||
|
||||
/**
|
||||
* Allows for setting the arguments after the binding has been added to the pdom.
|
||||
* Allows for setting the arguments after the binding has been added to the PDOM.
|
||||
*/
|
||||
void setArguments(ICPPTemplateArgument[] args) throws CoreException;
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType
|
|||
return partials.toArray(new ICPPClassTemplatePartialSpecialization[partials.size()]);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class PDOMCPPClassTemplatePartialSpecializationSpecialization extends PDOMCPPCla
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
public PDOMCPPClassTemplatePartialSpecializationSpecialization getNextPartial() throws CoreException {
|
||||
|
|
|
@ -255,17 +255,17 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
fReturnExpression);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ConfigureFunctionSpecialization implements Runnable {
|
||||
private final PDOMCPPFunctionSpecialization fSpec;
|
||||
private final PDOMCPPFunctionSpecialization fSpec;
|
||||
private final ICPPEvaluation fReturnExpression;
|
||||
|
||||
|
||||
public ConfigureFunctionSpecialization(ICPPFunction original, PDOMCPPFunctionSpecialization spec) {
|
||||
fSpec = spec;
|
||||
fReturnExpression = CPPFunction.getReturnExpression(original);
|
||||
postProcesses.add(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
fSpec.initData(fReturnExpression);
|
||||
|
@ -328,29 +328,29 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
fTemplate.initData(fOriginalAliasedType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ConfigureInstance implements Runnable {
|
||||
PDOMCPPSpecialization fInstance;
|
||||
|
||||
|
||||
public ConfigureInstance(PDOMCPPSpecialization specialization) {
|
||||
fInstance = specialization;
|
||||
postProcesses.add(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
fInstance.storeTemplateParameterMap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ConfigureClassInstance implements Runnable {
|
||||
PDOMCPPClassInstance fClassInstance;
|
||||
|
||||
|
||||
public ConfigureClassInstance(PDOMCPPClassInstance classInstance) {
|
||||
fClassInstance = classInstance;
|
||||
postProcesses.add(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
fClassInstance.storeTemplateArguments();
|
||||
|
@ -368,7 +368,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
IBinding binding = name.resolveBinding();
|
||||
|
||||
PDOMBinding pdomBinding = addBinding(binding, name);
|
||||
|
||||
|
||||
// Some nodes schedule some of their initialization to be done
|
||||
// after the binding has been added to the PDOM, to avoid
|
||||
// infinite recursion. We run those post-processes now.
|
||||
|
@ -382,7 +382,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
addImplicitMethods(pdomBinding, (ICPPClassType) binding, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Some of the nodes created during addImplicitMethods() can
|
||||
// also schedule post-processes, so we need to run through
|
||||
// them again.
|
||||
|
@ -588,7 +588,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
binding = ((ICPPSpecialization) binding).getSpecializedBinding();
|
||||
}
|
||||
if (binding instanceof ICPPClassTemplatePartialSpecialization) {
|
||||
// A class template partial specialization inherits the visibility of its primary class template.
|
||||
// A class template partial specialization inherits the visibility of its primary class template.
|
||||
binding = ((ICPPClassTemplatePartialSpecialization) binding).getPrimaryClassTemplate();
|
||||
}
|
||||
if (binding instanceof ICPPAliasTemplateInstance) {
|
||||
|
@ -665,7 +665,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
ICPPClassTemplate primarySpec = partialSpecSpec.getPrimaryClassTemplate();
|
||||
PDOMBinding pdomPrimarySpec = addBinding(primarySpec, null);
|
||||
if (pdomPrimarySpec instanceof PDOMCPPClassTemplateSpecialization) {
|
||||
result= new PDOMCPPClassTemplatePartialSpecializationSpecialization(this, parent, orig,
|
||||
result= new PDOMCPPClassTemplatePartialSpecializationSpecialization(this, parent, orig,
|
||||
partialSpecSpec, (PDOMCPPClassTemplateSpecialization) pdomPrimarySpec);
|
||||
}
|
||||
} else if (special instanceof ICPPConstructor) {
|
||||
|
|
|
@ -266,7 +266,7 @@ public class PDOMCPPTemplateTemplateParameter extends PDOMCPPBinding
|
|||
|
||||
@Override
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue