diff options
| author | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-01-26 17:08:37 +0000 |
|---|---|---|
| committer | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-01-26 17:08:37 +0000 |
| commit | f11ceb68972cd57da6b9c6d9488cf02c6cb85e43 (patch) | |
| tree | d2206e5f4d64834393d400d41971faa27d7f3242 /clang | |
| parent | 2d443e94b4eb07facc7170e16a057537104eba22 (diff) | |
| download | bcm5719-llvm-f11ceb68972cd57da6b9c6d9488cf02c6cb85e43.tar.gz bcm5719-llvm-f11ceb68972cd57da6b9c6d9488cf02c6cb85e43.zip | |
Added ASTContext methods getIntPtrType and getUIntPtrType.
llvm-svn: 173581
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/ASTContext.h | 8 | ||||
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index bf0487198d2..00af4cb08a1 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -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; diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 1d103f11296..7ba64e32f35 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -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 { |

