r242292 - Add support for armv7-windows-gnu targets to the clang front end.
Yaron Keren
yaron.keren at gmail.com
Wed Jul 15 06:32:23 PDT 2015
Author: yrnkrn
Date: Wed Jul 15 08:32:23 2015
New Revision: 242292
URL: http://llvm.org/viewvc/llvm-project?rev=242292&view=rev
Log:
Add support for armv7-windows-gnu targets to the clang front end.
http://reviews.llvm.org/D11071
Patch by Martell Malone
Reviewed by Reid Kleckner
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=242292&r1=242291&r2=242292&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jul 15 08:32:23 2015
@@ -4919,6 +4919,45 @@ public:
}
};
+// ARM MinGW target
+class MinGWARMTargetInfo : public WindowsARMTargetInfo {
+public:
+ MinGWARMTargetInfo(const llvm::Triple &Triple)
+ : WindowsARMTargetInfo(Triple) {
+ TheCXXABI.set(TargetCXXABI::GenericARM);
+ }
+
+ void getTargetDefines(const LangOptions &Opts,
+ MacroBuilder &Builder) const override {
+ WindowsARMTargetInfo::getTargetDefines(Opts, Builder);
+ DefineStd(Builder, "WIN32", Opts);
+ DefineStd(Builder, "WINNT", Opts);
+ Builder.defineMacro("_ARM_");
+ addMinGWDefines(Opts, Builder);
+ }
+};
+
+// ARM Cygwin target
+class CygwinARMTargetInfo : public ARMleTargetInfo {
+public:
+ CygwinARMTargetInfo(const llvm::Triple &Triple) : ARMleTargetInfo(Triple) {
+ TLSSupported = false;
+ WCharType = UnsignedShort;
+ DoubleAlign = LongLongAlign = 64;
+ DescriptionString = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64";
+ }
+ void getTargetDefines(const LangOptions &Opts,
+ MacroBuilder &Builder) const override {
+ ARMleTargetInfo::getTargetDefines(Opts, Builder);
+ Builder.defineMacro("_ARM_");
+ Builder.defineMacro("__CYGWIN__");
+ Builder.defineMacro("__CYGWIN32__");
+ DefineStd(Builder, "unix", Opts);
+ if (Opts.CPlusPlus)
+ Builder.defineMacro("_GNU_SOURCE");
+ }
+};
+
class DarwinARMTargetInfo :
public DarwinTargetInfo<ARMleTargetInfo> {
protected:
@@ -7039,6 +7078,10 @@ static TargetInfo *AllocateTarget(const
switch (Triple.getEnvironment()) {
default:
return new ARMleTargetInfo(Triple);
+ case llvm::Triple::Cygnus:
+ return new CygwinARMTargetInfo(Triple);
+ case llvm::Triple::GNU:
+ return new MinGWARMTargetInfo(Triple);
case llvm::Triple::Itanium:
return new ItaniumWindowsARMleTargetInfo(Triple);
case llvm::Triple::MSVC:
More information about the cfe-commits
mailing list