Skip to content

Commit 6f3e6ed

Browse files
committed
C++: Implement compilation_build_mode
1 parent 6a3e34c commit 6f3e6ed

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,7 @@ class Compilation extends @compilation {
112112
* termination, but crashing due to something like a segfault is not.
113113
*/
114114
predicate normalTermination() { compilation_finished(this, _, _) }
115+
116+
/** Holds if this compilation was compiled using the "none" build mode. */
117+
predicate buildModeNone() { compilation_build_mode(this, 0) }
115118
}

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ compilation_args(
4646
string arg : string ref
4747
);
4848

49+
/**
50+
* Optionally, record the build mode for each compilation.
51+
* The build mode should be the same for all compilations.
52+
* Build mode:
53+
* 0 = none
54+
* 1 = manual
55+
* 2 = auto
56+
*/
57+
#keyset[id, mode]
58+
compilation_build_mode(
59+
int id : @compilation ref,
60+
int mode : int ref
61+
);
62+
4963
/**
5064
* The source files that are compiled by a compiler invocation.
5165
* If `id` is for the compiler invocation

0 commit comments

Comments
 (0)