mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 20:15:22 +02:00
Cosmetics.
This commit is contained in:
parent
2050fe2bfb
commit
9827378be6
16 changed files with 156 additions and 157 deletions
|
@ -19,10 +19,10 @@
|
||||||
package org.eclipse.cdt.core.parser.tests.ast2;
|
package org.eclipse.cdt.core.parser.tests.ast2;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.parser.ParserLanguage.CPP;
|
import static org.eclipse.cdt.core.parser.ParserLanguage.CPP;
|
||||||
|
import static org.eclipse.cdt.core.parser.tests.VisibilityAsserts.assertVisibility;
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateType;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateType;
|
||||||
import static org.eclipse.cdt.core.parser.tests.VisibilityAsserts.assertVisibility;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.index.tests;
|
package org.eclipse.cdt.internal.index.tests;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||||
|
@ -65,9 +68,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for exercising resolution of template bindings against IIndex
|
* Tests for exercising resolution of template bindings against IIndex
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,8 +32,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
||||||
*/
|
*/
|
||||||
public class CPPClassTemplateSpecialization extends CPPClassSpecialization
|
public class CPPClassTemplateSpecialization extends CPPClassSpecialization
|
||||||
implements ICPPClassTemplate, ICPPInternalClassTemplate {
|
implements ICPPClassTemplate, ICPPInternalClassTemplate {
|
||||||
|
private ObjectMap instances;
|
||||||
private ObjectMap instances = null;
|
|
||||||
private ICPPDeferredClassInstance fDeferredInstance;
|
private ICPPDeferredClassInstance fDeferredInstance;
|
||||||
private ICPPClassTemplatePartialSpecialization[] fPartialSpecs;
|
private ICPPClassTemplatePartialSpecialization[] fPartialSpecs;
|
||||||
private ICPPTemplateParameter[] fTemplateParameters;
|
private ICPPTemplateParameter[] fTemplateParameters;
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
|
||||||
*/
|
*/
|
||||||
public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpecialization
|
public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpecialization
|
||||||
implements ICPPMethod {
|
implements ICPPMethod {
|
||||||
|
|
||||||
private ICPPTemplateParameter[] fTemplateParameters;
|
private ICPPTemplateParameter[] fTemplateParameters;
|
||||||
|
|
||||||
public CPPMethodTemplateSpecialization(ICPPMethod specialized, ICPPClassSpecialization owner,
|
public CPPMethodTemplateSpecialization(ICPPMethod specialized, ICPPClassSpecialization owner,
|
||||||
|
|
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
|
||||||
*/
|
*/
|
||||||
public class CPPTemplateNonTypeParameterSpecialization extends CPPTemplateParameterSpecialization
|
public class CPPTemplateNonTypeParameterSpecialization extends CPPTemplateParameterSpecialization
|
||||||
implements ICPPTemplateNonTypeParameter {
|
implements ICPPTemplateNonTypeParameter {
|
||||||
|
|
||||||
private final IType fType;
|
private final IType fType;
|
||||||
|
|
||||||
public CPPTemplateNonTypeParameterSpecialization(ICPPSpecialization owner, ICPPScope scope,
|
public CPPTemplateNonTypeParameterSpecialization(ICPPSpecialization owner, ICPPScope scope,
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
*/
|
*/
|
||||||
public abstract class CPPTemplateParameterSpecialization extends PlatformObject
|
public abstract class CPPTemplateParameterSpecialization extends PlatformObject
|
||||||
implements ICPPTemplateParameter, ICPPSpecialization {
|
implements ICPPTemplateParameter, ICPPSpecialization {
|
||||||
|
|
||||||
private final ICPPSpecialization fOwner;
|
private final ICPPSpecialization fOwner;
|
||||||
private final ICPPScope fScope;
|
private final ICPPScope fScope;
|
||||||
private final ICPPTemplateParameter fSpecialized;
|
private final ICPPTemplateParameter fSpecialized;
|
||||||
|
@ -126,5 +125,4 @@ public abstract class CPPTemplateParameterSpecialization extends PlatformObject
|
||||||
public boolean isParameterPack() {
|
public boolean isParameterPack() {
|
||||||
return fSpecialized.isParameterPack();
|
return fSpecialized.isParameterPack();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPFunctionParamet
|
||||||
* Assists in evaluating expressions.
|
* Assists in evaluating expressions.
|
||||||
*/
|
*/
|
||||||
public interface ICPPEvaluation extends ISerializableEvaluation {
|
public interface ICPPEvaluation extends ISerializableEvaluation {
|
||||||
|
public static final ICPPEvaluation[] EMPTY_ARRAY = {};
|
||||||
|
|
||||||
boolean isInitializerList();
|
boolean isInitializerList();
|
||||||
boolean isFunctionSet();
|
boolean isFunctionSet();
|
||||||
|
|
||||||
|
|
|
@ -2461,9 +2461,9 @@ public class CPPTemplates {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the template argument <code>arg</code> to match the parameter type
|
* Converts the template argument {@code arg} to match the parameter type {@code paramType}
|
||||||
* <code>paramType</code> or returns <code>null</code>, if this violates the rules
|
* or returns {@code null}, if this violates the rules specified in 14.3.2 - 5.
|
||||||
* specified in 14.3.2 - 5.
|
*
|
||||||
* @throws DOMException
|
* @throws DOMException
|
||||||
*/
|
*/
|
||||||
private static ICPPTemplateArgument convertNonTypeTemplateArgument(ICPPTemplateDefinition template,
|
private static ICPPTemplateArgument convertNonTypeTemplateArgument(ICPPTemplateDefinition template,
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
public EvalTypeId(IType type, IASTNode pointOfDefinition, ICPPEvaluation... arguments) {
|
public EvalTypeId(IType type, IASTNode pointOfDefinition, ICPPEvaluation... arguments) {
|
||||||
this(type, findEnclosingTemplate(pointOfDefinition), arguments);
|
this(type, findEnclosingTemplate(pointOfDefinition), arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) {
|
public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) {
|
||||||
super(templateDefinition);
|
super(templateDefinition);
|
||||||
fInputType= type;
|
fInputType= type;
|
||||||
|
@ -136,7 +137,8 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
marshalTemplateDefinition(buffer);
|
marshalTemplateDefinition(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ISerializableEvaluation unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
|
public static ISerializableEvaluation unmarshal(short firstBytes, ITypeMarshalBuffer buffer)
|
||||||
|
throws CoreException {
|
||||||
IType type= buffer.unmarshalType();
|
IType type= buffer.unmarshalType();
|
||||||
ICPPEvaluation[] args= null;
|
ICPPEvaluation[] args= null;
|
||||||
if ((firstBytes & ITypeMarshalBuffer.FLAG1) != 0) {
|
if ((firstBytes & ITypeMarshalBuffer.FLAG1) != 0) {
|
||||||
|
@ -146,7 +148,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
args[i]= (ICPPEvaluation) buffer.unmarshalEvaluation();
|
args[i]= (ICPPEvaluation) buffer.unmarshalEvaluation();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
args = new ICPPEvaluation[0]; // arguments must not be null
|
args = ICPPEvaluation.EMPTY_ARRAY; // arguments must not be null
|
||||||
}
|
}
|
||||||
IBinding templateDefinition= buffer.unmarshalBinding();
|
IBinding templateDefinition= buffer.unmarshalBinding();
|
||||||
return new EvalTypeId(type, templateDefinition, args);
|
return new EvalTypeId(type, templateDefinition, args);
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
private static final int BLOCKED_WRITE_LOCK_OUTPUT_INTERVAL = 30000;
|
private static final int BLOCKED_WRITE_LOCK_OUTPUT_INTERVAL = 30000;
|
||||||
private static final int LONG_WRITE_LOCK_REPORT_THRESHOLD = 1000;
|
private static final int LONG_WRITE_LOCK_REPORT_THRESHOLD = 1000;
|
||||||
private static final int LONG_READ_LOCK_WAIT_REPORT_THRESHOLD = 1000;
|
private static final int LONG_READ_LOCK_WAIT_REPORT_THRESHOLD = 1000;
|
||||||
static boolean sDEBUG_LOCKS= false; // initialized in the PDOMManager, because IBM needs PDOM independent of runtime plugin.
|
static boolean sDEBUG_LOCKS= false; // Initialized in the PDOMManager, because IBM needs PDOM independent of runtime plugin.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier for PDOM format
|
* Identifier for PDOM format
|
||||||
|
@ -239,6 +239,8 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
* 145.0 - Changed marshalling of CPPBasicType to store the associated numerical value, bug 407808.
|
* 145.0 - Changed marshalling of CPPBasicType to store the associated numerical value, bug 407808.
|
||||||
* 146.0 - Added visibility support on class type level, bug 402878.
|
* 146.0 - Added visibility support on class type level, bug 402878.
|
||||||
* #147.0# - Store whether function name is qualified in EvalFunctionSet, bug 408296. <<CDT 8.2>>
|
* #147.0# - Store whether function name is qualified in EvalFunctionSet, bug 408296. <<CDT 8.2>>
|
||||||
|
*
|
||||||
|
* CDT 8.3 development (versions not supported on the 8.2.x branch)
|
||||||
* 148.0 - Store specialized template parameters of class/function template specializations, bug 407497.
|
* 148.0 - Store specialized template parameters of class/function template specializations, bug 407497.
|
||||||
*/
|
*/
|
||||||
private static final int MIN_SUPPORTED_VERSION= version(148, 0);
|
private static final int MIN_SUPPORTED_VERSION= version(148, 0);
|
||||||
|
|
|
@ -44,7 +44,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
|
class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
|
||||||
implements ICPPClassTemplate, ICPPInstanceCache {
|
implements ICPPClassTemplate, ICPPInstanceCache {
|
||||||
|
|
||||||
private static final int TEMPLATE_PARAMS = PDOMCPPClassSpecialization.RECORD_SIZE;
|
private static final int TEMPLATE_PARAMS = PDOMCPPClassSpecialization.RECORD_SIZE;
|
||||||
|
|
||||||
@SuppressWarnings("hiding")
|
@SuppressWarnings("hiding")
|
||||||
|
@ -52,8 +51,8 @@ class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
|
||||||
|
|
||||||
private volatile IPDOMCPPTemplateParameter[] fTemplateParameters;
|
private volatile IPDOMCPPTemplateParameter[] fTemplateParameters;
|
||||||
|
|
||||||
public PDOMCPPClassTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent, ICPPClassTemplate template, PDOMBinding specialized)
|
public PDOMCPPClassTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent,
|
||||||
throws CoreException {
|
ICPPClassTemplate template, PDOMBinding specialized) throws CoreException {
|
||||||
super(linkage, parent, template, specialized);
|
super(linkage, parent, template, specialized);
|
||||||
computeTemplateParameters(template); // sets fTemplateParameters
|
computeTemplateParameters(template); // sets fTemplateParameters
|
||||||
final Database db = getDB();
|
final Database db = getDB();
|
||||||
|
@ -209,8 +208,8 @@ class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
|
||||||
|
|
||||||
private void computeTemplateParameters(ICPPClassTemplate originalTemplate) {
|
private void computeTemplateParameters(ICPPClassTemplate originalTemplate) {
|
||||||
try {
|
try {
|
||||||
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(), this,
|
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(),
|
||||||
originalTemplate.getTemplateParameters());
|
this, originalTemplate.getTemplateParameters());
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
fTemplateParameters = IPDOMCPPTemplateParameter.EMPTY_ARRAY;
|
fTemplateParameters = IPDOMCPPTemplateParameter.EMPTY_ARRAY;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX - Initial API and implementation
|
* QNX - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ class PDOMCPPConstructorTemplateSpecialization extends PDOMCPPMethodTemplateSpec
|
||||||
@SuppressWarnings("hiding")
|
@SuppressWarnings("hiding")
|
||||||
protected static final int RECORD_SIZE = PDOMCPPFunctionSpecialization.RECORD_SIZE + 0;
|
protected static final int RECORD_SIZE = PDOMCPPFunctionSpecialization.RECORD_SIZE + 0;
|
||||||
|
|
||||||
public PDOMCPPConstructorTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent, ICPPConstructor constructor, PDOMBinding specialized)
|
public PDOMCPPConstructorTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent,
|
||||||
throws CoreException {
|
ICPPConstructor constructor, PDOMBinding specialized) throws CoreException {
|
||||||
super(linkage, parent, constructor, specialized);
|
super(linkage, parent, constructor, specialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,9 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bryan Wilkinson
|
* @author Bryan Wilkinson
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class PDOMCPPMethodTemplateSpecialization extends
|
class PDOMCPPMethodTemplateSpecialization extends PDOMCPPFunctionTemplateSpecialization
|
||||||
PDOMCPPFunctionTemplateSpecialization implements ICPPMethod {
|
implements ICPPMethod {
|
||||||
|
|
||||||
private static final int TEMPLATE_PARAMS = PDOMCPPFunctionTemplateSpecialization.RECORD_SIZE;
|
private static final int TEMPLATE_PARAMS = PDOMCPPFunctionTemplateSpecialization.RECORD_SIZE;
|
||||||
|
|
||||||
@SuppressWarnings("hiding")
|
@SuppressWarnings("hiding")
|
||||||
|
@ -41,14 +39,15 @@ class PDOMCPPMethodTemplateSpecialization extends
|
||||||
|
|
||||||
private volatile IPDOMCPPTemplateParameter[] fTemplateParameters;
|
private volatile IPDOMCPPTemplateParameter[] fTemplateParameters;
|
||||||
|
|
||||||
public PDOMCPPMethodTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent, ICPPMethod method, PDOMBinding specialized)
|
public PDOMCPPMethodTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent,
|
||||||
throws CoreException {
|
ICPPMethod method, PDOMBinding specialized) throws CoreException {
|
||||||
super(linkage, parent, (ICPPFunctionTemplate) method, specialized);
|
super(linkage, parent, (ICPPFunctionTemplate) method, specialized);
|
||||||
computeTemplateParameters((ICPPFunctionTemplate) method); // sets fTemplateParameters
|
computeTemplateParameters((ICPPFunctionTemplate) method); // Sets fTemplateParameters
|
||||||
final Database db = getDB();
|
final Database db = getDB();
|
||||||
long rec = PDOMTemplateParameterArray.putArray(db, fTemplateParameters);
|
long rec = PDOMTemplateParameterArray.putArray(db, fTemplateParameters);
|
||||||
db.putRecPtr(record + TEMPLATE_PARAMS, rec);
|
db.putRecPtr(record + TEMPLATE_PARAMS, rec);
|
||||||
linkage.new ConfigureTemplateParameters(((ICPPFunctionTemplate) method).getTemplateParameters(), fTemplateParameters);
|
linkage.new ConfigureTemplateParameters(((ICPPFunctionTemplate) method).getTemplateParameters(),
|
||||||
|
fTemplateParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PDOMCPPMethodTemplateSpecialization(PDOMLinkage linkage, long bindingRecord) {
|
public PDOMCPPMethodTemplateSpecialization(PDOMLinkage linkage, long bindingRecord) {
|
||||||
|
@ -155,8 +154,8 @@ class PDOMCPPMethodTemplateSpecialization extends
|
||||||
|
|
||||||
private void computeTemplateParameters(ICPPFunctionTemplate originalMethodTemplate) {
|
private void computeTemplateParameters(ICPPFunctionTemplate originalMethodTemplate) {
|
||||||
try {
|
try {
|
||||||
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(), this,
|
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(),
|
||||||
originalMethodTemplate.getTemplateParameters());
|
this, originalMethodTemplate.getTemplateParameters());
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
fTemplateParameters = IPDOMCPPTemplateParameter.EMPTY_ARRAY;
|
fTemplateParameters = IPDOMCPPTemplateParameter.EMPTY_ARRAY;
|
||||||
|
|
Loading…
Add table
Reference in a new issue