Skip to content

Commit 7124a53

Browse files
aschackmulljketema
authored andcommitted
C++: Remove getLocation from Container.
1 parent 4920c7f commit 7124a53

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private module Input implements InputSig {
3232
private module Impl = Make<Input>;
3333

3434
/** A file or folder. */
35-
class Container extends Locatable, Impl::Container {
35+
class Container extends ElementBase, Impl::Container {
3636
override string toString() { result = Impl::Container.super.toString() }
3737
}
3838

@@ -47,11 +47,6 @@ class Container extends Locatable, Impl::Container {
4747
* To get the full path, use `getAbsolutePath`.
4848
*/
4949
class Folder extends Container, Impl::Folder {
50-
override Location getLocation() {
51-
result.getContainer() = this and
52-
result.hasLocationInfo(_, 0, 0, 0, 0)
53-
}
54-
5550
override string getAPrimaryQlClass() { result = "Folder" }
5651
}
5752

@@ -70,11 +65,6 @@ class Folder extends Container, Impl::Folder {
7065
class File extends Container, Impl::File {
7166
override string getAPrimaryQlClass() { result = "File" }
7267

73-
override Location getLocation() {
74-
result.getContainer() = this and
75-
result.hasLocationInfo(_, 0, 0, 0, 0)
76-
}
77-
7868
/** Holds if this file was compiled as C (at any point). */
7969
predicate compiledAsC() { fileannotations(underlyingElement(this), 1, "compiled as c", "1") }
8070

@@ -128,7 +118,7 @@ class File extends Container, Impl::File {
128118
* except the dummy file, whose name is the empty string, which contains
129119
* declarations that are built into the compiler.
130120
*/
131-
override predicate fromSource() { numlines(underlyingElement(this), _, _, _) }
121+
predicate fromSource() { numlines(underlyingElement(this), _, _, _) }
132122

133123
/** Gets the metric file. */
134124
MetricFile getMetrics() { result = this }

0 commit comments

Comments
 (0)