From f23d364084d1aabea688222780d6fc1dd8c7f78c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 4 Apr 2008 16:51:46 +0000 Subject: [PATCH] add an isAnyComplexType() method, which returns true for both 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 4d228776df..7ed12abf48 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -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(CanonicalType.getUnqualifiedType()); } +inline bool Type::isAnyComplexType() const { + return isa(CanonicalType); +} inline bool Type::isVectorType() const { return isa(CanonicalType.getUnqualifiedType()); } -- 2.50.1