Index: clang-query/Query.h =================================================================== --- clang-query/Query.h +++ clang-query/Query.h @@ -18,7 +18,7 @@ namespace clang { namespace query { -enum OutputKind { OK_Diag, OK_Print, OK_Dump }; +enum OutputKind { OK_Diag, OK_Print, OK_DetailedAST }; enum QueryKind { QK_Invalid, Index: clang-query/Query.cpp =================================================================== --- clang-query/Query.cpp +++ clang-query/Query.cpp @@ -53,8 +53,10 @@ "Pretty-print bound nodes.\n" " diag " "Diagnostic location for bound nodes.\n" + " detailed-ast " + "Detailed AST output for bound nodes.\n" " dump " - "Detailed AST output for bound nodes.\n\n"; + "Detailed AST output for bound nodes (alias of detailed-ast).\n\n"; return true; } @@ -124,7 +126,7 @@ OS << "\n"; break; } - case OK_Dump: { + case OK_DetailedAST: { OS << "Binding for \"" << BI->first << "\":\n"; BI->second.dump(OS, AST->getSourceManager()); OS << "\n"; Index: clang-query/QueryParser.cpp =================================================================== --- clang-query/QueryParser.cpp +++ clang-query/QueryParser.cpp @@ -111,11 +111,13 @@ unsigned OutKind = LexOrCompleteWord(this, ValStr) .Case("diag", OK_Diag) .Case("print", OK_Print) - .Case("dump", OK_Dump) + .Case("detailed-ast", OK_DetailedAST) + .Case("dump", OK_DetailedAST) .Default(~0u); if (OutKind == ~0u) { - return new InvalidQuery("expected 'diag', 'print' or 'dump', got '" + - ValStr + "'"); + return new InvalidQuery( + "expected 'diag', 'print', 'detailed-ast' or 'dump', got '" + ValStr + + "'"); } return new SetQuery(&QuerySession::OutKind, OutputKind(OutKind)); } Index: unittests/clang-query/QueryEngineTest.cpp =================================================================== --- unittests/clang-query/QueryEngineTest.cpp +++ unittests/clang-query/QueryEngineTest.cpp @@ -103,7 +103,8 @@ Str.clear(); - EXPECT_TRUE(SetQuery(&QuerySession::OutKind, OK_Dump).run(OS, S)); + EXPECT_TRUE( + SetQuery(&QuerySession::OutKind, OK_DetailedAST).run(OS, S)); EXPECT_TRUE(MatchQuery(FooMatcherString, FooMatcher).run(OS, S)); EXPECT_TRUE(OS.str().find("FunctionDecl") != std::string::npos); Index: unittests/clang-query/QueryParserTest.cpp =================================================================== --- unittests/clang-query/QueryParserTest.cpp +++ unittests/clang-query/QueryParserTest.cpp @@ -70,7 +70,7 @@ Q = parse("set output"); ASSERT_TRUE(isa(Q)); - EXPECT_EQ("expected 'diag', 'print' or 'dump', got ''", + EXPECT_EQ("expected 'diag', 'print', 'detailed-ast' or 'dump', got ''", cast(Q)->ErrStr); Q = parse("set bind-root true foo"); @@ -79,13 +79,18 @@ Q = parse("set output foo"); ASSERT_TRUE(isa(Q)); - EXPECT_EQ("expected 'diag', 'print' or 'dump', got 'foo'", + EXPECT_EQ("expected 'diag', 'print', 'detailed-ast' or 'dump', got 'foo'", cast(Q)->ErrStr); Q = parse("set output dump"); ASSERT_TRUE(isa >(Q)); EXPECT_EQ(&QuerySession::OutKind, cast >(Q)->Var); - EXPECT_EQ(OK_Dump, cast >(Q)->Value); + EXPECT_EQ(OK_DetailedAST, cast>(Q)->Value); + + Q = parse("set output detailed-ast"); + ASSERT_TRUE(isa>(Q)); + EXPECT_EQ(&QuerySession::OutKind, cast>(Q)->Var); + EXPECT_EQ(OK_DetailedAST, cast>(Q)->Value); Q = parse("set bind-root foo"); ASSERT_TRUE(isa(Q));