[cfe-commits] r39499 - /cfe/cfe/trunk/AST/Type.cpp
bwendlin at cs.uiuc.edu
bwendlin at cs.uiuc.edu
Wed Jul 11 09:45:01 PDT 2007
Author: bwendlin
Date: Wed Jul 11 11:45:01 2007
New Revision: 39499
URL: http://llvm.org/viewvc/llvm-project?rev=39499&view=rev
Log:
Bug #:
Submitted by: Bill Wendling
Reviewed by: Steve Naroff
- Steve suggested avoiding the dyn_cast by using the "Tagged" type class
and having the "default" just return false.
Modified:
cfe/cfe/trunk/AST/Type.cpp
Modified: cfe/cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Type.cpp?rev=39499&r1=39498&r2=39499&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/Type.cpp (original)
+++ cfe/cfe/trunk/AST/Type.cpp Wed Jul 11 11:45:01 2007
@@ -40,19 +40,21 @@
bool Type::isDerivedType() const {
switch (CanonicalType->getTypeClass()) {
- default:
- if (const TagType *TT = dyn_cast<TagType>(CanonicalType)) {
- const Decl::Kind Kind = TT->getDecl()->getKind();
- if (Kind == Decl::Struct || Kind == Decl::Union)
- return true;
- }
- return false;
case Pointer:
case Array:
case FunctionProto:
case FunctionNoProto:
case Reference:
return true;
+ case Tagged:
+ if (const TagType *TT = dyn_cast<TagType>(CanonicalType)) {
+ const Decl::Kind Kind = TT->getDecl()->getKind();
+ if (Kind == Decl::Struct || Kind == Decl::Union)
+ return true;
+ }
+ // Fall through
+ default:
+ return false;
}
}
More information about the cfe-commits
mailing list