mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 10:25:32 +02:00
Cosmetics.
This commit is contained in:
parent
3550a299d4
commit
824d47c599
3 changed files with 21 additions and 31 deletions
|
@ -156,12 +156,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IASTNode[] getDeclarations() {
|
public IASTNode[] getDeclarations() {
|
||||||
return declarations;
|
return declarations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IASTNode getDefinition() {
|
public IASTNode getDefinition() {
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +227,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IScope getFunctionScope() {
|
public IScope getFunctionScope() {
|
||||||
resolveAllDeclarations();
|
resolveAllDeclarations();
|
||||||
if (definition != null) {
|
if (definition != null) {
|
||||||
|
@ -239,12 +236,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
return declarations[0].getFunctionScope();
|
return declarations[0].getFunctionScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return getASTName().toString();
|
return getASTName().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return getASTName().getSimpleID();
|
return getASTName().getSimpleID();
|
||||||
}
|
}
|
||||||
|
@ -286,7 +281,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ICPPFunctionType getType() {
|
public ICPPFunctionType getType() {
|
||||||
if (type == null)
|
if (type == null)
|
||||||
type = (ICPPFunctionType) CPPVisitor.createType((definition != null) ? definition : declarations[0]);
|
type = (ICPPFunctionType) CPPVisitor.createType((definition != null) ? definition : declarations[0]);
|
||||||
|
@ -358,7 +352,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isStatic() {
|
public boolean isStatic() {
|
||||||
return isStatic(true);
|
return isStatic(true);
|
||||||
}
|
}
|
||||||
|
@ -401,17 +394,14 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
public String[] getQualifiedName() {
|
public String[] getQualifiedName() {
|
||||||
return CPPVisitor.getQualifiedName(this);
|
return CPPVisitor.getQualifiedName(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public char[][] getQualifiedNameCharArray() {
|
public char[][] getQualifiedNameCharArray() {
|
||||||
return CPPVisitor.getQualifiedNameCharArray(this);
|
return CPPVisitor.getQualifiedNameCharArray(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
IScope scope = getScope();
|
IScope scope = getScope();
|
||||||
while (scope != null) {
|
while (scope != null) {
|
||||||
|
|
|
@ -52,6 +52,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
public class Conversions {
|
public class Conversions {
|
||||||
enum UDCMode {allowUDC, noUDC, deferUDC}
|
enum UDCMode {allowUDC, noUDC, deferUDC}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the cost of an implicit conversion sequence
|
* Computes the cost of an implicit conversion sequence
|
||||||
* [over.best.ics] 13.3.3.1
|
* [over.best.ics] 13.3.3.1
|
||||||
|
@ -338,10 +339,10 @@ public class Conversions {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
//constructors
|
// Constructors
|
||||||
if (t instanceof ICPPClassType) {
|
if (t instanceof ICPPClassType) {
|
||||||
ICPPConstructor[] ctors= ((ICPPClassType) t).getConstructors();
|
ICPPConstructor[] ctors= ((ICPPClassType) t).getConstructors();
|
||||||
// select converting constructors
|
// Select converting constructors
|
||||||
int j= 0;
|
int j= 0;
|
||||||
ICPPConstructor[] convertingCtors= new ICPPConstructor[ctors.length];
|
ICPPConstructor[] convertingCtors= new ICPPConstructor[ctors.length];
|
||||||
for (int i = 0; i < ctors.length; i++) {
|
for (int i = 0; i < ctors.length; i++) {
|
||||||
|
@ -364,7 +365,7 @@ public class Conversions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//conversion operators
|
// Conversion operators
|
||||||
boolean ambiguousConversionOperator= false;
|
boolean ambiguousConversionOperator= false;
|
||||||
if (s instanceof ICPPClassType) {
|
if (s instanceof ICPPClassType) {
|
||||||
ICPPMethod[] ops = SemanticUtil.getConversionOperators((ICPPClassType) s);
|
ICPPMethod[] ops = SemanticUtil.getConversionOperators((ICPPClassType) s);
|
||||||
|
@ -456,7 +457,6 @@ public class Conversions {
|
||||||
IType target = getNestedType(cost.target, REF | TDEF);
|
IType target = getNestedType(cost.target, REF | TDEF);
|
||||||
IType source= getNestedType(cost.source, TDEF);
|
IType source= getNestedType(cost.source, TDEF);
|
||||||
|
|
||||||
|
|
||||||
// 4.1 lvalue to rvalue
|
// 4.1 lvalue to rvalue
|
||||||
IType srcRValue= getNestedType(source, REF | TDEF);
|
IType srcRValue= getNestedType(source, REF | TDEF);
|
||||||
if (source instanceof ICPPReferenceType) {
|
if (source instanceof ICPPReferenceType) {
|
||||||
|
@ -524,7 +524,7 @@ public class Conversions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should actually be done in 'checkImplicitConversionSequence', see 13.3.3.1-6 and 8.5.14
|
// This should actually be done in 'checkImplicitConversionSequence', see 13.3.3.1-6 and 8.5.14
|
||||||
// 8.5.14 cv-qualifiers can be ignored for non-class types
|
// 8.5.14 cv-qualifiers can be ignored for non-class types
|
||||||
IType unqualifiedTarget= getNestedType(target, CVQ | PTR_CVQ | TDEF | REF);
|
IType unqualifiedTarget= getNestedType(target, CVQ | PTR_CVQ | TDEF | REF);
|
||||||
if (!(unqualifiedTarget instanceof ICPPClassType)) {
|
if (!(unqualifiedTarget instanceof ICPPClassType)) {
|
||||||
|
@ -788,8 +788,8 @@ public class Conversions {
|
||||||
if (type instanceof IIndexFragmentBinding) {
|
if (type instanceof IIndexFragmentBinding) {
|
||||||
try {
|
try {
|
||||||
return ((IIndexFragmentBinding) type).hasDefinition();
|
return ((IIndexFragmentBinding) type).hasDefinition();
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue