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

Code streamlining.

This commit is contained in:
Sergey Prigogin 2012-11-25 11:28:00 -08:00
parent 93634c409b
commit 785c675364
2 changed files with 7 additions and 12 deletions

View file

@ -29,12 +29,13 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplate { public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplate {
private IASTName aliasName; private final IASTName aliasName;
private IType aliasedType; private final IType aliasedType;
private ICPPTemplateParameter[] templateParameters; private ICPPTemplateParameter[] templateParameters;
public CPPAliasTemplate(IASTName aliasName){ public CPPAliasTemplate(IASTName aliasName, IType aliasedType) {
this.aliasName = aliasName; this.aliasName = aliasName;
this.aliasedType = aliasedType;
aliasName.setBinding(this); aliasName.setBinding(this);
} }
@ -43,10 +44,6 @@ public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplat
return aliasedType; return aliasedType;
} }
public void setType(IType type) {
this.aliasedType = type;
}
@Override @Override
public String getName() { public String getName() {
return new String(getNameCharArray()); return new String(getNameCharArray());
@ -87,7 +84,7 @@ public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplat
try { try {
t = (IType) super.clone(); t = (IType) super.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
//not going to happen // Not going to happen
} }
return t; return t;
} }

View file

@ -673,9 +673,7 @@ public class CPPVisitor extends ASTQueries {
} }
if (type != null) { if (type != null) {
if (alias.getParent() instanceof ICPPASTTemplateDeclaration) { if (alias.getParent() instanceof ICPPASTTemplateDeclaration) {
CPPAliasTemplate templateAlias = new CPPAliasTemplate(alias.getAlias()); binding = new CPPAliasTemplate(alias.getAlias(), type);
templateAlias.setType(type);
binding = templateAlias;
} else { } else {
CPPTypedef typedef = new CPPTypedef(alias.getAlias()); CPPTypedef typedef = new CPPTypedef(alias.getAlias());
typedef.setType(type); typedef.setType(type);