Author: Michael Kruse Date: 2021-11-05T00:43:40-05:00 New Revision: 8f099d17a1bee857ada3c5af032cfcb559252024
URL: https://github.com/llvm/llvm-project/commit/8f099d17a1bee857ada3c5af032cfcb559252024 DIFF: https://github.com/llvm/llvm-project/commit/8f099d17a1bee857ada3c5af032cfcb559252024.diff LOG: [Preprocessor] Fix warning: left and right subexpressions are identical. NFCI. This is reported by msvc as warning C6287: redundant code: the left and right subexpressions are identical EmittedDirectiveOnThisLine implies EmittedTokensOnThisLine making this an NFC change. To be on the safe side and because both of them are checked at other places as well, we continue to check both. Compiler warning reported here: https://reviews.llvm.org/D104601#2957333 Added: Modified: clang/lib/Frontend/PrintPreprocessedOutput.cpp Removed: ################################################################################ diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 360fa1448b128..fadf0c054310d 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -700,7 +700,7 @@ void PrintPPOutputPPCallbacks::HandleWhitespaceBeforeTok(const Token &Tok, // - The whitespace is necessary to keep the tokens apart and there is not // already a newline between them if (RequireSpace || (!MinimizeWhitespace && Tok.hasLeadingSpace()) || - ((EmittedTokensOnThisLine || EmittedTokensOnThisLine) && + ((EmittedTokensOnThisLine || EmittedDirectiveOnThisLine) && AvoidConcat(PrevPrevTok, PrevTok, Tok))) OS << ' '; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits