mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Fix up PDOM to index ACE+TAO exception free.
This commit is contained in:
parent
0a054c0a7d
commit
ccaf9b361a
7 changed files with 31 additions and 12 deletions
|
@ -54,7 +54,7 @@ public class PDOM extends PlatformObject
|
||||||
|
|
||||||
private Database db;
|
private Database db;
|
||||||
|
|
||||||
public static final int VERSION = 9;
|
public static final int VERSION = 10;
|
||||||
// 0 - the beginning of it all
|
// 0 - the beginning of it all
|
||||||
// 1 - first change to kick off upgrades
|
// 1 - first change to kick off upgrades
|
||||||
// 2 - added file inclusions
|
// 2 - added file inclusions
|
||||||
|
@ -65,6 +65,7 @@ public class PDOM extends PlatformObject
|
||||||
// 7 - class key
|
// 7 - class key
|
||||||
// 8 - enumerators
|
// 8 - enumerators
|
||||||
// 9 - base classes
|
// 9 - base classes
|
||||||
|
// 10 - typedefs, types on C++ variables
|
||||||
|
|
||||||
public static final int LINKAGES = Database.DATA_AREA;
|
public static final int LINKAGES = Database.DATA_AREA;
|
||||||
public static final int FILE_INDEX = Database.DATA_AREA + 4;
|
public static final int FILE_INDEX = Database.DATA_AREA + 4;
|
||||||
|
|
|
@ -82,6 +82,11 @@ public abstract class PDOMNode implements IPDOMNode{
|
||||||
return pdom.getDB().getInt(record + TYPE);
|
return pdom.getDB().getInt(record + TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PDOMNode getParentNode() throws CoreException {
|
||||||
|
int parentrec = pdom.getDB().getInt(record + PARENT);
|
||||||
|
return parentrec != 0 ? getLinkage().getNode(parentrec) : null;
|
||||||
|
}
|
||||||
|
|
||||||
public PDOMLinkage getLinkage() throws CoreException {
|
public PDOMLinkage getLinkage() throws CoreException {
|
||||||
return getLinkage(pdom, record);
|
return getLinkage(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,12 +45,13 @@ public class PDOMPointerType extends PDOMNode implements IPointerType,
|
||||||
|
|
||||||
// type
|
// type
|
||||||
IType targetType = ((ITypeContainer)type).getType();
|
IType targetType = ((ITypeContainer)type).getType();
|
||||||
|
int typeRec = 0;
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
PDOMNode targetTypeNode = getLinkage().addType(this, targetType);
|
PDOMNode targetTypeNode = getLinkage().addType(this, targetType);
|
||||||
if (targetTypeNode != null) {
|
if (targetTypeNode != null)
|
||||||
db.putInt(record + TYPE, targetTypeNode.getRecord());
|
typeRec = targetTypeNode.getRecord();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
db.putInt(record + TYPE, typeRec);
|
||||||
|
|
||||||
// flags
|
// flags
|
||||||
byte flags = 0;
|
byte flags = 0;
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||||
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMMember;
|
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.PDOMMemberOwner;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||||
|
@ -214,13 +215,15 @@ public class PDOMCPPClassType extends PDOMMemberOwner implements ICPPClassType,
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
throw new PDOMNotImplementedError();
|
try {
|
||||||
|
return getParentNode() instanceof PDOMLinkage;
|
||||||
|
} catch (CoreException e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPClassType getClassType() {
|
public ICPPClassType getClassType() {
|
||||||
return null;
|
return this;
|
||||||
// TODO - do we need the real type?
|
|
||||||
// throw new PDOMNotImplementedError();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPMethod[] getImplicitMethods() {
|
public ICPPMethod[] getImplicitMethods() {
|
||||||
|
|
|
@ -37,6 +37,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
|
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
|
||||||
|
@ -221,6 +222,9 @@ public class PDOMCPPLinkage extends PDOMLinkage {
|
||||||
protected int getBindingType(IBinding binding) {
|
protected int getBindingType(IBinding binding) {
|
||||||
if (binding instanceof ICPPVariable)
|
if (binding instanceof ICPPVariable)
|
||||||
return CPPVARIABLE;
|
return CPPVARIABLE;
|
||||||
|
else if (binding instanceof ICPPTemplateDefinition)
|
||||||
|
// this must be before class type
|
||||||
|
return 0;
|
||||||
else if (binding instanceof ICPPFunction)
|
else if (binding instanceof ICPPFunction)
|
||||||
return CPPFUNCTION;
|
return CPPFUNCTION;
|
||||||
else if (binding instanceof ICPPClassType)
|
else if (binding instanceof ICPPClassType)
|
||||||
|
|
|
@ -197,7 +197,12 @@ public class PDOMCPPMethod extends PDOMMember implements ICPPMethod, ICPPFunctio
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
throw new PDOMNotImplementedError();
|
if (type == this)
|
||||||
|
return true;
|
||||||
|
if (type instanceof PDOMCPPMethod)
|
||||||
|
return getRecord() == ((PDOMCPPMethod)type).getRecordSize();
|
||||||
|
// TODO further analysis to compare with DOM objects
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue