]> granicus.if.org Git - clang/commitdiff
Comment parser and sema: remove useless return values
authorDmitri Gribenko <gribozavr@gmail.com>
Mon, 6 Aug 2012 19:03:12 +0000 (19:03 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Mon, 6 Aug 2012 19:03:12 +0000 (19:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161331 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/CommentParser.h
include/clang/AST/CommentSema.h
lib/AST/CommentParser.cpp
lib/AST/CommentSema.cpp

index 53ea2fcdecdc450cf45e3a1a7f8af80c0fd2c54d..9539c9f54e6891b96e01af78c169e4c8999ed639 100644 (file)
@@ -55,15 +55,13 @@ class Parser {
   /// A stack of additional lookahead tokens.
   SmallVector<Token, 8> MoreLATokens;
 
-  SourceLocation consumeToken() {
-    SourceLocation Loc = Tok.getLocation();
+  void consumeToken() {
     if (MoreLATokens.empty())
       L.lex(Tok);
     else {
       Tok = MoreLATokens.back();
       MoreLATokens.pop_back();
     }
-    return Loc;
   }
 
   void putBack(const Token &OldTok) {
@@ -90,19 +88,16 @@ public:
          const SourceManager &SourceMgr, DiagnosticsEngine &Diags);
 
   /// Parse arguments for \\param command.
-  ParamCommandComment *parseParamCommandArgs(
-                                    ParamCommandComment *PC,
-                                    TextTokenRetokenizer &Retokenizer);
+  void parseParamCommandArgs(ParamCommandComment *PC,
+                             TextTokenRetokenizer &Retokenizer);
 
   /// Parse arguments for \\tparam command.
-  TParamCommandComment *parseTParamCommandArgs(
-                                    TParamCommandComment *TPC,
-                                    TextTokenRetokenizer &Retokenizer);
-
-  BlockCommandComment *parseBlockCommandArgs(
-                                    BlockCommandComment *BC,
-                                    TextTokenRetokenizer &Retokenizer,
-                                    unsigned NumArgs);
+  void parseTParamCommandArgs(TParamCommandComment *TPC,
+                              TextTokenRetokenizer &Retokenizer);
+
+  void parseBlockCommandArgs(BlockCommandComment *BC,
+                             TextTokenRetokenizer &Retokenizer,
+                             unsigned NumArgs);
 
   BlockCommandComment *parseBlockCommand();
   InlineCommandComment *parseInlineCommand();
index 114cfc577bb7ceb356fdc0360308c56ede58d598..bbb7c94e248a18b48a953062eea88f1eaf119fd8 100644 (file)
@@ -95,44 +95,40 @@ public:
                                               SourceLocation LocEnd,
                                               StringRef Name);
 
-  BlockCommandComment *actOnBlockCommandArgs(
-                              BlockCommandComment *Command,
-                              ArrayRef<BlockCommandComment::Argument> Args);
+  void actOnBlockCommandArgs(BlockCommandComment *Command,
+                             ArrayRef<BlockCommandComment::Argument> Args);
 
-  BlockCommandComment *actOnBlockCommandFinish(BlockCommandComment *Command,
-                                               ParagraphComment *Paragraph);
+  void actOnBlockCommandFinish(BlockCommandComment *Command,
+                               ParagraphComment *Paragraph);
 
   ParamCommandComment *actOnParamCommandStart(SourceLocation LocBegin,
                                               SourceLocation LocEnd,
                                               StringRef Name);
 
-  ParamCommandComment *actOnParamCommandDirectionArg(
-                                            ParamCommandComment *Command,
-                                            SourceLocation ArgLocBegin,
-                                            SourceLocation ArgLocEnd,
-                                            StringRef Arg);
+  void actOnParamCommandDirectionArg(ParamCommandComment *Command,
+                                     SourceLocation ArgLocBegin,
+                                     SourceLocation ArgLocEnd,
+                                     StringRef Arg);
 
-  ParamCommandComment *actOnParamCommandParamNameArg(
-                                            ParamCommandComment *Command,
-                                            SourceLocation ArgLocBegin,
-                                            SourceLocation ArgLocEnd,
-                                            StringRef Arg);
+  void actOnParamCommandParamNameArg(ParamCommandComment *Command,
+                                     SourceLocation ArgLocBegin,
+                                     SourceLocation ArgLocEnd,
+                                     StringRef Arg);
 
-  ParamCommandComment *actOnParamCommandFinish(ParamCommandComment *Command,
-                                               ParagraphComment *Paragraph);
+  void actOnParamCommandFinish(ParamCommandComment *Command,
+                               ParagraphComment *Paragraph);
 
   TParamCommandComment *actOnTParamCommandStart(SourceLocation LocBegin,
                                                 SourceLocation LocEnd,
                                                 StringRef Name);
 
-  TParamCommandComment *actOnTParamCommandParamNameArg(
-                                            TParamCommandComment *Command,
-                                            SourceLocation ArgLocBegin,
-                                            SourceLocation ArgLocEnd,
-                                            StringRef Arg);
+  void actOnTParamCommandParamNameArg(TParamCommandComment *Command,
+                                      SourceLocation ArgLocBegin,
+                                      SourceLocation ArgLocEnd,
+                                      StringRef Arg);
 
-  TParamCommandComment *actOnTParamCommandFinish(TParamCommandComment *Command,
-                                                 ParagraphComment *Paragraph);
+  void actOnTParamCommandFinish(TParamCommandComment *Command,
+                                ParagraphComment *Paragraph);
 
   InlineCommandComment *actOnInlineCommand(SourceLocation CommandLocBegin,
                                            SourceLocation CommandLocEnd,
@@ -159,11 +155,10 @@ public:
   VerbatimBlockLineComment *actOnVerbatimBlockLine(SourceLocation Loc,
                                                    StringRef Text);
 
-  VerbatimBlockComment *actOnVerbatimBlockFinish(
-                              VerbatimBlockComment *Block,
-                              SourceLocation CloseNameLocBegin,
-                              StringRef CloseName,
-                              ArrayRef<VerbatimBlockLineComment *> Lines);
+  void actOnVerbatimBlockFinish(VerbatimBlockComment *Block,
+                                SourceLocation CloseNameLocBegin,
+                                StringRef CloseName,
+                                ArrayRef<VerbatimBlockLineComment *> Lines);
 
   VerbatimLineComment *actOnVerbatimLine(SourceLocation LocBegin,
                                          StringRef Name,
@@ -173,11 +168,10 @@ public:
   HTMLStartTagComment *actOnHTMLStartTagStart(SourceLocation LocBegin,
                                               StringRef TagName);
 
-  HTMLStartTagComment *actOnHTMLStartTagFinish(
-                              HTMLStartTagComment *Tag,
-                              ArrayRef<HTMLStartTagComment::Attribute> Attrs,
-                              SourceLocation GreaterLoc,
-                              bool IsSelfClosing);
+  void actOnHTMLStartTagFinish(HTMLStartTagComment *Tag,
+                               ArrayRef<HTMLStartTagComment::Attribute> Attrs,
+                               SourceLocation GreaterLoc,
+                               bool IsSelfClosing);
 
   HTMLEndTagComment *actOnHTMLEndTag(SourceLocation LocBegin,
                                      SourceLocation LocEnd,
index 63560e197dd8cdd2c21fb31f3e8e01b6acd4e008..8d7716a9d5baf9eccdd1549dae4909a1c3d06d73 100644 (file)
@@ -255,44 +255,37 @@ Parser::Parser(Lexer &L, Sema &S, llvm::BumpPtrAllocator &Allocator,
   consumeToken();
 }
 
-ParamCommandComment *Parser::parseParamCommandArgs(
-    ParamCommandComment *PC,
-    TextTokenRetokenizer &Retokenizer) {
+void Parser::parseParamCommandArgs(ParamCommandComment *PC,
+                                   TextTokenRetokenizer &Retokenizer) {
   Token Arg;
   // Check if argument looks like direction specification: [dir]
   // e.g., [in], [out], [in,out]
   if (Retokenizer.lexDelimitedSeq(Arg, '[', ']'))
-    PC = S.actOnParamCommandDirectionArg(PC,
-                                         Arg.getLocation(),
-                                         Arg.getEndLocation(),
-                                         Arg.getText());
+    S.actOnParamCommandDirectionArg(PC,
+                                    Arg.getLocation(),
+                                    Arg.getEndLocation(),
+                                    Arg.getText());
 
   if (Retokenizer.lexWord(Arg))
-    PC = S.actOnParamCommandParamNameArg(PC,
-                                         Arg.getLocation(),
-                                         Arg.getEndLocation(),
-                                         Arg.getText());
-
-  return PC;
+    S.actOnParamCommandParamNameArg(PC,
+                                    Arg.getLocation(),
+                                    Arg.getEndLocation(),
+                                    Arg.getText());
 }
 
-TParamCommandComment *Parser::parseTParamCommandArgs(
-                                  TParamCommandComment *TPC,
-                                  TextTokenRetokenizer &Retokenizer) {
+void Parser::parseTParamCommandArgs(TParamCommandComment *TPC,
+                                    TextTokenRetokenizer &Retokenizer) {
   Token Arg;
   if (Retokenizer.lexWord(Arg))
-    TPC = S.actOnTParamCommandParamNameArg(TPC,
-                                           Arg.getLocation(),
-                                           Arg.getEndLocation(),
-                                           Arg.getText());
-
-  return TPC;
+    S.actOnTParamCommandParamNameArg(TPC,
+                                     Arg.getLocation(),
+                                     Arg.getEndLocation(),
+                                     Arg.getText());
 }
 
-BlockCommandComment *Parser::parseBlockCommandArgs(
-    BlockCommandComment *BC,
-    TextTokenRetokenizer &Retokenizer,
-    unsigned NumArgs) {
+void Parser::parseBlockCommandArgs(BlockCommandComment *BC,
+                                   TextTokenRetokenizer &Retokenizer,
+                                   unsigned NumArgs) {
   typedef BlockCommandComment::Argument Argument;
   Argument *Args =
       new (Allocator.Allocate<Argument>(NumArgs)) Argument[NumArgs];
@@ -305,7 +298,7 @@ BlockCommandComment *Parser::parseBlockCommandArgs(
     ParsedArgs++;
   }
 
-  return S.actOnBlockCommandArgs(BC, llvm::makeArrayRef(Args, ParsedArgs));
+  S.actOnBlockCommandArgs(BC, llvm::makeArrayRef(Args, ParsedArgs));
 }
 
 BlockCommandComment *Parser::parseBlockCommand() {
@@ -340,7 +333,13 @@ BlockCommandComment *Parser::parseBlockCommand() {
     // command has an empty argument.
     ParagraphComment *Paragraph = S.actOnParagraphComment(
                                 ArrayRef<InlineContentComment *>());
-    return S.actOnBlockCommandFinish(IsParam ? PC : BC, Paragraph);
+    if (IsParam) {
+      S.actOnBlockCommandFinish(PC, Paragraph);
+      return PC;
+    } else {
+      S.actOnBlockCommandFinish(BC, Paragraph);
+      return BC;
+    }
   }
 
   if (IsParam || IsTParam || NumArgs > 0) {
@@ -349,11 +348,11 @@ BlockCommandComment *Parser::parseBlockCommand() {
     TextTokenRetokenizer Retokenizer(Allocator, *this);
 
     if (IsParam)
-      PC = parseParamCommandArgs(PC, Retokenizer);
+      parseParamCommandArgs(PC, Retokenizer);
     else if (IsTParam)
-      TPC = parseTParamCommandArgs(TPC, Retokenizer);
+      parseTParamCommandArgs(TPC, Retokenizer);
     else
-      BC = parseBlockCommandArgs(BC, Retokenizer, NumArgs);
+      parseBlockCommandArgs(BC, Retokenizer, NumArgs);
 
     Retokenizer.putBackLeftoverTokens();
   }
@@ -361,12 +360,17 @@ BlockCommandComment *Parser::parseBlockCommand() {
   BlockContentComment *Block = parseParagraphOrBlockCommand();
   // Since we have checked for a block command, we should have parsed a
   // paragraph.
-  if (IsParam)
-    return S.actOnParamCommandFinish(PC, cast<ParagraphComment>(Block));
-  else if (IsTParam)
-    return S.actOnTParamCommandFinish(TPC, cast<ParagraphComment>(Block));
-  else
-    return S.actOnBlockCommandFinish(BC, cast<ParagraphComment>(Block));
+  ParagraphComment *Paragraph = cast<ParagraphComment>(Block);
+  if (IsParam) {
+    S.actOnParamCommandFinish(PC, Paragraph);
+    return PC;
+  } else if (IsTParam) {
+    S.actOnTParamCommandFinish(TPC, Paragraph);
+    return TPC;
+  } else {
+    S.actOnBlockCommandFinish(BC, Paragraph);
+    return BC;
+  }
 }
 
 InlineCommandComment *Parser::parseInlineCommand() {
@@ -442,18 +446,18 @@ HTMLStartTagComment *Parser::parseHTMLStartTag() {
     }
 
     case tok::html_greater:
-      HST = S.actOnHTMLStartTagFinish(HST,
-                                      S.copyArray(llvm::makeArrayRef(Attrs)),
-                                      Tok.getLocation(),
-                                      /* IsSelfClosing = */ false);
+      S.actOnHTMLStartTagFinish(HST,
+                                S.copyArray(llvm::makeArrayRef(Attrs)),
+                                Tok.getLocation(),
+                                /* IsSelfClosing = */ false);
       consumeToken();
       return HST;
 
     case tok::html_slash_greater:
-      HST = S.actOnHTMLStartTagFinish(HST,
-                                      S.copyArray(llvm::makeArrayRef(Attrs)),
-                                      Tok.getLocation(),
-                                      /* IsSelfClosing = */ true);
+      S.actOnHTMLStartTagFinish(HST,
+                                S.copyArray(llvm::makeArrayRef(Attrs)),
+                                Tok.getLocation(),
+                                /* IsSelfClosing = */ true);
       consumeToken();
       return HST;
 
@@ -469,17 +473,18 @@ HTMLStartTagComment *Parser::parseHTMLStartTag() {
           Tok.is(tok::html_slash_greater))
         continue;
 
-      return S.actOnHTMLStartTagFinish(HST,
-                                       S.copyArray(llvm::makeArrayRef(Attrs)),
-                                       SourceLocation(),
-                                       /* IsSelfClosing = */ false);
+      S.actOnHTMLStartTagFinish(HST,
+                                S.copyArray(llvm::makeArrayRef(Attrs)),
+                                SourceLocation(),
+                                /* IsSelfClosing = */ false);
+      return HST;
 
     default:
       // Not a token from an HTML start tag.  Thus HTML tag prematurely ended.
-      HST = S.actOnHTMLStartTagFinish(HST,
-                                      S.copyArray(llvm::makeArrayRef(Attrs)),
-                                      SourceLocation(),
-                                      /* IsSelfClosing = */ false);
+      S.actOnHTMLStartTagFinish(HST,
+                                S.copyArray(llvm::makeArrayRef(Attrs)),
+                                SourceLocation(),
+                                /* IsSelfClosing = */ false);
       bool StartLineInvalid;
       const unsigned StartLine = SourceMgr.getPresumedLineNumber(
                                                   HST->getLocation(),
@@ -623,14 +628,14 @@ VerbatimBlockComment *Parser::parseVerbatimBlock() {
   }
 
   if (Tok.is(tok::verbatim_block_end)) {
-    VB = S.actOnVerbatimBlockFinish(VB, Tok.getLocation(),
-                                    Tok.getVerbatimBlockName(),
-                                    S.copyArray(llvm::makeArrayRef(Lines)));
+    S.actOnVerbatimBlockFinish(VB, Tok.getLocation(),
+                               Tok.getVerbatimBlockName(),
+                               S.copyArray(llvm::makeArrayRef(Lines)));
     consumeToken();
   } else {
     // Unterminated \\verbatim block
-    VB = S.actOnVerbatimBlockFinish(VB, SourceLocation(), "",
-                                    S.copyArray(llvm::makeArrayRef(Lines)));
+    S.actOnVerbatimBlockFinish(VB, SourceLocation(), "",
+                               S.copyArray(llvm::makeArrayRef(Lines)));
   }
 
   return VB;
index 57f8fda07c8f278ce819ed165a144d48421eb504..42dd320b5c0dc98ddfe793cfc3c2cfcc6805b82d 100644 (file)
@@ -43,21 +43,17 @@ BlockCommandComment *Sema::actOnBlockCommandStart(SourceLocation LocBegin,
   return new (Allocator) BlockCommandComment(LocBegin, LocEnd, Name);
 }
 
-BlockCommandComment *Sema::actOnBlockCommandArgs(
-                              BlockCommandComment *Command,
-                              ArrayRef<BlockCommandComment::Argument> Args) {
+void Sema::actOnBlockCommandArgs(BlockCommandComment *Command,
+                                 ArrayRef<BlockCommandComment::Argument> Args) {
   Command->setArgs(Args);
-  return Command;
 }
 
-BlockCommandComment *Sema::actOnBlockCommandFinish(
-                              BlockCommandComment *Command,
-                              ParagraphComment *Paragraph) {
+void Sema::actOnBlockCommandFinish(BlockCommandComment *Command,
+                                   ParagraphComment *Paragraph) {
   Command->setParagraph(Paragraph);
   checkBlockCommandEmptyParagraph(Command);
   checkBlockCommandDuplicate(Command);
   checkReturnsCommand(Command);
-  return Command;
 }
 
 ParamCommandComment *Sema::actOnParamCommandStart(SourceLocation LocBegin,
@@ -74,11 +70,10 @@ ParamCommandComment *Sema::actOnParamCommandStart(SourceLocation LocBegin,
   return Command;
 }
 
-ParamCommandComment *Sema::actOnParamCommandDirectionArg(
-                                                ParamCommandComment *Command,
-                                                SourceLocation ArgLocBegin,
-                                                SourceLocation ArgLocEnd,
-                                                StringRef Arg) {
+void Sema::actOnParamCommandDirectionArg(ParamCommandComment *Command,
+                                         SourceLocation ArgLocBegin,
+                                         SourceLocation ArgLocEnd,
+                                         StringRef Arg) {
   ParamCommandComment::PassDirection Direction;
   std::string ArgLower = Arg.lower();
   // TODO: optimize: lower Name first (need an API in SmallString for that),
@@ -128,14 +123,12 @@ ParamCommandComment *Sema::actOnParamCommandDirectionArg(
         << ArgRange;
   }
   Command->setDirection(Direction, /* Explicit = */ true);
-  return Command;
 }
 
-ParamCommandComment *Sema::actOnParamCommandParamNameArg(
-                                                ParamCommandComment *Command,
-                                                SourceLocation ArgLocBegin,
-                                                SourceLocation ArgLocEnd,
-                                                StringRef Arg) {
+void Sema::actOnParamCommandParamNameArg(ParamCommandComment *Command,
+                                         SourceLocation ArgLocBegin,
+                                         SourceLocation ArgLocEnd,
+                                         StringRef Arg) {
   // Parser will not feed us more arguments than needed.
   assert(Command->getNumArgs() == 0);
 
@@ -151,7 +144,7 @@ ParamCommandComment *Sema::actOnParamCommandParamNameArg(
 
   if (!isFunctionDecl()) {
     // We already warned that this \\param is not attached to a function decl.
-    return Command;
+    return;
   }
 
   ArrayRef<const ParmVarDecl *> ParamVars = getParamVars();
@@ -169,7 +162,7 @@ ParamCommandComment *Sema::actOnParamCommandParamNameArg(
         << PrevCommand->getParamNameRange();
     }
     ParamVarDocs[ResolvedParamIndex] = Command;
-    return Command;
+    return;
   }
 
   SourceRange ArgRange(ArgLocBegin, ArgLocEnd);
@@ -178,7 +171,7 @@ ParamCommandComment *Sema::actOnParamCommandParamNameArg(
 
   // No parameters -- can't suggest a correction.
   if (ParamVars.size() == 0)
-    return Command;
+    return;
 
   unsigned CorrectedParamIndex = ParamCommandComment::InvalidParamIndex;
   if (ParamVars.size() == 1) {
@@ -197,14 +190,13 @@ ParamCommandComment *Sema::actOnParamCommandParamNameArg(
         << FixItHint::CreateReplacement(ArgRange, CorrectedII->getName());
   }
 
-  return Command;
+  return;
 }
 
-ParamCommandComment *Sema::actOnParamCommandFinish(ParamCommandComment *Command,
-                                                   ParagraphComment *Paragraph) {
+void Sema::actOnParamCommandFinish(ParamCommandComment *Command,
+                                   ParagraphComment *Paragraph) {
   Command->setParagraph(Paragraph);
   checkBlockCommandEmptyParagraph(Command);
-  return Command;
 }
 
 TParamCommandComment *Sema::actOnTParamCommandStart(SourceLocation LocBegin,
@@ -221,11 +213,10 @@ TParamCommandComment *Sema::actOnTParamCommandStart(SourceLocation LocBegin,
   return Command;
 }
 
-TParamCommandComment *Sema::actOnTParamCommandParamNameArg(
-                                            TParamCommandComment *Command,
-                                            SourceLocation ArgLocBegin,
-                                            SourceLocation ArgLocEnd,
-                                            StringRef Arg) {
+void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command,
+                                          SourceLocation ArgLocBegin,
+                                          SourceLocation ArgLocEnd,
+                                          StringRef Arg) {
   // Parser will not feed us more arguments than needed.
   assert(Command->getNumArgs() == 0);
 
@@ -237,7 +228,7 @@ TParamCommandComment *Sema::actOnTParamCommandParamNameArg(
 
   if (!isTemplateDecl()) {
     // We already warned that this \\tparam is not attached to a template decl.
-    return Command;
+    return;
   }
 
   const TemplateParameterList *TemplateParameters =
@@ -256,7 +247,7 @@ TParamCommandComment *Sema::actOnTParamCommandParamNameArg(
         << PrevCommand->getParamNameRange();
     }
     TemplateParameterDocs[Arg] = Command;
-    return Command;
+    return;
   }
 
   SourceRange ArgRange(ArgLocBegin, ArgLocEnd);
@@ -264,7 +255,7 @@ TParamCommandComment *Sema::actOnTParamCommandParamNameArg(
     << Arg << ArgRange;
 
   if (!TemplateParameters || TemplateParameters->size() == 0)
-    return Command;
+    return;
 
   StringRef CorrectedName;
   if (TemplateParameters->size() == 1) {
@@ -282,15 +273,13 @@ TParamCommandComment *Sema::actOnTParamCommandParamNameArg(
       << FixItHint::CreateReplacement(ArgRange, CorrectedName);
   }
 
-  return Command;
+  return;
 }
 
-TParamCommandComment *Sema::actOnTParamCommandFinish(
-                                            TParamCommandComment *Command,
-                                            ParagraphComment *Paragraph) {
+void Sema::actOnTParamCommandFinish(TParamCommandComment *Command,
+                                    ParagraphComment *Paragraph) {
   Command->setParagraph(Paragraph);
   checkBlockCommandEmptyParagraph(Command);
-  return Command;
 }
 
 InlineCommandComment *Sema::actOnInlineCommand(SourceLocation CommandLocBegin,
@@ -353,14 +342,13 @@ VerbatimBlockLineComment *Sema::actOnVerbatimBlockLine(SourceLocation Loc,
   return new (Allocator) VerbatimBlockLineComment(Loc, Text);
 }
 
-VerbatimBlockComment *Sema::actOnVerbatimBlockFinish(
+void Sema::actOnVerbatimBlockFinish(
                             VerbatimBlockComment *Block,
                             SourceLocation CloseNameLocBegin,
                             StringRef CloseName,
                             ArrayRef<VerbatimBlockLineComment *> Lines) {
   Block->setCloseName(CloseName, CloseNameLocBegin);
   Block->setLines(Lines);
-  return Block;
 }
 
 VerbatimLineComment *Sema::actOnVerbatimLine(SourceLocation LocBegin,
@@ -380,7 +368,7 @@ HTMLStartTagComment *Sema::actOnHTMLStartTagStart(SourceLocation LocBegin,
   return new (Allocator) HTMLStartTagComment(LocBegin, TagName);
 }
 
-HTMLStartTagComment *Sema::actOnHTMLStartTagFinish(
+void Sema::actOnHTMLStartTagFinish(
                               HTMLStartTagComment *Tag,
                               ArrayRef<HTMLStartTagComment::Attribute> Attrs,
                               SourceLocation GreaterLoc,
@@ -391,7 +379,6 @@ HTMLStartTagComment *Sema::actOnHTMLStartTagFinish(
     Tag->setSelfClosing();
   else if (!isHTMLEndTagForbidden(Tag->getTagName()))
     HTMLOpenTags.push_back(Tag);
-  return Tag;
 }
 
 HTMLEndTagComment *Sema::actOnHTMLEndTag(SourceLocation LocBegin,