diff options
author | Paul Robinson <paul.robinson@sony.com> | 2018-01-03 20:29:49 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2018-01-03 20:29:49 +0000 |
commit | 4bb85ac54490ffdfa4cd747d06bb401bef69302c (patch) | |
tree | b110749f8362e06c02f6789413b4b80c245c95d3 /clang/lib/Frontend/PrintPreprocessedOutput.cpp | |
parent | f344987cad503e95e5cd727e1c9bec891269e32e (diff) | |
download | bcm5719-llvm-4bb85ac54490ffdfa4cd747d06bb401bef69302c.tar.gz bcm5719-llvm-4bb85ac54490ffdfa4cd747d06bb401bef69302c.zip |
Calculate size of buffer instead of using a magic value.
Patch by Matthew Davis!
Differential Revision: https://reviews.llvm.org/D41421
llvm-svn: 321757
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 2e023294f1e..36ecdada0c8 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -752,7 +752,7 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, } 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); |