aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/TargetInfo.h
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2008-10-31 09:52:39 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2008-10-31 09:52:39 +0000
commit31fc07df7f0fc89ebf83ca05a20b29de45a7598d (patch)
tree7d952a94384a81825468b68d59b257c7fe8ac780 /include/clang/Basic/TargetInfo.h
parentdd913e557628abadee5112cca90e339d25b9b398 (diff)
Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
etc more generic. For some targets, long may not be equal to pointer size. For example: PIC16 has int as i16, ptr as i16 but long as i32. Also fixed a few build warnings in assert() functions in CFRefCount.cpp, CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/TargetInfo.h')
-rw-r--r--include/clang/Basic/TargetInfo.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index 0d990179ff..32c87434d9 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -58,6 +58,24 @@ public:
virtual ~TargetInfo();
///===---- Target Data Type Query Methods -------------------------------===//
+ enum IntType {
+ NoInt = 0x0,
+ SignedShort,
+ UnsignedShort,
+ SignedInt,
+ UnsignedInt,
+ SignedLong,
+ UnsignedLong,
+ SignedLongLong,
+ UnsignedLongLong
+ } SizeType, IntMaxType, UIntMaxType, PtrDiffType, WCharType;
+ enum IntType getSizeType() const {return SizeType;}
+ enum IntType getIntMaxType() const {return IntMaxType;}
+ enum IntType getUIntMaxType() const {return UIntMaxType;}
+ enum IntType getPtrDiffType(unsigned AddrSpace) const {
+ return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
+ }
+ enum IntType getWCharType() const {return WCharType;}
/// isCharSigned - Return true if 'char' is 'signed char' or false if it is
/// treated as 'unsigned char'. This is implementation defined according to
@@ -219,7 +237,9 @@ protected:
virtual uint64_t getPointerAlignV(unsigned AddrSpace) const {
return PointerAlign;
}
-
+ virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
+ return PtrDiffType;
+ }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const = 0;
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,