mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 18:25:40 +02:00
PDOM - Some minor fixes to get by PDOMNotImplemented errors while indexing real projects.
This commit is contained in:
parent
0017da7863
commit
f61c63ba58
5 changed files with 24 additions and 8 deletions
|
@ -1108,13 +1108,14 @@ public class CPPSemantics {
|
|||
ICPPBase [] bases = null;
|
||||
if( lookIn instanceof ICPPClassScope ){
|
||||
ICPPClassType c = ((ICPPClassScope)lookIn).getClassType();
|
||||
bases = c.getBases();
|
||||
if (c != null)
|
||||
bases = c.getBases();
|
||||
}
|
||||
|
||||
Object inherited = null;
|
||||
Object result = null;
|
||||
|
||||
if( bases.length == 0 )
|
||||
if( bases == null || bases.length == 0 )
|
||||
return null;
|
||||
|
||||
//use data to detect circular inheritance
|
||||
|
|
|
@ -40,7 +40,9 @@ public class PDOMCField extends PDOMMember implements IField {
|
|||
}
|
||||
|
||||
public IType getType() throws DOMException {
|
||||
throw new PDOMNotImplementedError();
|
||||
return null;
|
||||
// TODO - do we need the real type?
|
||||
//throw new PDOMNotImplementedError();
|
||||
}
|
||||
|
||||
public boolean isStatic() throws DOMException {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class PDOMCStructure extends PDOMMemberOwner implements ICompositeType {
|
|||
public IField findField(String name) throws DOMException {
|
||||
try {
|
||||
PDOMMember[] members = findMembers(name.toCharArray());
|
||||
return (PDOMCField)members[0];
|
||||
return members.length > 0 ? (PDOMCField)members[0] : null;
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
return null;
|
||||
|
|
|
@ -13,8 +13,10 @@ package org.eclipse.cdt.internal.core.pdom.dom.c;
|
|||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.IVariable;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.c.CVariable;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOMDatabase;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
|
@ -29,6 +31,8 @@ public class PDOMCVariable extends PDOMBinding implements IVariable {
|
|||
|
||||
public PDOMCVariable(PDOMDatabase pdom, PDOMNode parent, IASTName name) throws CoreException {
|
||||
super(pdom, parent, name, PDOMCLinkage.CVARIABLE);
|
||||
CVariable binding = (CVariable)name.getBinding();
|
||||
IType type = binding.getType();
|
||||
}
|
||||
|
||||
public PDOMCVariable(PDOMDatabase pdom, int record) {
|
||||
|
@ -40,7 +44,9 @@ public class PDOMCVariable extends PDOMBinding implements IVariable {
|
|||
}
|
||||
|
||||
public IType getType() throws DOMException {
|
||||
throw new PDOMNotImplementedError();
|
||||
return null;
|
||||
// TODO - do we need the real type?
|
||||
//throw new PDOMNotImplementedError();
|
||||
}
|
||||
|
||||
public boolean isStatic() throws DOMException {
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOMDatabase;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMMember;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMMemberOwner;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
|
@ -53,7 +54,11 @@ public class PDOMCPPClassType extends PDOMMemberOwner implements ICPPClassType,
|
|||
}
|
||||
|
||||
public boolean isSameType(IType type) {
|
||||
throw new PDOMNotImplementedError();
|
||||
if (type instanceof PDOMBinding)
|
||||
return record == ((PDOMBinding)type).getRecord();
|
||||
else
|
||||
// TODO - should we check for real?
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
|
@ -121,7 +126,9 @@ public class PDOMCPPClassType extends PDOMMemberOwner implements ICPPClassType,
|
|||
}
|
||||
|
||||
public ICPPClassType getClassType() {
|
||||
throw new PDOMNotImplementedError();
|
||||
return null;
|
||||
// TODO - do we need the real type?
|
||||
//throw new PDOMNotImplementedError();
|
||||
}
|
||||
|
||||
public ICPPMethod[] getImplicitMethods() {
|
||||
|
@ -148,7 +155,7 @@ public class PDOMCPPClassType extends PDOMMemberOwner implements ICPPClassType,
|
|||
try {
|
||||
PDOMMember[] matches = findMembers(name.toCharArray());
|
||||
// TODO - need to check for overloads
|
||||
return matches[0];
|
||||
return matches.length > 0 ? matches[0] : null;
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue