[cfe-dev] [patch] Solaris/OpenSolaris x32/x64 support
phitaugamma
phitaugamma at googlemail.com
Thu May 21 16:24:22 PDT 2009
Hi,
The proposed patch adds Solaris x32/x64 support.
Thanks.
Index: Targets.cpp
===================================================================
--- Targets.cpp (revision 72221)
+++ Targets.cpp (working copy)
@@ -63,9 +63,10 @@
// Defines specific to certain operating systems.
//===----------------------------------------------------------------------===//
-static void getSolarisDefines(std::vector<char> &Defs) {
- Define(Defs, "__SUN__");
- Define(Defs, "__SOLARIS__");
+static void getSolarisDefines(const LangOptions &Opts, std::vector<char>
&Defs) {
+ DefineStd(Defs, "sun", Opts);
+ DefineStd(Defs, "unix", Opts);
+ Define(Defs, "__ELF__", "1");
}
static void getFreeBSDDefines(const LangOptions &Opts, bool is64Bit,
@@ -886,6 +887,22 @@
} // end anonymous namespace
namespace {
+// x86-32 Solaris target
+class SolarisX86_32TargetInfo : public X86_32TargetInfo {
+public:
+ SolarisX86_32TargetInfo(const std::string& triple) :
X86_32TargetInfo(triple) {
+ UserLabelPrefix = "";
+ }
+ virtual void getTargetDefines(const LangOptions &Opts,
+ std::vector<char> &Defines) const {
+ X86_32TargetInfo::getTargetDefines(Opts, Defines);
+ getSolarisDefines(Opts, Defines);
+ }
+};
+} // end anonymous namespace
+
+
+namespace {
// x86-32 Windows target
class WindowsX86_32TargetInfo : public X86_32TargetInfo {
public:
@@ -967,6 +984,21 @@
} // end anonymous namespace
namespace {
+// x86-64 Solaris target
+class SolarisX86_64TargetInfo : public X86_64TargetInfo {
+public:
+ SolarisX86_64TargetInfo(const std::string& triple) :
X86_64TargetInfo(triple) {
+ UserLabelPrefix = "";
+ }
+ virtual void getTargetDefines(const LangOptions &Opts,
+ std::vector<char> &Defines) const {
+ X86_64TargetInfo::getTargetDefines(Opts, Defines);
+ getSolarisDefines(Opts, Defines);
+ }
+};
+} // end anonymous namespace
+
+namespace {
// x86-64 Darwin (OS X) target
class DarwinX86_64TargetInfo : public X86_64TargetInfo {
public:
@@ -1246,7 +1278,7 @@
virtual void getTargetDefines(const LangOptions &Opts,
std::vector<char> &Defines) const {
SparcV8TargetInfo::getTargetDefines(Opts, Defines);
- getSolarisDefines(Defines);
+ getSolarisDefines(Opts, Defines);
}
};
} // end anonymous namespace.
@@ -1420,6 +1452,8 @@
return new LinuxX86_64TargetInfo(T);
if (isFreeBSD)
return new FreeBSDX86_64TargetInfo(T);
+ if (isSolaris)
+ return new SolarisX86_64TargetInfo(T);
return new X86_64TargetInfo(T);
}
@@ -1438,6 +1472,8 @@
return new DragonFlyX86_32TargetInfo(T);
if (isFreeBSD)
return new FreeBSDX86_32TargetInfo(T);
+ if (isSolaris)
+ return new SolarisX86_32TargetInfo(T);
if (isWindows)
return new WindowsX86_32TargetInfo(T);
return new X86_32TargetInfo(T);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090522/ebfb1576/attachment.html>
More information about the cfe-dev
mailing list