Skip to content

Commit d4bbb0f

Browse files
authored
Merge pull request #1474 from yh-semmle/java-dbscheme-diagnostics-rc
Java: add compilation/diagnostic relations to dbscheme (rc/1.21)
2 parents 217214c + f8f217b commit d4bbb0f

File tree

2 files changed

+2059
-2
lines changed

2 files changed

+2059
-2
lines changed

java/ql/src/config/semmlecode.dbscheme

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,130 @@
1+
/**
2+
* An invocation of the compiler. Note that more than one file may be
3+
* compiled per invocation. For example, this command compiles three
4+
* source files:
5+
*
6+
* javac A.java B.java C.java
7+
*
8+
* The `id` simply identifies the invocation, while `cwd` is the working
9+
* directory from which the compiler was invoked.
10+
*/
11+
compilations(
12+
/**
13+
* An invocation of the compiler. Note that more than one file may
14+
* be compiled per invocation. For example, this command compiles
15+
* three source files:
16+
*
17+
* javac A.java B.java C.java
18+
*/
19+
unique int id : @compilation,
20+
string cwd : string ref
21+
);
22+
23+
/**
24+
* The arguments that were passed to the extractor for a compiler
25+
* invocation. If `id` is for the compiler invocation
26+
*
27+
* javac A.java B.java C.java
28+
*
29+
* then typically there will be rows for
30+
*
31+
* num | arg
32+
* --- | ---
33+
* 0 | *path to extractor*
34+
* 1 | `--javac-args`
35+
* 2 | A.java
36+
* 3 | B.java
37+
* 4 | C.java
38+
*/
39+
#keyset[id, num]
40+
compilation_args(
41+
int id : @compilation ref,
42+
int num : int ref,
43+
string arg : string ref
44+
);
45+
46+
/**
47+
* The source files that are compiled by a compiler invocation.
48+
* If `id` is for the compiler invocation
49+
*
50+
* javac A.java B.java C.java
51+
*
52+
* then there will be rows for
53+
*
54+
* num | arg
55+
* --- | ---
56+
* 0 | A.java
57+
* 1 | B.java
58+
* 2 | C.java
59+
*/
60+
#keyset[id, num]
61+
compilation_compiling_files(
62+
int id : @compilation ref,
63+
int num : int ref,
64+
int file : @file ref
65+
);
66+
67+
/**
68+
* The time taken by the extractor for a compiler invocation.
69+
*
70+
* For each file `num`, there will be rows for
71+
*
72+
* kind | seconds
73+
* ---- | ---
74+
* 1 | CPU seconds used by the extractor frontend
75+
* 2 | Elapsed seconds during the extractor frontend
76+
* 3 | CPU seconds used by the extractor backend
77+
* 4 | Elapsed seconds during the extractor backend
78+
*/
79+
#keyset[id, num, kind]
80+
compilation_time(
81+
int id : @compilation ref,
82+
int num : int ref,
83+
/* kind:
84+
1 = frontend_cpu_seconds
85+
2 = frontend_elapsed_seconds
86+
3 = extractor_cpu_seconds
87+
4 = extractor_elapsed_seconds
88+
*/
89+
int kind : int ref,
90+
float seconds : float ref
91+
);
92+
93+
/**
94+
* An error or warning generated by the extractor.
95+
* The diagnostic message `diagnostic` was generated during compiler
96+
* invocation `compilation`, and is the `file_number_diagnostic_number`th
97+
* message generated while extracting the `file_number`th file of that
98+
* invocation.
99+
*/
100+
#keyset[compilation, file_number, file_number_diagnostic_number]
101+
diagnostic_for(
102+
unique int diagnostic : @diagnostic ref,
103+
int compilation : @compilation ref,
104+
int file_number : int ref,
105+
int file_number_diagnostic_number : int ref
106+
);
107+
108+
/**
109+
* If extraction was successful, then `cpu_seconds` and
110+
* `elapsed_seconds` are the CPU time and elapsed time (respectively)
111+
* that extraction took for compiler invocation `id`.
112+
*/
113+
compilation_finished(
114+
unique int id : @compilation ref,
115+
float cpu_seconds : float ref,
116+
float elapsed_seconds : float ref
117+
);
118+
119+
diagnostics(
120+
unique int id: @diagnostic,
121+
int severity: int ref,
122+
string error_tag: string ref,
123+
string error_message: string ref,
124+
string full_error_message: string ref,
125+
int location: @location_default ref
126+
);
127+
1128
/*
2129
* External artifacts
3130
*/

0 commit comments

Comments
 (0)