mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
8d580f3b98
commit
ee27356ecf
5 changed files with 32 additions and 40 deletions
|
@ -1,11 +1,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2009 IBM Corporation and others.
|
* Copyright (c) 2004, 2009 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
@ -18,22 +18,19 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class DOMException extends Exception {
|
public class DOMException extends Exception {
|
||||||
|
|
||||||
private static final long serialVersionUID = 0;
|
private static final long serialVersionUID = 0;
|
||||||
|
|
||||||
IProblemBinding problemBinding;
|
IProblemBinding problemBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param problem
|
* @param problem the binding for throwing
|
||||||
* binding for throwing
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public DOMException(IProblemBinding problem) {
|
public DOMException(IProblemBinding problem) {
|
||||||
problemBinding = problem;
|
problemBinding = problem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the problem associated w/this exception.
|
* Returns the problem associated w/this exception.
|
||||||
*
|
*
|
||||||
* @return problem
|
* @return problem
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2009 IBM Corporation and others.
|
* Copyright (c) 2004, 2009 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer (IBM) - Initial API and implementation
|
* Doug Schaefer (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
*/
|
*/
|
||||||
public interface ICPPTemplateNonTypeParameter extends ICPPTemplateParameter, ICPPVariable {
|
public interface ICPPTemplateNonTypeParameter extends ICPPTemplateParameter, ICPPVariable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated, use {@link ICPPTemplateParameter#getDefaultValue()}.
|
* @deprecated, use {@link ICPPTemplateParameter#getDefaultValue()}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -274,10 +274,10 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
IASTName[] ns= ((ICPPASTQualifiedName) n).getNames();
|
IASTName[] ns= ((ICPPASTQualifiedName) n).getNames();
|
||||||
if (ns.length < 2)
|
if (ns.length < 2)
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
qualifier= ns[ns.length-2].resolveBinding();
|
qualifier= ns[ns.length - 2].resolveBinding();
|
||||||
if (qualifier instanceof IProblemBinding)
|
if (qualifier instanceof IProblemBinding)
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
n= ns[ns.length-1];
|
n= ns[ns.length - 1];
|
||||||
}
|
}
|
||||||
if (n instanceof ICPPASTTemplateId) {
|
if (n instanceof ICPPASTTemplateId) {
|
||||||
args= CPPTemplates.createTemplateArgumentArray((ICPPASTTemplateId) n);
|
args= CPPTemplates.createTemplateArgumentArray((ICPPASTTemplateId) n);
|
||||||
|
|
|
@ -57,11 +57,11 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
private ObjectMap specializationMap= ObjectMap.EMPTY_MAP;
|
private ObjectMap specializationMap= ObjectMap.EMPTY_MAP;
|
||||||
private final ThreadLocal<Set<IBinding>> fInProgress= new ThreadLocal<Set<IBinding>>();
|
private final ThreadLocal<Set<IBinding>> fInProgress= new ThreadLocal<Set<IBinding>>();
|
||||||
|
|
||||||
public CPPClassSpecialization(ICPPClassType specialized, IBinding owner, ICPPTemplateParameterMap argumentMap) {
|
public CPPClassSpecialization(ICPPClassType specialized, IBinding owner,
|
||||||
|
ICPPTemplateParameterMap argumentMap) {
|
||||||
super(specialized, owner, argumentMap);
|
super(specialized, owner, argumentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPClassType getSpecializedBinding() {
|
public ICPPClassType getSpecializedBinding() {
|
||||||
return (ICPPClassType) super.getSpecializedBinding();
|
return (ICPPClassType) super.getSpecializedBinding();
|
||||||
|
@ -75,7 +75,7 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
@Override
|
@Override
|
||||||
public IBinding specializeMember(IBinding original, IASTNode point) {
|
public IBinding specializeMember(IBinding original, IASTNode point) {
|
||||||
Set<IBinding> set;
|
Set<IBinding> set;
|
||||||
synchronized(this) {
|
synchronized (this) {
|
||||||
IBinding result= (IBinding) specializationMap.get(original);
|
IBinding result= (IBinding) specializationMap.get(original);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
return result;
|
return result;
|
||||||
|
@ -91,7 +91,7 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
|
|
||||||
IBinding result= CPPTemplates.createSpecialization(this, original, point);
|
IBinding result= CPPTemplates.createSpecialization(this, original, point);
|
||||||
set.remove(original);
|
set.remove(original);
|
||||||
synchronized(this) {
|
synchronized (this) {
|
||||||
IBinding concurrent= (IBinding) specializationMap.get(original);
|
IBinding concurrent= (IBinding) specializationMap.get(original);
|
||||||
if (concurrent != null)
|
if (concurrent != null)
|
||||||
return concurrent;
|
return concurrent;
|
||||||
|
@ -233,9 +233,6 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
return specScope;
|
return specScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if (type == this)
|
if (type == this)
|
||||||
|
@ -251,7 +248,6 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -844,7 +844,7 @@ public class CPPTemplates {
|
||||||
return null;
|
return null;
|
||||||
ICPPClassSpecialization within= (ICPPClassSpecialization) owner;
|
ICPPClassSpecialization within= (ICPPClassSpecialization) owner;
|
||||||
ICPPClassType orig = within.getSpecializedBinding();
|
ICPPClassType orig = within.getSpecializedBinding();
|
||||||
for(;;) {
|
for (;;) {
|
||||||
IBinding o1 = within.getOwner();
|
IBinding o1 = within.getOwner();
|
||||||
IBinding o2 = orig.getOwner();
|
IBinding o2 = orig.getOwner();
|
||||||
if (!(o1 instanceof ICPPClassSpecialization && o2 instanceof ICPPClassType))
|
if (!(o1 instanceof ICPPClassSpecialization && o2 instanceof ICPPClassType))
|
||||||
|
@ -1027,7 +1027,7 @@ public class CPPTemplates {
|
||||||
IType[] newResult= new IType[result.length+packSize-1];
|
IType[] newResult= new IType[result.length+packSize-1];
|
||||||
System.arraycopy(result, 0, newResult, 0, j);
|
System.arraycopy(result, 0, newResult, 0, j);
|
||||||
result= newResult;
|
result= newResult;
|
||||||
for(int k=0; k<packSize; k++) {
|
for (int k= 0; k < packSize; k++) {
|
||||||
result[j++]= CPPTemplates.instantiateType(origType, tpMap, k, within, point);
|
result[j++]= CPPTemplates.instantiateType(origType, tpMap, k, within, point);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -1070,23 +1070,23 @@ public class CPPTemplates {
|
||||||
} else if (packSize == PACK_SIZE_DEFER) {
|
} else if (packSize == PACK_SIZE_DEFER) {
|
||||||
newArg= origArg;
|
newArg= origArg;
|
||||||
} else {
|
} else {
|
||||||
final int shift = packSize-1;
|
final int shift = packSize - 1;
|
||||||
ICPPTemplateArgument[] newResult= new ICPPTemplateArgument[args.length + resultShift + shift];
|
ICPPTemplateArgument[] newResult= new ICPPTemplateArgument[args.length + resultShift + shift];
|
||||||
System.arraycopy(result, 0, newResult, 0, i+resultShift);
|
System.arraycopy(result, 0, newResult, 0, i + resultShift);
|
||||||
for(int j=0; j<packSize; j++) {
|
for (int j= 0; j < packSize; j++) {
|
||||||
newResult[i+resultShift+j]= CPPTemplates.instantiateArgument(origArg, tpMap, j, within, point);
|
newResult[i + resultShift + j]= CPPTemplates.instantiateArgument(origArg, tpMap, j, within, point);
|
||||||
}
|
}
|
||||||
result= newResult;
|
result= newResult;
|
||||||
resultShift+= shift;
|
resultShift += shift;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newArg = CPPTemplates.instantiateArgument(origArg, tpMap, packOffset, within, point);
|
newArg = CPPTemplates.instantiateArgument(origArg, tpMap, packOffset, within, point);
|
||||||
}
|
}
|
||||||
if (result != args) {
|
if (result != args) {
|
||||||
result[i+resultShift]= newArg;
|
result[i + resultShift]= newArg;
|
||||||
} else if (newArg != origArg) {
|
} else if (newArg != origArg) {
|
||||||
assert resultShift==0;
|
assert resultShift == 0;
|
||||||
result = new ICPPTemplateArgument[args.length];
|
result = new ICPPTemplateArgument[args.length];
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
System.arraycopy(args, 0, result, 0, i);
|
System.arraycopy(args, 0, result, 0, i);
|
||||||
|
@ -1145,7 +1145,7 @@ public class CPPTemplates {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates the given type with the provided map and packoffset.
|
* Instantiates the given type with the provided map and packОffset.
|
||||||
* The context is used to replace templates with their specialization, where appropriate.
|
* The context is used to replace templates with their specialization, where appropriate.
|
||||||
* @param point
|
* @param point
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue