[PATCH] D100688: [AST] Remove args from LocationCall

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 17 09:22:16 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGebc6608fb790: [AST] Remove args from LocationCall (authored by stephenkelly).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100688/new/

https://reviews.llvm.org/D100688

Files:
  clang/include/clang/Tooling/NodeIntrospection.h
  clang/lib/Tooling/NodeIntrospection.cpp
  clang/unittests/Introspection/IntrospectionTest.cpp


Index: clang/unittests/Introspection/IntrospectionTest.cpp
===================================================================
--- clang/unittests/Introspection/IntrospectionTest.cpp
+++ clang/unittests/Introspection/IntrospectionTest.cpp
@@ -61,16 +61,7 @@
       print(*On, OS);
       OS << '.';
     }
-    OS << Call.name();
-    if (Call.args().empty()) {
-      OS << "()";
-      return;
-    }
-    OS << '(' << Call.args().front();
-    for (const std::string &Arg : Call.args().drop_front()) {
-      OS << ", " << Arg;
-    }
-    OS << ')';
+    OS << Call.name() << "()";
   }
 
   static std::string format(const LocationCall &Call) {
Index: clang/lib/Tooling/NodeIntrospection.cpp
===================================================================
--- clang/lib/Tooling/NodeIntrospection.cpp
+++ clang/lib/Tooling/NodeIntrospection.cpp
@@ -29,16 +29,7 @@
       OS << '.';
   }
 
-  OS << Call.name();
-  if (Call.args().empty()) {
-    OS << "()";
-    return;
-  }
-  OS << '(' << Call.args().front();
-  for (const std::string &Arg : Call.args().drop_front()) {
-    OS << ", " << Arg;
-  }
-  OS << ')';
+  OS << Call.name() << "()";
 }
 
 std::string LocationCallFormatterCpp::format(const LocationCall &Call) {
Index: clang/include/clang/Tooling/NodeIntrospection.h
===================================================================
--- clang/include/clang/Tooling/NodeIntrospection.h
+++ clang/include/clang/Tooling/NodeIntrospection.h
@@ -38,14 +38,9 @@
   LocationCall(SharedLocationCall on, std::string name,
                LocationCallFlags flags = NoFlags)
       : m_flags(flags), m_on(std::move(on)), m_name(std::move(name)) {}
-  LocationCall(SharedLocationCall on, std::string name,
-               std::vector<std::string> args, LocationCallFlags flags = NoFlags)
-      : m_flags(flags), m_on(std::move(on)), m_name(std::move(name)),
-        m_args(std::move(args)) {}
 
   LocationCall *on() const { return m_on.get(); }
   StringRef name() const { return m_name; }
-  ArrayRef<std::string> args() const { return m_args; }
   bool returnsPointer() const { return m_flags & ReturnsPointer; }
   bool isCast() const { return m_flags & IsCast; }
 
@@ -53,7 +48,6 @@
   LocationCallFlags m_flags;
   SharedLocationCall m_on;
   std::string m_name;
-  std::vector<std::string> m_args;
 };
 
 class LocationCallFormatterCpp {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100688.338316.patch
Type: text/x-patch
Size: 2359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210417/9c0d2aa1/attachment.bin>


More information about the cfe-commits mailing list