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 | d79592448b90650808aca35570220c12d773a163 (patch) | |
| tree | efc9545b6bbd946d3303c7e834b91a85511bc7be /clang/lib/Basic | |
| parent | ada702ef45247b42511ff0fb555a8ddcba94e780 (diff) | |
| download | bcm5719-llvm-d79592448b90650808aca35570220c12d773a163.tar.gz bcm5719-llvm-d79592448b90650808aca35570220c12d773a163.zip | |
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.
llvm-svn: 58501
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/TargetInfo.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index 20692ba5b13..aa19928e5fa 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/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/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 020c7d47db4..456c1f8f353 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/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; } |

