steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.

Future development can then dump other content than AST.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53500

Files:
  clang-query/Query.cpp
  clang-query/Query.h
  clang-query/QueryParser.cpp


Index: clang-query/QueryParser.cpp
===================================================================
--- clang-query/QueryParser.cpp
+++ clang-query/QueryParser.cpp
@@ -111,10 +111,11 @@
   unsigned OutKind = LexOrCompleteWord<unsigned>(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 '" +
+    return new InvalidQuery("expected 'diag', 'print', 'detailed-ast' or 
'dump', got '" +
                             ValStr + "'");
   }
   return new SetQuery<OutputKind>(&QuerySession::OutKind, OutputKind(OutKind));
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
@@ -52,8 +52,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 deatiled-ast)\n\n";
   return true;
 }
 
@@ -123,7 +125,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,10 +111,11 @@
   unsigned OutKind = LexOrCompleteWord<unsigned>(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 '" +
+    return new InvalidQuery("expected 'diag', 'print', 'detailed-ast' or 'dump', got '" +
                             ValStr + "'");
   }
   return new SetQuery<OutputKind>(&QuerySession::OutKind, OutputKind(OutKind));
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
@@ -52,8 +52,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 deatiled-ast)\n\n";
   return true;
 }
 
@@ -123,7 +125,7 @@
           OS << "\n";
           break;
         }
-        case OK_Dump: {
+        case OK_DetailedAST: {
           OS << "Binding for \"" << BI->first << "\":\n";
           BI->second.dump(OS, AST->getSourceManager());
           OS << "\n";
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to