[ClavaWeaver] Global action 'detach' now takes into account wrapped jps
For instance, 'comment', 'pragma' and 'omp' join points;
@@ -340,13 +340,20 @@ public abstract class ACxxWeaverJoinPoint extends AJoinPoint {
@Override
public void detachImpl() {
ClavaNode node = getNode();
- System.out.println("Hello");
+
if (!node.hasParent()) {
SpecsLogs.msgInfo(
"action detach: could not find a parent in joinpoint of type '" + getJoinpointType() + "'");
return;
}
+ // If node is wrapped, detach wrapper
+ ClavaNode parentNode = node.getParent();
+ if (parentNode.isWrapper()) {
+ parentNode.detach();
+ return;
+ }
+
node.detach();
}
