r196656 - CommentLexer: eliminate an NDEBUG from the headers

Alp Toker alp at nuanti.com
Sat Dec 7 05:51:26 PST 2013


Author: alp
Date: Sat Dec  7 07:51:26 2013
New Revision: 196656

URL: http://llvm.org/viewvc/llvm-project?rev=196656&view=rev
Log:
CommentLexer: eliminate an NDEBUG from the headers

Code in headers shouldn't be conditional on the build configuration.

Modified:
    cfe/trunk/include/clang/AST/CommentLexer.h
    cfe/trunk/lib/AST/CommentLexer.cpp

Modified: cfe/trunk/include/clang/AST/CommentLexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentLexer.h?rev=196656&r1=196655&r2=196656&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CommentLexer.h (original)
+++ cfe/trunk/include/clang/AST/CommentLexer.h Sat Dec  7 07:51:26 2013
@@ -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 = "<UNSET>";
-    Result.IntVal = 7;
-#endif
-    BufferPtr = TokEnd;
-  }
+                          tok::TokenKind Kind);
 
   void formTextToken(Token &Result, const char *TokEnd) {
     StringRef Text(BufferPtr, TokEnd - BufferPtr);

Modified: cfe/trunk/lib/AST/CommentLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentLexer.cpp?rev=196656&r1=196655&r2=196656&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CommentLexer.cpp (original)
+++ cfe/trunk/lib/AST/CommentLexer.cpp Sat Dec  7 07:51:26 2013
@@ -268,6 +268,19 @@ const char *findCCommentEnd(const char *
     
 } // 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 = "<UNSET>";
+  Result.IntVal = 7;
+#endif
+  BufferPtr = TokEnd;
+}
+
 void Lexer::lexCommentText(Token &T) {
   assert(CommentState == LCS_InsideBCPLComment ||
          CommentState == LCS_InsideCComment);





More information about the cfe-commits mailing list