From 757e685512b8616c9de918b3d3fad8247562dce2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 11 Oct 2010 05:44:49 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116191 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/UsersManual.html | 3 - lib/Basic/Targets.cpp | 72 ------------------ lib/CodeGen/TargetInfo.cpp | 73 ------------------ test/Coverage/targets.c | 1 - test/Preprocessor/init.c | 100 ------------------------- test/Preprocessor/stdint.c | 100 ------------------------- test/Sema/bitfield-promote-int-16bit.c | 25 ------- test/Sema/promote-int-16bit.c | 6 -- 8 files changed, 380 deletions(-) delete mode 100644 test/Sema/bitfield-promote-int-16bit.c delete mode 100644 test/Sema/promote-int-16bit.c diff --git a/docs/UsersManual.html b/docs/UsersManual.html index 44c77f91af..154cf86add 100644 --- a/docs/UsersManual.html +++ b/docs/UsersManual.html @@ -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. -

clang contains some support for the embedded PIC16 processor -(FIXME: I haven't been keeping track of this; what should this say?). -

clang contains limited support for the MSP430 embedded processor, but both the clang support and the LLVM backend support are highly experimental. diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 1896b5916b..4326733c4e 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -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(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); diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index e8e25ca6d4..38c746068d 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -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)); diff --git a/test/Coverage/targets.c b/test/Coverage/targets.c index c9f6f8d88d..d2a111241c 100644 --- a/test/Coverage/targets.c +++ b/test/Coverage/targets.c @@ -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 diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 6c27a6c431..88eecac6c6 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -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 diff --git a/test/Preprocessor/stdint.c b/test/Preprocessor/stdint.c index f8bb921a68..b3ae843803 100644 --- a/test/Preprocessor/stdint.c +++ b/test/Preprocessor/stdint.c @@ -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; diff --git a/test/Sema/bitfield-promote-int-16bit.c b/test/Sema/bitfield-promote-int-16bit.c deleted file mode 100644 index cd9adcffc0..0000000000 --- a/test/Sema/bitfield-promote-int-16bit.c +++ /dev/null @@ -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; - diff --git a/test/Sema/promote-int-16bit.c b/test/Sema/promote-int-16bit.c deleted file mode 100644 index 6446720a81..0000000000 --- a/test/Sema/promote-int-16bit.c +++ /dev/null @@ -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; -- 2.40.0