[ClavaWeaver] Refactors $function 'canonical' and 'isCanonical'
@@ -679,24 +679,26 @@ public class CxxFunction extends AFunction {
@Override
public AFunction getCanonicalImpl() {
- // First, try the implementation
- var definition = getDefinitionJpImpl();
-
- if (definition != null) {
- return definition;
- }
-
- // Implementation not found return declaration
- return getDeclarationJpImpl();
+ return CxxJoinpoints.create(function.canonical(), AFunction.class);
+ // // First, try the implementation
+ // var definition = getDefinitionJpImpl();
+ //
+ // if (definition != null) {
+ // return definition;
+ // }
+ //
+ // // Implementation not found return declaration
+ // return getDeclarationJpImpl();
}
@Override
public Boolean getIsCanonicalImpl() {
- // Get normalized function
- var canonicalFunction = getCanonicalImpl();
-
- // Compare
- return function.equals(canonicalFunction.getNode());
+ return function.isCanonical();
+ // // Get normalized function
+ // var canonicalFunction = getCanonicalImpl();
+ //
+ // // Compare
+ // return function.equals(canonicalFunction.getNode());
}
}
