[cfe-commits] r84416 - /cfe/trunk/lib/Basic/Targets.cpp

Edward O'Callaghan eocallaghan at auroraux.org
Sun Oct 18 06:34:01 PDT 2009


Author: evocallaghan
Date: Sun Oct 18 08:33:59 2009
New Revision: 84416

URL: http://llvm.org/viewvc/llvm-project?rev=84416&view=rev
Log:
The AuroraUX toolchain has conflicting wchar_t between the system stdlib.h header and the clang stddef.h header where clang was defining as int where we use long.

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=84416&r1=84415&r2=84416&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sun Oct 18 08:33:59 2009
@@ -320,6 +320,27 @@
     : OSTargetInfo<Target>(triple) {}
 };
 
+// AuroraUX target
+template<typename Target>
+class AuroraUXTargetInfo : public OSTargetInfo<Target> {
+protected:
+  virtual void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
+                                std::vector<char> &Defs) const {
+    DefineStd(Defs, "sun", Opts);
+    DefineStd(Defs, "unix", Opts);
+    Define(Defs, "__ELF__");
+    Define(Defs, "__svr4__");
+    Define(Defs, "__SVR4");
+  }
+public:
+  AuroraUXTargetInfo(const std::string& triple)
+    : OSTargetInfo<Target>(triple) {
+    this->UserLabelPrefix = "";
+    this->WCharType = this->SignedLong;
+    // FIXME: WIntType should be SignedLong
+  }
+};
+
 // Solaris target
 template<typename Target>
 class SolarisTargetInfo : public OSTargetInfo<Target> {
@@ -1456,6 +1477,14 @@
 } // end anonymous namespace.
 
 namespace {
+class AuroraUXSparcV8TargetInfo : public AuroraUXTargetInfo<SparcV8TargetInfo> {
+public:
+  AuroraUXSparcV8TargetInfo(const std::string& triple) :
+      AuroraUXTargetInfo<SparcV8TargetInfo>(triple) {
+    SizeType = UnsignedInt;
+    PtrDiffType = SignedInt;
+  }
+};
 class SolarisSparcV8TargetInfo : public SolarisTargetInfo<SparcV8TargetInfo> {
 public:
   SolarisSparcV8TargetInfo(const std::string& triple) :
@@ -1846,6 +1875,8 @@
     return new PPC64TargetInfo(T);
 
   case llvm::Triple::sparc:
+    if (os == llvm::Triple::AuroraUX)
+      return new AuroraUXSparcV8TargetInfo(T);
     if (os == llvm::Triple::Solaris)
       return new SolarisSparcV8TargetInfo(T);
     return new SparcV8TargetInfo(T);
@@ -1858,6 +1889,8 @@
 
   case llvm::Triple::x86:
     switch (os) {
+    case llvm::Triple::AuroraUX:
+      return new AuroraUXTargetInfo<X86_32TargetInfo>(T);
     case llvm::Triple::Darwin:
       return new DarwinI386TargetInfo(T);
     case llvm::Triple::Linux:
@@ -1884,6 +1917,8 @@
 
   case llvm::Triple::x86_64:
     switch (os) {
+    case llvm::Triple::AuroraUX:
+      return new AuroraUXTargetInfo<X86_64TargetInfo>(T);
     case llvm::Triple::Darwin:
       return new DarwinX86_64TargetInfo(T);
     case llvm::Triple::Linux:





More information about the cfe-commits mailing list