Skip to content

Commit 7baaa23

Browse files
authored
Merge pull request #18080 from github/revert-18072-revert-18009-calumgrant/bmn/record-build-mode
C++: Implement compilation_build_mode
2 parents b1b62f2 + fcf1684 commit 7baaa23

File tree

9 files changed

+10697
-1286
lines changed

9 files changed

+10697
-1286
lines changed

cpp/downgrades/f0156f5f88ab5967c79162012c20f30600ca5ebf/old.dbscheme

+2,339
Large diffs are not rendered by default.

cpp/downgrades/f0156f5f88ab5967c79162012c20f30600ca5ebf/semmlecode.cpp.dbscheme

+2,323
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: Implement compilation_build_mode/2
2+
compatibility: full
3+
compilation_build_mode.rel: delete

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

+3
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

+16
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ compilation_args(
4646
string arg : string ref
4747
);
4848

49+
/**
50+
* Optionally, record the build mode for each compilation.
51+
*/
52+
compilation_build_mode(
53+
unique int id : @compilation ref,
54+
int mode : int ref
55+
);
56+
57+
/*
58+
case @compilation_build_mode.mode of
59+
0 = @build_mode_none
60+
| 1 = @build_mode_manual
61+
| 2 = @build_mode_auto
62+
;
63+
*/
64+
4965
/**
5066
* The source files that are compiled by a compiler invocation.
5167
* If `id` is for the compiler invocation

0 commit comments

Comments
 (0)