Files
codeql/csharp/ql/lib/semmle/code/cil/Element.qll
Andrew Eisenberg c9f1c98390 Packaging: C# refactoring
Split c# pack into `codeql/csharp-all` and `codeql/csharp-queries`.
2021-08-19 14:09:35 -07:00

16 lines
458 B
Plaintext

/** Provides the `Element` class, the base class of all CIL program elements. */
private import dotnet
import semmle.code.csharp.Location
/** An element. */
class Element extends DotNet::Element, @cil_element {
override Location getLocation() { result = bestLocation(this) }
}
cached
private Location bestLocation(Element e) {
result = e.getALocation() and
(e.getALocation().getFile().isPdbSourceFile() implies result.getFile().isPdbSourceFile())
}