summaryrefslogtreecommitdiffstats
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2015-09-22 17:23:22 +0000
committerArtem Belevich <tra@google.com>2015-09-22 17:23:22 +0000
commit675c6b4346cdde41712c89a9c80cb4d1ffb7267e (patch)
treecb09d08fdedf679b21887b3ec10d8a3e931aa0d2 /include/clang/Lex/Preprocessor.h
parent20db8d08e59176291d746d4f65cedf639d308594 (diff)
[CUDA] Allow parsing of host and device code simultaneously.
* adds -aux-triple option to specify target triple * propagates aux target info to AST context and Preprocessor * pulls in target specific preprocessor macros. * pulls in target-specific builtins from aux target. * sets appropriate host or device attribute on builtins. Differential Revision: http://reviews.llvm.org/D12917 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index b2f58ead0e..de252cb5d5 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -98,6 +98,7 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
DiagnosticsEngine *Diags;
LangOptions &LangOpts;
const TargetInfo *Target;
+ const TargetInfo *AuxTarget;
FileManager &FileMgr;
SourceManager &SourceMgr;
std::unique_ptr<ScratchBuffer> ScratchBuf;
@@ -656,7 +657,10 @@ public:
///
/// \param Target is owned by the caller and must remain valid for the
/// lifetime of the preprocessor.
- void Initialize(const TargetInfo &Target);
+ /// \param AuxTarget is owned by the caller and must remain valid for
+ /// the lifetime of the preprocessor.
+ void Initialize(const TargetInfo &Target,
+ const TargetInfo *AuxTarget = nullptr);
/// \brief Initialize the preprocessor to parse a model file
///
@@ -678,6 +682,7 @@ public:
const LangOptions &getLangOpts() const { return LangOpts; }
const TargetInfo &getTargetInfo() const { return *Target; }
+ const TargetInfo *getAuxTargetInfo() const { return AuxTarget; }
FileManager &getFileManager() const { return FileMgr; }
SourceManager &getSourceManager() const { return SourceMgr; }
HeaderSearch &getHeaderSearchInfo() const { return HeaderInfo; }