File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -278,9 +278,32 @@ Decl const*
278278decayToPrimaryTemplate (Decl const * D)
279279{
280280#ifndef  NDEBUG
281+     //  Print only the class header (name and template args if specialization)
281282    SmallString<128 > symbolName;
283+     if  (const  auto * ND = dyn_cast<NamedDecl>(D))
284+     {
285+         if  (const  auto * CTS = dyn_cast<ClassTemplateSpecializationDecl>(ND)) {
286+             llvm::raw_svector_ostream os (symbolName);
287+             CTS->getSpecializedTemplate ()->printQualifiedName (os, CTS->getASTContext ().getPrintingPolicy ());
288+             const  TemplateArgumentList& args = CTS->getTemplateArgs ();
289+             os << ' <'  ;
290+             for  (unsigned  i = 0 , e = args.size (); i != e; ++i)
291+             {
292+                 if  (i) os << " , "  ;
293+                 args[i].print (CTS->getASTContext ().getPrintingPolicy (), os, true );
294+             }
295+             os << ' >'  ;
296+         } else  if  (ND) {
297+             llvm::raw_svector_ostream os (symbolName);
298+             ND->printQualifiedName (os, ND->getASTContext ().getPrintingPolicy ());
299+         }
300+     }
301+     else 
302+     {
303+         llvm::raw_svector_ostream os (symbolName);
304+         os << " <unnamed "   << D->Decl ::getDeclKindName () << " >"  ;
305+     }
282306    llvm::raw_svector_ostream os (symbolName);
283-     D->print (os);
284307    report::trace (" symbolName: "  , std::string_view (os.str ()));
285308#endif 
286309
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments