Skip to content

Commit 4ea5c13

Browse files
committed
C++: Add back getLocation in File
1 parent 7124a53 commit 4ea5c13

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cpp/ql/lib/semmle/code/cpp/File.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ class Folder extends Container, Impl::Folder {
6565
class File extends Container, Impl::File {
6666
override string getAPrimaryQlClass() { result = "File" }
6767

68+
/** Gets the primary location of this file. */
69+
Location getLocation() {
70+
result.getContainer() = this and
71+
result.hasLocationInfo(_, 0, 0, 0, 0)
72+
}
73+
6874
/** Holds if this file was compiled as C (at any point). */
6975
predicate compiledAsC() { fileannotations(underlyingElement(this), 1, "compiled as c", "1") }
7076

0 commit comments

Comments
 (0)