r351011 - [ASTDump] Change parameter to StringRef

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 12 07:45:05 PST 2019


Author: steveire
Date: Sat Jan 12 07:45:05 2019
New Revision: 351011

URL: http://llvm.org/viewvc/llvm-project?rev=351011&view=rev
Log:
[ASTDump] Change parameter to StringRef

Modified:
    cfe/trunk/include/clang/AST/TextNodeDumper.h
    cfe/trunk/lib/AST/TextNodeDumper.cpp

Modified: cfe/trunk/include/clang/AST/TextNodeDumper.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TextNodeDumper.h?rev=351011&r1=351010&r2=351011&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TextNodeDumper.h (original)
+++ cfe/trunk/include/clang/AST/TextNodeDumper.h Sat Jan 12 07:45:05 2019
@@ -160,7 +160,7 @@ public:
   void dumpAccessSpecifier(AccessSpecifier AS);
   void dumpCXXTemporary(const CXXTemporary *Temporary);
 
-  void dumpDeclRef(const Decl *D, const char *Label = nullptr);
+  void dumpDeclRef(const Decl *D, StringRef Label = {});
 
   void visitTextComment(const comments::TextComment *C,
                         const comments::FullComment *);

Modified: cfe/trunk/lib/AST/TextNodeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TextNodeDumper.cpp?rev=351011&r1=351010&r2=351011&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TextNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/TextNodeDumper.cpp Sat Jan 12 07:45:05 2019
@@ -184,12 +184,12 @@ void TextNodeDumper::dumpCXXTemporary(co
   OS << ")";
 }
 
-void TextNodeDumper::dumpDeclRef(const Decl *D, const char *Label) {
+void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
   if (!D)
     return;
 
   AddChild([=] {
-    if (Label)
+    if (!Label.empty())
       OS << Label << ' ';
     dumpBareDeclRef(D);
   });




More information about the cfe-commits mailing list