juliehockett updated this revision to Diff 168200.
juliehockett marked 2 inline comments as done.

https://reviews.llvm.org/D52847

Files:
  clang-tools-extra/clang-doc/Representation.cpp
  clang-tools-extra/clang-doc/Representation.h
  clang-tools-extra/clang-doc/Serialize.cpp
  clang-tools-extra/clang-doc/gen_tests.py
  clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
  clang-tools-extra/test/clang-doc/bc-linkage.cpp
  clang-tools-extra/test/clang-doc/mapper-linkage.cpp
  clang-tools-extra/test/clang-doc/md-comment.cpp
  clang-tools-extra/test/clang-doc/md-linkage.cpp
  clang-tools-extra/test/clang-doc/md-module.cpp
  clang-tools-extra/test/clang-doc/md-namespace.cpp
  clang-tools-extra/test/clang-doc/md-record.cpp
  clang-tools-extra/test/clang-doc/yaml-linkage.cpp

Index: clang-tools-extra/test/clang-doc/yaml-linkage.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/yaml-linkage.cpp
+++ clang-tools-extra/test/clang-doc/yaml-linkage.cpp
@@ -214,84 +214,44 @@
 // CHECK-1-NEXT:         Name:            'void'
 // CHECK-1-NEXT: ...
 
-// RUN: cat %t/docs/./AnonClass.yaml | FileCheck %s --check-prefix CHECK-2
+// RUN: cat %t/docs/./@nonymous.yaml | FileCheck %s --check-prefix CHECK-2
 // CHECK-2: ---
 // CHECK-2-NEXT: USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-2-NEXT: Name:            'AnonClass'
-// CHECK-2-NEXT: Namespace:       
-// CHECK-2-NEXT:   - Type:            Namespace
-// CHECK-2-NEXT:     USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-2-NEXT: DefLocation:     
-// CHECK-2-NEXT:   LineNumber:      78
-// CHECK-2-NEXT:   Filename:        'test'
-// CHECK-2-NEXT: TagType:         Class
-// CHECK-2-NEXT: Members:         
-// CHECK-2-NEXT:   - Type:            
-// CHECK-2-NEXT:       Name:            'int'
-// CHECK-2-NEXT:     Name:            'anonPublicField'
-// CHECK-2-NEXT:   - Type:            
-// CHECK-2-NEXT:       Name:            'int'
-// CHECK-2-NEXT:     Name:            'anonProtectedField'
-// CHECK-2-NEXT:     Access:          Protected
-// CHECK-2-NEXT:   - Type:            
-// CHECK-2-NEXT:       Name:            'int'
-// CHECK-2-NEXT:     Name:            'anonPrivateField'
-// CHECK-2-NEXT:     Access:          Private
+// CHECK-2-NEXT: Name:            '@nonymous'
 // CHECK-2-NEXT: ChildFunctions:  
 // CHECK-2-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-2-NEXT:     Name:            'anonPublicMethod'
+// CHECK-2-NEXT:     Name:            'anonFunction'
 // CHECK-2-NEXT:     Namespace:       
-// CHECK-2-NEXT:       - Type:            Record
-// CHECK-2-NEXT:         Name:            'AnonClass'
-// CHECK-2-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:       - Type:            Namespace
+// CHECK-2-NEXT:         Name:            '@nonymous'
 // CHECK-2-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:     Location:        
-// CHECK-2-NEXT:       - LineNumber:      80
+// CHECK-2-NEXT:       - LineNumber:      92
 // CHECK-2-NEXT:         Filename:        'test'
-// CHECK-2-NEXT:     IsMethod:        true
-// CHECK-2-NEXT:     Parent:          
-// CHECK-2-NEXT:       Type:            Record
-// CHECK-2-NEXT:       Name:            'AnonClass'
-// CHECK-2-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:     ReturnType:      
 // CHECK-2-NEXT:       Type:            
 // CHECK-2-NEXT:         Name:            'void'
 // CHECK-2-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-2-NEXT:     Name:            'anonProtectedMethod'
+// CHECK-2-NEXT:     Name:            'anonStaticFunction'
 // CHECK-2-NEXT:     Namespace:       
-// CHECK-2-NEXT:       - Type:            Record
-// CHECK-2-NEXT:         Name:            'AnonClass'
-// CHECK-2-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:       - Type:            Namespace
+// CHECK-2-NEXT:         Name:            '@nonymous'
 // CHECK-2-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:     Location:        
-// CHECK-2-NEXT:       - LineNumber:      84
+// CHECK-2-NEXT:       - LineNumber:      93
 // CHECK-2-NEXT:         Filename:        'test'
-// CHECK-2-NEXT:     IsMethod:        true
-// CHECK-2-NEXT:     Parent:          
-// CHECK-2-NEXT:       Type:            Record
-// CHECK-2-NEXT:       Name:            'AnonClass'
-// CHECK-2-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:     ReturnType:      
 // CHECK-2-NEXT:       Type:            
 // CHECK-2-NEXT:         Name:            'void'
 // CHECK-2-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-2-NEXT:     Name:            'anonPrivateMethod'
+// CHECK-2-NEXT:     Name:            'anonInlineFunction'
 // CHECK-2-NEXT:     Namespace:       
-// CHECK-2-NEXT:       - Type:            Record
-// CHECK-2-NEXT:         Name:            'AnonClass'
-// CHECK-2-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:       - Type:            Namespace
+// CHECK-2-NEXT:         Name:            '@nonymous'
 // CHECK-2-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:     Location:        
-// CHECK-2-NEXT:       - LineNumber:      88
+// CHECK-2-NEXT:       - LineNumber:      94
 // CHECK-2-NEXT:         Filename:        'test'
-// CHECK-2-NEXT:     IsMethod:        true
-// CHECK-2-NEXT:     Parent:          
-// CHECK-2-NEXT:       Type:            Record
-// CHECK-2-NEXT:       Name:            'AnonClass'
-// CHECK-2-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-2-NEXT:     ReturnType:      
 // CHECK-2-NEXT:       Type:            
 // CHECK-2-NEXT:         Name:            'void'
@@ -302,123 +262,249 @@
 // CHECK-3-NEXT: USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-3-NEXT: ChildFunctions:  
 // CHECK-3-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-3-NEXT:     Name:            'anonFunction'
-// CHECK-3-NEXT:     Namespace:       
-// CHECK-3-NEXT:       - Type:            Namespace
-// CHECK-3-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-3-NEXT:     Name:            'function'
 // CHECK-3-NEXT:     Location:        
-// CHECK-3-NEXT:       - LineNumber:      92
+// CHECK-3-NEXT:       - LineNumber:      10
 // CHECK-3-NEXT:         Filename:        'test'
+// CHECK-3-NEXT:     Params:          
+// CHECK-3-NEXT:       - Type:            
+// CHECK-3-NEXT:           Name:            'int'
+// CHECK-3-NEXT:         Name:            'x'
 // CHECK-3-NEXT:     ReturnType:      
 // CHECK-3-NEXT:       Type:            
 // CHECK-3-NEXT:         Name:            'void'
 // CHECK-3-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-3-NEXT:     Name:            'anonStaticFunction'
-// CHECK-3-NEXT:     Namespace:       
-// CHECK-3-NEXT:       - Type:            Namespace
-// CHECK-3-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-3-NEXT:     Name:            'inlinedFunction'
 // CHECK-3-NEXT:     Location:        
-// CHECK-3-NEXT:       - LineNumber:      93
+// CHECK-3-NEXT:       - LineNumber:      12
 // CHECK-3-NEXT:         Filename:        'test'
+// CHECK-3-NEXT:     Params:          
+// CHECK-3-NEXT:       - Type:            
+// CHECK-3-NEXT:           Name:            'int'
+// CHECK-3-NEXT:         Name:            'x'
 // CHECK-3-NEXT:     ReturnType:      
 // CHECK-3-NEXT:       Type:            
-// CHECK-3-NEXT:         Name:            'void'
+// CHECK-3-NEXT:         Name:            'int'
+// CHECK-3-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-3-NEXT:     Name:            'functionWithInnerClass'
+// CHECK-3-NEXT:     DefLocation:     
+// CHECK-3-NEXT:       LineNumber:      14
+// CHECK-3-NEXT:       Filename:        'test'
+// CHECK-3-NEXT:     Params:          
+// CHECK-3-NEXT:       - Type:            
+// CHECK-3-NEXT:           Name:            'int'
+// CHECK-3-NEXT:         Name:            'x'
+// CHECK-3-NEXT:     ReturnType:      
+// CHECK-3-NEXT:       Type:            
+// CHECK-3-NEXT:         Name:            'int'
 // CHECK-3-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-3-NEXT:     Name:            'anonInlineFunction'
-// CHECK-3-NEXT:     Namespace:       
-// CHECK-3-NEXT:       - Type:            Namespace
-// CHECK-3-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-3-NEXT:     Name:            'inlinedFunctionWithInnerClass'
+// CHECK-3-NEXT:     DefLocation:     
+// CHECK-3-NEXT:       LineNumber:      23
+// CHECK-3-NEXT:       Filename:        'test'
+// CHECK-3-NEXT:     Params:          
+// CHECK-3-NEXT:       - Type:            
+// CHECK-3-NEXT:           Name:            'int'
+// CHECK-3-NEXT:         Name:            'x'
+// CHECK-3-NEXT:     ReturnType:      
+// CHECK-3-NEXT:       Type:            
+// CHECK-3-NEXT:         Name:            'int'
+// CHECK-3-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-3-NEXT:     Name:            'staticFunction'
 // CHECK-3-NEXT:     Location:        
-// CHECK-3-NEXT:       - LineNumber:      94
+// CHECK-3-NEXT:       - LineNumber:      66
 // CHECK-3-NEXT:         Filename:        'test'
+// CHECK-3-NEXT:     Params:          
+// CHECK-3-NEXT:       - Type:            
+// CHECK-3-NEXT:           Name:            'int'
+// CHECK-3-NEXT:         Name:            'x'
 // CHECK-3-NEXT:     ReturnType:      
 // CHECK-3-NEXT:       Type:            
 // CHECK-3-NEXT:         Name:            'void'
+// CHECK-3-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-3-NEXT:     Name:            'staticFunctionWithInnerClass'
+// CHECK-3-NEXT:     DefLocation:     
+// CHECK-3-NEXT:       LineNumber:      68
+// CHECK-3-NEXT:       Filename:        'test'
+// CHECK-3-NEXT:     Params:          
+// CHECK-3-NEXT:       - Type:            
+// CHECK-3-NEXT:           Name:            'int'
+// CHECK-3-NEXT:         Name:            'x'
+// CHECK-3-NEXT:     ReturnType:      
+// CHECK-3-NEXT:       Type:            
+// CHECK-3-NEXT:         Name:            'int'
 // CHECK-3-NEXT: ...
 
-// RUN: cat %t/docs/named/NamedClass.yaml | FileCheck %s --check-prefix CHECK-4
+// RUN: cat %t/docs/@nonymous/AnonClass.yaml | FileCheck %s --check-prefix CHECK-4
 // CHECK-4: ---
 // CHECK-4-NEXT: USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-4-NEXT: Name:            'NamedClass'
+// CHECK-4-NEXT: Name:            'AnonClass'
 // CHECK-4-NEXT: Namespace:       
 // CHECK-4-NEXT:   - Type:            Namespace
-// CHECK-4-NEXT:     Name:            'named'
+// CHECK-4-NEXT:     Name:            '@nonymous'
 // CHECK-4-NEXT:     USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT: DefLocation:     
-// CHECK-4-NEXT:   LineNumber:      47
+// CHECK-4-NEXT:   LineNumber:      78
 // CHECK-4-NEXT:   Filename:        'test'
 // CHECK-4-NEXT: TagType:         Class
 // CHECK-4-NEXT: Members:         
 // CHECK-4-NEXT:   - Type:            
 // CHECK-4-NEXT:       Name:            'int'
-// CHECK-4-NEXT:     Name:            'namedPublicField'
+// CHECK-4-NEXT:     Name:            'anonPublicField'
 // CHECK-4-NEXT:   - Type:            
 // CHECK-4-NEXT:       Name:            'int'
-// CHECK-4-NEXT:     Name:            'namedProtectedField'
+// CHECK-4-NEXT:     Name:            'anonProtectedField'
 // CHECK-4-NEXT:     Access:          Protected
 // CHECK-4-NEXT:   - Type:            
 // CHECK-4-NEXT:       Name:            'int'
-// CHECK-4-NEXT:     Name:            'namedPrivateField'
+// CHECK-4-NEXT:     Name:            'anonPrivateField'
 // CHECK-4-NEXT:     Access:          Private
 // CHECK-4-NEXT: ChildFunctions:  
 // CHECK-4-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-4-NEXT:     Name:            'namedPublicMethod'
+// CHECK-4-NEXT:     Name:            'anonPublicMethod'
 // CHECK-4-NEXT:     Namespace:       
 // CHECK-4-NEXT:       - Type:            Record
-// CHECK-4-NEXT:         Name:            'NamedClass'
+// CHECK-4-NEXT:         Name:            'AnonClass'
 // CHECK-4-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:       - Type:            Namespace
-// CHECK-4-NEXT:         Name:            'named'
+// CHECK-4-NEXT:         Name:            '@nonymous'
 // CHECK-4-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:     Location:        
-// CHECK-4-NEXT:       - LineNumber:      49
+// CHECK-4-NEXT:       - LineNumber:      80
 // CHECK-4-NEXT:         Filename:        'test'
 // CHECK-4-NEXT:     IsMethod:        true
 // CHECK-4-NEXT:     Parent:          
 // CHECK-4-NEXT:       Type:            Record
-// CHECK-4-NEXT:       Name:            'NamedClass'
+// CHECK-4-NEXT:       Name:            'AnonClass'
 // CHECK-4-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:     ReturnType:      
 // CHECK-4-NEXT:       Type:            
 // CHECK-4-NEXT:         Name:            'void'
 // CHECK-4-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-4-NEXT:     Name:            'namedProtectedMethod'
+// CHECK-4-NEXT:     Name:            'anonProtectedMethod'
 // CHECK-4-NEXT:     Namespace:       
 // CHECK-4-NEXT:       - Type:            Record
-// CHECK-4-NEXT:         Name:            'NamedClass'
+// CHECK-4-NEXT:         Name:            'AnonClass'
 // CHECK-4-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:       - Type:            Namespace
-// CHECK-4-NEXT:         Name:            'named'
+// CHECK-4-NEXT:         Name:            '@nonymous'
 // CHECK-4-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:     Location:        
-// CHECK-4-NEXT:       - LineNumber:      53
+// CHECK-4-NEXT:       - LineNumber:      84
 // CHECK-4-NEXT:         Filename:        'test'
 // CHECK-4-NEXT:     IsMethod:        true
 // CHECK-4-NEXT:     Parent:          
 // CHECK-4-NEXT:       Type:            Record
-// CHECK-4-NEXT:       Name:            'NamedClass'
+// CHECK-4-NEXT:       Name:            'AnonClass'
 // CHECK-4-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:     ReturnType:      
 // CHECK-4-NEXT:       Type:            
 // CHECK-4-NEXT:         Name:            'void'
 // CHECK-4-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
-// CHECK-4-NEXT:     Name:            'namedPrivateMethod'
+// CHECK-4-NEXT:     Name:            'anonPrivateMethod'
 // CHECK-4-NEXT:     Namespace:       
 // CHECK-4-NEXT:       - Type:            Record
-// CHECK-4-NEXT:         Name:            'NamedClass'
+// CHECK-4-NEXT:         Name:            'AnonClass'
 // CHECK-4-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:       - Type:            Namespace
-// CHECK-4-NEXT:         Name:            'named'
+// CHECK-4-NEXT:         Name:            '@nonymous'
 // CHECK-4-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:     Location:        
-// CHECK-4-NEXT:       - LineNumber:      57
+// CHECK-4-NEXT:       - LineNumber:      88
 // CHECK-4-NEXT:         Filename:        'test'
 // CHECK-4-NEXT:     IsMethod:        true
 // CHECK-4-NEXT:     Parent:          
 // CHECK-4-NEXT:       Type:            Record
-// CHECK-4-NEXT:       Name:            'NamedClass'
+// CHECK-4-NEXT:       Name:            'AnonClass'
 // CHECK-4-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
 // CHECK-4-NEXT:     ReturnType:      
 // CHECK-4-NEXT:       Type:            
 // CHECK-4-NEXT:         Name:            'void'
 // CHECK-4-NEXT: ...
