[cfe-commits] r58501 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Analysis/CFRefCount.cpp lib/Basic/TargetInfo.cpp lib/Basic/Targets.cpp lib/CodeGen/CGDecl.cpp lib/Lex/Preprocessor.cpp lib/Parse/ParseDeclCXX.cpp lib/Sema/SemaDeclCXX.cpp

Eli Friedman eli.friedman at gmail.com
Sat Nov 1 11:48:58 PDT 2008


On Fri, Oct 31, 2008 at 2:52 AM, Sanjiv Gupta
<sanjiv.gupta at microchip.com> wrote:
> --- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
> +++ cfe/trunk/lib/Basic/TargetInfo.cpp Fri Oct 31 04:52:39 2008
> @@ -34,6 +34,11 @@
>   DoubleAlign = 64;
>   LongDoubleWidth = 64;
>   LongDoubleAlign = 64;
> +  SizeType = UnsignedInt;
> +  IntMaxType = SignedLongLong;
> +  UIntMaxType = UnsignedLongLong;
> +  PtrDiffType = SignedLongLong;
> +  WCharType = UnsignedInt;
>   FloatFormat = &llvm::APFloat::IEEEsingle;
>   DoubleFormat = &llvm::APFloat::IEEEdouble;
>   LongDoubleFormat = &llvm::APFloat::IEEEdouble;


> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Fri Oct 31 04:52:39 2008
> @@ -801,11 +801,17 @@
>   class PIC16TargetInfo : public TargetInfo{
>   public:
>     PIC16TargetInfo(const std::string& triple) : TargetInfo(triple) {
> -      // FIXME: Is IntAlign really supposed to be 16?  There seems
> -      // little point on a platform with 8-bit loads.
> -      IntWidth = IntAlign = LongAlign = LongLongAlign = PointerWidth = 16;
> -      LongWidth = 16;
> +      IntWidth = 16;
> +      LongWidth = LongLongWidth = 32;
> +      PointerWidth = 16;
> +      IntAlign = 8;
> +      LongAlign = LongLongAlign = 8;
>       PointerAlign = 8;
> +      SizeType = UnsignedInt;
> +      IntMaxType = SignedLong;
> +      UIntMaxType = UnsignedLong;
> +      PtrDiffType = SignedShort;
> +      WCharType = UnsignedInt;
>       DescriptionString = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8";
>     }
>     virtual uint64_t getPointerWidthV(unsigned AddrSpace) const { return 16; }

Is this really correct for platforms other than PIC16?

-Eli



More information about the cfe-commits mailing list