Skip to content

Commit e20ce57

Browse files
committed
C++: Expose PCH file creation as usage in QL
1 parent e9b00f1 commit e20ce57

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
string toString() { result = "PCH for " + this.getHeaderFile() }
13+
14+
/**
15+
* Gets the header file from with the PCH file was created.
16+
*/
17+
File getHeaderFile() { pch_creations(this, _, result) }
18+
19+
/**
20+
* Gets a source file that includes the PCH.
21+
*/
22+
File getAUse() { pch_uses(this, _, result) }
23+
}

0 commit comments

Comments
 (0)