mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
namespace Semmle.Extraction.Entities
|
|
{
|
|
public class GeneratedLocation : SourceLocation
|
|
{
|
|
readonly File GeneratedFile;
|
|
|
|
GeneratedLocation(Context cx)
|
|
: base(cx, null)
|
|
{
|
|
GeneratedFile = File.CreateGenerated(cx);
|
|
}
|
|
|
|
public override void Populate()
|
|
{
|
|
Context.Emit(Tuples.locations_default(this, GeneratedFile, 0, 0, 0, 0));
|
|
}
|
|
|
|
public override IId Id => new Key("loc,", GeneratedFile, ",0,0,0,0");
|
|
|
|
public override int GetHashCode() => 98732567;
|
|
|
|
public override bool Equals(object obj) => obj != null && obj.GetType() == typeof(GeneratedLocation);
|
|
|
|
public static GeneratedLocation Create(Context cx) => GeneratedLocationFactory.Instance.CreateEntity(cx, null);
|
|
|
|
class GeneratedLocationFactory : ICachedEntityFactory<string, GeneratedLocation>
|
|
{
|
|
public static GeneratedLocationFactory Instance = new GeneratedLocationFactory();
|
|
|
|
public GeneratedLocation Create(Context cx, string init) => new GeneratedLocation(cx);
|
|
}
|
|
}
|
|
}
|