make module loader a bit more flexible
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3987 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
2ed3b05257
commit
da98a43469
|
@ -18,7 +18,7 @@ import java.util.Collections;
|
|||
import com.ibm.wala.cast.loader.SingleClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.ArrayClassLoader;
|
||||
import com.ibm.wala.classLoader.Language;
|
||||
import com.ibm.wala.classLoader.SourceFileModule;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
import com.ibm.wala.classLoader.SourceURLModule;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
|
@ -49,7 +49,7 @@ public class CAstAnalysisScope extends AnalysisScope {
|
|||
}
|
||||
}
|
||||
|
||||
public CAstAnalysisScope(SourceFileModule[] sources, SingleClassLoaderFactory loaders, Collection<Language> languages)
|
||||
public CAstAnalysisScope(Module[] sources, SingleClassLoaderFactory loaders, Collection<Language> languages)
|
||||
throws IOException {
|
||||
this(loaders, languages);
|
||||
for (int i = 0; i < sources.length; i++) {
|
||||
|
|
|
@ -54,6 +54,10 @@ public abstract class CAstAbstractModuleLoader extends CAstAbstractLoader {
|
|||
|
||||
protected abstract TranslatorToCAst getTranslatorToCAst(CAst ast, ModuleEntry M, URL sourceURL, String localFileName);
|
||||
|
||||
protected TranslatorToCAst getTranslatorToCAst(CAst ast, ModuleEntry M, File sourceFile, String localFileName) throws MalformedURLException {
|
||||
return getTranslatorToCAst(ast, M, sourceFile.toURI().toURL(), localFileName);
|
||||
}
|
||||
|
||||
protected abstract boolean shouldTranslate(CAstEntity entity);
|
||||
|
||||
protected abstract TranslatorToIR initTranslator();
|
||||
|
@ -79,7 +83,7 @@ public abstract class CAstAbstractModuleLoader extends CAstAbstractLoader {
|
|||
File f = ((SourceFileModule) moduleEntry).getFile();
|
||||
String fn = f.toString();
|
||||
|
||||
TranslatorToCAst xlatorToCAst = getTranslatorToCAst(ast, moduleEntry, f.toURI().toURL(), fn);
|
||||
TranslatorToCAst xlatorToCAst = getTranslatorToCAst(ast, moduleEntry, f, fn);
|
||||
|
||||
CAstEntity fileEntity = xlatorToCAst.translateToCAst();
|
||||
|
||||
|
|
Loading…
Reference in New Issue