r308737 - [clang-diff] Get rid of unused variable warnings in ASTDiff.cpp
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 21 06:18:51 PDT 2017
Author: arphaman
Date: Fri Jul 21 06:18:51 2017
New Revision: 308737
URL: http://llvm.org/viewvc/llvm-project?rev=308737&view=rev
Log:
[clang-diff] Get rid of unused variable warnings in ASTDiff.cpp
Modified:
cfe/trunk/lib/Tooling/ASTDiff/ASTDiff.cpp
Modified: cfe/trunk/lib/Tooling/ASTDiff/ASTDiff.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/ASTDiff/ASTDiff.cpp?rev=308737&r1=308736&r2=308737&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/ASTDiff/ASTDiff.cpp (original)
+++ cfe/trunk/lib/Tooling/ASTDiff/ASTDiff.cpp Fri Jul 21 06:18:51 2017
@@ -279,9 +279,7 @@ std::string SyntaxTreeImpl::getNodeValue
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::getNodeValue
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");
}
More information about the cfe-commits
mailing list