From: Craig Topper Date: Wed, 19 Apr 2017 21:02:45 +0000 (+0000) Subject: [CodeGen] Use preincrement version of APInt::operator++ instead of postincrement... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7769fb2cf35fa115bcd43e7885614dc6ba8802c2;p=clang [CodeGen] Use preincrement version of APInt::operator++ instead of postincrement to avoid creating and immediately discarding a temporary APInt. This is preparation for a clang change to improve the [[nodiscard]] warning to not be ignored on methods that return a class marked [[nodiscard]] that are defined in the class itself. See D32207. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300756 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 0ebfd99363..683f366ebe 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -1166,7 +1166,7 @@ void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) { if (Rem) Rem--; SwitchInsn->addCase(Builder.getInt(LHS), CaseDest); - LHS++; + ++LHS; } return; }