[cfe-commits] r40651 - in /cfe/trunk: AST/Type.cpp include/clang/AST/Type.h
Chris Lattner
sabre at nondot.org
Tue Jul 31 14:13:59 PDT 2007
Author: lattner
Date: Tue Jul 31 16:13:58 2007
New Revision: 40651
URL: http://llvm.org/viewvc/llvm-project?rev=40651&view=rev
Log:
move trivial type predicates inline.
Modified:
cfe/trunk/AST/Type.cpp
cfe/trunk/include/clang/AST/Type.h
Modified: cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Type.cpp?rev=40651&r1=40650&r2=40651&view=diff
==============================================================================
--- cfe/trunk/AST/Type.cpp (original)
+++ cfe/trunk/AST/Type.cpp Tue Jul 31 16:13:58 2007
@@ -56,12 +56,6 @@
}
}
-// FIXME: move inline
-bool Type::isFunctionType() const { return isa<FunctionType>(CanonicalType); }
-bool Type::isPointerType() const { return isa<PointerType>(CanonicalType); }
-bool Type::isReferenceType() const { return isa<ReferenceType>(CanonicalType); }
-bool Type::isArrayType() const { return isa<ArrayType>(CanonicalType); }
-bool Type::isRecordType() const { return isa<RecordType>(CanonicalType); }
bool Type::isStructureType() const {
if (const RecordType *RT = dyn_cast<RecordType>(this))
if (RT->getDecl()->getKind() == Decl::Struct)
@@ -74,9 +68,6 @@
return true;
return false;
}
-bool Type::isVectorType() const { return isa<VectorType>(CanonicalType); }
-bool Type::isOCUVectorType() const { return isa<OCUVectorType>(CanonicalType); }
-
const FunctionType *Type::getAsFunctionType() const {
// If this is directly a function type, return it.
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=40651&r1=40650&r2=40651&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Jul 31 16:13:58 2007
@@ -739,13 +739,7 @@
};
-/// ...
-
-// 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<int>' from 'std::vector<int, std::allocator<int> >'. 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 @@
getQualifiers() |
getTypePtr()->getCanonicalTypeInternal().getQualifiers());
}
-
+
+
+inline bool Type::isFunctionType() const {
+ return isa<FunctionType>(CanonicalType);
+}
+inline bool Type::isPointerType() const {
+ return isa<PointerType>(CanonicalType);
+}
+inline bool Type::isReferenceType() const {
+ return isa<ReferenceType>(CanonicalType);
+}
+inline bool Type::isArrayType() const {
+ return isa<ArrayType>(CanonicalType);
+}
+inline bool Type::isRecordType() const {
+ return isa<RecordType>(CanonicalType);
+}
+inline bool Type::isVectorType() const {
+ return isa<VectorType>(CanonicalType);
+}
+inline bool Type::isOCUVectorType() const {
+ return isa<OCUVectorType>(CanonicalType);
+}
+
} // end namespace clang
#endif
More information about the cfe-commits
mailing list