martell updated this revision to Diff 29407. martell added a comment. Tidied up the patch to make it more readable
http://reviews.llvm.org/D11071 Files: lib/Basic/Targets.cpp Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -4839,9 +4839,9 @@ }; // Windows ARM + Itanium C++ ABI Target -class ItaniumWindowsARMleTargetInfo : public WindowsARMTargetInfo { +class ItaniumWindowsARMTargetInfo : public WindowsARMTargetInfo { public: - ItaniumWindowsARMleTargetInfo(const llvm::Triple &Triple) + ItaniumWindowsARMTargetInfo(const llvm::Triple &Triple) : WindowsARMTargetInfo(Triple) { TheCXXABI.set(TargetCXXABI::GenericARM); } @@ -4856,9 +4856,9 @@ }; // Windows ARM, MS (C++) ABI -class MicrosoftARMleTargetInfo : public WindowsARMTargetInfo { +class MicrosoftARMTargetInfo : public WindowsARMTargetInfo { public: - MicrosoftARMleTargetInfo(const llvm::Triple &Triple) + MicrosoftARMTargetInfo(const llvm::Triple &Triple) : WindowsARMTargetInfo(Triple) { TheCXXABI.set(TargetCXXABI::Microsoft); } @@ -4870,6 +4870,46 @@ } }; +// 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: @@ -6990,10 +7030,14 @@ 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); + return new ItaniumWindowsARMTargetInfo(Triple); case llvm::Triple::MSVC: - return new MicrosoftARMleTargetInfo(Triple); + return new MicrosoftARMTargetInfo(Triple); } default: return new ARMleTargetInfo(Triple);
Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -4839,9 +4839,9 @@ }; // Windows ARM + Itanium C++ ABI Target -class ItaniumWindowsARMleTargetInfo : public WindowsARMTargetInfo { +class ItaniumWindowsARMTargetInfo : public WindowsARMTargetInfo { public: - ItaniumWindowsARMleTargetInfo(const llvm::Triple &Triple) + ItaniumWindowsARMTargetInfo(const llvm::Triple &Triple) : WindowsARMTargetInfo(Triple) { TheCXXABI.set(TargetCXXABI::GenericARM); } @@ -4856,9 +4856,9 @@ }; // Windows ARM, MS (C++) ABI -class MicrosoftARMleTargetInfo : public WindowsARMTargetInfo { +class MicrosoftARMTargetInfo : public WindowsARMTargetInfo { public: - MicrosoftARMleTargetInfo(const llvm::Triple &Triple) + MicrosoftARMTargetInfo(const llvm::Triple &Triple) : WindowsARMTargetInfo(Triple) { TheCXXABI.set(TargetCXXABI::Microsoft); } @@ -4870,6 +4870,46 @@ } }; +// 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: @@ -6990,10 +7030,14 @@ 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); + return new ItaniumWindowsARMTargetInfo(Triple); case llvm::Triple::MSVC: - return new MicrosoftARMleTargetInfo(Triple); + return new MicrosoftARMTargetInfo(Triple); } default: return new ARMleTargetInfo(Triple);
_______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits