All Downloads are FREE. Search and download functionalities are using the official Maven repository.

boomerang.weights.PathTrackingBoomerang Maven / Gradle / Ivy

There is a newer version: 3.2.2
Show newest version
/**
 * ***************************************************************************** Copyright (c) 2018
 * Fraunhofer IEM, Paderborn, Germany. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * 

SPDX-License-Identifier: EPL-2.0 * *

Contributors: Johannes Spaeth - initial API and implementation * ***************************************************************************** */ package boomerang.weights; import boomerang.BoomerangOptions; import boomerang.ForwardQuery; import boomerang.WeightedBoomerang; import boomerang.scene.CallGraph; import boomerang.scene.ControlFlowGraph.Edge; import boomerang.scene.DataFlowScope; import boomerang.scene.Field; import boomerang.scene.Val; import sync.pds.solver.OneWeightFunctions; import sync.pds.solver.WeightFunctions; public abstract class PathTrackingBoomerang extends WeightedBoomerang { private OneWeightFunctions fieldWeights; private PathTrackingWeightFunctions callWeights; public PathTrackingBoomerang(CallGraph cg, DataFlowScope scope) { super(cg, scope); } public PathTrackingBoomerang(CallGraph cg, DataFlowScope scope, BoomerangOptions opt) { super(cg, scope, opt); } @Override protected WeightFunctions getForwardFieldWeights() { return getOrCreateFieldWeights(); } @Override protected WeightFunctions getBackwardFieldWeights() { return getOrCreateFieldWeights(); } @Override protected WeightFunctions getBackwardCallWeights() { return getOrCreateCallWeights(); } @Override protected WeightFunctions getForwardCallWeights( ForwardQuery sourceQuery) { return getOrCreateCallWeights(); } private WeightFunctions getOrCreateFieldWeights() { if (fieldWeights == null) { fieldWeights = new OneWeightFunctions<>(DataFlowPathWeight.one()); } return fieldWeights; } private WeightFunctions getOrCreateCallWeights() { if (callWeights == null) { callWeights = new PathTrackingWeightFunctions( options.trackDataFlowPath(), options.trackPathConditions(), options.trackImplicitFlows()); } return callWeights; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy