Merge Extractor.Standalone and OutputPath

This commit is contained in:
Tamas Vajk
2021-02-18 13:01:38 +01:00
parent 10ab17a7e0
commit 2697677239
7 changed files with 11 additions and 20 deletions

View File

@@ -65,7 +65,7 @@ namespace Semmle.Extraction.CSharp.Entities
public static Assembly CreateOutputAssembly(Context cx)
{
if (cx.Extractor.OutputPath == null)
if (cx.Extractor.Standalone)
throw new InternalError("Attempting to create the output assembly in standalone extraction mode");
return AssemblyConstructorFactory.Instance.CreateEntity(cx, outputAssemblyCacheKey, null);
}

View File

@@ -53,7 +53,7 @@ namespace Semmle.Extraction.CSharp.Entities
if (attributeSyntax is object)
{
if (Context.Extractor.OutputPath != null)
if (!Context.Extractor.Standalone)
{
trapFile.attribute_location(this, Assembly.CreateOutputAssembly(Context));
}

View File

@@ -83,7 +83,7 @@ namespace Semmle.Extraction.CSharp.Entities
{
// Some built in operators lack locations, so loc is null.
yield return Context.CreateLocation(ReportingLocation);
if (Context.Extractor.OutputPath != null && loc.Kind == LocationKind.SourceFile)
if (!Context.Extractor.Standalone && loc.Kind == LocationKind.SourceFile)
yield return Assembly.CreateOutputAssembly(Context);
}
}

View File

@@ -108,7 +108,7 @@ namespace Semmle.Extraction.CSharp.Entities
foreach (var l in GetLocations(Symbol))
yield return Context.CreateLocation(l);
if (Context.Extractor.OutputPath != null && Symbol.DeclaringSyntaxReferences.Any())
if (!Context.Extractor.Standalone && Symbol.DeclaringSyntaxReferences.Any())
yield return Assembly.CreateOutputAssembly(Context);
}
}