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
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 020c7d4..456c1f8 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -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; }