Some refactoring in my patch on document
command source fidelity. // rdar://13066276



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176401 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp
index 3227138..e7bd5c8 100644
--- a/lib/AST/CommentSema.cpp
+++ b/lib/AST/CommentSema.cpp
@@ -49,8 +49,9 @@
 
 BlockCommandComment *Sema::actOnBlockCommandStart(SourceLocation LocBegin,
                                                   SourceLocation LocEnd,
-                                                  unsigned CommandID) {
-  return new (Allocator) BlockCommandComment(LocBegin, LocEnd, CommandID);
+                                                  unsigned CommandID,
+                                                  bool AtCommand) {
+  return new (Allocator) BlockCommandComment(LocBegin, LocEnd, CommandID, AtCommand);
 }
 
 void Sema::actOnBlockCommandArgs(BlockCommandComment *Command,
@@ -69,9 +70,10 @@
 
 ParamCommandComment *Sema::actOnParamCommandStart(SourceLocation LocBegin,
                                                   SourceLocation LocEnd,
-                                                  unsigned CommandID) {
+                                                  unsigned CommandID,
+                                                  bool AtCommand) {
   ParamCommandComment *Command =
-      new (Allocator) ParamCommandComment(LocBegin, LocEnd, CommandID);
+      new (Allocator) ParamCommandComment(LocBegin, LocEnd, CommandID, AtCommand);
 
   if (!isFunctionDecl())
     Diag(Command->getLocation(),
@@ -162,9 +164,10 @@
 
 TParamCommandComment *Sema::actOnTParamCommandStart(SourceLocation LocBegin,
                                                     SourceLocation LocEnd,
-                                                    unsigned CommandID) {
+                                                    unsigned CommandID,
+                                                    bool AtCommand) {
   TParamCommandComment *Command =
-      new (Allocator) TParamCommandComment(LocBegin, LocEnd, CommandID);
+      new (Allocator) TParamCommandComment(LocBegin, LocEnd, CommandID, AtCommand);
 
   if (!isTemplateOrSpecialization())
     Diag(Command->getLocation(),
@@ -432,7 +435,7 @@
     if (!DiagLoc.isValid())
       DiagLoc = Command->getCommandNameRange(Traits).getEnd();
     Diag(DiagLoc, diag::warn_doc_block_command_empty_paragraph)
-      << Command->getHDCommand()
+      << Command->getAtCommand()
       << Command->getCommandName(Traits)
       << Command->getSourceRange();
   }
@@ -460,7 +463,7 @@
       }
       Diag(Command->getLocation(),
            diag::warn_doc_returns_attached_to_a_void_function)
-        << Command->getHDCommand()
+        << Command->getAtCommand()
         << Command->getCommandName(Traits)
         << DiagKind
         << Command->getSourceRange();
@@ -472,7 +475,7 @@
   
   Diag(Command->getLocation(),
        diag::warn_doc_returns_not_attached_to_a_function_decl)
-    << Command->getHDCommand()
+    << Command->getAtCommand()
     << Command->getCommandName(Traits)
     << Command->getSourceRange();
 }
@@ -505,18 +508,18 @@
   StringRef CommandName = Command->getCommandName(Traits);
   StringRef PrevCommandName = PrevCommand->getCommandName(Traits);
   Diag(Command->getLocation(), diag::warn_doc_block_command_duplicate)
-      << Command->getHDCommand()
+      << Command->getAtCommand()
       << CommandName
       << Command->getSourceRange();
   if (CommandName == PrevCommandName)
     Diag(PrevCommand->getLocation(), diag::note_doc_block_command_previous)
-        << PrevCommand->getHDCommand()
+        << PrevCommand->getAtCommand()
         << PrevCommandName
         << PrevCommand->getSourceRange();
   else
     Diag(PrevCommand->getLocation(),
          diag::note_doc_block_command_previous_alias)
-        << PrevCommand->getHDCommand()
+        << PrevCommand->getAtCommand()
         << PrevCommandName
         << CommandName;
 }