Added ASTContext methods getIntPtrType and getUIntPtrType.
authorEnea Zaffanella <zaffanella@cs.unipr.it>
Sat, 26 Jan 2013 17:08:37 +0000 (17:08 +0000)
committerEnea Zaffanella <zaffanella@cs.unipr.it>
Sat, 26 Jan 2013 17:08:37 +0000 (17:08 +0000)
llvm-svn: 173581

clang/include/clang/AST/ASTContext.h
clang/lib/AST/ASTContext.cpp

index bf04871..00af4cb 100644 (file)
@@ -1108,6 +1108,14 @@ public:
   /// defined in <stddef.h> as defined by the target.
   QualType getWIntType() const { return WIntTy; }
 
+  /// \brief Return a type compatible with "intptr_t" (C99 7.18.1.4),
+  /// as defined by the target.
+  QualType getIntPtrType() const;
+
+  /// \brief Return a type compatible with "uintptr_t" (C99 7.18.1.4),
+  /// as defined by the target.
+  QualType getUIntPtrType() const;
+
   /// \brief Return the unique type for "ptrdiff_t" (C99 7.17) defined in
   /// <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
   QualType getPointerDiffType() const;
index 1d103f1..7ba64e3 100644 (file)
@@ -3589,6 +3589,14 @@ QualType ASTContext::getUnsignedWCharType() const {
   return UnsignedIntTy;
 }
 
+QualType ASTContext::getIntPtrType() const {
+  return getFromTargetType(Target->getIntPtrType());
+}
+
+QualType ASTContext::getUIntPtrType() const {
+  return getCorrespondingUnsignedType(getIntPtrType());
+}
+
 /// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17)
 /// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
 QualType ASTContext::getPointerDiffType() const {