mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 13:55:39 +02:00
Rename ICPPEvaluation.getTypeOrFunctionSet() to getType().
getTypeOrFunctionSet() is an unwieldy name, and since the return type is IType, it seems reasonable to call the function getType(). Change-Id: I7e3211fdd3b474cc8e33da3e1f398b58122fe89d Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
59de5c303f
commit
54e9a84673
47 changed files with 99 additions and 98 deletions
|
@ -213,7 +213,7 @@ public abstract class VariableReadWriteFlags {
|
||||||
|
|
||||||
private IType getArgumentType(IASTInitializerClause argument) {
|
private IType getArgumentType(IASTInitializerClause argument) {
|
||||||
if (argument instanceof ICPPASTInitializerClause) {
|
if (argument instanceof ICPPASTInitializerClause) {
|
||||||
return ((ICPPASTInitializerClause) argument).getEvaluation().getTypeOrFunctionSet(argument);
|
return ((ICPPASTInitializerClause) argument).getEvaluation().getType(argument);
|
||||||
} else if (argument instanceof IASTExpression) {
|
} else if (argument instanceof IASTExpression) {
|
||||||
return ((IASTExpression) argument).getExpressionType();
|
return ((IASTExpression) argument).getExpressionType();
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,7 @@ public class CPPASTArraySubscriptExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -285,7 +285,7 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class CPPASTConditionalExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -268,7 +268,7 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
private ICPPEvaluation createEvaluation() {
|
private ICPPEvaluation createEvaluation() {
|
||||||
ICPPEvaluation ownerEval = fOwner.getEvaluation();
|
ICPPEvaluation ownerEval = fOwner.getEvaluation();
|
||||||
if (!ownerEval.isTypeDependent()) {
|
if (!ownerEval.isTypeDependent()) {
|
||||||
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getTypeOrFunctionSet(this), fIsDeref, this, null, false);
|
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getType(this), fIsDeref, this, null, false);
|
||||||
if (ownerType != null) {
|
if (ownerType != null) {
|
||||||
IBinding binding = fName.resolvePreBinding();
|
IBinding binding = fName.resolvePreBinding();
|
||||||
if (binding instanceof CPPFunctionSet)
|
if (binding instanceof CPPFunctionSet)
|
||||||
|
@ -306,7 +306,7 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -342,7 +342,7 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class CPPASTIdExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
IType type= getEvaluation().getTypeOrFunctionSet(this);
|
IType type= getEvaluation().getType(this);
|
||||||
if (type instanceof FunctionSetType) {
|
if (type instanceof FunctionSetType) {
|
||||||
IBinding binding= fName.resolveBinding();
|
IBinding binding= fName.resolveBinding();
|
||||||
if (binding instanceof IFunction) {
|
if (binding instanceof IFunction) {
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CPPClosureType getExpressionType() {
|
public CPPClosureType getExpressionType() {
|
||||||
return (CPPClosureType) getEvaluation().getTypeOrFunctionSet(this);
|
return (CPPClosureType) getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -675,7 +675,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -304,7 +304,7 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class CPPASTPackExpansionExpression extends ASTNode implements ICPPASTPac
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class CPPASTTypeIdInitializerExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -218,7 +218,7 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
IType type= getEvaluation().getTypeOrFunctionSet(this);
|
IType type= getEvaluation().getType(this);
|
||||||
if (type instanceof FunctionSetType) {
|
if (type instanceof FunctionSetType) {
|
||||||
type= fOperand.getExpressionType();
|
type= fOperand.getExpressionType();
|
||||||
if (fOperator == op_amper) {
|
if (fOperator == op_amper) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class CPPTemplateNonTypeArgument implements ICPPTemplateArgument {
|
||||||
// Avoid nesting EvalFixed's as nesting causes the signature to be different.
|
// Avoid nesting EvalFixed's as nesting causes the signature to be different.
|
||||||
fEvaluation = value.getEvaluation();
|
fEvaluation = value.getEvaluation();
|
||||||
} else {
|
} else {
|
||||||
fEvaluation= new EvalFixed(evaluation.getTypeOrFunctionSet(point),
|
fEvaluation= new EvalFixed(evaluation.getType(point),
|
||||||
evaluation.getValueCategory(point), value);
|
evaluation.getValueCategory(point), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,17 +85,17 @@ public class CPPTemplateNonTypeArgument implements ICPPTemplateArgument {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOfNonTypeValue() {
|
public IType getTypeOfNonTypeValue() {
|
||||||
return fEvaluation.getTypeOrFunctionSet(null);
|
return fEvaluation.getType(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPackExpansion() {
|
public boolean isPackExpansion() {
|
||||||
return fEvaluation.getTypeOrFunctionSet(null) instanceof ICPPParameterPackType;
|
return fEvaluation.getType(null) instanceof ICPPParameterPackType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPTemplateArgument getExpansionPattern() {
|
public ICPPTemplateArgument getExpansionPattern() {
|
||||||
IType type = fEvaluation.getTypeOrFunctionSet(null);
|
IType type = fEvaluation.getType(null);
|
||||||
if (type instanceof ICPPParameterPackType) {
|
if (type instanceof ICPPParameterPackType) {
|
||||||
IType t= ((ICPPParameterPackType) type).getType();
|
IType t= ((ICPPParameterPackType) type).getType();
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
|
|
|
@ -49,12 +49,13 @@ public interface ICPPEvaluation extends ISerializableEvaluation {
|
||||||
boolean isConstantExpression(IASTNode point);
|
boolean isConstantExpression(IASTNode point);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type of the expression, or a {@code FunctionSetType} if the expression evaluates
|
* Returns the type of the expression.
|
||||||
* to a function set.
|
*
|
||||||
|
* If the expression evaluates to a function set, a {@code FunctionSetType} is returned.
|
||||||
*
|
*
|
||||||
* @param point the point of instantiation, determines the scope for name lookups
|
* @param point the point of instantiation, determines the scope for name lookups
|
||||||
*/
|
*/
|
||||||
IType getTypeOrFunctionSet(IASTNode point);
|
IType getType(IASTNode point);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the value of the expression.
|
* Returns the value of the expression.
|
||||||
|
|
|
@ -88,13 +88,13 @@ class BuiltinOperators {
|
||||||
fUnary= args.length < 2;
|
fUnary= args.length < 2;
|
||||||
fGlobalCandidates= globCandidates;
|
fGlobalCandidates= globCandidates;
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
IType type= args[0].getTypeOrFunctionSet(point);
|
IType type= args[0].getType(point);
|
||||||
if (!(type instanceof ISemanticProblem))
|
if (!(type instanceof ISemanticProblem))
|
||||||
fType1= type;
|
fType1= type;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
IType type= args[1].getTypeOrFunctionSet(point);
|
IType type= args[1].getType(point);
|
||||||
if (!(type instanceof ISemanticProblem))
|
if (!(type instanceof ISemanticProblem))
|
||||||
fType2= type;
|
fType2= type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ public class CPPSemantics {
|
||||||
if (expression instanceof ICPPASTLiteralExpression) {
|
if (expression instanceof ICPPASTLiteralExpression) {
|
||||||
final ICPPASTLiteralExpression litExpr = (ICPPASTLiteralExpression) expression;
|
final ICPPASTLiteralExpression litExpr = (ICPPASTLiteralExpression) expression;
|
||||||
if (litExpr.getKind() == IASTLiteralExpression.lk_this) {
|
if (litExpr.getKind() == IASTLiteralExpression.lk_this) {
|
||||||
final IType thisType = SemanticUtil.getNestedType(litExpr.getEvaluation().getTypeOrFunctionSet(litExpr), TDEF | ALLCVQ | PTR | ARRAY | MPTR | REF);
|
final IType thisType = SemanticUtil.getNestedType(litExpr.getEvaluation().getType(litExpr), TDEF | ALLCVQ | PTR | ARRAY | MPTR | REF);
|
||||||
if (thisType instanceof ICPPUnknownBinding || thisType instanceof ICPPTemplateDefinition) {
|
if (thisType instanceof ICPPUnknownBinding || thisType instanceof ICPPTemplateDefinition) {
|
||||||
result[0]= true;
|
result[0]= true;
|
||||||
return PROCESS_ABORT;
|
return PROCESS_ABORT;
|
||||||
|
@ -3297,9 +3297,9 @@ public class CPPSemantics {
|
||||||
if (op == null || arg1 == null || arg2 == null)
|
if (op == null || arg1 == null || arg2 == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
IType op1type = getNestedType(arg1.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE);
|
IType op1type = getNestedType(arg1.getType(pointOfInstantiation), TDEF | REF | CVTYPE);
|
||||||
if (!isUserDefined(op1type) && !isUserDefined(
|
if (!isUserDefined(op1type) && !isUserDefined(
|
||||||
getNestedType(arg2.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE)))
|
getNestedType(arg2.getType(pointOfInstantiation), TDEF | REF | CVTYPE)))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
final LookupMode lookupNonMember;
|
final LookupMode lookupNonMember;
|
||||||
|
@ -3338,7 +3338,7 @@ public class CPPSemantics {
|
||||||
args[i++]= a;
|
args[i++]= a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IType type= getNestedType(arg1.getTypeOrFunctionSet(expr), TDEF | REF | CVTYPE);
|
IType type= getNestedType(arg1.getType(expr), TDEF | REF | CVTYPE);
|
||||||
return findOverloadedOperator(expr, null, args, type, op, LookupMode.GLOBALS_IF_NO_MEMBERS);
|
return findOverloadedOperator(expr, null, args, type, op, LookupMode.GLOBALS_IF_NO_MEMBERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3435,7 +3435,7 @@ public class CPPSemantics {
|
||||||
IASTEqualsInitializer eqInit= (IASTEqualsInitializer) initializer;
|
IASTEqualsInitializer eqInit= (IASTEqualsInitializer) initializer;
|
||||||
ICPPASTInitializerClause initClause = (ICPPASTInitializerClause) eqInit.getInitializerClause();
|
ICPPASTInitializerClause initClause = (ICPPASTInitializerClause) eqInit.getInitializerClause();
|
||||||
final ICPPEvaluation evaluation = initClause.getEvaluation();
|
final ICPPEvaluation evaluation = initClause.getEvaluation();
|
||||||
IType sourceType= evaluation.getTypeOrFunctionSet(typeId);
|
IType sourceType= evaluation.getType(typeId);
|
||||||
ValueCategory isLValue= evaluation.getValueCategory(typeId);
|
ValueCategory isLValue= evaluation.getValueCategory(typeId);
|
||||||
if (sourceType != null) {
|
if (sourceType != null) {
|
||||||
Cost c;
|
Cost c;
|
||||||
|
@ -3556,8 +3556,8 @@ public class CPPSemantics {
|
||||||
*/
|
*/
|
||||||
public static ICPPFunction findOverloadedOperatorComma(IASTNode pointOfInstantiation, IScope pointOfDefinition,
|
public static ICPPFunction findOverloadedOperatorComma(IASTNode pointOfInstantiation, IScope pointOfDefinition,
|
||||||
ICPPEvaluation arg1, ICPPEvaluation arg2) {
|
ICPPEvaluation arg1, ICPPEvaluation arg2) {
|
||||||
IType op1type = getNestedType(arg1.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE);
|
IType op1type = getNestedType(arg1.getType(pointOfInstantiation), TDEF | REF | CVTYPE);
|
||||||
IType op2type = getNestedType(arg2.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE);
|
IType op2type = getNestedType(arg2.getType(pointOfInstantiation), TDEF | REF | CVTYPE);
|
||||||
if (!isUserDefined(op1type) && !isUserDefined(op2type))
|
if (!isUserDefined(op1type) && !isUserDefined(op2type))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -3577,7 +3577,7 @@ public class CPPSemantics {
|
||||||
ICPPClassType callToObjectOfClassType= null;
|
ICPPClassType callToObjectOfClassType= null;
|
||||||
IType type2= null;
|
IType type2= null;
|
||||||
if (args.length >= 2) {
|
if (args.length >= 2) {
|
||||||
type2 = args[1].getTypeOrFunctionSet(pointOfInstantiation);
|
type2 = args[1].getType(pointOfInstantiation);
|
||||||
type2= getNestedType(type2, TDEF | REF | CVTYPE);
|
type2= getNestedType(type2, TDEF | REF | CVTYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1344,7 +1344,7 @@ public class CPPTemplates {
|
||||||
ICPPEvaluation instantiated = eval.instantiate(tpMap, packOffset, within,
|
ICPPEvaluation instantiated = eval.instantiate(tpMap, packOffset, within,
|
||||||
Value.MAX_RECURSION_DEPTH, point);
|
Value.MAX_RECURSION_DEPTH, point);
|
||||||
if (instantiated != eval)
|
if (instantiated != eval)
|
||||||
return instantiated.getTypeOrFunctionSet(point);
|
return instantiated.getType(point);
|
||||||
} else {
|
} else {
|
||||||
IBinding binding= resolveUnknown((ICPPUnknownBinding) type, tpMap, packOffset,
|
IBinding binding= resolveUnknown((ICPPUnknownBinding) type, tpMap, packOffset,
|
||||||
within, point);
|
within, point);
|
||||||
|
|
|
@ -2008,7 +2008,7 @@ public class CPPVisitor extends ASTQueries {
|
||||||
sizeValue = Value.create(clauses.length);
|
sizeValue = Value.create(clauses.length);
|
||||||
} else if (clause instanceof ICPPASTLiteralExpression) {
|
} else if (clause instanceof ICPPASTLiteralExpression) {
|
||||||
ICPPEvaluation value = ((ICPPASTLiteralExpression) clause).getEvaluation();
|
ICPPEvaluation value = ((ICPPASTLiteralExpression) clause).getEvaluation();
|
||||||
IType valueType = value.getTypeOrFunctionSet(clause);
|
IType valueType = value.getType(clause);
|
||||||
if (valueType instanceof IArrayType) {
|
if (valueType instanceof IArrayType) {
|
||||||
sizeValue = ((IArrayType) valueType).getSize();
|
sizeValue = ((IArrayType) valueType).getSize();
|
||||||
}
|
}
|
||||||
|
@ -2173,7 +2173,7 @@ public class CPPVisitor extends ASTQueries {
|
||||||
}
|
}
|
||||||
type = decorateType(type, declSpec, declarator);
|
type = decorateType(type, declSpec, declarator);
|
||||||
final ICPPEvaluation evaluation = initClause.getEvaluation();
|
final ICPPEvaluation evaluation = initClause.getEvaluation();
|
||||||
initType= evaluation.getTypeOrFunctionSet(declarator);
|
initType= evaluation.getType(declarator);
|
||||||
valueCat= evaluation.getValueCategory(declarator);
|
valueCat= evaluation.getValueCategory(declarator);
|
||||||
if (initType == null || initType instanceof ISemanticProblem) {
|
if (initType == null || initType instanceof ISemanticProblem) {
|
||||||
return new ProblemType(ISemanticProblem.TYPE_CANNOT_DEDUCE_AUTO_TYPE);
|
return new ProblemType(ISemanticProblem.TYPE_CANNOT_DEDUCE_AUTO_TYPE);
|
||||||
|
|
|
@ -352,9 +352,9 @@ public class Conversions {
|
||||||
|
|
||||||
if (listType != null) {
|
if (listType != null) {
|
||||||
ICPPEvaluation[] clauses = arg.getClauses();
|
ICPPEvaluation[] clauses = arg.getClauses();
|
||||||
Cost worstCost= new Cost(arg.getTypeOrFunctionSet(point), target, Rank.IDENTITY);
|
Cost worstCost= new Cost(arg.getType(point), target, Rank.IDENTITY);
|
||||||
for (ICPPEvaluation clause : clauses) {
|
for (ICPPEvaluation clause : clauses) {
|
||||||
Cost cost= checkImplicitConversionSequence(listType, clause.getTypeOrFunctionSet(point),
|
Cost cost= checkImplicitConversionSequence(listType, clause.getType(point),
|
||||||
clause.getValueCategory(point), UDCMode.ALLOWED, Context.ORDINARY, point);
|
clause.getValueCategory(point), UDCMode.ALLOWED, Context.ORDINARY, point);
|
||||||
if (!cost.converts())
|
if (!cost.converts())
|
||||||
return cost;
|
return cost;
|
||||||
|
@ -376,7 +376,7 @@ public class Conversions {
|
||||||
|
|
||||||
ICPPClassType classTarget= (ICPPClassType) noCVTarget;
|
ICPPClassType classTarget= (ICPPClassType) noCVTarget;
|
||||||
if (TypeTraits.isAggregateClass(classTarget, point)) {
|
if (TypeTraits.isAggregateClass(classTarget, point)) {
|
||||||
Cost cost= new Cost(arg.getTypeOrFunctionSet(point), target, Rank.IDENTITY);
|
Cost cost= new Cost(arg.getType(point), target, Rank.IDENTITY);
|
||||||
cost.setUserDefinedConversion(null);
|
cost.setUserDefinedConversion(null);
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
@ -387,14 +387,14 @@ public class Conversions {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final ICPPEvaluation firstArg = args[0];
|
final ICPPEvaluation firstArg = args[0];
|
||||||
if (!firstArg.isInitializerList()) {
|
if (!firstArg.isInitializerList()) {
|
||||||
Cost cost= checkImplicitConversionSequence(target, firstArg.getTypeOrFunctionSet(point), firstArg.getValueCategory(point), udc, Context.ORDINARY, point);
|
Cost cost= checkImplicitConversionSequence(target, firstArg.getType(point), firstArg.getValueCategory(point), udc, Context.ORDINARY, point);
|
||||||
if (cost.isNarrowingConversion(point)) {
|
if (cost.isNarrowingConversion(point)) {
|
||||||
return Cost.NO_CONVERSION;
|
return Cost.NO_CONVERSION;
|
||||||
}
|
}
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
} else if (args.length == 0) {
|
} else if (args.length == 0) {
|
||||||
return new Cost(arg.getTypeOrFunctionSet(point), target, Rank.IDENTITY);
|
return new Cost(arg.getType(point), target, Rank.IDENTITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Cost.NO_CONVERSION;
|
return Cost.NO_CONVERSION;
|
||||||
|
@ -541,7 +541,7 @@ public class Conversions {
|
||||||
// 13.3.1.7 Initialization by list-initialization
|
// 13.3.1.7 Initialization by list-initialization
|
||||||
static Cost listInitializationOfClass(EvalInitList arg, ICPPClassType t, boolean isDirect, boolean deferUDC, IASTNode point) throws DOMException {
|
static Cost listInitializationOfClass(EvalInitList arg, ICPPClassType t, boolean isDirect, boolean deferUDC, IASTNode point) throws DOMException {
|
||||||
if (deferUDC) {
|
if (deferUDC) {
|
||||||
Cost c= new Cost(arg.getTypeOrFunctionSet(point), t, Rank.USER_DEFINED_CONVERSION);
|
Cost c= new Cost(arg.getType(point), t, Rank.USER_DEFINED_CONVERSION);
|
||||||
c.setDeferredUDC(isDirect ? DeferredUDC.DIRECT_LIST_INIT_OF_CLASS : DeferredUDC.LIST_INIT_OF_CLASS);
|
c.setDeferredUDC(isDirect ? DeferredUDC.DIRECT_LIST_INIT_OF_CLASS : DeferredUDC.LIST_INIT_OF_CLASS);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,7 @@ public class Conversions {
|
||||||
final int minArgCount = ctor.getRequiredArgumentCount();
|
final int minArgCount = ctor.getRequiredArgumentCount();
|
||||||
if (minArgCount == 0) {
|
if (minArgCount == 0) {
|
||||||
if (arg.getClauses().length == 0) {
|
if (arg.getClauses().length == 0) {
|
||||||
Cost c= new Cost(arg.getTypeOrFunctionSet(point), t, Rank.IDENTITY);
|
Cost c= new Cost(arg.getType(point), t, Rank.IDENTITY);
|
||||||
c.setUserDefinedConversion(ctor);
|
c.setUserDefinedConversion(ctor);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -624,11 +624,11 @@ public class Conversions {
|
||||||
final IBinding result= CPPSemantics.resolveFunction(data, filteredConstructors, true);
|
final IBinding result= CPPSemantics.resolveFunction(data, filteredConstructors, true);
|
||||||
final Cost c;
|
final Cost c;
|
||||||
if (result instanceof ICPPMethod) {
|
if (result instanceof ICPPMethod) {
|
||||||
c= new Cost(arg.getTypeOrFunctionSet(point), t, Rank.IDENTITY);
|
c= new Cost(arg.getType(point), t, Rank.IDENTITY);
|
||||||
c.setUserDefinedConversion((ICPPMethod) result);
|
c.setUserDefinedConversion((ICPPMethod) result);
|
||||||
} else if (result instanceof IProblemBinding
|
} else if (result instanceof IProblemBinding
|
||||||
&& ((IProblemBinding) result).getID() == IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP) {
|
&& ((IProblemBinding) result).getID() == IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP) {
|
||||||
c = new Cost(arg.getTypeOrFunctionSet(point), t, Rank.USER_DEFINED_CONVERSION);
|
c = new Cost(arg.getType(point), t, Rank.USER_DEFINED_CONVERSION);
|
||||||
c.setAmbiguousUDC(true);
|
c.setAmbiguousUDC(true);
|
||||||
} else {
|
} else {
|
||||||
c= Cost.NO_CONVERSION;
|
c= Cost.NO_CONVERSION;
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class EvalBinary extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null) {
|
if (fType == null) {
|
||||||
if (isTypeDependent()) {
|
if (isTypeDependent()) {
|
||||||
fType= new TypeOfDependentExpression(this);
|
fType= new TypeOfDependentExpression(this);
|
||||||
|
@ -124,7 +124,7 @@ public class EvalBinary extends CPPDependentEvaluation {
|
||||||
if (overload != null) {
|
if (overload != null) {
|
||||||
fType= ExpressionTypes.restoreTypedefs(
|
fType= ExpressionTypes.restoreTypedefs(
|
||||||
ExpressionTypes.typeFromFunctionCall(overload),
|
ExpressionTypes.typeFromFunctionCall(overload),
|
||||||
fArg1.getTypeOrFunctionSet(point), fArg2.getTypeOrFunctionSet(point));
|
fArg1.getType(point), fArg2.getType(point));
|
||||||
} else {
|
} else {
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
}
|
}
|
||||||
|
@ -219,12 +219,12 @@ public class EvalBinary extends CPPDependentEvaluation {
|
||||||
return LVALUE;
|
return LVALUE;
|
||||||
|
|
||||||
case op_pmdot:
|
case op_pmdot:
|
||||||
if (!(getTypeOrFunctionSet(point) instanceof ICPPFunctionType))
|
if (!(getType(point) instanceof ICPPFunctionType))
|
||||||
return fArg1.getValueCategory(point);
|
return fArg1.getValueCategory(point);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case op_pmarrow:
|
case op_pmarrow:
|
||||||
if (!(getTypeOrFunctionSet(point) instanceof ICPPFunctionType))
|
if (!(getType(point) instanceof ICPPFunctionType))
|
||||||
return LVALUE;
|
return LVALUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ public class EvalBinary extends CPPDependentEvaluation {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (fOperator == op_arrayAccess) {
|
if (fOperator == op_arrayAccess) {
|
||||||
IType type = fArg1.getTypeOrFunctionSet(point);
|
IType type = fArg1.getType(point);
|
||||||
type= SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
|
type= SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
|
||||||
if (type instanceof ICPPClassType) {
|
if (type instanceof ICPPClassType) {
|
||||||
return CPPSemantics.findOverloadedBinaryOperator(point, getTemplateDefinitionScope(),
|
return CPPSemantics.findOverloadedBinaryOperator(point, getTemplateDefinitionScope(),
|
||||||
|
@ -266,13 +266,13 @@ public class EvalBinary extends CPPDependentEvaluation {
|
||||||
if (o != null)
|
if (o != null)
|
||||||
return typeFromFunctionCall(o);
|
return typeFromFunctionCall(o);
|
||||||
|
|
||||||
final IType originalType1 = fArg1.getTypeOrFunctionSet(point);
|
final IType originalType1 = fArg1.getType(point);
|
||||||
final IType type1 = prvalueTypeWithResolvedTypedefs(originalType1);
|
final IType type1 = prvalueTypeWithResolvedTypedefs(originalType1);
|
||||||
if (type1 instanceof ISemanticProblem) {
|
if (type1 instanceof ISemanticProblem) {
|
||||||
return type1;
|
return type1;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IType originalType2 = fArg2.getTypeOrFunctionSet(point);
|
final IType originalType2 = fArg2.getType(point);
|
||||||
final IType type2 = prvalueTypeWithResolvedTypedefs(originalType2);
|
final IType type2 = prvalueTypeWithResolvedTypedefs(originalType2);
|
||||||
if (type2 instanceof ISemanticProblem) {
|
if (type2 instanceof ISemanticProblem) {
|
||||||
return type2;
|
return type2;
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class EvalBinaryTypeId extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
switch (fOperator) {
|
switch (fOperator) {
|
||||||
case __is_base_of:
|
case __is_base_of:
|
||||||
return CPPBasicType.BOOLEAN;
|
return CPPBasicType.BOOLEAN;
|
||||||
|
|
|
@ -256,7 +256,7 @@ public class EvalBinding extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null) {
|
if (fType == null) {
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class EvalComma extends CPPDependentEvaluation {
|
||||||
} else {
|
} else {
|
||||||
overloads[i - 1] = overload;
|
overloads[i - 1] = overload;
|
||||||
e1= new EvalFixed(typeFromFunctionCall(overload), valueCategoryFromFunctionCall(overload), Value.UNKNOWN);
|
e1= new EvalFixed(typeFromFunctionCall(overload), valueCategoryFromFunctionCall(overload), Value.UNKNOWN);
|
||||||
if (e1.getTypeOrFunctionSet(point) instanceof ISemanticProblem) {
|
if (e1.getType(point) instanceof ISemanticProblem) {
|
||||||
e1= e2;
|
e1= e2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ public class EvalComma extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null) {
|
if (fType == null) {
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public class EvalComma extends CPPDependentEvaluation {
|
||||||
return typeFromFunctionCall(last);
|
return typeFromFunctionCall(last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fArguments[fArguments.length - 1].getTypeOrFunctionSet(point);
|
return fArguments[fArguments.length - 1].getType(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -71,8 +71,8 @@ public class EvalCompound extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
return fDelegate.getTypeOrFunctionSet(point);
|
return fDelegate.getType(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class EvalConditional extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
evaluate(point);
|
evaluate(point);
|
||||||
return fType;
|
return fType;
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,8 @@ public class EvalConditional extends CPPDependentEvaluation {
|
||||||
|
|
||||||
final ICPPEvaluation positive = fPositive == null ? fCondition : fPositive;
|
final ICPPEvaluation positive = fPositive == null ? fCondition : fPositive;
|
||||||
|
|
||||||
IType t2 = positive.getTypeOrFunctionSet(point);
|
IType t2 = positive.getType(point);
|
||||||
IType t3 = fNegative.getTypeOrFunctionSet(point);
|
IType t3 = fNegative.getType(point);
|
||||||
|
|
||||||
final IType uqt2= getNestedType(t2, TDEF | REF | CVTYPE);
|
final IType uqt2= getNestedType(t2, TDEF | REF | CVTYPE);
|
||||||
final IType uqt3= getNestedType(t3, TDEF | REF | CVTYPE);
|
final IType uqt3= getNestedType(t3, TDEF | REF | CVTYPE);
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class EvalFixed extends CPPEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
return fType;
|
return fType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
|
||||||
if (isTypeDependent())
|
if (isTypeDependent())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
IType t= SemanticUtil.getNestedType(fArguments[0].getTypeOrFunctionSet(point), TDEF | REF | CVTYPE);
|
IType t= SemanticUtil.getNestedType(fArguments[0].getType(point), TDEF | REF | CVTYPE);
|
||||||
if (t instanceof ICPPClassType) {
|
if (t instanceof ICPPClassType) {
|
||||||
return CPPSemantics.findOverloadedOperator(point, getTemplateDefinitionScope(), fArguments, t,
|
return CPPSemantics.findOverloadedOperator(point, getTemplateDefinitionScope(), fArguments, t,
|
||||||
OverloadableOperator.PAREN, LookupMode.NO_GLOBALS);
|
OverloadableOperator.PAREN, LookupMode.NO_GLOBALS);
|
||||||
|
@ -111,7 +111,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null)
|
if (fType == null)
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
return fType;
|
return fType;
|
||||||
|
@ -126,7 +126,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
|
||||||
return ExpressionTypes.typeFromFunctionCall(overload);
|
return ExpressionTypes.typeFromFunctionCall(overload);
|
||||||
|
|
||||||
final ICPPEvaluation arg0 = fArguments[0];
|
final ICPPEvaluation arg0 = fArguments[0];
|
||||||
IType t= SemanticUtil.getNestedType(arg0.getTypeOrFunctionSet(point), TDEF | REF | CVTYPE);
|
IType t= SemanticUtil.getNestedType(arg0.getType(point), TDEF | REF | CVTYPE);
|
||||||
if (t instanceof ICPPClassType) {
|
if (t instanceof ICPPClassType) {
|
||||||
return ProblemType.UNKNOWN_FOR_EXPRESSION;
|
return ProblemType.UNKNOWN_FOR_EXPRESSION;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
|
||||||
if (overload != null)
|
if (overload != null)
|
||||||
return valueCategoryFromFunctionCall(overload);
|
return valueCategoryFromFunctionCall(overload);
|
||||||
|
|
||||||
IType t= fArguments[0].getTypeOrFunctionSet(point);
|
IType t= fArguments[0].getType(point);
|
||||||
if (t instanceof IPointerType) {
|
if (t instanceof IPointerType) {
|
||||||
t= SemanticUtil.getNestedType(((IPointerType) t).getType(), TDEF | REF | CVTYPE);
|
t= SemanticUtil.getNestedType(((IPointerType) t).getType(), TDEF | REF | CVTYPE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class EvalFunctionSet extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
return new FunctionSetType(fFunctionSet, fAddressOf);
|
return new FunctionSetType(fFunctionSet, fAddressOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class EvalID extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
return new TypeOfDependentExpression(this);
|
return new TypeOfDependentExpression(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ public class EvalID extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
|
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
|
||||||
IType fieldOwnerType = fieldOwner.getTypeOrFunctionSet(point);
|
IType fieldOwnerType = fieldOwner.getType(point);
|
||||||
if (fIsPointerDeref) {
|
if (fIsPointerDeref) {
|
||||||
fieldOwnerType = SemanticUtil.getSimplifiedType(fieldOwnerType);
|
fieldOwnerType = SemanticUtil.getSimplifiedType(fieldOwnerType);
|
||||||
if (fieldOwnerType instanceof IPointerType) {
|
if (fieldOwnerType instanceof IPointerType) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class EvalInitList extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
return new InitializerListType(this);
|
return new InitializerListType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class EvalMemberAccess extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null) {
|
if (fType == null) {
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,9 +72,9 @@ public class EvalParameterPack extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null) {
|
if (fType == null) {
|
||||||
IType type = fExpansionPattern.getTypeOrFunctionSet(point);
|
IType type = fExpansionPattern.getType(point);
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
fType= ProblemType.UNKNOWN_FOR_EXPRESSION;
|
fType= ProblemType.UNKNOWN_FOR_EXPRESSION;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fOutputType == null) {
|
if (fOutputType == null) {
|
||||||
fOutputType= computeType();
|
fOutputType= computeType();
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class EvalUnary extends CPPDependentEvaluation {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
IType type = fArgument.getTypeOrFunctionSet(point);
|
IType type = fArgument.getType(point);
|
||||||
type = SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
|
type = SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
|
||||||
if (!CPPSemantics.isUserDefined(type))
|
if (!CPPSemantics.isUserDefined(type))
|
||||||
return null;
|
return null;
|
||||||
|
@ -191,7 +191,7 @@ public class EvalUnary extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null)
|
if (fType == null)
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
return fType;
|
return fType;
|
||||||
|
@ -225,9 +225,9 @@ public class EvalUnary extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CPPPointerType(fArgument.getTypeOrFunctionSet(point));
|
return new CPPPointerType(fArgument.getType(point));
|
||||||
case op_star:
|
case op_star:
|
||||||
IType type= fArgument.getTypeOrFunctionSet(point);
|
IType type= fArgument.getType(point);
|
||||||
type = prvalueTypeWithResolvedTypedefs(type);
|
type = prvalueTypeWithResolvedTypedefs(type);
|
||||||
if (type instanceof IPointerType) {
|
if (type instanceof IPointerType) {
|
||||||
return glvalueType(((IPointerType) type).getType());
|
return glvalueType(((IPointerType) type).getType());
|
||||||
|
@ -241,14 +241,14 @@ public class EvalUnary extends CPPDependentEvaluation {
|
||||||
return CPPBasicType.BOOLEAN;
|
return CPPBasicType.BOOLEAN;
|
||||||
case op_postFixDecr:
|
case op_postFixDecr:
|
||||||
case op_postFixIncr:
|
case op_postFixIncr:
|
||||||
return prvalueType(fArgument.getTypeOrFunctionSet(point));
|
return prvalueType(fArgument.getType(point));
|
||||||
case op_plus:
|
case op_plus:
|
||||||
return promoteType(fArgument.getTypeOrFunctionSet(point), true);
|
return promoteType(fArgument.getType(point), true);
|
||||||
case op_minus:
|
case op_minus:
|
||||||
case op_tilde:
|
case op_tilde:
|
||||||
return promoteType(fArgument.getTypeOrFunctionSet(point), false);
|
return promoteType(fArgument.getType(point), false);
|
||||||
}
|
}
|
||||||
return fArgument.getTypeOrFunctionSet(point);
|
return fArgument.getType(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IType promoteType(IType type, boolean allowPointer) {
|
private IType promoteType(IType type, boolean allowPointer) {
|
||||||
|
@ -284,12 +284,12 @@ public class EvalUnary extends CPPDependentEvaluation {
|
||||||
switch (fOperator) {
|
switch (fOperator) {
|
||||||
case op_sizeof: {
|
case op_sizeof: {
|
||||||
SizeAndAlignment info =
|
SizeAndAlignment info =
|
||||||
SizeofCalculator.getSizeAndAlignment(fArgument.getTypeOrFunctionSet(point), point);
|
SizeofCalculator.getSizeAndAlignment(fArgument.getType(point), point);
|
||||||
return info == null ? Value.UNKNOWN : Value.create(info.size);
|
return info == null ? Value.UNKNOWN : Value.create(info.size);
|
||||||
}
|
}
|
||||||
case op_alignOf: {
|
case op_alignOf: {
|
||||||
SizeAndAlignment info =
|
SizeAndAlignment info =
|
||||||
SizeofCalculator.getSizeAndAlignment(fArgument.getTypeOrFunctionSet(point), point);
|
SizeofCalculator.getSizeAndAlignment(fArgument.getType(point), point);
|
||||||
return info == null ? Value.UNKNOWN : Value.create(info.alignment);
|
return info == null ? Value.UNKNOWN : Value.create(info.alignment);
|
||||||
}
|
}
|
||||||
case op_noexcept:
|
case op_noexcept:
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getTypeOrFunctionSet(IASTNode point) {
|
public IType getType(IASTNode point) {
|
||||||
if (fType == null)
|
if (fType == null)
|
||||||
fType= computeType(point);
|
fType= computeType(point);
|
||||||
return fType;
|
return fType;
|
||||||
|
@ -209,7 +209,7 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
|
||||||
if (packSize == CPPTemplates.PACK_SIZE_FAIL || packSize == CPPTemplates.PACK_SIZE_NOT_FOUND) {
|
if (packSize == CPPTemplates.PACK_SIZE_FAIL || packSize == CPPTemplates.PACK_SIZE_NOT_FOUND) {
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
} else if (packSize != CPPTemplates.PACK_SIZE_DEFER) {
|
} else if (packSize != CPPTemplates.PACK_SIZE_DEFER) {
|
||||||
return new EvalFixed(getTypeOrFunctionSet(point), getValueCategory(point), Value.create(packSize));
|
return new EvalFixed(getType(point), getValueCategory(point), Value.create(packSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IType type = CPPTemplates.instantiateType(fOrigType, tpMap, packOffset, within, point);
|
IType type = CPPTemplates.instantiateType(fOrigType, tpMap, packOffset, within, point);
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class HeuristicResolver {
|
||||||
EvalID evalId = (EvalID) evaluation;
|
EvalID evalId = (EvalID) evaluation;
|
||||||
ICPPEvaluation fieldOwner = evalId.getFieldOwner();
|
ICPPEvaluation fieldOwner = evalId.getFieldOwner();
|
||||||
if (fieldOwner != null) {
|
if (fieldOwner != null) {
|
||||||
IType fieldOwnerType = fieldOwner.getTypeOrFunctionSet(point);
|
IType fieldOwnerType = fieldOwner.getType(point);
|
||||||
if (fieldOwnerType instanceof ICPPDeferredClassInstance) {
|
if (fieldOwnerType instanceof ICPPDeferredClassInstance) {
|
||||||
ICPPDeferredClassInstance instance = (ICPPDeferredClassInstance) fieldOwnerType;
|
ICPPDeferredClassInstance instance = (ICPPDeferredClassInstance) fieldOwnerType;
|
||||||
IScope scope = instance.getClassTemplate().getCompositeScope();
|
IScope scope = instance.getClassTemplate().getCompositeScope();
|
||||||
|
@ -158,7 +158,7 @@ public class HeuristicResolver {
|
||||||
// Handle the common case of a dependent type representing the result of
|
// Handle the common case of a dependent type representing the result of
|
||||||
// dereferencing another dependent type.
|
// dereferencing another dependent type.
|
||||||
if (unary.getOperator() == IASTUnaryExpression.op_star) {
|
if (unary.getOperator() == IASTUnaryExpression.op_star) {
|
||||||
IType argument = unary.getArgument().getTypeOrFunctionSet(point);
|
IType argument = unary.getArgument().getType(point);
|
||||||
if (argument instanceof ICPPUnknownType) {
|
if (argument instanceof ICPPUnknownType) {
|
||||||
IType resolved = resolveUnknownType((ICPPUnknownType) argument, point);
|
IType resolved = resolveUnknownType((ICPPUnknownType) argument, point);
|
||||||
resolved = SemanticUtil.getSimplifiedType(resolved);
|
resolved = SemanticUtil.getSimplifiedType(resolved);
|
||||||
|
@ -171,7 +171,7 @@ public class HeuristicResolver {
|
||||||
EvalID id = (EvalID) evaluation;
|
EvalID id = (EvalID) evaluation;
|
||||||
ICPPEvaluation fieldOwner = id.getFieldOwner();
|
ICPPEvaluation fieldOwner = id.getFieldOwner();
|
||||||
if (fieldOwner != null) {
|
if (fieldOwner != null) {
|
||||||
IBinding[] candidates = lookInside(fieldOwner.getTypeOrFunctionSet(point),
|
IBinding[] candidates = lookInside(fieldOwner.getType(point),
|
||||||
id.isPointerDeref(), id.getName(), id.getTemplateArgs(), point);
|
id.isPointerDeref(), id.getName(), id.getTemplateArgs(), point);
|
||||||
if (candidates.length == 1) {
|
if (candidates.length == 1) {
|
||||||
return typeForBinding(candidates[0]);
|
return typeForBinding(candidates[0]);
|
||||||
|
|
|
@ -534,7 +534,7 @@ public class LookupData extends ScopeLookupData {
|
||||||
functionArgTypes= new IType[functionArgs.length];
|
functionArgTypes= new IType[functionArgs.length];
|
||||||
for (int i = 0; i < functionArgs.length; i++) {
|
for (int i = 0; i < functionArgs.length; i++) {
|
||||||
ICPPEvaluation e = functionArgs[i];
|
ICPPEvaluation e = functionArgs[i];
|
||||||
functionArgTypes[i]= getSimplifiedType(e.getTypeOrFunctionSet(getLookupPoint()));
|
functionArgTypes[i]= getSimplifiedType(e.getType(getLookupPoint()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return functionArgTypes;
|
return functionArgTypes;
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class TemplateArgumentDeduction {
|
||||||
if (inner != null) {
|
if (inner != null) {
|
||||||
final EvalInitList eval = ((InitializerListType) arg).getEvaluation();
|
final EvalInitList eval = ((InitializerListType) arg).getEvaluation();
|
||||||
for (ICPPEvaluation clause : eval.getClauses()) {
|
for (ICPPEvaluation clause : eval.getClauses()) {
|
||||||
if (!deduceFromFunctionArg(inner, clause.getTypeOrFunctionSet(point),
|
if (!deduceFromFunctionArg(inner, clause.getType(point),
|
||||||
clause.getValueCategory(point), deduct, point))
|
clause.getValueCategory(point), deduct, point))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class ASTUtil {
|
||||||
|
|
||||||
ICPPASTInitializerClause cppInit = (ICPPASTInitializerClause) init;
|
ICPPASTInitializerClause cppInit = (ICPPASTInitializerClause) init;
|
||||||
ICPPEvaluation eval = cppInit.getEvaluation();
|
ICPPEvaluation eval = cppInit.getEvaluation();
|
||||||
return eval == null ? null : getBaseType(eval.getTypeOrFunctionSet(cppInit));
|
return eval == null ? null : getBaseType(eval.getType(cppInit));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ICPPClassType getReceiverType(IASTFunctionCallExpression fncall) {
|
public static ICPPClassType getReceiverType(IASTFunctionCallExpression fncall) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue