diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2008-10-31 09:52:39 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2008-10-31 09:52:39 +0000 |
commit | 31fc07df7f0fc89ebf83ca05a20b29de45a7598d (patch) | |
tree | 7d952a94384a81825468b68d59b257c7fe8ac780 /lib/Basic | |
parent | dd913e557628abadee5112cca90e339d25b9b398 (diff) |
Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
etc more generic. For some targets, long may not be equal to pointer size. For
example: PIC16 has int as i16, ptr as i16 but long as i32.
Also fixed a few build warnings in assert() functions in CFRefCount.cpp,
CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/TargetInfo.cpp | 5 | ||||
-rw-r--r-- | lib/Basic/Targets.cpp | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 20692ba5b1..aa19928e5f 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -34,6 +34,11 @@ TargetInfo::TargetInfo(const std::string &T) : Triple(T) { 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; diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 020c7d47db..456c1f8f35 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -801,11 +801,17 @@ namespace { 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; } |