1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Remove the redundant ISerializableExecution interface

Change-Id: If7b2fdcf372685c9a251d92e6e24ed40188e449a
This commit is contained in:
Nathan Ridge 2016-12-12 16:23:45 -05:00
parent 4405ae2580
commit 3f3b8b2ee7
26 changed files with 70 additions and 102 deletions

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2016 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
import org.eclipse.core.runtime.CoreException;
/**
* Interface for marshalling ICPPExecution objects for storage in the index.
*/
public interface ISerializableExecution {
/**
* Marshals an ICPPExecution object for storage in the index.
*
* @param buffer The buffer that will hold the marshalled ICPPExecution object.
* @param includeValue Specifies whether nested IValue objects should be marshalled as well.
* */
void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException;
}

View file

@ -18,6 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.IValue;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
import org.eclipse.core.runtime.CoreException;
/**
@ -118,7 +119,7 @@ public interface ITypeMarshalBuffer {
IValue unmarshalValue() throws CoreException;
IBinding unmarshalBinding() throws CoreException;
ICPPEvaluation unmarshalEvaluation() throws CoreException;
ISerializableExecution unmarshalExecution() throws CoreException;
ICPPExecution unmarshalExecution() throws CoreException;
ICPPTemplateArgument unmarshalTemplateArgument() throws CoreException;
int getByte() throws CoreException;
int getFixedInt() throws CoreException;
@ -144,7 +145,7 @@ public interface ITypeMarshalBuffer {
void marshalValue(IValue value) throws CoreException;
void marshalBinding(IBinding binding) throws CoreException;
void marshalEvaluation(ICPPEvaluation eval, boolean includeValue) throws CoreException;
void marshalExecution(ISerializableExecution exec, boolean includeValue) throws CoreException;
void marshalExecution(ICPPExecution exec, boolean includeValue) throws CoreException;
void marshalTemplateArgument(ICPPTemplateArgument arg) throws CoreException;
void putByte(byte data);
void putFixedInt(int data);

View file

@ -8,14 +8,15 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ActivationRecord;
import org.eclipse.core.runtime.CoreException;
/**
* Assists in executing statements for constexpr evaluation
*/
public interface ICPPExecution extends ISerializableExecution {
public interface ICPPExecution {
/**
* Instantiates the execution with the provided template parameter map and pack offset.
* The context is used to replace templates with their specialization, where appropriate.
@ -32,4 +33,12 @@ public interface ICPPExecution extends ISerializableExecution {
* @return the computed execution
*/
ICPPExecution executeForFunctionCall(ActivationRecord record, ConstexprEvaluationContext context);
/**
* Marshals an ICPPExecution object for storage in the index.
*
* @param buffer The buffer that will hold the marshalled ICPPExecution object.
* @param includeValue Specifies whether nested IValue objects should be marshalled as well.
* */
void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException;
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
@ -31,7 +30,7 @@ public class ExecBreak implements ICPPExecution {
buffer.putShort(ITypeMarshalBuffer.EXEC_BREAK);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
return new ExecBreak();
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -53,8 +52,8 @@ public class ExecCase implements ICPPExecution {
buffer.marshalEvaluation(caseExprEval, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation caseExprEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation caseExprEval = buffer.unmarshalEvaluation();
return new ExecCase(caseExprEval);
}
}

View file

@ -9,7 +9,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
@ -71,11 +70,11 @@ public class ExecCompoundStatement implements ICPPExecution {
}
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
int len = buffer.getInt();
ICPPExecution[] executions = new ICPPExecution[len];
for (int i = 0; i < executions.length; i++) {
executions[i] = (ICPPExecution) buffer.unmarshalExecution();
executions[i] = buffer.unmarshalExecution();
}
return new ExecCompoundStatement(executions);
}

View file

@ -13,7 +13,6 @@ import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -54,12 +53,12 @@ public class ExecConstructorChain implements ICPPExecution {
}
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
int len = buffer.getInt();
Map<IBinding, ICPPEvaluation> ccInitializers = new HashMap<>();
for (int i = 0; i < len; i++) {
IBinding member = buffer.unmarshalBinding();
ICPPEvaluation memberEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
ICPPEvaluation memberEval = buffer.unmarshalEvaluation();
ccInitializers.put(member, memberEval);
}
return new ExecConstructorChain(ccInitializers);

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
@ -31,7 +30,7 @@ public class ExecContinue implements ICPPExecution {
buffer.putShort(ITypeMarshalBuffer.EXEC_CONTINUE);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
return new ExecContinue();
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
@ -46,8 +45,8 @@ public class ExecDeclarationStatement implements ICPPExecution {
buffer.marshalExecution(declarationExec, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPExecution declarationExec = (ICPPExecution) buffer.unmarshalExecution();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPExecution declarationExec = buffer.unmarshalExecution();
return new ExecDeclarationStatement(declarationExec);
}
}

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
import org.eclipse.cdt.internal.core.dom.parser.CompositeValue;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPQualifierType;
@ -249,9 +248,9 @@ public final class ExecDeclarator implements ICPPExecution {
buffer.marshalEvaluation(initializerEval, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPBinding declaredBinding = (ICPPBinding) buffer.unmarshalBinding();
ICPPEvaluation initializerEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
ICPPEvaluation initializerEval = buffer.unmarshalEvaluation();
return new ExecDeclarator(declaredBinding, initializerEval);
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
@ -31,7 +30,7 @@ public class ExecDefault implements ICPPExecution {
buffer.putShort(ITypeMarshalBuffer.EXEC_DEFAULT);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
return new ExecDefault();
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -59,9 +58,9 @@ public class ExecDo implements ICPPExecution {
buffer.marshalExecution(bodyExec, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation conditionEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
ICPPExecution bodyExec = (ICPPExecution) buffer.unmarshalExecution();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation conditionEval = buffer.unmarshalEvaluation();
ICPPExecution bodyExec = buffer.unmarshalExecution();
return new ExecDo(conditionEval, bodyExec);
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -47,8 +46,8 @@ public class ExecExpressionStatement implements ICPPExecution {
buffer.marshalEvaluation(exprEval, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation exprEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation exprEval = buffer.unmarshalEvaluation();
return new ExecExpressionStatement(exprEval);
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -98,12 +97,12 @@ public class ExecFor implements ICPPExecution {
buffer.marshalExecution(bodyExec, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPExecution initializerExec = (ICPPExecution) buffer.unmarshalExecution();
ICPPEvaluation conditionExprEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPExecution initializerExec = buffer.unmarshalExecution();
ICPPEvaluation conditionExprEval = buffer.unmarshalEvaluation();
ExecSimpleDeclaration conditionDeclExec = (ExecSimpleDeclaration) buffer.unmarshalExecution();
ICPPEvaluation iterationEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
ICPPExecution bodyExec = (ICPPExecution) buffer.unmarshalExecution();
ICPPEvaluation iterationEval = buffer.unmarshalEvaluation();
ICPPExecution bodyExec = buffer.unmarshalExecution();
return new ExecFor(initializerExec, conditionExprEval, conditionDeclExec, iterationEval, bodyExec);
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -67,11 +66,11 @@ public class ExecIf implements ICPPExecution {
buffer.marshalExecution(elseClauseExec, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation conditionExprEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation conditionExprEval = buffer.unmarshalEvaluation();
ExecSimpleDeclaration conditionDeclExec = (ExecSimpleDeclaration) buffer.unmarshalExecution();
ICPPExecution thenClauseExec = (ICPPExecution) buffer.unmarshalExecution();
ICPPExecution elseClauseExec = (ICPPExecution) buffer.unmarshalExecution();
ICPPExecution thenClauseExec = buffer.unmarshalExecution();
ICPPExecution elseClauseExec = buffer.unmarshalExecution();
return new ExecIf(conditionExprEval, conditionDeclExec, thenClauseExec, elseClauseExec);
}
}

View file

@ -24,7 +24,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
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.ICPPReferenceType;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -186,12 +185,12 @@ public class ExecRangeBasedFor implements ICPPExecution {
buffer.marshalExecution(bodyExec, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ExecSimpleDeclaration declarationExec = (ExecSimpleDeclaration) buffer.unmarshalExecution();
ICPPEvaluation initClauseEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
ICPPEvaluation initClauseEval = buffer.unmarshalEvaluation();
ICPPFunction begin = (ICPPFunction) buffer.unmarshalBinding();
ICPPFunction end = (ICPPFunction) buffer.unmarshalBinding();
ICPPExecution bodyExec = (ICPPExecution) buffer.unmarshalExecution();
ICPPExecution bodyExec = buffer.unmarshalExecution();
return new ExecRangeBasedFor(declarationExec, initClauseEval, begin, end, bodyExec);
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -51,8 +50,8 @@ public class ExecReturn implements ICPPExecution {
buffer.marshalEvaluation(retVal, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation retVal = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation retVal = buffer.unmarshalEvaluation();
return new ExecReturn(retVal);
}
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
@ -53,11 +52,11 @@ public class ExecSimpleDeclaration implements ICPPExecution {
}
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
int len = buffer.getInt();
ICPPExecution[] declaratorExecutions = new ICPPExecution[len];
for (int i = 0; i < declaratorExecutions.length; i++) {
declaratorExecutions[i] = (ICPPExecution) buffer.unmarshalExecution();
declaratorExecutions[i] = buffer.unmarshalExecution();
}
return new ExecSimpleDeclaration(declaratorExecutions);
}

View file

@ -9,7 +9,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.core.dom.ast.IValue;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -103,13 +102,13 @@ public class ExecSwitch implements ICPPExecution {
}
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation controllerExprEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation controllerExprEval = buffer.unmarshalEvaluation();
ExecSimpleDeclaration controllerDeclExec = (ExecSimpleDeclaration) buffer.unmarshalExecution();
int len = buffer.getInt();
ICPPExecution[] bodyStmtExecutions = new ICPPExecution[len];
for (int i = 0; i < bodyStmtExecutions.length; i++) {
bodyStmtExecutions[i] = (ICPPExecution) buffer.unmarshalExecution();
bodyStmtExecutions[i] = buffer.unmarshalExecution();
}
return new ExecSwitch(controllerExprEval, controllerDeclExec, bodyStmtExecutions);
}

View file

@ -8,7 +8,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation.ConstexprEvaluationContext;
@ -74,10 +73,10 @@ public class ExecWhile implements ICPPExecution {
buffer.marshalExecution(bodyExec, includeValue);
}
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation conditionExprEval = (ICPPEvaluation) buffer.unmarshalEvaluation();
public static ICPPExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
ICPPEvaluation conditionExprEval = buffer.unmarshalEvaluation();
ExecSimpleDeclaration conditionDeclExec = (ExecSimpleDeclaration) buffer.unmarshalExecution();
ICPPExecution bodyExec = (ICPPExecution) buffer.unmarshalExecution();
ICPPExecution bodyExec = buffer.unmarshalExecution();
return new ExecWhile(conditionExprEval, conditionDeclExec, bodyExec);
}
}

View file

@ -18,10 +18,10 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
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.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
import org.eclipse.core.runtime.CoreException;
class SignatureBuilder implements ITypeMarshalBuffer {
@ -92,7 +92,7 @@ class SignatureBuilder implements ITypeMarshalBuffer {
}
@Override
public void marshalExecution(ISerializableExecution exec, boolean includeValue) throws CoreException {
public void marshalExecution(ICPPExecution exec, boolean includeValue) throws CoreException {
if (exec == null) {
putShort(NULL_TYPE);
} else {
@ -178,7 +178,7 @@ class SignatureBuilder implements ITypeMarshalBuffer {
}
@Override
public ISerializableExecution unmarshalExecution() throws CoreException {
public ICPPExecution unmarshalExecution() throws CoreException {
throw new UnsupportedOperationException();
}

View file

@ -39,10 +39,10 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDirective;
import org.eclipse.cdt.core.index.IIndexLinkage;
import org.eclipse.cdt.core.parser.util.CharArrayMap;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
import org.eclipse.cdt.internal.core.index.IIndexBindingConstants;
import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.cdt.internal.core.pdom.PDOM;
@ -430,7 +430,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
public abstract IType unmarshalType(ITypeMarshalBuffer buffer) throws CoreException;
public abstract IBinding unmarshalBinding(ITypeMarshalBuffer buffer) throws CoreException;
public abstract ICPPEvaluation unmarshalEvaluation(ITypeMarshalBuffer typeMarshalBuffer) throws CoreException;
public abstract ISerializableExecution unmarshalExecution(ITypeMarshalBuffer typeMarhsalBuffer) throws CoreException;
public abstract ICPPExecution unmarshalExecution(ITypeMarshalBuffer typeMarhsalBuffer) throws CoreException;
public void storeType(long offset, IType type) throws CoreException {
final Database db= getDB();
@ -694,13 +694,13 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
return buffer.unmarshalEvaluation();
}
public void storeExecution(long offset, ISerializableExecution exec) throws CoreException {
public void storeExecution(long offset, ICPPExecution exec) throws CoreException {
final Database db = getDB();
deleteExecution(db, offset);
storeExecution(db, offset, exec);
}
private void storeExecution(Database db, long offset, ISerializableExecution exec) throws CoreException {
private void storeExecution(Database db, long offset, ICPPExecution exec) throws CoreException {
if (exec != null) {
TypeMarshalBuffer bc = new TypeMarshalBuffer(this);
bc.marshalExecution(exec, true);
@ -712,7 +712,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
deleteSerializedData(db, offset, Database.EXECUTION_SIZE);
}
public ISerializableExecution loadExecution(long offset) throws CoreException {
public ICPPExecution loadExecution(long offset) throws CoreException {
TypeMarshalBuffer buffer = loadBuffer(offset, Database.EXECUTION_SIZE);
if (buffer == null)
return null;

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.internal.core.dom.parser.CStringValue;
import org.eclipse.cdt.internal.core.dom.parser.CompositeValue;
import org.eclipse.cdt.internal.core.dom.parser.DependentValue;
import org.eclipse.cdt.internal.core.dom.parser.FloatingPointValue;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
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.IntegralValue;
@ -32,6 +31,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateNonTypeArgument;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateTypeArgument;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.core.runtime.CoreException;
@ -168,7 +168,7 @@ public final class TypeMarshalBuffer implements ITypeMarshalBuffer {
}
@Override
public void marshalExecution(ISerializableExecution exec, boolean includeValue) throws CoreException {
public void marshalExecution(ICPPExecution exec, boolean includeValue) throws CoreException {
if (exec == null) {
putShort(NULL_TYPE);
} else {
@ -182,7 +182,7 @@ public final class TypeMarshalBuffer implements ITypeMarshalBuffer {
}
@Override
public ISerializableExecution unmarshalExecution() throws CoreException {
public ICPPExecution unmarshalExecution() throws CoreException {
return fLinkage.unmarshalExecution(this);
}

View file

@ -26,7 +26,6 @@ import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.internal.core.dom.ast.tag.TagManager;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
import org.eclipse.cdt.internal.core.dom.parser.c.CArrayType;
@ -35,6 +34,7 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CFunctionType;
import org.eclipse.cdt.internal.core.dom.parser.c.CPointerType;
import org.eclipse.cdt.internal.core.dom.parser.c.CQualifierType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
import org.eclipse.cdt.internal.core.index.IIndexBindingConstants;
import org.eclipse.cdt.internal.core.index.IIndexCBindingConstants;
import org.eclipse.cdt.internal.core.index.composite.CompositeIndexBinding;
@ -387,7 +387,7 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants {
}
@Override
public ISerializableExecution unmarshalExecution(ITypeMarshalBuffer buffer)
public ICPPExecution unmarshalExecution(ITypeMarshalBuffer buffer)
throws CoreException {
throw new CoreException(CCorePlugin.createStatus("Cannot unmarshal an execution, first byte=" + buffer.getByte())); //$NON-NLS-1$
}

View file

@ -86,7 +86,6 @@ import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.ast.tag.TagManager;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
import org.eclipse.cdt.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPArrayType;
@ -1619,7 +1618,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
}
@Override
public ISerializableExecution unmarshalExecution(ITypeMarshalBuffer buffer) throws CoreException {
public ICPPExecution unmarshalExecution(ITypeMarshalBuffer buffer) throws CoreException {
short firstBytes = buffer.getShort();
if(firstBytes == TypeMarshalBuffer.NULL_TYPE)
return null;

View file

@ -17,9 +17,9 @@ import org.eclipse.cdt.core.dom.ILinkage;
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.internal.core.dom.parser.ISerializableExecution;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPExecution;
import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.cdt.internal.core.pdom.db.IBTreeComparator;
@ -299,7 +299,7 @@ public class QtPDOMLinkage extends PDOMLinkage {
}
@Override
public ISerializableExecution unmarshalExecution(ITypeMarshalBuffer typeMarhsalBuffer) throws CoreException {
public ICPPExecution unmarshalExecution(ITypeMarshalBuffer typeMarhsalBuffer) throws CoreException {
throw new CoreException(Activator.error("Qt Linkage does not marshal executions")); //$NON-NLS-1$
}
}