mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Code streamlining.
This commit is contained in:
parent
93634c409b
commit
785c675364
2 changed files with 7 additions and 12 deletions
|
@ -29,12 +29,13 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|||
import org.eclipse.core.runtime.PlatformObject;
|
||||
|
||||
public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplate {
|
||||
private IASTName aliasName;
|
||||
private IType aliasedType;
|
||||
private final IASTName aliasName;
|
||||
private final IType aliasedType;
|
||||
private ICPPTemplateParameter[] templateParameters;
|
||||
|
||||
public CPPAliasTemplate(IASTName aliasName){
|
||||
public CPPAliasTemplate(IASTName aliasName, IType aliasedType) {
|
||||
this.aliasName = aliasName;
|
||||
this.aliasedType = aliasedType;
|
||||
aliasName.setBinding(this);
|
||||
}
|
||||
|
||||
|
@ -43,10 +44,6 @@ public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplat
|
|||
return aliasedType;
|
||||
}
|
||||
|
||||
public void setType(IType type) {
|
||||
this.aliasedType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return new String(getNameCharArray());
|
||||
|
@ -74,7 +71,7 @@ public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplat
|
|||
|
||||
@Override
|
||||
public boolean isSameType(IType type) {
|
||||
if(type == null){
|
||||
if (type == null) {
|
||||
return false;
|
||||
}
|
||||
IType aliasedType = getType();
|
||||
|
@ -87,7 +84,7 @@ public class CPPAliasTemplate extends PlatformObject implements ICPPAliasTemplat
|
|||
try {
|
||||
t = (IType) super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
//not going to happen
|
||||
// Not going to happen
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
|
@ -673,9 +673,7 @@ public class CPPVisitor extends ASTQueries {
|
|||
}
|
||||
if (type != null) {
|
||||
if (alias.getParent() instanceof ICPPASTTemplateDeclaration) {
|
||||
CPPAliasTemplate templateAlias = new CPPAliasTemplate(alias.getAlias());
|
||||
templateAlias.setType(type);
|
||||
binding = templateAlias;
|
||||
binding = new CPPAliasTemplate(alias.getAlias(), type);
|
||||
} else {
|
||||
CPPTypedef typedef = new CPPTypedef(alias.getAlias());
|
||||
typedef.setType(type);
|
||||
|
|
Loading…
Add table
Reference in a new issue