+
+// RUN: cat %t/docs/named/NamedClass.yaml | FileCheck %s --check-prefix CHECK-5
+// CHECK-5: ---
+// CHECK-5-NEXT: USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT: Name:            'NamedClass'
+// CHECK-5-NEXT: Namespace:       
+// CHECK-5-NEXT:   - Type:            Namespace
+// CHECK-5-NEXT:     Name:            'named'
+// CHECK-5-NEXT:     USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT: DefLocation:     
+// CHECK-5-NEXT:   LineNumber:      47
+// CHECK-5-NEXT:   Filename:        'test'
+// CHECK-5-NEXT: TagType:         Class
+// CHECK-5-NEXT: Members:         
+// CHECK-5-NEXT:   - Type:            
+// CHECK-5-NEXT:       Name:            'int'
+// CHECK-5-NEXT:     Name:            'namedPublicField'
+// CHECK-5-NEXT:   - Type:            
+// CHECK-5-NEXT:       Name:            'int'
+// CHECK-5-NEXT:     Name:            'namedProtectedField'
+// CHECK-5-NEXT:     Access:          Protected
+// CHECK-5-NEXT:   - Type:            
+// CHECK-5-NEXT:       Name:            'int'
+// CHECK-5-NEXT:     Name:            'namedPrivateField'
+// CHECK-5-NEXT:     Access:          Private
+// CHECK-5-NEXT: ChildFunctions:  
+// CHECK-5-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     Name:            'namedPublicMethod'
+// CHECK-5-NEXT:     Namespace:       
+// CHECK-5-NEXT:       - Type:            Record
+// CHECK-5-NEXT:         Name:            'NamedClass'
+// CHECK-5-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:       - Type:            Namespace
+// CHECK-5-NEXT:         Name:            'named'
+// CHECK-5-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     Location:        
+// CHECK-5-NEXT:       - LineNumber:      49
+// CHECK-5-NEXT:         Filename:        'test'
+// CHECK-5-NEXT:     IsMethod:        true
+// CHECK-5-NEXT:     Parent:          
+// CHECK-5-NEXT:       Type:            Record
+// CHECK-5-NEXT:       Name:            'NamedClass'
+// CHECK-5-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     ReturnType:      
+// CHECK-5-NEXT:       Type:            
+// CHECK-5-NEXT:         Name:            'void'
+// CHECK-5-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     Name:            'namedProtectedMethod'
+// CHECK-5-NEXT:     Namespace:       
+// CHECK-5-NEXT:       - Type:            Record
+// CHECK-5-NEXT:         Name:            'NamedClass'
+// CHECK-5-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:       - Type:            Namespace
+// CHECK-5-NEXT:         Name:            'named'
+// CHECK-5-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     Location:        
+// CHECK-5-NEXT:       - LineNumber:      53
+// CHECK-5-NEXT:         Filename:        'test'
+// CHECK-5-NEXT:     IsMethod:        true
+// CHECK-5-NEXT:     Parent:          
+// CHECK-5-NEXT:       Type:            Record
+// CHECK-5-NEXT:       Name:            'NamedClass'
+// CHECK-5-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     ReturnType:      
+// CHECK-5-NEXT:       Type:            
+// CHECK-5-NEXT:         Name:            'void'
+// CHECK-5-NEXT:   - USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     Name:            'namedPrivateMethod'
+// CHECK-5-NEXT:     Namespace:       
+// CHECK-5-NEXT:       - Type:            Record
+// CHECK-5-NEXT:         Name:            'NamedClass'
+// CHECK-5-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:       - Type:            Namespace
+// CHECK-5-NEXT:         Name:            'named'
+// CHECK-5-NEXT:         USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     Location:        
+// CHECK-5-NEXT:       - LineNumber:      57
+// CHECK-5-NEXT:         Filename:        'test'
+// CHECK-5-NEXT:     IsMethod:        true
+// CHECK-5-NEXT:     Parent:          
+// CHECK-5-NEXT:       Type:            Record
+// CHECK-5-NEXT:       Name:            'NamedClass'
+// CHECK-5-NEXT:       USR:             '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-5-NEXT:     ReturnType:      
+// CHECK-5-NEXT:       Type:            
+// CHECK-5-NEXT:         Name:            'void'
+// CHECK-5-NEXT: ...
Index: clang-tools-extra/test/clang-doc/md-record.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/md-record.cpp
+++ clang-tools-extra/test/clang-doc/md-record.cpp
@@ -41,7 +41,7 @@
 
 class G;
 
-// RUN: clang-doc --format=md --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
+// RUN: clang-doc --format=md --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
 
 
 // RUN: cat %t/docs/./F.md | FileCheck %s --check-prefix CHECK-0
@@ -100,3 +100,7 @@
 
 // RUN: cat %t/docs/./G.md | FileCheck %s --check-prefix CHECK-7
 // CHECK-7: # class G
+
+// RUN: cat %t/docs/X/Y.md | FileCheck %s --check-prefix CHECK-8
+// CHECK-8: # class Y
+// CHECK-8: *Defined at line 39 of test*
Index: clang-tools-extra/test/clang-doc/md-namespace.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/md-namespace.cpp
+++ clang-tools-extra/test/clang-doc/md-namespace.cpp
@@ -25,7 +25,7 @@
 }  // namespace B
 }  // namespace A
 
-// RUN: clang-doc --format=md --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
+// RUN: clang-doc --format=md --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
 
 
 // RUN: cat %t/docs/./A.md | FileCheck %s --check-prefix CHECK-0
Index: clang-tools-extra/test/clang-doc/md-module.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/md-module.cpp
+++ clang-tools-extra/test/clang-doc/md-module.cpp
@@ -14,11 +14,12 @@
 
 export double exportedModuleFunction(double y, int z); // ExternalLinkage
 
-// RUN: clang-doc --format=md --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
+// RUN: clang-doc --format=md --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
 
 
 // RUN: cat %t/docs/./GlobalNamespace.md | FileCheck %s --check-prefix CHECK-0
 // CHECK-0: # Global Namespace
 // CHECK-0: ## Functions
 // CHECK-0: ### int moduleFunction(int x)
+// CHECK-0: ### int staticModuleFunction(int x)
 // CHECK-0: ### double exportedModuleFunction(double y, int z)
Index: clang-tools-extra/test/clang-doc/md-linkage.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/md-linkage.cpp
+++ clang-tools-extra/test/clang-doc/md-linkage.cpp
@@ -94,23 +94,26 @@
 inline void anonInlineFunction();
 } // namespace
 
-// RUN: clang-doc --format=md --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
+// RUN: clang-doc --format=md --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
 
 
 // RUN: cat %t/docs/./Class.md | FileCheck %s --check-prefix CHECK-0
 // CHECK-0: # class Class
 // CHECK-0: *Defined at line 32 of test*
 // CHECK-0: ## Members
 // CHECK-0: int publicField
 // CHECK-0: protected int protectedField
