summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-12-07 19:04:10 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-12-07 19:04:10 +0000
commit6cdef0efb7bf62cc44e80cd0c8973eda26d09db4 (patch)
tree643e2443aca590b913c107f648045d420f6bffb0 /clang/lib/Frontend/InitPreprocessor.cpp
parentd182aaa69daf3c62ab302ec64356169575e277a2 (diff)
downloadbcm5719-llvm-6cdef0efb7bf62cc44e80cd0c8973eda26d09db4.tar.gz
bcm5719-llvm-6cdef0efb7bf62cc44e80cd0c8973eda26d09db4.zip
[driver] Set the 'simulator' environment for Darwin when compiling for
iOS/tvOS/watchOS simulator rdar://35135215 Differential Revision: https://reviews.llvm.org/D40682 llvm-svn: 320073
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 617b6aabcc7..a7ce2868a63 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -998,6 +998,11 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__nullable", "_Nullable");
}
+ // Add a macro to differentiate between regular iOS/tvOS/watchOS targets and
+ // the corresponding simulator targets.
+ if (TI.getTriple().isOSDarwin() && TI.getTriple().isSimulatorEnvironment())
+ Builder.defineMacro("__APPLE_EMBEDDED_SIMULATOR__", "1");
+
// OpenMP definition
// OpenMP 2.2:
// In implementations that support a preprocessor, the _OPENMP
OpenPOWER on IntegriCloud