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:
dolby-oss 2010-11-03 17:49:59 +00:00
parent 2ed3b05257
commit da98a43469
2 changed files with 7 additions and 3 deletions

View File

@ -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++) {

View File

@ -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();