+// CHECK-0: private int privateField
 // CHECK-0: ## Functions
 // CHECK-0: ### void publicMethod()
 // CHECK-0: ### void protectedMethod()
+// CHECK-0: ### void privateMethod()
 
 // RUN: cat %t/docs/./named.md | FileCheck %s --check-prefix CHECK-1
 // CHECK-1: # namespace named
 // CHECK-1: ## Functions
 // CHECK-1: ### void namedFunction()
+// CHECK-1: ### void namedStaticFunction()
 // CHECK-1: ### void namedInlineFunction()
 
 // RUN: cat %t/docs/./GlobalNamespace.md | FileCheck %s --check-prefix CHECK-2
@@ -122,13 +125,37 @@
 // CHECK-2: *Defined at line 14 of test*
 // CHECK-2: ### int inlinedFunctionWithInnerClass(int x)
 // CHECK-2: *Defined at line 23 of test*
+// CHECK-2: ### void staticFunction(int x)
+// CHECK-2: ### int staticFunctionWithInnerClass(int x)
+// CHECK-2: *Defined at line 68 of test*
 
-// RUN: cat %t/docs/named/NamedClass.md | FileCheck %s --check-prefix CHECK-3
-// CHECK-3: # class NamedClass
-// CHECK-3: *Defined at line 47 of test*
-// CHECK-3: ## Members
-// CHECK-3: int namedPublicField
-// CHECK-3: protected int namedProtectedField
+// RUN: cat %t/docs/./@nonymous.md | FileCheck %s --check-prefix CHECK-3
+// CHECK-3: # namespace @nonymous
 // CHECK-3: ## Functions
-// CHECK-3: ### void namedPublicMethod()
-// CHECK-3: ### void namedProtectedMethod()
+// CHECK-3: ### void anonFunction()
+// CHECK-3: ### void anonStaticFunction()
+// CHECK-3: ### void anonInlineFunction()
+
+// RUN: cat %t/docs/@nonymous/AnonClass.md | FileCheck %s --check-prefix CHECK-4
+// CHECK-4: # class AnonClass
+// CHECK-4: *Defined at line 78 of test*
+// CHECK-4: ## Members
+// CHECK-4: int anonPublicField
+// CHECK-4: protected int anonProtectedField
+// CHECK-4: private int anonPrivateField
+// CHECK-4: ## Functions
+// CHECK-4: ### void anonPublicMethod()
+// CHECK-4: ### void anonProtectedMethod()
+// CHECK-4: ### void anonPrivateMethod()
+
+// RUN: cat %t/docs/named/NamedClass.md | FileCheck %s --check-prefix CHECK-5
+// CHECK-5: # class NamedClass
+// CHECK-5: *Defined at line 47 of test*
+// CHECK-5: ## Members
+// CHECK-5: int namedPublicField
+// CHECK-5: protected int namedProtectedField
+// CHECK-5: private int namedPrivateField
+// CHECK-5: ## Functions
+// CHECK-5: ### void namedPublicMethod()
+// CHECK-5: ### void namedProtectedMethod()
+// CHECK-5: ### void namedPrivateMethod()
Index: clang-tools-extra/test/clang-doc/md-comment.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/md-comment.cpp
+++ clang-tools-extra/test/clang-doc/md-comment.cpp
@@ -27,7 +27,7 @@
 /// Bonus comment on definition
 void F(int I, int J) {}
 
-// RUN: clang-doc --format=md --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
+// RUN: clang-doc --format=md --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs
 
 
 // RUN: cat %t/docs/./GlobalNamespace.md | FileCheck %s --check-prefix CHECK-0
Index: clang-tools-extra/test/clang-doc/mapper-linkage.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/mapper-linkage.cpp
+++ clang-tools-extra/test/clang-doc/mapper-linkage.cpp
@@ -226,19 +226,20 @@
 // CHECK-4-NEXT: <VersionBlock NumWords=1 BlockCodeSize=4>
 // CHECK-4-NEXT:   <Version abbrevid=4 op0=2/>
 // CHECK-4-NEXT: </VersionBlock>
-// CHECK-4-NEXT: <RecordBlock NumWords=69 BlockCodeSize=4>
+// CHECK-4-NEXT: <RecordBlock NumWords=74 BlockCodeSize=4>
 // CHECK-4-NEXT:   <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
-// CHECK-4-NEXT:   <FunctionBlock NumWords=61 BlockCodeSize=4>
+// CHECK-4-NEXT:   <FunctionBlock NumWords=66 BlockCodeSize=4>
 // CHECK-4-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:     <Name abbrevid=5 op0=17/> blob data = 'anonPrivateMethod'
 // CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = 'AnonClass'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=2/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
-// CHECK-4-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
@@ -264,13 +265,14 @@
 // CHECK-5-NEXT: <VersionBlock NumWords=1 BlockCodeSize=4>
 // CHECK-5-NEXT:   <Version abbrevid=4 op0=2/>
 // CHECK-5-NEXT: </VersionBlock>
-// CHECK-5-NEXT: <NamespaceBlock NumWords=41 BlockCodeSize=4>
+// CHECK-5-NEXT: <NamespaceBlock NumWords=46 BlockCodeSize=4>
 // CHECK-5-NEXT:   <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
-// CHECK-5-NEXT:   <FunctionBlock NumWords=33 BlockCodeSize=4>
+// CHECK-5-NEXT:   <FunctionBlock NumWords=38 BlockCodeSize=4>
 // CHECK-5-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-5-NEXT:     <Name abbrevid=5 op0=18/> blob data = 'anonInlineFunction'
