From 1f84f8d970a673e487b40d341cd3e8d52ca9cc22 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 24 Jun 2010 02:02:00 +0000 Subject: More clang support for darwin tls. Add a __has_feature macro and target specific preprocessor define as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106715 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/InitPreprocessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Frontend/InitPreprocessor.cpp') diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index c9c76e5f1f..ab0e7067a8 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -460,6 +460,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI, if (FEOpts.ProgramAction == frontend::RunAnalysis) Builder.defineMacro("__clang_analyzer__"); + // Define __HAS_TLS__ if the target supports it. + if (TI.isTLSSupported()) + Builder.defineMacro("__HAS_TLS__"); + // Get other target #defines. TI.getTargetDefines(LangOpts, Builder); } -- cgit v1.2.3