From: Chris Lattner Date: Tue, 31 Jul 2007 21:13:58 +0000 (+0000) Subject: move trivial type predicates inline. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=611c1fff195d32df97706e0920c92468b2509900;p=clang move trivial type predicates inline. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40651 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/Type.cpp b/AST/Type.cpp index dc3ee8ebcb..15f0968b81 100644 --- a/AST/Type.cpp +++ b/AST/Type.cpp @@ -56,12 +56,6 @@ bool Type::isDerivedType() const { } } -// FIXME: move inline -bool Type::isFunctionType() const { return isa(CanonicalType); } -bool Type::isPointerType() const { return isa(CanonicalType); } -bool Type::isReferenceType() const { return isa(CanonicalType); } -bool Type::isArrayType() const { return isa(CanonicalType); } -bool Type::isRecordType() const { return isa(CanonicalType); } bool Type::isStructureType() const { if (const RecordType *RT = dyn_cast(this)) if (RT->getDecl()->getKind() == Decl::Struct) @@ -74,9 +68,6 @@ bool Type::isUnionType() const { return true; return false; } -bool Type::isVectorType() const { return isa(CanonicalType); } -bool Type::isOCUVectorType() const { return isa(CanonicalType); } - const FunctionType *Type::getAsFunctionType() const { // If this is directly a function type, return it. diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index ceba2fa0b0..a2308c670b 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -739,13 +739,7 @@ public: }; -/// ... - -// TODO: When we support C++, we should have types for uses of template with -// default parameters. We should be able to distinguish source use of -// 'std::vector' from 'std::vector >'. Though they -// specify the same type, we want to print the default argument only if -// specified in the source code. +// Inline function definitions. /// getCanonicalType - Return the canonical version of this type, with the /// appropriate type qualifiers on it. @@ -754,7 +748,30 @@ inline QualType QualType::getCanonicalType() const { getQualifiers() | getTypePtr()->getCanonicalTypeInternal().getQualifiers()); } - + + +inline bool Type::isFunctionType() const { + return isa(CanonicalType); +} +inline bool Type::isPointerType() const { + return isa(CanonicalType); +} +inline bool Type::isReferenceType() const { + return isa(CanonicalType); +} +inline bool Type::isArrayType() const { + return isa(CanonicalType); +} +inline bool Type::isRecordType() const { + return isa(CanonicalType); +} +inline bool Type::isVectorType() const { + return isa(CanonicalType); +} +inline bool Type::isOCUVectorType() const { + return isa(CanonicalType); +} + } // end namespace clang #endif