]> granicus.if.org Git - clang/commitdiff
add an isAnyComplexType() method, which returns true for both
authorChris Lattner <sabre@nondot.org>
Fri, 4 Apr 2008 16:51:46 +0000 (16:51 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 4 Apr 2008 16:51:46 +0000 (16:51 +0000)
integer and FP complexes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49219 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Type.h

index 4d228776df9f432010b19b960d00cb400791aa53..7ed12abf48f5704e8e35b5f38260fd6ec21f3407 100644 (file)
@@ -293,6 +293,7 @@ public:
   /// isComplexType() does *not* include complex integers (a GCC extension).
   /// isComplexIntegerType() can be used to test for complex integers.
   bool isComplexType() const;      // C99 6.2.5p11 (complex)
+  bool isAnyComplexType() const;   // C99 6.2.5p11 (complex) + Complex Int.
   bool isFloatingType() const;     // C99 6.2.5p11 (real floating + complex)
   bool isRealType() const;         // C99 6.2.5p17 (real floating + integer)
   bool isArithmeticType() const;   // C99 6.2.5p18 (integer + floating)
@@ -1170,6 +1171,9 @@ inline bool Type::isArrayType() const {
 inline bool Type::isRecordType() const {
   return isa<RecordType>(CanonicalType.getUnqualifiedType());
 }
+inline bool Type::isAnyComplexType() const {
+  return isa<ComplexType>(CanonicalType);
+}
 inline bool Type::isVectorType() const {
   return isa<VectorType>(CanonicalType.getUnqualifiedType());
 }