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