diff --git a/cpp/ql/lib/cpp.qll b/cpp/ql/lib/cpp.qll index c8afac1c7ae..46c651daf57 100644 --- a/cpp/ql/lib/cpp.qll +++ b/cpp/ql/lib/cpp.qll @@ -15,6 +15,7 @@ import Customizations import semmle.code.cpp.File +import semmle.code.cpp.PchFile import semmle.code.cpp.Linkage import semmle.code.cpp.Location import semmle.code.cpp.Compilation diff --git a/cpp/ql/lib/semmle/code/cpp/PchFile.qll b/cpp/ql/lib/semmle/code/cpp/PchFile.qll new file mode 100644 index 00000000000..fbb372b30e5 --- /dev/null +++ b/cpp/ql/lib/semmle/code/cpp/PchFile.qll @@ -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) } +}