Implement codegen for + and - with pointers. Patch contributed by
Keith Bauer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39793 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index b1c20c9..17b18d5 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -397,6 +397,14 @@
return UnsignedLongTy;
}
+/// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
+/// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
+QualType ASTContext::getPointerDiffType() const {
+ // On Darwin, ptrdiff_t is defined as a "int". This seems like a bug...
+ // FIXME: should derive from "Target".
+ return IntTy;
+}
+
/// getIntegerBitwidth - Return the bitwidth of the specified integer type
/// according to the target. 'Loc' specifies the source location that
/// requires evaluation of this property.