<div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 17, 2012 at 1:54 AM, Jin-Gu Kang <span dir="ltr"><<a href="mailto:jaykang10@imrc.kist.re.kr" target="_blank" class="cremed">jaykang10@imrc.kist.re.kr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jaykang10<br>
Date: Fri Aug 17 03:54:57 2012<br>
New Revision: 162090<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=162090&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=162090&view=rev</a><br>
Log:<br>
Insertion of NoFolder functions to avoid ambiguous overload warnings or errors about whether to convert Idx to ArrayRef<Constant *> or ArrayRef<Value *> like ConstantFolder and TargetFolder.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/Support/NoFolder.h<br>
<br>
Modified: llvm/trunk/include/llvm/Support/NoFolder.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/NoFolder.h?rev=162090&r1=162089&r2=162090&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/NoFolder.h?rev=162090&r1=162089&r2=162090&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/include/llvm/Support/NoFolder.h (original)<br>
+++ llvm/trunk/include/llvm/Support/NoFolder.h Fri Aug 17 03:54:57 2012<br>
@@ -181,6 +181,12 @@<br>
                                 ArrayRef<Constant *> IdxList) const {<br>
     return ConstantExpr::getGetElementPtr(C, IdxList);<br>
   }<br>
+  Constant *CreateGetElementPtr(Constant *C, Constant *Idx) const {<br>
+    // This form of the function only exists to avoid ambiguous overload<br>
+    // warnings about whether to convert Idx to ArrayRef<Constant *> or<br>
+    // ArrayRef<Value *>.<br></blockquote><div><br></div><div>This comment doesn't seem right at all -- this function doesn't accept anything to do with ArrayRef. The comment seems copy/pasted from the edit below where it is correct, but it needs updating for this signature.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+    return ConstantExpr::getGetElementPtr(C, Idx);<br>
+  }<br>
   Instruction *CreateGetElementPtr(Constant *C,<br>
                                    ArrayRef<Value *> IdxList) const {<br>
     return GetElementPtrInst::Create(C, IdxList);<br>
@@ -190,6 +196,12 @@<br>
                                         ArrayRef<Constant *> IdxList) const {<br>
     return ConstantExpr::getInBoundsGetElementPtr(C, IdxList);<br>
   }<br>
+  Constant *CreateInBoundsGetElementPtr(Constant *C, Constant *Idx) const {<br>
+    // This form of the function only exists to avoid ambiguous overload<br>
+    // warnings about whether to convert Idx to ArrayRef<Constant *> or<br>
+    // ArrayRef<Value *>.<br>
+    return ConstantExpr::getInBoundsGetElementPtr(C, Idx);<br>
+  }<br>
   Instruction *CreateInBoundsGetElementPtr(Constant *C,<br>
                                            ArrayRef<Value *> IdxList) const {<br>
     return GetElementPtrInst::CreateInBounds(C, IdxList);<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>