1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2009-04-06 05:29:24 +00:00
parent 80a6ae7f57
commit 4a68624fe0

View file

@ -763,7 +763,6 @@ public class CPPSemantics {
}
mergeResults(data, bindings, true);
// store using-directives found in this block or namespace for later use.
if ((!data.hasResults() || !data.qualified() || data.contentAssist) && scope instanceof ICPPNamespaceScope) {
final ICPPNamespaceScope blockScope= (ICPPNamespaceScope) scope;
@ -2562,7 +2561,7 @@ public class CPPSemantics {
}
/*
* Also collections the funciton bindings if requested.
* Also collections the function bindings if requested.
*/
public static IType getChainedMemberAccessOperatorReturnType(ICPPASTFieldReference fieldReference, Collection<ICPPFunction> functionBindings) throws DOMException {
IASTExpression owner = fieldReference.getFieldOwner();
@ -2655,11 +2654,9 @@ public class CPPSemantics {
argsToPass.add(e);
}
args = argsToPass.toArray(new IASTExpression[argsToPass.size()]);
}
else if(param != null) {
} else if (param != null) {
args = new IASTExpression[] { null, param };
}
else {
} else {
args = new IASTExpression[] { null };
}
@ -2688,8 +2685,7 @@ public class CPPSemantics {
if (placement instanceof IASTExpressionList) {
for (IASTExpression p : ((IASTExpressionList) placement).getExpressions())
args.add(p);
}
else if(placement != null) {
} else if (placement != null) {
args.add(placement);
}
@ -2697,7 +2693,6 @@ public class CPPSemantics {
return findOverloadedOperator(exp, argArray, type, op.toCharArray(), true);
}
public static ICPPFunction findOverloadedOperator(ICPPASTDeleteExpression exp) {
OverloadableOperator op = OverloadableOperator.fromDeleteExpression(exp);
IASTExpression[] args = { exp.getOperand() };
@ -2774,7 +2769,6 @@ public class CPPSemantics {
return findOverloadedOperator(exp, args, type, op.toCharArray(), true);
}
public static ICPPFunction findOverloadedOperator(IASTBinaryExpression exp) {
OverloadableOperator op = OverloadableOperator.fromBinaryExpression(exp);
if (op == null)
@ -2795,7 +2789,6 @@ public class CPPSemantics {
return findOverloadedOperator(exp, args, op1type, op.toCharArray(), lookupNonMember);
}
/**
* Returns the operator,() function that would apply to the two given arguments.
* The lookup type of the class where the operator,() might be found must also be provided.
@ -2816,9 +2809,8 @@ public class CPPSemantics {
return findOverloadedOperator(dummy, args, lookupType, name, true);
}
private static ICPPFunction findOverloadedOperator(IASTExpression parent, IASTExpression[] args, IType methodLookupType, char[] operatorName, boolean lookupNonMember) {
// find a method
// Find a method
LookupData methodData = null;
CPPASTName methodName = null;
if (methodLookupType instanceof IProblemBinding)
@ -2841,7 +2833,7 @@ public class CPPSemantics {
}
}
// find a function
// Find a function
LookupData funcData = null;
CPPASTName funcName = null;
if (lookupNonMember) {
@ -2862,7 +2854,7 @@ public class CPPSemantics {
}
}
// resolve ambiguities
// Resolve ambiguities
try {
IBinding binding = null;
if (methodData != null && funcData != null) {
@ -2870,29 +2862,24 @@ public class CPPSemantics {
mergeResults(funcData, methodData.foundItems, false);
funcData.firstArgIsImpliedMethodArg = true;
binding = resolveAmbiguities(funcData, funcName);
}
else if(funcData != null) {
} else if (funcData != null) {
binding = resolveAmbiguities(funcData, funcName);
}
else if(methodData != null) {
} else if (methodData != null) {
binding = resolveAmbiguities(methodData, methodName);
}
if (binding instanceof ICPPFunction)
return (ICPPFunction) binding;
} catch (DOMException e) {
}
return null;
}
private static boolean isUserDefined(IType type) {
return type instanceof ICPPClassType || type instanceof IEnumeration;
}
public static IBinding[] findBindings(IScope scope, String name, boolean qualified) throws DOMException {
return findBindings(scope, name.toCharArray(), qualified, null);
}
@ -3050,5 +3037,4 @@ public class CPPSemantics {
binding = postResolution(binding, data);
return binding;
}
}