[cfe-commits] r42792 - /cfe/trunk/CodeGen/CGStmt.cpp

Devang Patel dpatel at apple.com
Tue Oct 9 10:11:00 PDT 2007


Author: dpatel
Date: Tue Oct  9 12:10:59 2007
New Revision: 42792

URL: http://llvm.org/viewvc/llvm-project?rev=42792&view=rev
Log:
Use const& for RHS.
Use copy for LHS, because it is incremented using ++ operator.

Modified:
    cfe/trunk/CodeGen/CGStmt.cpp

Modified: cfe/trunk/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGStmt.cpp?rev=42792&r1=42791&r2=42792&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/CodeGen/CGStmt.cpp Tue Oct  9 12:10:59 2007
@@ -365,7 +365,7 @@
   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))) {





More information about the cfe-commits mailing list