[PATCH] D38270: [clang] Add getUnsignedPointerDiffType method
Alexander Shaposhnikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 26 15:30:45 PDT 2017
alexshap updated this revision to Diff 116635.
alexshap added a comment.
fix typo
Repository:
rL LLVM
https://reviews.llvm.org/D38270
Files:
include/clang/AST/ASTContext.h
include/clang/Basic/TargetInfo.h
lib/AST/ASTContext.cpp
Index: lib/AST/ASTContext.cpp
===================================================================
--- lib/AST/ASTContext.cpp
+++ lib/AST/ASTContext.cpp
@@ -4571,6 +4571,12 @@
return getFromTargetType(Target->getPtrDiffType(0));
}
+/// getUnsignedPointerDiffType - Return the unique unsigned counterpart of
+/// "ptrdiff_t" integer type.
+QualType ASTContext::getUnsignedPointerDiffType() const {
+ return getFromTargetType(Target->getUnsignedPtrDiffType(0));
+}
+
/// \brief Return the unique type for "pid_t" defined in
/// <sys/types.h>. We need this to compute the correct type for vfork().
QualType ASTContext::getProcessIDType() const {
Index: include/clang/Basic/TargetInfo.h
===================================================================
--- include/clang/Basic/TargetInfo.h
+++ include/clang/Basic/TargetInfo.h
@@ -248,6 +248,9 @@
IntType getPtrDiffType(unsigned AddrSpace) const {
return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
}
+ IntType getUnsignedPtrDiffType(unsigned AddrSpace) const {
+ return getCorrespondingUnsignedType(getPtrDiffType(AddrSpace));
+ }
IntType getIntPtrType() const { return IntPtrType; }
IntType getUIntPtrType() const {
return getCorrespondingUnsignedType(IntPtrType);
Index: include/clang/AST/ASTContext.h
===================================================================
--- include/clang/AST/ASTContext.h
+++ include/clang/AST/ASTContext.h
@@ -1489,6 +1489,10 @@
/// <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
QualType getPointerDiffType() const;
+ /// \brief Return the unique unsigned counterpart of
+ /// "ptrdiff_t" integer type.
+ QualType getUnsignedPointerDiffType() const;
+
/// \brief Return the unique type for "pid_t" defined in
/// <sys/types.h>. We need this to compute the correct type for vfork().
QualType getProcessIDType() const;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38270.116635.patch
Type: text/x-patch
Size: 1887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170926/954a4b1c/attachment-0001.bin>
More information about the cfe-commits
mailing list