Skip to content

Commit 0274162

Browse files
authored
Merge pull request github#5385 from github/igfoo/failed_extractions
C++: Add FailedExtractions.ql
2 parents 2d4f624 + 75ebb34 commit 0274162

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
codescanning
2+
* Added cpp/diagnostics/failed-extractions. This query gives information about which extractions did not run to completion.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @name Failed extractions
3+
* @description Gives the command-line of compilations for which extraction did not run to completion.
4+
* @kind diagnostic
5+
* @id cpp/diagnostics/failed-extractions
6+
*/
7+
8+
import cpp
9+
10+
class AnonymousCompilation extends Compilation {
11+
override string toString() { result = "<compilation>" }
12+
}
13+
14+
string describe(Compilation c) {
15+
if c.getArgument(1) = "--mimic"
16+
then result = "compiler invocation " + concat(int i | i > 1 | c.getArgument(i), " " order by i)
17+
else result = "extractor invocation " + concat(int i | | c.getArgument(i), " " order by i)
18+
}
19+
20+
from Compilation c
21+
where not c.normalTermination()
22+
select c, "Extraction failed for " + describe(c), 2

0 commit comments

Comments
 (0)