From d5553f1c34727a4bfabf34ace2c9fad0a7079350 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 17 Aug 2011 21:35:28 +0000 Subject: [PATCH] Remove an unnecessary assignment (to InstFromD). Caught by the static analyzer! llvm-svn: 137878 --- clang/lib/Serialization/ASTWriterDecl.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index efc1ea30efd8..a0f7da20e67e 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -1059,16 +1059,12 @@ void ASTDeclWriter::VisitClassTemplateSpecializationDecl( llvm::PointerUnion InstFrom = D->getSpecializedTemplateOrPartial(); - Decl *InstFromD; - if (InstFrom.is()) { - InstFromD = InstFrom.get(); + if (Decl *InstFromD = InstFrom.dyn_cast()) { Writer.AddDeclRef(InstFromD, Record); } else { - InstFromD = InstFrom.get(); - Writer.AddDeclRef(InstFromD, Record); + Writer.AddDeclRef(InstFrom.get(), + Record); Writer.AddTemplateArgumentList(&D->getTemplateInstantiationArgs(), Record); - InstFromD = cast(InstFromD)-> - getSpecializedTemplate(); } // Explicit info.