[ClavaLaraApi] Replaces calls to .deepCopy with .copy, in ClavaTypes
@@ -14,20 +14,23 @@ var ClavaType = {};
*/
ClavaType.visitExprInTypeCopy = function($type, exprFunction) {
+ //debug("ClavaType.visitExprInTypeCopy: visiting type " + $type.astName);
+
if($type.instanceOf("pointerType")) {
- var $typeCopy = $type.deepCopy();
+ var $typeCopy = $type.copy();
$typeCopy.pointee = ClavaType.visitExprInTypeCopy($typeCopy.pointee, exprFunction);
return $typeCopy;
}
if($type.instanceOf("parenType")) {
- var $typeCopy = $type.deepCopy();
+ var $typeCopy = $type.copy();
$typeCopy.desugar = ClavaType.visitExprInTypeCopy($typeCopy.desugar, exprFunction);
return $typeCopy;
}
if($type.instanceOf("variableArrayType")) {
- var $typeCopy = $type.deepCopy();
+ var $typeCopy = $type.copy();
+ $typeCopy.sizeExpr = $typeCopy.sizeExpr.copy();
exprFunction($typeCopy.sizeExpr);
return $typeCopy;
}
@@ -39,7 +42,6 @@ ClavaType.visitExprInTypeCopy = function($type, exprFunction) {
/**
* @param type a type join point that will be visited looking for $expr join points. Any visited nodes in the type (e.g., desugar) will be copied, so that the returned varrefs can be safely modified.
- *
* @param varrefs an array (possibly empty) where the $varref join points found in the given type will be stored
*
* @return a copy of the given $type, to which the varrefs refer to
