From cceab1a8b714f5cf7f56fb378cc72ddb9db43848 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 26 Mar 2007 20:16:44 +0000 Subject: [PATCH] Unnest assignment to make the code more clear llvm-svn: 39363 --- clang/AST/ASTContext.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clang/AST/ASTContext.cpp b/clang/AST/ASTContext.cpp index d82cea91993b..7ba084a7c6cd 100644 --- a/clang/AST/ASTContext.cpp +++ b/clang/AST/ASTContext.cpp @@ -270,8 +270,9 @@ TypeRef ASTContext::getTypedefType(TypedefDecl *Decl) { // FIXME: does this lose qualifiers from the typedef?? Type *Canonical = Decl->getUnderlyingType().getCanonicalType().getTypePtr(); - Types.push_back(Decl->TypeForDecl = new TypedefType(Decl, Canonical)); - return Types.back(); + Decl->TypeForDecl = new TypedefType(Decl, Canonical); + Types.push_back(Decl->TypeForDecl); + return Decl->TypeForDecl; } /// getTagDeclType - Return the unique reference to the type for the @@ -280,8 +281,9 @@ TypeRef ASTContext::getTagDeclType(TagDecl *Decl) { // The decl stores the type cache. if (Decl->TypeForDecl) return Decl->TypeForDecl; - Types.push_back(Decl->TypeForDecl = new TagType(Decl, 0)); - return Types.back(); + Decl->TypeForDecl = new TagType(Decl, 0); + Types.push_back(Decl->TypeForDecl); + return Decl->TypeForDecl; }