[cfe-commits] r61798 - in /cfe/trunk/lib: AST/DeclBase.cpp Sema/SemaDecl.cpp
Douglas Gregor
dgregor at apple.com
Mon Jan 5 23:17:59 PST 2009
Author: dgregor
Date: Tue Jan 6 01:17:58 2009
New Revision: 61798
URL: http://llvm.org/viewvc/llvm-project?rev=61798&view=rev
Log:
Minor tweaks to the transparent declcontext patch
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=61798&r1=61797&r2=61798&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Tue Jan 6 01:17:58 2009
@@ -513,7 +513,8 @@
/// transparent contexts nested within it).
void DeclContext::buildLookup(ASTContext &Context, DeclContext *DCtx) {
for (; DCtx; DCtx = DCtx->getNextContext()) {
- for (decl_iterator D = DCtx->decls_begin(); D != DCtx->decls_end(); ++D) {
+ for (decl_iterator D = DCtx->decls_begin(), DEnd = DCtx->decls_end();
+ D != DEnd; ++D) {
// Insert this declaration into the lookup structure
insertImpl(*D);
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=61798&r1=61797&r2=61798&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Jan 6 01:17:58 2009
@@ -3138,12 +3138,10 @@
}
void Sema::ActOnEnumStartDefinition(Scope *S, DeclTy *EnumD) {
- EnumDecl *Enum = cast_or_null<EnumDecl>((Decl *)EnumD);
+ EnumDecl *Enum = cast<EnumDecl>((Decl *)EnumD);
- if (Enum) {
- // Enter the enumeration context.
- PushDeclContext(S, Enum);
- }
+ // Enter the enumeration context.
+ PushDeclContext(S, Enum);
}
Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,
More information about the cfe-commits
mailing list