-// CHECK-5-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-5-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-5-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-5-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-5-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-5-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-5-NEXT:     </ReferenceBlock>
Index: clang-tools-extra/test/clang-doc/bc-linkage.cpp
===================================================================
--- clang-tools-extra/test/clang-doc/bc-linkage.cpp
+++ clang-tools-extra/test/clang-doc/bc-linkage.cpp
@@ -519,11 +519,12 @@
 // CHECK-4-NEXT: <VersionBlock NumWords=1 BlockCodeSize=4>
 // CHECK-4-NEXT:   <Version abbrevid=4 op0=2/>
 // CHECK-4-NEXT: </VersionBlock>
-// CHECK-4-NEXT: <RecordBlock NumWords=252 BlockCodeSize=4>
+// CHECK-4-NEXT: <RecordBlock NumWords=272 BlockCodeSize=4>
 // CHECK-4-NEXT:   <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:   <Name abbrevid=5 op0=9/> blob data = 'AnonClass'
-// CHECK-4-NEXT:   <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-4-NEXT:   <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-4-NEXT:     <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-4-NEXT:     <RefType abbrevid=6 op0=1/>
 // CHECK-4-NEXT:     <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:   </ReferenceBlock>
@@ -553,17 +554,18 @@
 // CHECK-4-NEXT:     <Name abbrevid=4 op0=16/> blob data = 'anonPrivateField'
 // CHECK-4-NEXT:     <Access abbrevid=5 op0=2/>
 // CHECK-4-NEXT:   </MemberTypeBlock>
-// CHECK-4-NEXT:   <FunctionBlock NumWords=60 BlockCodeSize=4>
+// CHECK-4-NEXT:   <FunctionBlock NumWords=65 BlockCodeSize=4>
 // CHECK-4-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:     <Name abbrevid=5 op0=16/> blob data = 'anonPublicMethod'
 // CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = 'AnonClass'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=2/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
-// CHECK-4-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
@@ -582,17 +584,18 @@
 // CHECK-4-NEXT:       </ReferenceBlock>
 // CHECK-4-NEXT:     </TypeBlock>
 // CHECK-4-NEXT:   </FunctionBlock>
-// CHECK-4-NEXT:   <FunctionBlock NumWords=61 BlockCodeSize=4>
+// CHECK-4-NEXT:   <FunctionBlock NumWords=66 BlockCodeSize=4>
 // CHECK-4-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:     <Name abbrevid=5 op0=19/> blob data = 'anonProtectedMethod'
 // CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = 'AnonClass'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=2/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
-// CHECK-4-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
@@ -611,17 +614,18 @@
 // CHECK-4-NEXT:       </ReferenceBlock>
 // CHECK-4-NEXT:     </TypeBlock>
 // CHECK-4-NEXT:   </FunctionBlock>
-// CHECK-4-NEXT:   <FunctionBlock NumWords=61 BlockCodeSize=4>
+// CHECK-4-NEXT:   <FunctionBlock NumWords=66 BlockCodeSize=4>
 // CHECK-4-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:     <Name abbrevid=5 op0=17/> blob data = 'anonPrivateMethod'
 // CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = 'AnonClass'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=2/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
-// CHECK-4-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-4-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-4-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-4-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-4-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-4-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-4-NEXT:     </ReferenceBlock>
@@ -647,13 +651,15 @@
 // CHECK-5-NEXT: <VersionBlock NumWords=1 BlockCodeSize=4>
 // CHECK-5-NEXT:   <Version abbrevid=4 op0=2/>
 // CHECK-5-NEXT: </VersionBlock>
-// CHECK-5-NEXT: <NamespaceBlock NumWords=109 BlockCodeSize=4>
+// CHECK-5-NEXT: <NamespaceBlock NumWords=129 BlockCodeSize=4>
 // CHECK-5-NEXT:   <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
-// CHECK-5-NEXT:   <FunctionBlock NumWords=31 BlockCodeSize=4>
+// CHECK-5-NEXT:   <Name abbrevid=5 op0=9/> blob data = '@nonymous'
+// CHECK-5-NEXT:   <FunctionBlock NumWords=36 BlockCodeSize=4>
 // CHECK-5-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-5-NEXT:     <Name abbrevid=5 op0=12/> blob data = 'anonFunction'
-// CHECK-5-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-5-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-5-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-5-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-5-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-5-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-5-NEXT:     </ReferenceBlock>
@@ -665,11 +671,12 @@
 // CHECK-5-NEXT:       </ReferenceBlock>
 // CHECK-5-NEXT:     </TypeBlock>
 // CHECK-5-NEXT:   </FunctionBlock>
-// CHECK-5-NEXT:   <FunctionBlock NumWords=33 BlockCodeSize=4>
+// CHECK-5-NEXT:   <FunctionBlock NumWords=38 BlockCodeSize=4>
 // CHECK-5-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-5-NEXT:     <Name abbrevid=5 op0=18/> blob data = 'anonStaticFunction'
-// CHECK-5-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-5-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-5-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-5-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-5-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-5-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-5-NEXT:     </ReferenceBlock>
@@ -681,11 +688,12 @@
 // CHECK-5-NEXT:       </ReferenceBlock>
 // CHECK-5-NEXT:     </TypeBlock>
 // CHECK-5-NEXT:   </FunctionBlock>
-// CHECK-5-NEXT:   <FunctionBlock NumWords=33 BlockCodeSize=4>
+// CHECK-5-NEXT:   <FunctionBlock NumWords=38 BlockCodeSize=4>
 // CHECK-5-NEXT:     <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
 // CHECK-5-NEXT:     <Name abbrevid=5 op0=18/> blob data = 'anonInlineFunction'
