2007-06-21 15:17:34 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2007 IBM Corporation.
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IBM Corporation - initial API and implementation
|
|
|
|
*******************************************************************************/
|
|
|
|
package com.ibm.wala.ipa.cfg;
|
|
|
|
|
2007-07-06 22:08:13 +00:00
|
|
|
import com.ibm.wala.cfg.ControlFlowGraph;
|
|
|
|
import com.ibm.wala.cfg.IBasicBlock;
|
2007-06-21 15:17:34 +00:00
|
|
|
|
2007-08-07 17:53:05 +00:00
|
|
|
/**
|
|
|
|
* A view of a CFG that ignores exceptional edges
|
|
|
|
*/
|
2007-06-21 15:17:34 +00:00
|
|
|
public class ExceptionPrunedCFG {
|
|
|
|
|
2007-09-02 14:45:41 +00:00
|
|
|
private static class ExceptionEdgePruner<T extends IBasicBlock> implements EdgeFilter<T>{
|
|
|
|
public boolean hasNormalEdge(T src, T dst) {
|
2007-06-21 15:17:34 +00:00
|
|
|
return true;
|
|
|
|
}
|
2007-09-02 14:45:41 +00:00
|
|
|
public boolean hasExceptionalEdge(T src, T dst) {
|
2007-06-21 15:17:34 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-09-02 14:45:41 +00:00
|
|
|
public static <T extends IBasicBlock> PrunedCFG<T> make(ControlFlowGraph<T> cfg) {
|
|
|
|
return PrunedCFG.make(cfg, new ExceptionEdgePruner<T>());
|
2007-06-21 15:17:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|