]> granicus.if.org Git - clang/commitdiff
Use const& for RHS.
authorDevang Patel <dpatel@apple.com>
Tue, 9 Oct 2007 17:10:59 +0000 (17:10 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 9 Oct 2007 17:10:59 +0000 (17:10 +0000)
Use copy for LHS, because it is incremented using ++ operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42792 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGStmt.cpp

index f9d614d91c45eb18e8b55db51b9cec335d05179b..8412ece2ed282663a41a2b18cf62f96a32f8499a 100644 (file)
@@ -365,7 +365,7 @@ void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) {
   llvm::ConstantInt *LV = cast<llvm::ConstantInt>(EmitScalarExpr(L));
   llvm::ConstantInt *RV = cast<llvm::ConstantInt>(EmitScalarExpr(R));
   llvm::APInt LHS = LV->getValue();
-  llvm::APInt RHS = RV->getValue();
+  const llvm::APInt &RHS = RV->getValue();
 
   llvm::APInt Range = RHS - LHS;
   if (Range.ult(llvm::APInt(Range.getBitWidth(), 64))) {