-// CHECK-5-NEXT:     <ReferenceBlock NumWords=7 BlockCodeSize=4>
+// CHECK-5-NEXT:     <ReferenceBlock NumWords=12 BlockCodeSize=4>
 // CHECK-5-NEXT:       <USR abbrevid=4 op0=20 op1={{[0-9]+}} op2={{[0-9]+}} op3={{[0-9]+}} op4={{[0-9]+}} op5={{[0-9]+}} op6={{[0-9]+}} op7={{[0-9]+}} op8={{[0-9]+}} op9={{[0-9]+}} op10={{[0-9]+}} op11={{[0-9]+}} op12={{[0-9]+}} op13={{[0-9]+}} op14={{[0-9]+}} op15={{[0-9]+}} op16={{[0-9]+}} op17={{[0-9]+}} op18={{[0-9]+}} op19={{[0-9]+}} op20={{[0-9]+}}/>
+// CHECK-5-NEXT:       <Name abbrevid=5 op0=9/> blob data = '@nonymous'
 // CHECK-5-NEXT:       <RefType abbrevid=6 op0=1/>
 // CHECK-5-NEXT:       <Field abbrevid=7 op0=1/>
 // CHECK-5-NEXT:     </ReferenceBlock>
Index: clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
===================================================================
--- clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
+++ clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
@@ -154,9 +154,6 @@
   if (CreateDirectory(Path))
     return llvm::make_error<llvm::StringError>("Unable to create directory.\n",
                                                llvm::inconvertibleErrorCode());
-
-  if (Name.empty())
-    Name = "GlobalNamespace";
   llvm::sys::path::append(Path, Name + Ext);
   return Path;
 }
@@ -273,8 +270,8 @@
     }
     doc::Info *I = Reduced.get().get();
 
