[cfe-commits] r64804 - in /cfe/trunk: include/clang/AST/Stmt.h lib/CodeGen/ModuleBuilder.cpp lib/Sema/SemaDecl.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Tue Feb 17 12:23:54 PST 2009
Author: akirtzidis
Date: Tue Feb 17 14:23:54 2009
New Revision: 64804
URL: http://llvm.org/viewvc/llvm-project?rev=64804&view=rev
Log:
Remove some redundant Decl -> Decl castings.
Modified:
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=64804&r1=64803&r2=64804&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Tue Feb 17 14:23:54 2009
@@ -244,13 +244,13 @@
const Decl* getSolitaryDecl() const {
assert (hasSolitaryDecl() &&
"Caller assumes this DeclStmt points to one Decl*");
- return llvm::cast<Decl>(*DG.begin());
+ return *DG.begin();
}
Decl* getSolitaryDecl() {
assert (hasSolitaryDecl() &&
"Caller assumes this DeclStmt points to one Decl*");
- return llvm::cast<Decl>(*DG.begin());
+ return *DG.begin();
}
SourceLocation getStartLoc() const { return StartLoc; }
@@ -281,7 +281,7 @@
return R.I != I;
}
Decl* operator*() const {
- return llvm::cast<Decl>(*I);
+ return *I;
}
};
@@ -297,7 +297,7 @@
return R.I != I;
}
Decl* operator*() const {
- return llvm::cast<Decl>(*I);
+ return *I;
}
};
Modified: cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ModuleBuilder.cpp?rev=64804&r1=64803&r2=64804&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ModuleBuilder.cpp (original)
+++ cfe/trunk/lib/CodeGen/ModuleBuilder.cpp Tue Feb 17 14:23:54 2009
@@ -68,12 +68,8 @@
virtual void HandleTopLevelDecl(Decl *D) {
// Make sure to emit all elements of a Decl.
- if (Decl *SD = dyn_cast<Decl>(D)) {
- for (; SD; SD = SD->getNextDeclarator())
- Builder->EmitTopLevelDecl(SD);
- } else {
+ for (; D; D = D->getNextDeclarator())
Builder->EmitTopLevelDecl(D);
- }
}
/// HandleTagDeclDefinition - This callback is invoked each time a TagDecl
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=64804&r1=64803&r2=64804&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Feb 17 14:23:54 2009
@@ -2552,11 +2552,10 @@
/// The declarators are chained together backwards, reverse the list.
Sema::DeclTy *Sema::FinalizeDeclaratorGroup(Scope *S, DeclTy *group) {
// Often we have single declarators, handle them quickly.
- Decl *GroupDecl = static_cast<Decl*>(group);
- if (GroupDecl == 0)
+ Decl *Group = static_cast<Decl*>(group);
+ if (Group == 0)
return 0;
- Decl *Group = dyn_cast<Decl>(GroupDecl);
Decl *NewGroup = 0;
if (Group->getNextDeclarator() == 0)
NewGroup = Group;
More information about the cfe-commits
mailing list