diff options
author | JF Bastien <jfb@google.com> | 2014-06-25 01:31:33 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2014-06-25 01:31:33 +0000 |
commit | 41c9813dabe57ee52648139b174f569395a6fb47 (patch) | |
tree | 6fdb62a904d25ec5544e7de1b68252bf2b9014c6 /include | |
parent | e15c5bb0df8f1d7f9a1f4887c893e8517a0465ea (diff) | |
download | clang-41c9813dabe57ee52648139b174f569395a6fb47.tar.gz clang-41c9813dabe57ee52648139b174f569395a6fb47.tar.bz2 clang-41c9813dabe57ee52648139b174f569395a6fb47.tar.xz |
Implement predefined stdint macros
Add predefined stdint macros that match the given patterns:
U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE}
U?INT{PTR,MAX}_{MAX,TYPE}
http://reviews.llvm.org/D4141
Author: binji
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index ef88ec2fd9..e1d01168b9 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -214,6 +214,9 @@ public: return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace); } IntType getIntPtrType() const { return IntPtrType; } + IntType getUIntPtrType() const { + return getIntTypeByWidth(getTypeWidth(IntPtrType), false); + } IntType getWCharType() const { return WCharType; } IntType getWIntType() const { return WIntType; } IntType getChar16Type() const { return Char16Type; } @@ -230,6 +233,9 @@ public: /// \brief Return integer type with specified width. IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const; + /// \brief Return the smallest integer type with at least the specified width. + IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const; + /// \brief Return floating point type with specified width. RealType getRealTypeByWidth(unsigned BitWidth) const; |