diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:10:26 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:10:26 +0000 |
commit | 2fce988e86bc01829142e4362d4eff1af0925147 (patch) | |
tree | c69d3f4f13d508570bb5257a6aea735f88bdf09c /include/clang/Frontend | |
parent | a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824 (diff) | |
download | FreeBSD-src-2fce988e86bc01829142e4362d4eff1af0925147.zip FreeBSD-src-2fce988e86bc01829142e4362d4eff1af0925147.tar.gz |
Update clang to r94309.
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 17 | ||||
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 20 | ||||
-rw-r--r-- | include/clang/Frontend/PreprocessorOptions.h | 22 | ||||
-rw-r--r-- | include/clang/Frontend/Utils.h | 23 |
4 files changed, 52 insertions, 30 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index f18972a..2659dbb 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -21,6 +21,11 @@ #include <string> #include <vector> #include <cassert> +#include <utility> + +namespace llvm { + class MemoryBuffer; +} namespace clang { class ASTContext; @@ -111,6 +116,10 @@ public: return TopLevelDecls; } + /// \brief A mapping from a file name to the memory buffer that stores the + /// remapped contents of that file. + typedef std::pair<std::string, const llvm::MemoryBuffer *> RemappedFile; + /// \brief Create a ASTUnit from a PCH file. /// /// \param Filename - The PCH file to load. @@ -122,7 +131,9 @@ public: static ASTUnit *LoadFromPCHFile(const std::string &Filename, Diagnostic &Diags, bool OnlyLocalDecls = false, - bool UseBumpAllocator = false); + bool UseBumpAllocator = false, + RemappedFile *RemappedFiles = 0, + unsigned NumRemappedFiles = 0); /// LoadFromCompilerInvocation - Create an ASTUnit from a source file, via a /// CompilerInvocation object. @@ -158,7 +169,9 @@ public: Diagnostic &Diags, llvm::StringRef ResourceFilesPath, bool OnlyLocalDecls = false, - bool UseBumpAllocator = false); + bool UseBumpAllocator = false, + RemappedFile *RemappedFiles = 0, + unsigned NumRemappedFiles = 0); }; } // namespace clang diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index 536bd41..1a9f4ce 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -30,7 +30,7 @@ namespace clang { /// designed for the previous version could not support reading /// the new version), this number should be increased. /// - /// Version 3 of PCH files also requires that the Subversion branch and + /// Version 3 of PCH files also requires that the version control branch and /// revision match exactly, since there is no backward compatibility of /// PCH files at this time. const unsigned VERSION_MAJOR = 3; @@ -219,9 +219,9 @@ namespace clang { /// comments were encountered in the source code. COMMENT_RANGES = 20, - /// \brief Record code for the Subversion branch and revision information - /// of the compiler used to build this PCH file. - SVN_BRANCH_REVISION = 21 + /// \brief Record code for the version control branch and revision + /// information of the compiler used to build this PCH file. + VERSION_CONTROL_BRANCH_REVISION = 21 }; /// \brief Record types used within a source manager block. @@ -676,7 +676,17 @@ namespace clang { /// \brief A CXXOperatorCallExpr record. EXPR_CXX_OPERATOR_CALL, /// \brief A CXXConstructExpr record. - EXPR_CXX_CONSTRUCT + EXPR_CXX_CONSTRUCT, + // \brief A CXXStaticCastExpr record. + EXPR_CXX_STATIC_CAST, + // \brief A CXXDynamicCastExpr record. + EXPR_CXX_DYNAMIC_CAST, + // \brief A CXXReinterpretCastExpr record. + EXPR_CXX_REINTERPRET_CAST, + // \brief A CXXConstCastExpr record. + EXPR_CXX_CONST_CAST, + // \brief A CXXFunctionalCastExpr record. + EXPR_CXX_FUNCTIONAL_CAST }; /// \brief The kinds of designators that can occur in a diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h index c43a1fe..7ba7c5c 100644 --- a/include/clang/Frontend/PreprocessorOptions.h +++ b/include/clang/Frontend/PreprocessorOptions.h @@ -16,6 +16,10 @@ #include <utility> #include <vector> +namespace llvm { + class MemoryBuffer; +} + namespace clang { class Preprocessor; @@ -48,6 +52,12 @@ public: /// pair). std::vector<std::pair<std::string, std::string> > RemappedFiles; + /// \brief The set of file-to-buffer remappings, which take existing files + /// on the system (the first part of each pair) and gives them the contents + /// of the specified memory buffer (the second part of each pair). + std::vector<std::pair<std::string, const llvm::MemoryBuffer *> > + RemappedFileBuffers; + typedef std::vector<std::pair<std::string, std::string> >::const_iterator remapped_file_iterator; remapped_file_iterator remapped_file_begin() const { @@ -57,6 +67,15 @@ public: return RemappedFiles.end(); } + typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >:: + const_iterator remapped_file_buffer_iterator; + remapped_file_buffer_iterator remapped_file_buffer_begin() const { + return RemappedFileBuffers.begin(); + } + remapped_file_buffer_iterator remapped_file_buffer_end() const { + return RemappedFileBuffers.end(); + } + public: PreprocessorOptions() : UsePredefines(true) {} @@ -69,6 +88,9 @@ public: void addRemappedFile(llvm::StringRef From, llvm::StringRef To) { RemappedFiles.push_back(std::make_pair(From, To)); } + void addRemappedFile(llvm::StringRef From, const llvm::MemoryBuffer * To) { + RemappedFileBuffers.push_back(std::make_pair(From, To)); + } }; } // end namespace clang diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index c8df494..7f43b2a 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -15,7 +15,6 @@ #define LLVM_CLANG_FRONTEND_UTILS_H #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/Twine.h" #include "llvm/Support/raw_ostream.h" namespace llvm { @@ -41,28 +40,6 @@ class Stmt; class TargetInfo; class FrontendOptions; -class MacroBuilder { - llvm::raw_ostream &Out; -public: - MacroBuilder(llvm::raw_ostream &Output) : Out(Output) {} - - /// Append a #define line for macro of the form "#define Name Value\n". - void defineMacro(const llvm::Twine &Name, const llvm::Twine &Value = "1") { - Out << "#define " << Name << ' ' << Value << '\n'; - } - - /// Append a #undef line for Name. Name should be of the form XXX - /// and we emit "#undef XXX". - void undefineMacro(const llvm::Twine &Name) { - Out << "#undef " << Name << '\n'; - } - - /// Directly append Str and a newline to the underlying buffer. - void append(const llvm::Twine &Str) { - Out << Str << '\n'; - } -}; - /// Normalize \arg File for use in a user defined #include directive (in the /// predefines buffer). std::string NormalizeDashIncludePath(llvm::StringRef File); |