[PATCH] D41421: Eliminate a magic number. NFC.
Paul Robinson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 3 12:30:58 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rC321757: Calculate size of buffer instead of using a magic value. (authored by probinson, committed by ).
Repository:
rC Clang
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.128549.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180103/8ebba533/attachment.bin>
More information about the cfe-commits
mailing list