[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[imp-commit] r22895 - trunk/org.eclipse.imp.lpg.analysis/src/org/eclipse/imp/lpg/analysis

Author: rfuhrer
Date: 2011-03-15 09:21:43 -0400 (Tue, 15 Mar 2011)
New Revision: 22895

Modified:
   trunk/org.eclipse.imp.lpg.analysis/src/org/eclipse/imp/lpg/analysis/LPGCallGraphGenerator.java
Log:
Accommodate API change to IFactGenerator: generate() no longer takes a FactBase, and is now only responsible for producing the value, not posting it to the FactBase.

Modified: trunk/org.eclipse.imp.lpg.analysis/src/org/eclipse/imp/lpg/analysis/LPGCallGraphGenerator.java
===================================================================
--- trunk/org.eclipse.imp.lpg.analysis/src/org/eclipse/imp/lpg/analysis/LPGCallGraphGenerator.java	2011-03-11 23:25:45 UTC (rev 22894)
+++ trunk/org.eclipse.imp.lpg.analysis/src/org/eclipse/imp/lpg/analysis/LPGCallGraphGenerator.java	2011-03-15 13:21:43 UTC (rev 22895)
@@ -11,6 +11,9 @@
 
 package org.eclipse.imp.lpg.analysis;
 
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.imp.language.Language;
 import org.eclipse.imp.language.LanguageRegistry;
@@ -30,12 +33,11 @@
 import org.eclipse.imp.pdb.facts.ISetWriter;
 import org.eclipse.imp.pdb.facts.ITuple;
 import org.eclipse.imp.pdb.facts.IValue;
-import org.eclipse.imp.pdb.facts.db.FactBase;
-import org.eclipse.imp.pdb.facts.db.FactKey;
 import org.eclipse.imp.pdb.facts.db.IFactContext;
 import org.eclipse.imp.pdb.facts.db.context.CompilationUnitContext;
 import org.eclipse.imp.pdb.facts.impl.reference.ValueFactory;
 import org.eclipse.imp.pdb.facts.type.Type;
+import org.eclipse.imp.pdb.indexing.IndexedDocumentDescriptor;
 import org.eclipse.imp.utils.ErrorIndicatorMessageHandler;
 
 public class LPGCallGraphGenerator implements IFactGenerator {
@@ -78,7 +80,7 @@
         }
     }
 
-    public void generate(FactBase factBase, Type type, IFactContext context) throws AnalysisException {
+    public IValue generate(Type type, IFactContext context, Map<IResource, IndexedDocumentDescriptor> workingCopies) throws AnalysisException {
         CompilationUnitContext cuc= (CompilationUnitContext) context;
         Language lpgLang= LanguageRegistry.findLanguage(LPGRuntimePlugin.getInstance().getLanguageID());
         IParseController pc= ServiceFactory.getInstance().getParseController(lpgLang);
@@ -95,6 +97,6 @@
         final ISetWriter cgw= LPGAnalysisTypes.LPGCallGraphType.writer(ValueFactory.getInstance());
 
         root.accept(new CGVisitor(cgw));
-        factBase.defineFact(new FactKey(type, context), cgw.done());
+        return cgw.done();
     }
 }