mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Expose PCH file creation as usage in QL
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
import Customizations
|
import Customizations
|
||||||
import semmle.code.cpp.File
|
import semmle.code.cpp.File
|
||||||
|
import semmle.code.cpp.PchFile
|
||||||
import semmle.code.cpp.Linkage
|
import semmle.code.cpp.Linkage
|
||||||
import semmle.code.cpp.Location
|
import semmle.code.cpp.Location
|
||||||
import semmle.code.cpp.Compilation
|
import semmle.code.cpp.Compilation
|
||||||
|
|||||||
23
cpp/ql/lib/semmle/code/cpp/PchFile.qll
Normal file
23
cpp/ql/lib/semmle/code/cpp/PchFile.qll
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Provides the `PchFile` class representing precompiled header (PCH) files created and
|
||||||
|
* used during the build process.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import semmle.code.cpp.File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A precompiled header (PCH) file created during the build process.
|
||||||
|
*/
|
||||||
|
class PchFile extends @pch {
|
||||||
|
string toString() { result = "PCH for " + this.getHeaderFile() }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the header file from with the PCH file was created.
|
||||||
|
*/
|
||||||
|
File getHeaderFile() { pch_creations(this, _, result) }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a source file that includes the PCH.
|
||||||
|
*/
|
||||||
|
File getAUse() { pch_uses(this, _, result) }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user