Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if

it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.

llvm-svn: 116191
This commit is contained in:
Chris Lattner 2010-10-11 05:44:49 +00:00
parent 1ef5e84c31
commit a09e8efd1f
8 changed files with 0 additions and 380 deletions

View File

@ -970,9 +970,6 @@ clang currently contains some support for PPC and Sparc; however, significant
pieces of code generation are still missing, and they haven't undergone
significant testing.
<p>clang contains some support for the embedded PIC16 processor
(FIXME: I haven't been keeping track of this; what should this say?).
<p>clang contains limited support for the MSP430 embedded processor, but both
the clang support and the LLVM backend support are highly experimental.

View File

@ -1993,75 +1993,6 @@ public:
};
} // end anonymous namespace.
namespace {
class PIC16TargetInfo : public TargetInfo{
public:
PIC16TargetInfo(const std::string& triple) : TargetInfo(triple) {
TLSSupported = false;
IntWidth = 16;
LongWidth = LongLongWidth = 32;
PointerWidth = 16;
IntAlign = 8;
LongAlign = LongLongAlign = 8;
PointerAlign = 8;
SizeType = UnsignedInt;
IntMaxType = SignedLong;
UIntMaxType = UnsignedLong;
IntPtrType = SignedShort;
PtrDiffType = SignedInt;
SigAtomicType = SignedLong;
FloatWidth = 32;
FloatAlign = 32;
DoubleWidth = 32;
DoubleAlign = 32;
LongDoubleWidth = 32;
LongDoubleAlign = 32;
FloatFormat = &llvm::APFloat::IEEEsingle;
DoubleFormat = &llvm::APFloat::IEEEsingle;
LongDoubleFormat = &llvm::APFloat::IEEEsingle;
DescriptionString = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-f32:32:32-n8";
}
virtual uint64_t getPointerWidthV(unsigned AddrSpace) const { return 16; }
virtual uint64_t getPointerAlignV(unsigned AddrSpace) const { return 8; }
virtual void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
Builder.defineMacro("__pic16");
Builder.defineMacro("__PIC16");
Builder.defineMacro("rom", "__attribute__((address_space(1)))");
Builder.defineMacro("ram", "__attribute__((address_space(0)))");
Builder.defineMacro("__section(SectName)",
"__attribute__((section(SectName)))");
Builder.defineMacro("near",
"__attribute__((section(\"Address=NEAR\")))");
Builder.defineMacro("__address(Addr)",
"__attribute__((section(\"Address=\"#Addr)))");
Builder.defineMacro("__config(conf)", "asm(\"CONFIG \"#conf)");
Builder.defineMacro("__idlocs(value)", "asm(\"__IDLOCS \"#value)");
Builder.defineMacro("interrupt",
"__attribute__((section(\"interrupt=0x4\"))) \
__attribute__((used))");
}
virtual void getTargetBuiltins(const Builtin::Info *&Records,
unsigned &NumRecords) const {}
virtual const char *getVAListDeclaration() const {
return "typedef char* __builtin_va_list;";
}
virtual const char *getClobbers() const {
return "";
}
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const {}
virtual bool validateAsmConstraint(const char *&Name,
TargetInfo::ConstraintInfo &info) const {
return true;
}
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
unsigned &NumAliases) const {}
virtual bool useGlobalsForAutomaticVariables() const {return true;}
};
}
namespace {
class MSP430TargetInfo : public TargetInfo {
static const char * const GCCRegNames[];
@ -2529,9 +2460,6 @@ static TargetInfo *AllocateTarget(const std::string &T) {
return new LinuxTargetInfo<MipselTargetInfo>(T);
return new MipselTargetInfo(T);
case llvm::Triple::pic16:
return new PIC16TargetInfo(T);
case llvm::Triple::ppc:
if (os == llvm::Triple::Darwin)
return new DarwinPPCTargetInfo(T);

View File

@ -2047,76 +2047,6 @@ llvm::Value *WinX86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
return AddrTyped;
}
//===----------------------------------------------------------------------===//
// PIC16 ABI Implementation
//===----------------------------------------------------------------------===//
namespace {
class PIC16ABIInfo : public ABIInfo {
public:
PIC16ABIInfo(CodeGenTypes &CGT) : ABIInfo(CGT) {}
ABIArgInfo classifyReturnType(QualType RetTy) const;
ABIArgInfo classifyArgumentType(QualType RetTy) const;
virtual void computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)
it->info = classifyArgumentType(it->type);
}
virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
CodeGenFunction &CGF) const;
};
class PIC16TargetCodeGenInfo : public TargetCodeGenInfo {
public:
PIC16TargetCodeGenInfo(CodeGenTypes &CGT)
: TargetCodeGenInfo(new PIC16ABIInfo(CGT)) {}
};
}
ABIArgInfo PIC16ABIInfo::classifyReturnType(QualType RetTy) const {
if (RetTy->isVoidType()) {
return ABIArgInfo::getIgnore();
} else {
return ABIArgInfo::getDirect();
}
}
ABIArgInfo PIC16ABIInfo::classifyArgumentType(QualType Ty) const {
return ABIArgInfo::getDirect();
}
llvm::Value *PIC16ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
CodeGenFunction &CGF) const {
const llvm::Type *BP = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
const llvm::Type *BPP = llvm::PointerType::getUnqual(BP);
CGBuilderTy &Builder = CGF.Builder;
llvm::Value *VAListAddrAsBPP = Builder.CreateBitCast(VAListAddr, BPP,
"ap");
llvm::Value *Addr = Builder.CreateLoad(VAListAddrAsBPP, "ap.cur");
llvm::Type *PTy =
llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
llvm::Value *AddrTyped = Builder.CreateBitCast(Addr, PTy);
uint64_t Offset = CGF.getContext().getTypeSize(Ty) / 8;
llvm::Value *NextAddr =
Builder.CreateGEP(Addr, llvm::ConstantInt::get(
llvm::Type::getInt32Ty(CGF.getLLVMContext()), Offset),
"ap.next");
Builder.CreateStore(NextAddr, VAListAddrAsBPP);
return AddrTyped;
}
// PowerPC-32
namespace {
@ -2695,9 +2625,6 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
return *(TheTargetCodeGenInfo =
new ARMTargetCodeGenInfo(Types, ARMABIInfo::AAPCS));
case llvm::Triple::pic16:
return *(TheTargetCodeGenInfo = new PIC16TargetCodeGenInfo(Types));
case llvm::Triple::ppc:
return *(TheTargetCodeGenInfo = new PPC32TargetCodeGenInfo(Types));

View File

@ -6,7 +6,6 @@
// RUN: %clang_cc1 -g -triple i686-unknown-dragonfly -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-unknown-win32 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple pic16-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc-apple-darwin9 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc64-apple-darwin9 -emit-llvm -o %t %s

View File

@ -508,106 +508,6 @@
// MSP430:#define __WINT_WIDTH__ 16
// MSP430:#define __clang__ 1
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=pic16-none-none < /dev/null | FileCheck -check-prefix PIC16 %s
//
// PIC16:#define __CHAR16_TYPE__ unsigned short
// PIC16:#define __CHAR32_TYPE__ unsigned int
// PIC16:#define __CHAR_BIT__ 8
// PIC16:#define __DBL_DENORM_MIN__ 1.40129846e-45F
// PIC16:#define __DBL_DIG__ 6
// PIC16:#define __DBL_EPSILON__ 1.19209290e-7F
// PIC16:#define __DBL_HAS_DENORM__ 1
// PIC16:#define __DBL_HAS_INFINITY__ 1
// PIC16:#define __DBL_HAS_QUIET_NAN__ 1
// PIC16:#define __DBL_MANT_DIG__ 24
// PIC16:#define __DBL_MAX_10_EXP__ 38
// PIC16:#define __DBL_MAX_EXP__ 128
// PIC16:#define __DBL_MAX__ 3.40282347e+38F
// PIC16:#define __DBL_MIN_10_EXP__ (-37)
// PIC16:#define __DBL_MIN_EXP__ (-125)
// PIC16:#define __DBL_MIN__ 1.17549435e-38F
// PIC16:#define __DECIMAL_DIG__ -1
// PIC16:#define __FLT_DENORM_MIN__ 1.40129846e-45F
// PIC16:#define __FLT_DIG__ 6
// PIC16:#define __FLT_EPSILON__ 1.19209290e-7F
// PIC16:#define __FLT_EVAL_METHOD__ 0
// PIC16:#define __FLT_HAS_DENORM__ 1
// PIC16:#define __FLT_HAS_INFINITY__ 1
// PIC16:#define __FLT_HAS_QUIET_NAN__ 1
// PIC16:#define __FLT_MANT_DIG__ 24
// PIC16:#define __FLT_MAX_10_EXP__ 38
// PIC16:#define __FLT_MAX_EXP__ 128
// PIC16:#define __FLT_MAX__ 3.40282347e+38F
// PIC16:#define __FLT_MIN_10_EXP__ (-37)
// PIC16:#define __FLT_MIN_EXP__ (-125)
// PIC16:#define __FLT_MIN__ 1.17549435e-38F
// PIC16:#define __FLT_RADIX__ 2
// PIC16:#define __INT16_TYPE__ short
// PIC16:#define __INT32_C_SUFFIX__ L
// PIC16:#define __INT32_TYPE__ long int
// PIC16:#define __INT8_TYPE__ char
// PIC16:#define __INTMAX_MAX__ 2147483647L
// PIC16:#define __INTMAX_TYPE__ long int
// PIC16:#define __INTMAX_WIDTH__ 32
// PIC16:#define __INTPTR_TYPE__ short
// PIC16:#define __INTPTR_WIDTH__ 16
// PIC16:#define __INT_MAX__ 32767
// PIC16:#define __LDBL_DENORM_MIN__ 1.40129846e-45F
// PIC16:#define __LDBL_DIG__ 6
// PIC16:#define __LDBL_EPSILON__ 1.19209290e-7F
// PIC16:#define __LDBL_HAS_DENORM__ 1
// PIC16:#define __LDBL_HAS_INFINITY__ 1
// PIC16:#define __LDBL_HAS_QUIET_NAN__ 1
// PIC16:#define __LDBL_MANT_DIG__ 24
// PIC16:#define __LDBL_MAX_10_EXP__ 38
// PIC16:#define __LDBL_MAX_EXP__ 128
// PIC16:#define __LDBL_MAX__ 3.40282347e+38F
// PIC16:#define __LDBL_MIN_10_EXP__ (-37)
// PIC16:#define __LDBL_MIN_EXP__ (-125)
// PIC16:#define __LDBL_MIN__ 1.17549435e-38F
// PIC16:#define __LONG_LONG_MAX__ 2147483647LL
// PIC16:#define __LONG_MAX__ 2147483647L
// PIC16:#define __NO_INLINE__ 1
// PIC16:#define __PIC16 1
// PIC16:#define __POINTER_WIDTH__ 16
// PIC16:#define __PTRDIFF_TYPE__ int
// PIC16:#define __PTRDIFF_WIDTH__ 16
// PIC16:#define __SCHAR_MAX__ 127
// PIC16:#define __SHRT_MAX__ 32767
// PIC16:#define __SIG_ATOMIC_WIDTH__ 32
// PIC16:#define __SIZEOF_DOUBLE__ 4
// PIC16:#define __SIZEOF_FLOAT__ 4
// PIC16:#define __SIZEOF_INT__ 2
// PIC16:#define __SIZEOF_LONG_DOUBLE__ 4
// PIC16:#define __SIZEOF_LONG_LONG__ 4
// PIC16:#define __SIZEOF_LONG__ 4
// PIC16:#define __SIZEOF_POINTER__ 2
// PIC16:#define __SIZEOF_PTRDIFF_T__ 2
// PIC16:#define __SIZEOF_SHORT__ 2
// PIC16:#define __SIZEOF_SIZE_T__ 2
// PIC16:#define __SIZEOF_WCHAR_T__ 2
// PIC16:#define __SIZEOF_WINT_T__ 2
// PIC16:#define __SIZE_TYPE__ unsigned int
// PIC16:#define __SIZE_WIDTH__ 16
// PIC16:#define __UINTMAX_TYPE__ long unsigned int
// PIC16:#define __USER_LABEL_PREFIX__ _
// PIC16:#define __WCHAR_MAX__ 32767
// PIC16:#define __WCHAR_TYPE__ int
// PIC16:#define __WCHAR_WIDTH__ 16
// PIC16:#define __WINT_TYPE__ int
// PIC16:#define __WINT_WIDTH__ 16
// PIC16:#define __address(Addr) __attribute__((section("Address="#Addr)))
// PIC16:#define __clang__ 1
// PIC16:#define __config(conf) asm("CONFIG "#conf)
// PIC16:#define __idlocs(value) asm("__IDLOCS "#value)
// PIC16:#define __llvm__ 1
// PIC16:#define __pic16 1
// PIC16:#define __section(SectName) __attribute__((section(SectName)))
// PIC16:#define interrupt __attribute__((section("interrupt=0x4"))) __attribute__((used))
// PIC16:#define near __attribute__((section("Address=NEAR")))
// PIC16:#define ram __attribute__((address_space(0)))
// PIC16:#define rom __attribute__((address_space(1)))
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix PPC64 %s
//
// PPC64:#define _ARCH_PPC 1

View File

@ -421,106 +421,6 @@
// MSP430:INTMAX_C_(0) 0L
// MSP430:UINTMAX_C_(0) 0UL
//
// RUN: %clang_cc1 -E -ffreestanding -triple=pic16-none-none %s | FileCheck -check-prefix PIC16 %s
//
// PIC16:typedef signed long int int32_t;
// PIC16:typedef unsigned long int uint32_t;
// PIC16:typedef int32_t int_least32_t;
// PIC16:typedef uint32_t uint_least32_t;
// PIC16:typedef int32_t int_fast32_t;
// PIC16:typedef uint32_t uint_fast32_t;
//
// PIC16:typedef signed short int16_t;
// PIC16:typedef unsigned short uint16_t;
// PIC16:typedef int16_t int_least16_t;
// PIC16:typedef uint16_t uint_least16_t;
// PIC16:typedef int16_t int_fast16_t;
// PIC16:typedef uint16_t uint_fast16_t;
//
// PIC16:typedef signed char int8_t;
// PIC16:typedef unsigned char uint8_t;
// PIC16:typedef int8_t int_least8_t;
// PIC16:typedef uint8_t uint_least8_t;
// PIC16:typedef int8_t int_fast8_t;
// PIC16:typedef uint8_t uint_fast8_t;
//
// PIC16:typedef int16_t intptr_t;
// PIC16:typedef uint16_t uintptr_t;
//
// PIC16:typedef long int intmax_t;
// PIC16:typedef long unsigned int uintmax_t;
//
// PIC16:INT8_MAX_ 127
// PIC16:INT8_MIN_ (-127 -1)
// PIC16:UINT8_MAX_ 255
// PIC16:INT_LEAST8_MIN_ (-127 -1)
// PIC16:INT_LEAST8_MAX_ 127
// PIC16:UINT_LEAST8_MAX_ 255
// PIC16:INT_FAST8_MIN_ (-127 -1)
// PIC16:INT_FAST8_MAX_ 127
// PIC16:UINT_FAST8_MAX_ 255
//
// PIC16:INT16_MAX_ 32767
// PIC16:INT16_MIN_ (-32767 -1)
// PIC16:UINT16_MAX_ 65535
// PIC16:INT_LEAST16_MIN_ (-32767 -1)
// PIC16:INT_LEAST16_MAX_ 32767
// PIC16:UINT_LEAST16_MAX_ 65535
// PIC16:INT_FAST16_MIN_ (-32767 -1)
// PIC16:INT_FAST16_MAX_ 32767
// PIC16:UINT_FAST16_MAX_ 65535
//
// PIC16:INT32_MAX_ 2147483647L
// PIC16:INT32_MIN_ (-2147483647L -1)
// PIC16:UINT32_MAX_ 4294967295UL
// PIC16:INT_LEAST32_MIN_ (-2147483647L -1)
// PIC16:INT_LEAST32_MAX_ 2147483647L
// PIC16:UINT_LEAST32_MAX_ 4294967295UL
// PIC16:INT_FAST32_MIN_ (-2147483647L -1)
// PIC16:INT_FAST32_MAX_ 2147483647L
// PIC16:UINT_FAST32_MAX_ 4294967295UL
//
// PIC16:INT64_MAX_ INT64_MAX
// PIC16:INT64_MIN_ INT64_MIN
// PIC16:UINT64_MAX_ UINT64_MAX
// PIC16:INT_LEAST64_MIN_ INT_LEAST64_MIN
// PIC16:INT_LEAST64_MAX_ INT_LEAST64_MAX
// PIC16:UINT_LEAST64_MAX_ UINT_LEAST64_MAX
// PIC16:INT_FAST64_MIN_ INT_FAST64_MIN
// PIC16:INT_FAST64_MAX_ INT_FAST64_MAX
// PIC16:UINT_FAST64_MAX_ UINT_FAST64_MAX
//
// PIC16:INTPTR_MIN_ (-32767 -1)
// PIC16:INTPTR_MAX_ 32767
// PIC16:UINTPTR_MAX_ 65535
// PIC16:PTRDIFF_MIN_ (-32767 -1)
// PIC16:PTRDIFF_MAX_ 32767
// PIC16:SIZE_MAX_ 65535
//
// PIC16:INTMAX_MIN_ (-2147483647L -1)
// PIC16:INTMAX_MAX_ 2147483647L
// PIC16:UINTMAX_MAX_ 4294967295UL
//
// PIC16:SIG_ATOMIC_MIN_ (-2147483647L -1)
// PIC16:SIG_ATOMIC_MAX_ 2147483647L
// PIC16:WINT_MIN_ (-32767 -1)
// PIC16:WINT_MAX_ 32767
//
// PIC16:WCHAR_MAX_ 32767
// PIC16:WCHAR_MIN_ (-32767 -1)
//
// PIC16:INT8_C_(0) 0
// PIC16:UINT8_C_(0) 0U
// PIC16:INT16_C_(0) 0
// PIC16:UINT16_C_(0) 0U
// PIC16:INT32_C_(0) 0L
// PIC16:UINT32_C_(0) 0UL
// PIC16:INT64_C_(0) INT64_C(0)
// PIC16:UINT64_C_(0) UINT64_C(0)
//
// PIC16:INTMAX_C_(0) 0L
// PIC16:UINTMAX_C_(0) 0UL
//
// RUN: %clang_cc1 -E -ffreestanding -triple=powerpc64-none-none %s | FileCheck -check-prefix PPC64 %s
//
// PPC64:typedef signed long int int64_t;

View File

@ -1,25 +0,0 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -triple pic16-unknown-unknown
// Check that int-sized unsigned bit-fields promote to unsigned int
// on targets where sizeof(unsigned short) == sizeof(unsigned int)
enum E { ec1, ec2, ec3 };
struct S {
enum E e : 16;
unsigned short us : 16;
unsigned long ul1 : 8;
unsigned long ul2 : 16;
} s;
__typeof(s.e + s.e) x_e;
unsigned x_e;
__typeof(s.us + s.us) x_us;
unsigned x_us;
__typeof(s.ul1 + s.ul1) x_ul1;
signed x_ul1;
__typeof(s.ul2 + s.ul2) x_ul2;
unsigned x_ul2;

View File

@ -1,6 +0,0 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -triple pic16-unknown-unknown
// Check that unsigned short promotes to unsigned int on targets where
// sizeof(unsigned short) == sizeof(unsigned int)
__typeof(1+(unsigned short)1) x;
unsigned x;