2013-05-22 22:39:19 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2013 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
|
|
|
|
*******************************************************************************/
|
2007-08-08 12:01:12 +00:00
|
|
|
package com.ibm.wala.cast.ipa.modref;
|
|
|
|
|
2007-11-16 20:57:45 +00:00
|
|
|
import java.util.Collection;
|
2007-08-08 12:01:12 +00:00
|
|
|
|
2009-04-09 20:31:14 +00:00
|
|
|
import com.ibm.wala.cast.ir.ssa.AstAssertInstruction;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstEchoInstruction;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstGlobalRead;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstGlobalWrite;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstInstructionVisitor;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.AstLexicalWrite;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.EachElementGetInstruction;
|
|
|
|
import com.ibm.wala.cast.ir.ssa.EachElementHasNextInstruction;
|
2007-11-16 20:57:45 +00:00
|
|
|
import com.ibm.wala.ipa.callgraph.CGNode;
|
|
|
|
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
|
|
|
|
import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
|
|
|
|
import com.ibm.wala.ipa.modref.ExtendedHeapModel;
|
|
|
|
import com.ibm.wala.ipa.modref.ModRef;
|
2007-08-08 12:01:12 +00:00
|
|
|
|
|
|
|
public class AstModRef extends ModRef {
|
|
|
|
|
|
|
|
protected static class AstRefVisitor
|
|
|
|
extends RefVisitor
|
|
|
|
implements AstInstructionVisitor
|
|
|
|
{
|
|
|
|
|
|
|
|
protected AstRefVisitor(CGNode n, Collection<PointerKey> result, PointerAnalysis pa, ExtendedHeapModel h) {
|
|
|
|
super(n, result, pa, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstLexicalRead(AstLexicalRead instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstLexicalWrite(AstLexicalWrite instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstGlobalRead(AstGlobalRead instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstGlobalWrite(AstGlobalWrite instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAssert(AstAssertInstruction instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitEachElementGet(EachElementGetInstruction inst) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitEachElementHasNext(EachElementHasNextInstruction inst) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitIsDefined(AstIsDefinedInstruction inst) {
|
|
|
|
|
|
|
|
}
|
2007-12-10 04:26:21 +00:00
|
|
|
|
|
|
|
public void visitEcho(AstEchoInstruction inst) {
|
|
|
|
|
|
|
|
}
|
2007-08-08 12:01:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected RefVisitor makeRefVisitor(CGNode n, Collection<PointerKey> result, PointerAnalysis pa, ExtendedHeapModel h) {
|
|
|
|
return new AstRefVisitor(n, result, pa, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected static class AstModVisitor
|
|
|
|
extends ModVisitor
|
|
|
|
implements AstInstructionVisitor
|
|
|
|
{
|
|
|
|
|
|
|
|
protected AstModVisitor(CGNode n, Collection<PointerKey> result, ExtendedHeapModel h, PointerAnalysis pa) {
|
2008-01-25 13:46:23 +00:00
|
|
|
super(n, result, h, pa, true);
|
2007-08-08 12:01:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstLexicalRead(AstLexicalRead instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstLexicalWrite(AstLexicalWrite instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstGlobalRead(AstGlobalRead instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAstGlobalWrite(AstGlobalWrite instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitAssert(AstAssertInstruction instruction) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitEachElementGet(EachElementGetInstruction inst) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitEachElementHasNext(EachElementHasNextInstruction inst) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void visitIsDefined(AstIsDefinedInstruction inst) {
|
|
|
|
|
|
|
|
}
|
2007-12-10 04:26:21 +00:00
|
|
|
|
|
|
|
public void visitEcho(AstEchoInstruction inst) {
|
|
|
|
|
|
|
|
}
|
2007-08-08 12:01:12 +00:00
|
|
|
}
|
|
|
|
|
2008-01-25 13:55:18 +00:00
|
|
|
@Override
|
|
|
|
protected ModVisitor makeModVisitor(CGNode n, Collection<PointerKey> result, PointerAnalysis pa, ExtendedHeapModel h, boolean ignoreAllocHeapDefs) {
|
2007-08-08 12:01:12 +00:00
|
|
|
return new AstModVisitor(n, result, h, pa);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|