[llvm] r176604 - ArrayRef has a OneElt constructor. Beautify the code.

Nadav Rotem nrotem at apple.com
Wed Mar 6 17:38:04 PST 2013


Author: nadav
Date: Wed Mar  6 19:38:04 2013
New Revision: 176604

URL: http://llvm.org/viewvc/llvm-project?rev=176604&view=rev
Log:
ArrayRef has a OneElt constructor. Beautify the code.

Modified:
    llvm/trunk/lib/IR/Constants.cpp

Modified: llvm/trunk/lib/IR/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Constants.cpp?rev=176604&r1=176603&r2=176604&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Constants.cpp (original)
+++ llvm/trunk/lib/IR/Constants.cpp Wed Mar  6 19:38:04 2013
@@ -1417,8 +1417,7 @@ static inline Constant *getFoldedCast(
   LLVMContextImpl *pImpl = Ty->getContext().pImpl;
 
   // Look up the constant in the table first to ensure uniqueness.
-  ArrayRef<Constant*> Ops(&C, 1);
-  ExprMapKeyType Key(opc, Ops);
+  ExprMapKeyType Key(opc, C);
 
   return pImpl->ExprConstants.getOrCreate(Ty, Key);
 }





More information about the llvm-commits mailing list