[cfe-commits] r137878 - /cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Aug 17 14:35:28 PDT 2011
Author: akirtzidis
Date: Wed Aug 17 16:35:28 2011
New Revision: 137878
URL: http://llvm.org/viewvc/llvm-project?rev=137878&view=rev
Log:
Remove an unnecessary assignment (to InstFromD).
Caught by the static analyzer!
Modified:
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=137878&r1=137877&r2=137878&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Wed Aug 17 16:35:28 2011
@@ -1059,16 +1059,12 @@
llvm::PointerUnion<ClassTemplateDecl *,
ClassTemplatePartialSpecializationDecl *> InstFrom
= D->getSpecializedTemplateOrPartial();
- Decl *InstFromD;
- if (InstFrom.is<ClassTemplateDecl *>()) {
- InstFromD = InstFrom.get<ClassTemplateDecl *>();
+ if (Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
Writer.AddDeclRef(InstFromD, Record);
} else {
- InstFromD = InstFrom.get<ClassTemplatePartialSpecializationDecl *>();
- Writer.AddDeclRef(InstFromD, Record);
+ Writer.AddDeclRef(InstFrom.get<ClassTemplatePartialSpecializationDecl *>(),
+ Record);
Writer.AddTemplateArgumentList(&D->getTemplateInstantiationArgs(), Record);
- InstFromD = cast<ClassTemplatePartialSpecializationDecl>(InstFromD)->
- getSpecializedTemplate();
}
// Explicit info.
More information about the cfe-commits
mailing list