Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java
index d260b1e4b9c..bd5e6a46b61 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java
@@ -16,6 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.IValue;
+import org.eclipse.cdt.internal.core.dom.parser.ISerializableEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableType;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
@@ -109,12 +110,12 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
@Override
public void marshalType(IType type) throws CoreException {
- if (type instanceof IBinding) {
- marshalBinding((IBinding) type);
- } else if (type instanceof ISerializableType) {
+ if (type instanceof ISerializableType) {
((ISerializableType) type).marshal(this);
} else if (type == null) {
putByte(NULL_TYPE);
+ } else if (type instanceof IBinding) {
+ marshalBinding((IBinding) type);
} else {
assert false : "Cannot serialize " + ASTTypeUtil.getType(type) + "(" + type.getClass().getName() + ")"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
putByte(UNSTORABLE_TYPE);
@@ -143,6 +144,28 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
}
@Override
+ public void marshalEvaluation(ISerializableEvaluation eval, boolean includeValues) throws CoreException {
+ if (eval == null) {
+ putByte(NULL_TYPE);
+ } else {
+ eval.marshal(this, includeValues);
+ }
+ }
+
+ @Override
+ public ISerializableEvaluation unmarshalEvaluation() throws CoreException {
+ if (fPos >= fBuffer.length)
+ throw unmarshallingError();
+
+ byte firstByte= fBuffer[fPos];
+ if (firstByte == NULL_TYPE) {
+ fPos++;
+ return null;
+ }
+ return fLinkage.unmarshalEvaluation(this);
+ }
+
+ @Override
public void marshalValue(IValue value) throws CoreException {
if (value instanceof Value) {
((Value) value).marshall(this);

Back to the top