From b5bc923af407cbe7e1d96fcb884c7ef5c6897bc0 Mon Sep 17 00:00:00 2001 From: Artem Belevich Date: Tue, 22 Sep 2015 17:23:22 +0000 Subject: [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 --- clang/lib/Frontend/InitPreprocessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Frontend/InitPreprocessor.cpp') 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 -- cgit v1.2.3