small dead code elimination
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@729 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
9e6751583c
commit
2affbe8215
|
@ -1,12 +1,11 @@
|
||||||
package com.ibm.wala.stringAnalysis.js.examples;
|
package com.ibm.wala.stringAnalysis.js.examples;
|
||||||
|
|
||||||
import com.ibm.wala.classLoader.*;
|
import java.io.File;
|
||||||
import com.ibm.wala.ipa.callgraph.*;
|
import java.util.Collections;
|
||||||
import com.ibm.wala.stringAnalysis.js.client.*;
|
|
||||||
import com.ibm.wala.util.debug.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
import com.ibm.wala.classLoader.SourceFileModule;
|
||||||
import java.util.*;
|
import com.ibm.wala.stringAnalysis.js.client.JSStringAnalysisEngine;
|
||||||
|
import com.ibm.wala.util.debug.Assertions;
|
||||||
|
|
||||||
public class SimpleStringAnalysisDriver {
|
public class SimpleStringAnalysisDriver {
|
||||||
|
|
||||||
|
@ -21,7 +20,7 @@ public class SimpleStringAnalysisDriver {
|
||||||
JSStringAnalysisEngine engine = new JSStringAnalysisEngine();
|
JSStringAnalysisEngine engine = new JSStringAnalysisEngine();
|
||||||
engine.setModuleFiles(
|
engine.setModuleFiles(
|
||||||
Collections.singleton(new SourceFileModule(scriptFile, testName)));
|
Collections.singleton(new SourceFileModule(scriptFile, testName)));
|
||||||
CallGraph CG = engine.buildDefaultCallGraph();
|
engine.buildDefaultCallGraph();
|
||||||
|
|
||||||
String variableName = args[1];
|
String variableName = args[1];
|
||||||
String patternString = args[2];
|
String patternString = args[2];
|
||||||
|
|
|
@ -29,7 +29,6 @@ public class TestCG2GR extends TestJSTranslatorBase {
|
||||||
CG2GR cg2gr = new CG2GR(ir2gr, new FunctionNameCalleeResolver(new JSFunctionNameResolver()));
|
CG2GR cg2gr = new CG2GR(ir2gr, new FunctionNameCalleeResolver(new JSFunctionNameResolver()));
|
||||||
ISimplify g = cg2gr.translate(getCallGraphBuilder());
|
ISimplify g = cg2gr.translate(getCallGraphBuilder());
|
||||||
assertTrue(g instanceof GR);
|
assertTrue(g instanceof GR);
|
||||||
GR gr = (GR) g;
|
|
||||||
//Trace.println("--- GR:");
|
//Trace.println("--- GR:");
|
||||||
//Trace.println(SAUtil.prettyFormat(gr));
|
//Trace.println(SAUtil.prettyFormat(gr));
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,6 @@ public class TestGR2CFG extends TestJSTranslatorBase {
|
||||||
|
|
||||||
|
|
||||||
public void testConditionalBranch() {
|
public void testConditionalBranch() {
|
||||||
IVariable r2 = new LexicalVariable("r2");
|
|
||||||
IContextFreeGrammar cfg = verifyCFG(new LexicalVariable("r2"), "astrA|bstrB");
|
IContextFreeGrammar cfg = verifyCFG(new LexicalVariable("r2"), "astrA|bstrB");
|
||||||
assertTrue(CFLReachability.containsSome(cfg, pattern("a" + "strA")));
|
assertTrue(CFLReachability.containsSome(cfg, pattern("a" + "strA")));
|
||||||
assertTrue(CFLReachability.containsSome(cfg, pattern("b" + "strB")));
|
assertTrue(CFLReachability.containsSome(cfg, pattern("b" + "strB")));
|
||||||
|
@ -125,7 +124,7 @@ public class TestGR2CFG extends TestJSTranslatorBase {
|
||||||
public void testAssocArray1() {
|
public void testAssocArray1() {
|
||||||
//TODO:
|
//TODO:
|
||||||
//assertTrue(CFLReachability.containsAll(pattern("strA|strB|ASSOC"), cfg));
|
//assertTrue(CFLReachability.containsAll(pattern("strA|strB|ASSOC"), cfg));
|
||||||
IContextFreeGrammar cfg = verifyCFG(new LexicalVariable("r21"), "ASSOC");
|
verifyCFG(new LexicalVariable("r21"), "ASSOC");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSubstring1() {
|
public void testSubstring1() {
|
||||||
|
@ -197,7 +196,7 @@ public class TestGR2CFG extends TestJSTranslatorBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSplit1() {
|
public void testSplit1() {
|
||||||
IContextFreeGrammar cfg = verifyCFG(new LexicalVariable("rSplit1"), "a|b|c|()");
|
verifyCFG(new LexicalVariable("rSplit1"), "a|b|c|()");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testProp1() {
|
public void testProp1() {
|
||||||
|
@ -207,10 +206,10 @@ public class TestGR2CFG extends TestJSTranslatorBase {
|
||||||
pattern("foo"),
|
pattern("foo"),
|
||||||
Automatons.createAutomaton(new ISymbol[]{new NumberSymbol(123.0)}));
|
Automatons.createAutomaton(new ISymbol[]{new NumberSymbol(123.0)}));
|
||||||
*/
|
*/
|
||||||
IContextFreeGrammar cfg = verifyCFG(new LexicalVariable("rProp1"), pattern("foo"));
|
verifyCFG(new LexicalVariable("rProp1"), pattern("foo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCyclic1() {
|
public void testCyclic1() {
|
||||||
IContextFreeGrammar cfg = verifyCFG(new LexicalVariable("rCyclic1"), "(abcdefg)|(bcd)");
|
verifyCFG(new LexicalVariable("rCyclic1"), "(abcdefg)|(bcd)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue