From: Alp Toker Date: Sat, 7 Dec 2013 13:51:26 +0000 (+0000) Subject: CommentLexer: eliminate an NDEBUG from the headers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65e21292daa1a68469fc0e4bef912b6a616c3c70;p=clang CommentLexer: eliminate an NDEBUG from the headers Code in headers shouldn't be conditional on the build configuration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196656 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/CommentLexer.h b/include/clang/AST/CommentLexer.h index f152c778c9..418fe0fbb6 100644 --- a/include/clang/AST/CommentLexer.h +++ b/include/clang/AST/CommentLexer.h @@ -293,17 +293,7 @@ private: StringRef resolveHTMLHexCharacterReference(StringRef Name) const; void formTokenWithChars(Token &Result, const char *TokEnd, - tok::TokenKind Kind) { - const unsigned TokLen = TokEnd - BufferPtr; - Result.setLocation(getSourceLocation(BufferPtr)); - Result.setKind(Kind); - Result.setLength(TokLen); -#ifndef NDEBUG - Result.TextPtr = ""; - Result.IntVal = 7; -#endif - BufferPtr = TokEnd; - } + tok::TokenKind Kind); void formTextToken(Token &Result, const char *TokEnd) { StringRef Text(BufferPtr, TokEnd - BufferPtr); diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp index 01ed3ce80a..792a832044 100644 --- a/lib/AST/CommentLexer.cpp +++ b/lib/AST/CommentLexer.cpp @@ -268,6 +268,19 @@ const char *findCCommentEnd(const char *BufferPtr, const char *BufferEnd) { } // unnamed namespace +void Lexer::formTokenWithChars(Token &Result, const char *TokEnd, + tok::TokenKind Kind) { + const unsigned TokLen = TokEnd - BufferPtr; + Result.setLocation(getSourceLocation(BufferPtr)); + Result.setKind(Kind); + Result.setLength(TokLen); +#ifndef NDEBUG + Result.TextPtr = ""; + Result.IntVal = 7; +#endif + BufferPtr = TokEnd; +} + void Lexer::lexCommentText(Token &T) { assert(CommentState == LCS_InsideBCPLComment || CommentState == LCS_InsideCComment);