[PATCH] D41421: Eliminate a magic number. NFC.

Matt Davis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 17:57:17 PST 2017


mattd updated this revision to Diff 127641.
mattd added a comment.

Thanks for the suggestion Eli.  Took your initial suggestion.


https://reviews.llvm.org/D41421

Files:
  lib/Frontend/PrintPreprocessedOutput.cpp


Index: lib/Frontend/PrintPreprocessedOutput.cpp
===================================================================
--- lib/Frontend/PrintPreprocessedOutput.cpp
+++ lib/Frontend/PrintPreprocessedOutput.cpp
@@ -752,7 +752,7 @@
     } else if (Tok.isLiteral() && !Tok.needsCleaning() &&
                Tok.getLiteralData()) {
       OS.write(Tok.getLiteralData(), Tok.getLength());
-    } else if (Tok.getLength() < 256) {
+    } else if (Tok.getLength() < llvm::array_lengthof(Buffer)) {
       const char *TokPtr = Buffer;
       unsigned Len = PP.getSpelling(Tok, TokPtr);
       OS.write(TokPtr, Len);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41421.127641.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171220/8f461767/attachment.bin>


More information about the cfe-commits mailing list