From 0bb8462bf7e447e7099e1433f250deaa975f8598 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 llvm-svn: 161175 --- clang/lib/Basic/Targets.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 171a857a6a6b..558ae84f6c44 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/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: