diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-12 01:31:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-12 01:31:05 +0000 |
commit | b64c19365deab788753d29c9bc881253c3f16f37 (patch) | |
tree | 904471327e615a25388412991745290bf92b668f /include/clang/Frontend/PCHReader.h | |
parent | 06ab044127f0ff9a2b3696b6787d23c877505292 (diff) |
Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/PCHReader.h')
-rw-r--r-- | include/clang/Frontend/PCHReader.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h index e5591fe631..1e00ae3413 100644 --- a/include/clang/Frontend/PCHReader.h +++ b/include/clang/Frontend/PCHReader.h @@ -216,6 +216,10 @@ private: /// the PCH file. llvm::SmallVector<uint64_t, 4> ObjCCategoryImpls; + /// \brief The original file name that was used to build the PCH + /// file. + std::string OriginalFileName; + /// \brief Mapping from switch-case IDs in the PCH file to /// switch-case statements. std::map<unsigned, SwitchCase *> SwitchCaseStmts; @@ -327,8 +331,18 @@ public: explicit PCHReader(Preprocessor &PP, ASTContext *Context); ~PCHReader(); + /// \brief Load the precompiled header designated by the given file + /// name. PCHReadResult ReadPCH(const std::string &FileName); + /// \brief Retrieve the name of the original source file name + const std::string &getOriginalSourceFile() { return OriginalFileName; } + + /// \brief Retrieve the name of the original source file name + /// directly from the PCH file, without actually loading the PCH + /// file. + static std::string getOriginalSourceFile(const std::string &PCHFileName); + /// \brief Returns the suggested contents of the predefines buffer, /// which contains a (typically-empty) subset of the predefines /// build prior to including the precompiled header. |