C#: Store output assembly in compilation_assembly relation

This commit is contained in:
Tamas Vajk
2021-01-08 09:35:57 +01:00
parent 983c4d06d4
commit fb13126676
10 changed files with 42 additions and 2 deletions

View File

@@ -21,9 +21,10 @@ namespace Semmle.Extraction.CSharp.Entities
protected override void Populate(TextWriter trapFile)
{
Extraction.Entities.Assembly.CreateOutputAssembly(cx);
var assembly = Extraction.Entities.Assembly.CreateOutputAssembly(cx);
trapFile.compilations(this, FileUtils.ConvertToUnix(cwd));
trapFile.compilation_assembly(this, assembly);
// Arguments
var index = 0;

View File

@@ -111,6 +111,11 @@ namespace Semmle.Extraction.CSharp
trapFile.WriteTuple("compilations", compilation, cwd);
}
internal static void compilation_assembly(this TextWriter trapFile, Compilation compilation, Assembly assembly)
{
trapFile.WriteTuple("compilation_assembly", compilation, assembly);
}
internal static void compiler_generated(this TextWriter trapFile, IEntity entity)
{
trapFile.WriteTuple("compiler_generated", entity);

View File

@@ -58,7 +58,8 @@ namespace Semmle.Extraction.Entities
}
private static readonly object outputAssemblyCacheKey = new object();
public static Location CreateOutputAssembly(Context cx)
public static Assembly CreateOutputAssembly(Context cx)
{
if (cx.Extractor.OutputPath == null)
throw new InternalError("Attempting to create the output assembly in standalone extraction mode");