[cfe-commits] r96362 - /cfe/trunk/lib/Basic/Targets.cpp
Chris Lattner
sabre at nondot.org
Tue Feb 16 10:14:57 PST 2010
Author: lattner
Date: Tue Feb 16 12:14:57 2010
New Revision: 96362
URL: http://llvm.org/viewvc/llvm-project?rev=96362&view=rev
Log:
add freebsd/ppc[64] support, patch by Nathan Whitehorn, PR6318
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=96362&r1=96361&r2=96362&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Feb 16 12:14:57 2010
@@ -436,11 +436,13 @@
// Target identification.
Builder.defineMacro("__ppc__");
Builder.defineMacro("_ARCH_PPC");
+ Builder.defineMacro("__powerpc__");
Builder.defineMacro("__POWERPC__");
if (PointerWidth == 64) {
Builder.defineMacro("_ARCH_PPC64");
Builder.defineMacro("_LP64");
Builder.defineMacro("__LP64__");
+ Builder.defineMacro("__powerpc64__");
Builder.defineMacro("__ppc64__");
} else {
Builder.defineMacro("__ppc__");
@@ -571,9 +573,12 @@
namespace {
class PPC32TargetInfo : public PPCTargetInfo {
public:
- PPC32TargetInfo(const std::string& triple) : PPCTargetInfo(triple) {
+ PPC32TargetInfo(const std::string &triple) : PPCTargetInfo(triple) {
DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
"i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32";
+
+ if (getTriple().getOS() == llvm::Triple::FreeBSD)
+ this->SizeType = TargetInfo::UnsignedInt;
}
};
} // end anonymous namespace.
@@ -2096,6 +2101,8 @@
case llvm::Triple::ppc:
if (os == llvm::Triple::Darwin)
return new DarwinTargetInfo<PPCTargetInfo>(T);
+ else if (os == llvm::Triple::FreeBSD)
+ return new FreeBSDTargetInfo<PPC32TargetInfo>(T);
return new PPC32TargetInfo(T);
case llvm::Triple::ppc64:
@@ -2103,6 +2110,8 @@
return new DarwinTargetInfo<PPC64TargetInfo>(T);
else if (os == llvm::Triple::Lv2)
return new PS3PPUTargetInfo<PPC64TargetInfo>(T);
+ else if (os == llvm::Triple::FreeBSD)
+ return new FreeBSDTargetInfo<PPC64TargetInfo>(T);
return new PPC64TargetInfo(T);
case llvm::Triple::sparc:
More information about the cfe-commits
mailing list