summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
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
commitb5bc923af407cbe7e1d96fcb884c7ef5c6897bc0 (patch)
treea9c6e261ed99150fc40f767d7ec017ca104b6b8d /clang/lib/Frontend/InitPreprocessor.cpp
parentccf0d699f02710c75556bf74229a1bc4ce85547c (diff)
downloadbcm5719-llvm-b5bc923af407cbe7e1d96fcb884c7ef5c6897bc0.tar.gz
bcm5719-llvm-b5bc923af407cbe7e1d96fcb884c7ef5c6897bc0.zip
[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 llvm-svn: 248299
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 0791494f791..0b445e8b65c 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -918,6 +918,10 @@ void clang::InitializePreprocessor(
// Install things like __POWERPC__, __GNUC__, etc into the macro table.
if (InitOpts.UsePredefines) {
+ if (LangOpts.CUDA && PP.getAuxTargetInfo())
+ InitializePredefinedMacros(*PP.getAuxTargetInfo(), LangOpts, FEOpts,
+ Builder);
+
InitializePredefinedMacros(PP.getTargetInfo(), LangOpts, FEOpts, Builder);
// Install definitions to make Objective-C++ ARC work well with various
OpenPOWER on IntegriCloud