[clang-diff] Get rid of unused variable warnings in ASTDiff.cpp

llvm-svn: 308737
This commit is contained in:
Alex Lorenz
2017-07-21 13:18:51 +00:00
parent be7a7e4979
commit 04184a6d75

View File

@@ -279,9 +279,7 @@ std::string SyntaxTreeImpl::getNodeValueImpl(const DynTypedNode &DTN) const {
return X->getString();
if (auto *X = DTN.get<ValueDecl>())
return X->getNameAsString() + "(" + X->getType().getAsString() + ")";
if (auto *X = DTN.get<DeclStmt>())
return "";
if (auto *X = DTN.get<TranslationUnitDecl>())
if (DTN.get<DeclStmt>() || DTN.get<TranslationUnitDecl>())
return "";
std::string Value;
if (auto *X = DTN.get<DeclRefExpr>()) {
@@ -297,15 +295,15 @@ std::string SyntaxTreeImpl::getNodeValueImpl(const DynTypedNode &DTN) const {
Value += X->getNameAsString() + ";";
if (auto *X = DTN.get<TypedefNameDecl>())
return Value + X->getUnderlyingType().getAsString() + ";";
if (auto *X = DTN.get<NamespaceDecl>())
if (DTN.get<NamespaceDecl>())
return Value;
if (auto *X = DTN.get<TypeDecl>())
if (X->getTypeForDecl())
Value +=
X->getTypeForDecl()->getCanonicalTypeInternal().getAsString() + ";";
if (auto *X = DTN.get<Decl>())
if (DTN.get<Decl>())
return Value;
if (auto *X = DTN.get<Stmt>())
if (DTN.get<Stmt>())
return "";
llvm_unreachable("Fatal: unhandled AST node.\n");
}