r323524 - [ASTImporter] avoid warnings: unused var, switch covered
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 26 04:06:44 PST 2018
Author: sammccall
Date: Fri Jan 26 04:06:44 2018
New Revision: 323524
URL: http://llvm.org/viewvc/llvm-project?rev=323524&view=rev
Log:
[ASTImporter] avoid warnings: unused var, switch covered
Modified:
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/lib/AST/ExternalASTMerger.cpp
Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=323524&r1=323523&r2=323524&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Fri Jan 26 04:06:44 2018
@@ -2079,7 +2079,7 @@ bool ASTNodeImporter::ImportTemplateInfo
switch (FromFD->getTemplatedKind()) {
case FunctionDecl::TK_NonTemplate:
case FunctionDecl::TK_FunctionTemplate:
- break;
+ return false;
case FunctionDecl::TK_MemberSpecialization: {
auto *InstFD = cast_or_null<FunctionDecl>(
@@ -2092,7 +2092,7 @@ bool ASTNodeImporter::ImportTemplateInfo
FromFD->getMemberSpecializationInfo()->getPointOfInstantiation());
ToFD->setInstantiationOfMemberFunction(InstFD, TSK);
ToFD->getMemberSpecializationInfo()->setPointOfInstantiation(POI);
- break;
+ return false;
}
case FunctionDecl::TK_FunctionTemplateSpecialization: {
@@ -2127,7 +2127,7 @@ bool ASTNodeImporter::ImportTemplateInfo
ToFD->setFunctionTemplateSpecialization(
Template, ToTAList, /* InsertPos= */ nullptr,
TSK, FromTAArgsAsWritten ? &ToTAInfo : nullptr, POI);
- break;
+ return false;
}
case FunctionDecl::TK_DependentFunctionTemplateSpecialization: {
@@ -2153,13 +2153,10 @@ bool ASTNodeImporter::ImportTemplateInfo
ToFD->setDependentTemplateSpecialization(Importer.getToContext(),
TemplDecls, ToTAInfo);
- break;
+ return false;
}
- default:
- llvm_unreachable("All cases should be covered!");
}
-
- return false;
+ llvm_unreachable("All cases should be covered!");
}
Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) {
Modified: cfe/trunk/lib/AST/ExternalASTMerger.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExternalASTMerger.cpp?rev=323524&r1=323523&r2=323524&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExternalASTMerger.cpp (original)
+++ cfe/trunk/lib/AST/ExternalASTMerger.cpp Fri Jan 26 04:06:44 2018
@@ -408,6 +408,7 @@ bool ExternalASTMerger::FindExternalVisi
bool IsSpecImportFailed =
importSpecializationsIfNeeded(LookupRes, Importer);
assert(!IsSpecImportFailed);
+ (void)IsSpecImportFailed;
Decls.push_back(ND);
}
SetExternalVisibleDeclsForName(DC, Name, Decls);
More information about the cfe-commits
mailing list