-    auto InfoPath =
-        getInfoOutputFile(OutDirectory, I->Namespace, I->Name, "." + Format);
+    auto InfoPath = getInfoOutputFile(OutDirectory, I->Namespace,
+                                      I->extractFileName(), "." + Format);
     if (!InfoPath) {
       llvm::errs() << toString(InfoPath.takeError()) << "\n";
       continue;
Index: clang-tools-extra/clang-doc/gen_tests.py
===================================================================
--- clang-tools-extra/clang-doc/gen_tests.py
+++ clang-tools-extra/clang-doc/gen_tests.py
@@ -30,7 +30,7 @@
     python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--public' -flag='--extra-arg=-fmodules-ts' -prefix public -use-check-next
 
 - Generate Markdown tests:
-    python gen_tests.py -flag='--format=md' -flag='--doxygen' -flag='--public' -flag='--extra-arg=-fmodules-ts' -prefix md
+    python gen_tests.py -flag='--format=md' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix md
 
 This script was written on/for Linux, and has not been tested on any other
 platform and so it may not work.
Index: clang-tools-extra/clang-doc/Serialize.cpp
===================================================================
--- clang-tools-extra/clang-doc/Serialize.cpp
+++ clang-tools-extra/clang-doc/Serialize.cpp
@@ -268,13 +268,19 @@
 template <typename T>
 static void
 populateParentNamespaces(llvm::SmallVector<Reference, 4> &Namespaces,
-                         const T *D) {
+                         const T *D, bool &IsAnonymousNamespace) {
   const auto *DC = dyn_cast<DeclContext>(D);
   while ((DC = DC->getParent())) {
-    if (const auto *N = dyn_cast<NamespaceDecl>(DC))
-      Namespaces.emplace_back(getUSRForDecl(N), N->getNameAsString(),
+    if (const auto *N = dyn_cast<NamespaceDecl>(DC)) {
+      std::string Namespace;
+      if (N->isAnonymousNamespace()) {
+        Namespace = "@nonymous";
+        IsAnonymousNamespace = true;
+      } else
+        Namespace = N->getNameAsString();
+      Namespaces.emplace_back(getUSRForDecl(N), Namespace,
                               InfoType::IT_namespace);
-    else if (const auto *N = dyn_cast<RecordDecl>(DC))
+    } else if (const auto *N = dyn_cast<RecordDecl>(DC))
       Namespaces.emplace_back(getUSRForDecl(N), N->getNameAsString(),
                               InfoType::IT_record);
     else if (const auto *N = dyn_cast<FunctionDecl>(DC))
@@ -287,30 +293,33 @@
 }
 
 template <typename T>
-static void populateInfo(Info &I, const T *D, const FullComment *C) {
+static void populateInfo(Info &I, const T *D, const FullComment *C,
+                         bool &IsInAnonymousNamespace) {
   I.USR = getUSRForDecl(D);
   I.Name = D->getNameAsString();
-  populateParentNamespaces(I.Namespace, D);
+  populateParentNamespaces(I.Namespace, D, IsInAnonymousNamespace);
   if (C) {
     I.Description.emplace_back();
     parseFullComment(C, I.Description.back());
   }
 }
 
 template <typename T>
 static void populateSymbolInfo(SymbolInfo &I, const T *D, const FullComment *C,
-                               int LineNumber, StringRef Filename) {
-  populateInfo(I, D, C);
+                               int LineNumber, StringRef Filename,
+                               bool &IsInAnonymousNamespace) {
+  populateInfo(I, D, C, IsInAnonymousNamespace);
   if (D->isThisDeclarationADefinition())
     I.DefLoc.emplace(LineNumber, Filename);
   else
     I.Loc.emplace_back(LineNumber, Filename);
 }
 
 static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
                                  const FullComment *FC, int LineNumber,
-                                 StringRef Filename) {
-  populateSymbolInfo(I, D, FC, LineNumber, Filename);
+                                 StringRef Filename,
+                                 bool &IsInAnonymousNamespace) {
+  populateSymbolInfo(I, D, FC, LineNumber, Filename, IsInAnonymousNamespace);
   if (const auto *T = getDeclForType(D->getReturnType())) {
     if (dyn_cast<EnumDecl>(T))
       I.ReturnType =
@@ -327,21 +336,27 @@
 std::unique_ptr<Info> emitInfo(const NamespaceDecl *D, const FullComment *FC,
                                int LineNumber, llvm::StringRef File,
                                bool PublicOnly) {
-  if (PublicOnly && ((D->isAnonymousNamespace()) ||
+  auto I = llvm::make_unique<NamespaceInfo>();
+  bool IsInAnonymousNamespace = false;
+  populateInfo(*I, D, FC, IsInAnonymousNamespace);
+  if (PublicOnly && ((IsInAnonymousNamespace || D->isAnonymousNamespace()) ||
                      !isPublic(D->getAccess(), D->getLinkageInternal())))
     return nullptr;
-  auto I = llvm::make_unique<NamespaceInfo>();
-  populateInfo(*I, D, FC);
+  I->Name =
+      D->isAnonymousNamespace() ? llvm::SmallString<16>("@nonymous") : I->Name;
   return std::unique_ptr<Info>{std::move(I)};
 }
 
 std::unique_ptr<Info> emitInfo(const RecordDecl *D, const FullComment *FC,
                                int LineNumber, llvm::StringRef File,
                                bool PublicOnly) {
-  if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal()))
-    return nullptr;
   auto I = llvm::make_unique<RecordInfo>();
-  populateSymbolInfo(*I, D, FC, LineNumber, File);
+  bool IsInAnonymousNamespace = false;
+  populateSymbolInfo(*I, D, FC, LineNumber, File, IsInAnonymousNamespace);
+  if (PublicOnly && ((IsInAnonymousNamespace ||
+                      !isPublic(D->getAccess(), D->getLinkageInternal()))))
+    return nullptr;
+
   I->TagType = D->getTagKind();
   parseFields(*I, D, PublicOnly);
   if (const auto *C = dyn_cast<CXXRecordDecl>(D))
@@ -352,10 +367,13 @@
 std::unique_ptr<Info> emitInfo(const FunctionDecl *D, const FullComment *FC,
                                int LineNumber, llvm::StringRef File,
                                bool PublicOnly) {
-  if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal()))
-    return nullptr;
   FunctionInfo Func;
-  populateFunctionInfo(Func, D, FC, LineNumber, File);
+  bool IsInAnonymousNamespace = false;
+  populateFunctionInfo(Func, D, FC, LineNumber, File, IsInAnonymousNamespace);
+  if (PublicOnly && ((IsInAnonymousNamespace ||
+                      !isPublic(D->getAccess(), D->getLinkageInternal()))))
+    return nullptr;
+
   Func.Access = clang::AccessSpecifier::AS_none;
 
   // Wrap in enclosing scope
@@ -371,10 +389,13 @@
 std::unique_ptr<Info> emitInfo(const CXXMethodDecl *D, const FullComment *FC,
                                int LineNumber, llvm::StringRef File,
                                bool PublicOnly) {
-  if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal()))
-    return nullptr;
   FunctionInfo Func;
-  populateFunctionInfo(Func, D, FC, LineNumber, File);
+  bool IsInAnonymousNamespace = false;
+  populateFunctionInfo(Func, D, FC, LineNumber, File, IsInAnonymousNamespace);
+  if (PublicOnly && ((IsInAnonymousNamespace ||
+                      !isPublic(D->getAccess(), D->getLinkageInternal()))))
+    return nullptr;
+
   Func.IsMethod = true;
 
   SymbolID ParentUSR = getUSRForDecl(D->getParent());
@@ -392,10 +413,13 @@
 std::unique_ptr<Info> emitInfo(const EnumDecl *D, const FullComment *FC,
                                int LineNumber, llvm::StringRef File,
                                bool PublicOnly) {
-  if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal()))
-    return nullptr;
   EnumInfo Enum;
-  populateSymbolInfo(Enum, D, FC, LineNumber, File);
+  bool IsInAnonymousNamespace = false;
+  populateSymbolInfo(Enum, D, FC, LineNumber, File, IsInAnonymousNamespace);
+  if (PublicOnly && ((IsInAnonymousNamespace ||
+                      !isPublic(D->getAccess(), D->getLinkageInternal()))))
+    return nullptr;
+
   Enum.Scoped = D->isScoped();
   parseEnumerators(Enum, D);
 
Index: clang-tools-extra/clang-doc/Representation.h
===================================================================
--- clang-tools-extra/clang-doc/Representation.h
+++ clang-tools-extra/clang-doc/Representation.h
@@ -175,6 +175,7 @@
 
   void mergeBase(Info &&I);
   bool mergeable(const Info &Other);
+  llvm::SmallString<16> extractFileName();
 
   // Returns a reference to the parent scope (that is, the immediate parent
   // namespace or class in which this decl resides).
Index: clang-tools-extra/clang-doc/Representation.cpp
===================================================================
--- clang-tools-extra/clang-doc/Representation.cpp
+++ clang-tools-extra/clang-doc/Representation.cpp
@@ -22,6 +22,7 @@
 //===----------------------------------------------------------------------===//
 #include "Representation.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/Path.h"
 
 namespace clang {
 namespace doc {
@@ -189,5 +190,28 @@
   SymbolInfo::merge(std::move(Other));
 }
 
+llvm::SmallString<16> Info::extractFileName() {
+  if (!Name.empty())
+    return Name;
+
+  switch (IT) {
+  case InfoType::IT_namespace:
+    // The case of anonymous namespaces is taken care of in serialization, so
+    // here we can safely assume an unnamed namespace is the global one.
+    return llvm::SmallString<16>("GlobalNamespace");
+  case InfoType::IT_record:
+    return llvm::SmallString<16>("@nonymous_record_" +
+                                 toHex(llvm::toStringRef(USR)));
+  case InfoType::IT_enum:
+    return llvm::SmallString<16>("@nonymous_enum_" +
+                                 toHex(llvm::toStringRef(USR)));
+  case InfoType::IT_function:
+    return llvm::SmallString<16>("@nonymous_function_" +
+                                 toHex(llvm::toStringRef(USR)));
+  case InfoType::IT_default:
+    return llvm::SmallString<16>("@nonymous_" + toHex(llvm::toStringRef(USR)));
+  }
+}
+
 } // namespace doc
 } // namespace clang
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to