Skip to content

Commit b8917c8

Browse files
authored
Merge branch 'main' into add-comptr-model-now-with-more-models
2 parents b9cd7a8 + 2c2b1e4 commit b8917c8

File tree

140 files changed

+17510
-4701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+17510
-4701
lines changed

cpp/downgrades/c16b29b27f71247023321cc0d0360998b318837c/old.dbscheme

Lines changed: 2436 additions & 0 deletions
Large diffs are not rendered by default.

cpp/downgrades/c16b29b27f71247023321cc0d0360998b318837c/semmlecode.cpp.dbscheme

Lines changed: 2423 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
description: Link PCH creations and uses
2+
compatibility: full
3+
pch_uses.rel: delete
4+
pch_creations.rel: delete
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
category: feature
3+
---
4+
* Added a new class `PchFile` representing precompiled header (PCH) files used during project compilation.
5+

cpp/ql/lib/cpp.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import Customizations
1717
import semmle.code.cpp.File
18+
import semmle.code.cpp.PchFile
1819
import semmle.code.cpp.Linkage
1920
import semmle.code.cpp.Location
2021
import semmle.code.cpp.Compilation
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Provides the `PchFile` class representing precompiled header (PCH) files created and
3+
* used during the build process.
4+
*/
5+
6+
import semmle.code.cpp.File
7+
8+
/**
9+
* A precompiled header (PCH) file created during the build process.
10+
*/
11+
class PchFile extends @pch {
12+
/**
13+
* Gets a textual representation of this element.
14+
*/
15+
string toString() { result = "PCH for " + this.getHeaderFile() }
16+
17+
/**
18+
* Gets the header file from which the PCH file was created.
19+
*/
20+
File getHeaderFile() { pch_creations(this, _, result) }
21+
22+
/**
23+
* Gets a source file that includes the PCH.
24+
*/
25+
File getAUse() { pch_uses(this, _, result) }
26+
}

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3884,7 +3884,7 @@ class TranslatedNewExpr extends TranslatedNewOrNewArrayExpr {
38843884
final override Type getTargetType() { result = expr.getAllocatedType().getUnspecifiedType() }
38853885

38863886
final override TranslatedInitialization getInitialization() {
3887-
result = getTranslatedInitialization(expr.getInitializer())
3887+
result = getTranslatedInitialization(expr.getInitializer().getFullyConverted())
38883888
}
38893889
}
38903890

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,19 @@ extractor_version(
222222
string frontend_version: string ref
223223
)
224224

225+
pch_uses(
226+
int pch: @pch ref,
227+
int compilation: @compilation ref,
228+
int id: @file ref
229+
)
230+
231+
#keyset[pch, compilation]
232+
pch_creations(
233+
int pch: @pch,
234+
int compilation: @compilation ref,
235+
int from: @file ref
236+
)
237+
225238
/** An element for which line-count information is available. */
226239
@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable;
227240

0 commit comments

Comments
 (0)