Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: lib/Basic/Targets.cpp

Issue 7748035: PNaClTargetInfo: add __ELF__, _REENTRANT and _GNU_SOURCE defines and update the test. (Closed) Base URL: https://llvm.org/svn/llvm-project/cfe/trunk/
Patch Set: include <stdio.h> in the test Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/Driver/le32-unknown-nacl.cpp » ('j') | test/Driver/le32-unknown-nacl.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===--- Targets.cpp - Implement -arch option and targets -----------------===// 1 //===--- Targets.cpp - Implement -arch option and targets -----------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements construction of a TargetInfo object from a 10 // This file implements construction of a TargetInfo object from a
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2863 void getDefaultFeatures(const std::string &CPU, 2863 void getDefaultFeatures(const std::string &CPU,
2864 llvm::StringMap<bool> &Features) const { 2864 llvm::StringMap<bool> &Features) const {
2865 } 2865 }
2866 virtual void getArchDefines(const LangOptions &Opts, 2866 virtual void getArchDefines(const LangOptions &Opts,
2867 MacroBuilder &Builder) const { 2867 MacroBuilder &Builder) const {
2868 Builder.defineMacro("__le32__"); 2868 Builder.defineMacro("__le32__");
2869 Builder.defineMacro("__pnacl__"); 2869 Builder.defineMacro("__pnacl__");
2870 } 2870 }
2871 virtual void getTargetDefines(const LangOptions &Opts, 2871 virtual void getTargetDefines(const LangOptions &Opts,
2872 MacroBuilder &Builder) const { 2872 MacroBuilder &Builder) const {
2873 DefineStd(Builder, "unix", Opts);
2874 Builder.defineMacro("__ELF__");
2875 if (Opts.POSIXThreads)
2876 Builder.defineMacro("_REENTRANT");
2877 if (Opts.CPlusPlus)
2878 Builder.defineMacro("_GNU_SOURCE");
2879
2873 Builder.defineMacro("__native_client__"); 2880 Builder.defineMacro("__native_client__");
2874 getArchDefines(Opts, Builder); 2881 getArchDefines(Opts, Builder);
2875 } 2882 }
2876 virtual void getTargetBuiltins(const Builtin::Info *&Records, 2883 virtual void getTargetBuiltins(const Builtin::Info *&Records,
2877 unsigned &NumRecords) const { 2884 unsigned &NumRecords) const {
2878 } 2885 }
2879 virtual const char *getVAListDeclaration() const { 2886 virtual const char *getVAListDeclaration() const {
2880 return "typedef struct __va_list_tag {" 2887 return "typedef struct __va_list_tag {"
2881 " void* ptr;" 2888 " void* ptr;"
2882 " void* padding1;" 2889 " void* padding1;"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3169 // need to pass the minuses. 3176 // need to pass the minuses.
3170 Opts.Features.clear(); 3177 Opts.Features.clear();
3171 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), 3178 for (llvm::StringMap<bool>::const_iterator it = Features.begin(),
3172 ie = Features.end(); it != ie; ++it) 3179 ie = Features.end(); it != ie; ++it)
3173 Opts.Features.push_back(std::string(it->second ? "+" : "-") + 3180 Opts.Features.push_back(std::string(it->second ? "+" : "-") +
3174 it->first().str()); 3181 it->first().str());
3175 Target->HandleTargetFeatures(Opts.Features); 3182 Target->HandleTargetFeatures(Opts.Features);
3176 3183
3177 return Target.take(); 3184 return Target.take();
3178 } 3185 }
OLDNEW
« no previous file with comments | « no previous file | test/Driver/le32-unknown-nacl.cpp » ('j') | test/Driver/le32-unknown-nacl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698