From 5e601dcb398f8af5465d0d1a97a7fcf38d6932ec Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 2 Aug 2012 13:45:48 +0000 Subject: [PATCH] Add OpenBSD arch targets for powerpc, arm, mips64, mips64el and sparc. Contributed by Brad Smith git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161175 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 171a857a6a..558ae84f6c 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -778,7 +778,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, } // Target properties. - if (getTriple().getOS() != llvm::Triple::NetBSD) + if (getTriple().getOS() != llvm::Triple::NetBSD && + getTriple().getOS() != llvm::Triple::OpenBSD) Builder.defineMacro("_BIG_ENDIAN"); Builder.defineMacro("__BIG_ENDIAN__"); @@ -956,6 +957,7 @@ public: case llvm::Triple::Linux: case llvm::Triple::FreeBSD: case llvm::Triple::NetBSD: + case llvm::Triple::OpenBSD: SizeType = UnsignedInt; PtrDiffType = SignedInt; IntPtrType = SignedInt; @@ -4152,6 +4154,8 @@ static TargetInfo *AllocateTarget(const std::string &T) { return new FreeBSDTargetInfo(T); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(T); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(T); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(T); default: @@ -4199,6 +4203,8 @@ static TargetInfo *AllocateTarget(const std::string &T) { return new FreeBSDTargetInfo(T); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(T); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(T); default: return new Mips64EBTargetInfo(T); } @@ -4213,6 +4219,8 @@ static TargetInfo *AllocateTarget(const std::string &T) { return new FreeBSDTargetInfo(T); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(T); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(T); default: return new Mips64ELTargetInfo(T); } @@ -4235,6 +4243,8 @@ static TargetInfo *AllocateTarget(const std::string &T) { return new FreeBSDTargetInfo(T); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(T); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(T); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(T); default: @@ -4275,6 +4285,8 @@ static TargetInfo *AllocateTarget(const std::string &T) { return new SolarisSparcV8TargetInfo(T); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(T); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(T); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(T); default: