1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +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:
Nathan Ridge 2015-12-18 00:05:37 -05:00 committed by Sergey Prigogin
parent 59de5c303f
commit 54e9a84673
47 changed files with 99 additions and 98 deletions

View file

@ -213,7 +213,7 @@ public abstract class VariableReadWriteFlags {
private IType getArgumentType(IASTInitializerClause argument) {
if (argument instanceof ICPPASTInitializerClause) {
return ((ICPPASTInitializerClause) argument).getEvaluation().getTypeOrFunctionSet(argument);
return ((ICPPASTInitializerClause) argument).getEvaluation().getType(argument);
} else if (argument instanceof IASTExpression) {
return ((IASTExpression) argument).getExpressionType();
}

View file

@ -200,7 +200,7 @@ public class CPPASTArraySubscriptExpression extends ASTNode
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -285,7 +285,7 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -135,7 +135,7 @@ public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpr
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -172,7 +172,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -122,7 +122,7 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -190,7 +190,7 @@ public class CPPASTConditionalExpression extends ASTNode
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -195,7 +195,7 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -268,7 +268,7 @@ public class CPPASTFieldReference extends ASTNode
private ICPPEvaluation createEvaluation() {
ICPPEvaluation ownerEval = fOwner.getEvaluation();
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) {
IBinding binding = fName.resolvePreBinding();
if (binding instanceof CPPFunctionSet)
@ -306,7 +306,7 @@ public class CPPASTFieldReference extends ASTNode
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -342,7 +342,7 @@ public class CPPASTFunctionCallExpression extends ASTNode
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -137,7 +137,7 @@ public class CPPASTIdExpression extends ASTNode
@Override
public IType getExpressionType() {
IType type= getEvaluation().getTypeOrFunctionSet(this);
IType type= getEvaluation().getType(this);
if (type instanceof FunctionSetType) {
IBinding binding= fName.resolveBinding();
if (binding instanceof IFunction) {

View file

@ -215,7 +215,7 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
@Override
public CPPClosureType getExpressionType() {
return (CPPClosureType) getEvaluation().getTypeOrFunctionSet(this);
return (CPPClosureType) getEvaluation().getType(this);
}
@Override

View file

@ -675,7 +675,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -304,7 +304,7 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -71,7 +71,7 @@ public class CPPASTPackExpansionExpression extends ASTNode implements ICPPASTPac
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -75,7 +75,7 @@ public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTP
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -117,7 +117,7 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -117,7 +117,7 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -151,7 +151,7 @@ public class CPPASTTypeIdInitializerExpression extends ASTNode
@Override
public IType getExpressionType() {
return getEvaluation().getTypeOrFunctionSet(this);
return getEvaluation().getType(this);
}
@Override

View file

@ -218,7 +218,7 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
@Override
public IType getExpressionType() {
IType type= getEvaluation().getTypeOrFunctionSet(this);
IType type= getEvaluation().getType(this);
if (type instanceof FunctionSetType) {
type= fOperand.getExpressionType();
if (fOperator == op_amper) {

View file

@ -43,7 +43,7 @@ public class CPPTemplateNonTypeArgument implements ICPPTemplateArgument {
// Avoid nesting EvalFixed's as nesting causes the signature to be different.
fEvaluation = value.getEvaluation();
} else {
fEvaluation= new EvalFixed(evaluation.getTypeOrFunctionSet(point),
fEvaluation= new EvalFixed(evaluation.getType(point),
evaluation.getValueCategory(point), value);
}
}
@ -85,17 +85,17 @@ public class CPPTemplateNonTypeArgument implements ICPPTemplateArgument {
@Override
public IType getTypeOfNonTypeValue() {
return fEvaluation.getTypeOrFunctionSet(null);
return fEvaluation.getType(null);
}
@Override
public boolean isPackExpansion() {
return fEvaluation.getTypeOrFunctionSet(null) instanceof ICPPParameterPackType;
return fEvaluation.getType(null) instanceof ICPPParameterPackType;
}
@Override
public ICPPTemplateArgument getExpansionPattern() {
IType type = fEvaluation.getTypeOrFunctionSet(null);
IType type = fEvaluation.getType(null);
if (type instanceof ICPPParameterPackType) {
IType t= ((ICPPParameterPackType) type).getType();
if (t != null) {

View file

@ -49,12 +49,13 @@ public interface ICPPEvaluation extends ISerializableEvaluation {
boolean isConstantExpression(IASTNode point);
/**
* Returns the type of the expression, or a {@code FunctionSetType} if the expression evaluates
* to a function set.
* Returns the type of the expression.
*
* 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
*/
IType getTypeOrFunctionSet(IASTNode point);
IType getType(IASTNode point);
/**
* Returns the value of the expression.

View file

@ -88,13 +88,13 @@ class BuiltinOperators {
fUnary= args.length < 2;
fGlobalCandidates= globCandidates;
if (args.length > 0) {
IType type= args[0].getTypeOrFunctionSet(point);
IType type= args[0].getType(point);
if (!(type instanceof ISemanticProblem))
fType1= type;
}
if (args.length > 1) {
IType type= args[1].getTypeOrFunctionSet(point);
IType type= args[1].getType(point);
if (!(type instanceof ISemanticProblem))
fType2= type;
}

View file

@ -1246,7 +1246,7 @@ public class CPPSemantics {
if (expression instanceof ICPPASTLiteralExpression) {
final ICPPASTLiteralExpression litExpr = (ICPPASTLiteralExpression) expression;
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) {
result[0]= true;
return PROCESS_ABORT;
@ -3297,9 +3297,9 @@ public class CPPSemantics {
if (op == null || arg1 == null || arg2 == 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(
getNestedType(arg2.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE)))
getNestedType(arg2.getType(pointOfInstantiation), TDEF | REF | CVTYPE)))
return null;
final LookupMode lookupNonMember;
@ -3338,7 +3338,7 @@ public class CPPSemantics {
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);
}
@ -3435,7 +3435,7 @@ public class CPPSemantics {
IASTEqualsInitializer eqInit= (IASTEqualsInitializer) initializer;
ICPPASTInitializerClause initClause = (ICPPASTInitializerClause) eqInit.getInitializerClause();
final ICPPEvaluation evaluation = initClause.getEvaluation();
IType sourceType= evaluation.getTypeOrFunctionSet(typeId);
IType sourceType= evaluation.getType(typeId);
ValueCategory isLValue= evaluation.getValueCategory(typeId);
if (sourceType != null) {
Cost c;
@ -3556,8 +3556,8 @@ public class CPPSemantics {
*/
public static ICPPFunction findOverloadedOperatorComma(IASTNode pointOfInstantiation, IScope pointOfDefinition,
ICPPEvaluation arg1, ICPPEvaluation arg2) {
IType op1type = getNestedType(arg1.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE);
IType op2type = getNestedType(arg2.getTypeOrFunctionSet(pointOfInstantiation), TDEF | REF | CVTYPE);
IType op1type = getNestedType(arg1.getType(pointOfInstantiation), TDEF | REF | CVTYPE);
IType op2type = getNestedType(arg2.getType(pointOfInstantiation), TDEF | REF | CVTYPE);
if (!isUserDefined(op1type) && !isUserDefined(op2type))
return null;
@ -3577,7 +3577,7 @@ public class CPPSemantics {
ICPPClassType callToObjectOfClassType= null;
IType type2= null;
if (args.length >= 2) {
type2 = args[1].getTypeOrFunctionSet(pointOfInstantiation);
type2 = args[1].getType(pointOfInstantiation);
type2= getNestedType(type2, TDEF | REF | CVTYPE);
}

View file

@ -1344,7 +1344,7 @@ public class CPPTemplates {
ICPPEvaluation instantiated = eval.instantiate(tpMap, packOffset, within,
Value.MAX_RECURSION_DEPTH, point);
if (instantiated != eval)
return instantiated.getTypeOrFunctionSet(point);
return instantiated.getType(point);
} else {
IBinding binding= resolveUnknown((ICPPUnknownBinding) type, tpMap, packOffset,
within, point);

View file

@ -2008,7 +2008,7 @@ public class CPPVisitor extends ASTQueries {
sizeValue = Value.create(clauses.length);
} else if (clause instanceof ICPPASTLiteralExpression) {
ICPPEvaluation value = ((ICPPASTLiteralExpression) clause).getEvaluation();
IType valueType = value.getTypeOrFunctionSet(clause);
IType valueType = value.getType(clause);
if (valueType instanceof IArrayType) {
sizeValue = ((IArrayType) valueType).getSize();
}
@ -2173,7 +2173,7 @@ public class CPPVisitor extends ASTQueries {
}
type = decorateType(type, declSpec, declarator);
final ICPPEvaluation evaluation = initClause.getEvaluation();
initType= evaluation.getTypeOrFunctionSet(declarator);
initType= evaluation.getType(declarator);
valueCat= evaluation.getValueCategory(declarator);
if (initType == null || initType instanceof ISemanticProblem) {
return new ProblemType(ISemanticProblem.TYPE_CANNOT_DEDUCE_AUTO_TYPE);

View file

@ -352,9 +352,9 @@ public class Conversions {
if (listType != null) {
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) {
Cost cost= checkImplicitConversionSequence(listType, clause.getTypeOrFunctionSet(point),
Cost cost= checkImplicitConversionSequence(listType, clause.getType(point),
clause.getValueCategory(point), UDCMode.ALLOWED, Context.ORDINARY, point);
if (!cost.converts())
return cost;
@ -376,7 +376,7 @@ public class Conversions {
ICPPClassType classTarget= (ICPPClassType) noCVTarget;
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);
return cost;
}
@ -387,14 +387,14 @@ public class Conversions {
if (args.length == 1) {
final ICPPEvaluation firstArg = args[0];
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)) {
return Cost.NO_CONVERSION;
}
return cost;
}
} 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;
@ -541,7 +541,7 @@ public class Conversions {
// 13.3.1.7 Initialization by list-initialization
static Cost listInitializationOfClass(EvalInitList arg, ICPPClassType t, boolean isDirect, boolean deferUDC, IASTNode point) throws DOMException {
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);
return c;
}
@ -556,7 +556,7 @@ public class Conversions {
final int minArgCount = ctor.getRequiredArgumentCount();
if (minArgCount == 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);
return c;
}
@ -624,11 +624,11 @@ public class Conversions {
final IBinding result= CPPSemantics.resolveFunction(data, filteredConstructors, true);
final Cost c;
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);
} else if (result instanceof IProblemBinding
&& ((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);
} else {
c= Cost.NO_CONVERSION;

View file

@ -115,7 +115,7 @@ public class EvalBinary extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null) {
if (isTypeDependent()) {
fType= new TypeOfDependentExpression(this);
@ -124,7 +124,7 @@ public class EvalBinary extends CPPDependentEvaluation {
if (overload != null) {
fType= ExpressionTypes.restoreTypedefs(
ExpressionTypes.typeFromFunctionCall(overload),
fArg1.getTypeOrFunctionSet(point), fArg2.getTypeOrFunctionSet(point));
fArg1.getType(point), fArg2.getType(point));
} else {
fType= computeType(point);
}
@ -219,12 +219,12 @@ public class EvalBinary extends CPPDependentEvaluation {
return LVALUE;
case op_pmdot:
if (!(getTypeOrFunctionSet(point) instanceof ICPPFunctionType))
if (!(getType(point) instanceof ICPPFunctionType))
return fArg1.getValueCategory(point);
break;
case op_pmarrow:
if (!(getTypeOrFunctionSet(point) instanceof ICPPFunctionType))
if (!(getType(point) instanceof ICPPFunctionType))
return LVALUE;
break;
}
@ -244,7 +244,7 @@ public class EvalBinary extends CPPDependentEvaluation {
return null;
if (fOperator == op_arrayAccess) {
IType type = fArg1.getTypeOrFunctionSet(point);
IType type = fArg1.getType(point);
type= SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
if (type instanceof ICPPClassType) {
return CPPSemantics.findOverloadedBinaryOperator(point, getTemplateDefinitionScope(),
@ -266,13 +266,13 @@ public class EvalBinary extends CPPDependentEvaluation {
if (o != null)
return typeFromFunctionCall(o);
final IType originalType1 = fArg1.getTypeOrFunctionSet(point);
final IType originalType1 = fArg1.getType(point);
final IType type1 = prvalueTypeWithResolvedTypedefs(originalType1);
if (type1 instanceof ISemanticProblem) {
return type1;
}
final IType originalType2 = fArg2.getTypeOrFunctionSet(point);
final IType originalType2 = fArg2.getType(point);
final IType type2 = prvalueTypeWithResolvedTypedefs(originalType2);
if (type2 instanceof ISemanticProblem) {
return type2;

View file

@ -73,7 +73,7 @@ public class EvalBinaryTypeId extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
switch (fOperator) {
case __is_base_of:
return CPPBasicType.BOOLEAN;

View file

@ -256,7 +256,7 @@ public class EvalBinding extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null) {
fType= computeType(point);
}

View file

@ -110,7 +110,7 @@ public class EvalComma extends CPPDependentEvaluation {
} else {
overloads[i - 1] = overload;
e1= new EvalFixed(typeFromFunctionCall(overload), valueCategoryFromFunctionCall(overload), Value.UNKNOWN);
if (e1.getTypeOrFunctionSet(point) instanceof ISemanticProblem) {
if (e1.getType(point) instanceof ISemanticProblem) {
e1= e2;
}
}
@ -119,7 +119,7 @@ public class EvalComma extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null) {
fType= computeType(point);
}
@ -137,7 +137,7 @@ public class EvalComma extends CPPDependentEvaluation {
return typeFromFunctionCall(last);
}
}
return fArguments[fArguments.length - 1].getTypeOrFunctionSet(point);
return fArguments[fArguments.length - 1].getType(point);
}
@Override

View file

@ -71,8 +71,8 @@ public class EvalCompound extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
return fDelegate.getTypeOrFunctionSet(point);
public IType getType(IASTNode point) {
return fDelegate.getType(point);
}
@Override

View file

@ -108,7 +108,7 @@ public class EvalConditional extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
evaluate(point);
return fType;
}
@ -162,8 +162,8 @@ public class EvalConditional extends CPPDependentEvaluation {
final ICPPEvaluation positive = fPositive == null ? fCondition : fPositive;
IType t2 = positive.getTypeOrFunctionSet(point);
IType t3 = fNegative.getTypeOrFunctionSet(point);
IType t2 = positive.getType(point);
IType t3 = fNegative.getType(point);
final IType uqt2= getNestedType(t2, TDEF | REF | CVTYPE);
final IType uqt3= getNestedType(t3, TDEF | REF | CVTYPE);

View file

@ -104,7 +104,7 @@ public class EvalFixed extends CPPEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
return fType;
}

View file

@ -102,7 +102,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
if (isTypeDependent())
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) {
return CPPSemantics.findOverloadedOperator(point, getTemplateDefinitionScope(), fArguments, t,
OverloadableOperator.PAREN, LookupMode.NO_GLOBALS);
@ -111,7 +111,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null)
fType= computeType(point);
return fType;
@ -126,7 +126,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
return ExpressionTypes.typeFromFunctionCall(overload);
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) {
return ProblemType.UNKNOWN_FOR_EXPRESSION;
}
@ -159,7 +159,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
if (overload != null)
return valueCategoryFromFunctionCall(overload);
IType t= fArguments[0].getTypeOrFunctionSet(point);
IType t= fArguments[0].getType(point);
if (t instanceof IPointerType) {
t= SemanticUtil.getNestedType(((IPointerType) t).getType(), TDEF | REF | CVTYPE);
}

View file

@ -148,7 +148,7 @@ public class EvalFunctionSet extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
return new FunctionSetType(fFunctionSet, fAddressOf);
}

View file

@ -150,7 +150,7 @@ public class EvalID extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
return new TypeOfDependentExpression(this);
}
@ -370,7 +370,7 @@ public class EvalID extends CPPDependentEvaluation {
}
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
IType fieldOwnerType = fieldOwner.getTypeOrFunctionSet(point);
IType fieldOwnerType = fieldOwner.getType(point);
if (fIsPointerDeref) {
fieldOwnerType = SemanticUtil.getSimplifiedType(fieldOwnerType);
if (fieldOwnerType instanceof IPointerType) {

View file

@ -71,7 +71,7 @@ public class EvalInitList extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
return new InitializerListType(this);
}

View file

@ -220,7 +220,7 @@ public class EvalMemberAccess extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null) {
fType= computeType(point);
}

View file

@ -72,9 +72,9 @@ public class EvalParameterPack extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null) {
IType type = fExpansionPattern.getTypeOrFunctionSet(point);
IType type = fExpansionPattern.getType(point);
if (type == null) {
fType= ProblemType.UNKNOWN_FOR_EXPRESSION;
} else {

View file

@ -90,7 +90,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fOutputType == null) {
fOutputType= computeType();
}

View file

@ -175,7 +175,7 @@ public class EvalUnary extends CPPDependentEvaluation {
return null;
}
IType type = fArgument.getTypeOrFunctionSet(point);
IType type = fArgument.getType(point);
type = SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
if (!CPPSemantics.isUserDefined(type))
return null;
@ -191,7 +191,7 @@ public class EvalUnary extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null)
fType= computeType(point);
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:
IType type= fArgument.getTypeOrFunctionSet(point);
IType type= fArgument.getType(point);
type = prvalueTypeWithResolvedTypedefs(type);
if (type instanceof IPointerType) {
return glvalueType(((IPointerType) type).getType());
@ -241,14 +241,14 @@ public class EvalUnary extends CPPDependentEvaluation {
return CPPBasicType.BOOLEAN;
case op_postFixDecr:
case op_postFixIncr:
return prvalueType(fArgument.getTypeOrFunctionSet(point));
return prvalueType(fArgument.getType(point));
case op_plus:
return promoteType(fArgument.getTypeOrFunctionSet(point), true);
return promoteType(fArgument.getType(point), true);
case op_minus:
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) {
@ -284,12 +284,12 @@ public class EvalUnary extends CPPDependentEvaluation {
switch (fOperator) {
case op_sizeof: {
SizeAndAlignment info =
SizeofCalculator.getSizeAndAlignment(fArgument.getTypeOrFunctionSet(point), point);
SizeofCalculator.getSizeAndAlignment(fArgument.getType(point), point);
return info == null ? Value.UNKNOWN : Value.create(info.size);
}
case op_alignOf: {
SizeAndAlignment info =
SizeofCalculator.getSizeAndAlignment(fArgument.getTypeOrFunctionSet(point), point);
SizeofCalculator.getSizeAndAlignment(fArgument.getType(point), point);
return info == null ? Value.UNKNOWN : Value.create(info.alignment);
}
case op_noexcept:

View file

@ -132,7 +132,7 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
}
@Override
public IType getTypeOrFunctionSet(IASTNode point) {
public IType getType(IASTNode point) {
if (fType == null)
fType= computeType(point);
return fType;
@ -209,7 +209,7 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
if (packSize == CPPTemplates.PACK_SIZE_FAIL || packSize == CPPTemplates.PACK_SIZE_NOT_FOUND) {
return EvalFixed.INCOMPLETE;
} 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);

View file

@ -51,7 +51,7 @@ public class HeuristicResolver {
EvalID evalId = (EvalID) evaluation;
ICPPEvaluation fieldOwner = evalId.getFieldOwner();
if (fieldOwner != null) {
IType fieldOwnerType = fieldOwner.getTypeOrFunctionSet(point);
IType fieldOwnerType = fieldOwner.getType(point);
if (fieldOwnerType instanceof ICPPDeferredClassInstance) {
ICPPDeferredClassInstance instance = (ICPPDeferredClassInstance) fieldOwnerType;
IScope scope = instance.getClassTemplate().getCompositeScope();
@ -158,7 +158,7 @@ public class HeuristicResolver {
// Handle the common case of a dependent type representing the result of
// dereferencing another dependent type.
if (unary.getOperator() == IASTUnaryExpression.op_star) {
IType argument = unary.getArgument().getTypeOrFunctionSet(point);
IType argument = unary.getArgument().getType(point);
if (argument instanceof ICPPUnknownType) {
IType resolved = resolveUnknownType((ICPPUnknownType) argument, point);
resolved = SemanticUtil.getSimplifiedType(resolved);
@ -171,7 +171,7 @@ public class HeuristicResolver {
EvalID id = (EvalID) evaluation;
ICPPEvaluation fieldOwner = id.getFieldOwner();
if (fieldOwner != null) {
IBinding[] candidates = lookInside(fieldOwner.getTypeOrFunctionSet(point),
IBinding[] candidates = lookInside(fieldOwner.getType(point),
id.isPointerDeref(), id.getName(), id.getTemplateArgs(), point);
if (candidates.length == 1) {
return typeForBinding(candidates[0]);

View file

@ -534,7 +534,7 @@ public class LookupData extends ScopeLookupData {
functionArgTypes= new IType[functionArgs.length];
for (int i = 0; i < functionArgs.length; i++) {
ICPPEvaluation e = functionArgs[i];
functionArgTypes[i]= getSimplifiedType(e.getTypeOrFunctionSet(getLookupPoint()));
functionArgTypes[i]= getSimplifiedType(e.getType(getLookupPoint()));
}
}
return functionArgTypes;

View file

@ -150,7 +150,7 @@ public class TemplateArgumentDeduction {
if (inner != null) {
final EvalInitList eval = ((InitializerListType) arg).getEvaluation();
for (ICPPEvaluation clause : eval.getClauses()) {
if (!deduceFromFunctionArg(inner, clause.getTypeOrFunctionSet(point),
if (!deduceFromFunctionArg(inner, clause.getType(point),
clause.getValueCategory(point), deduct, point))
return false;
}

View file

@ -142,7 +142,7 @@ public class ASTUtil {
ICPPASTInitializerClause cppInit = (ICPPASTInitializerClause) init;
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) {