[Lldb-commits] [lldb] r157488 - /lldb/trunk/source/Symbol/ClangASTImporter.cpp

Sean Callanan scallanan at apple.com
Fri May 25 11:12:26 PDT 2012


Author: spyffe
Date: Fri May 25 13:12:26 2012
New Revision: 157488

URL: http://llvm.org/viewvc/llvm-project?rev=157488&view=rev
Log:
Fixed a crash in logging when the name of an
entity imported by the ASTImporter had a NamedDecl
with a name that wasn't a plain string (e.g., a
selector).

Modified:
    lldb/trunk/source/Symbol/ClangASTImporter.cpp

Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=157488&r1=157487&r2=157488&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Fri May 25 13:12:26 2012
@@ -431,10 +431,15 @@
     {
         if (NamedDecl *from_named_decl = dyn_cast<clang::NamedDecl>(from))
         {
+            std::string name_string;
+            llvm::raw_string_ostream name_stream(name_string);
+            from_named_decl->printName(name_stream);
+            name_stream.flush();
+            
             log->Printf("    [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%llx",
                         from->getDeclKindName(),
                         to,
-                        from_named_decl->getName().str().c_str(),
+                        name_string.c_str(),
                         from,
                         m_master.GetDeclMetadata(from));
         }





More information about the lldb-commits mailing list