Give TargetInfo a new IntPtrType to hold the intptr_t type for
a target.
Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this.
On linux/32, set intptr_t to int, instead of long. This fixes PR3563.
llvm-svn: 64495
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index 378a915..82b6c19 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -39,6 +39,7 @@
PtrDiffType = SignedLong;
IntMaxType = SignedLongLong;
UIntMaxType = UnsignedLongLong;
+ IntPtrType = SignedLong;
WCharType = SignedInt;
FloatFormat = &llvm::APFloat::IEEEsingle;
DoubleFormat = &llvm::APFloat::IEEEdouble;
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index c72982b..9e81ed7 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -629,6 +629,7 @@
UserLabelPrefix = "";
SizeType = UnsignedInt;
PtrDiffType = SignedInt;
+ IntPtrType = SignedInt;
}
virtual void getTargetDefines(std::vector<char> &Defines) const {
X86_32TargetInfo::getTargetDefines(Defines);
@@ -937,6 +938,7 @@
SizeType = UnsignedInt;
IntMaxType = SignedLong;
UIntMaxType = UnsignedLong;
+ IntPtrType = SignedShort;
PtrDiffType = SignedInt;
DescriptionString = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8";
}