<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19298">
<style title="owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">Thanks for your comment,</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">This comment means that this function's goal is to avoid ambigious overload error as following when we use NoFolder.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr">/llvm-3.1.src/include/llvm/Support/IRBuilder.h:841: error: call of overloaded ‘CreateGetElementPtr(llvm::Constant*&, llvm::Constant*&)’ is ambiguous<br>
/llvm-3.1.src/include/llvm/Support/NoFolder.h:180: note: candidates are: llvm::Constant* llvm::NoFolder::CreateGetElementPtr(llvm::Constant*, llvm::ArrayRef<llvm::Constant*>) const<br>
/llvm-3.1.src/include/llvm/Support/NoFolder.h:194: note: llvm::Instruction* llvm::NoFolder::CreateGetElementPtr(llvm::Constant*, llvm::ArrayRef<llvm::Value*>) const</div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">What do you think about this comment?</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr">"Insertion of NoFolder functions to avoid ambiguous overload warnings or errors like ConstantFolder and TargetFolder."</div>
<div dir="ltr"><font face="times new roman"></font> </div>
<div dir="ltr"><font face="times new roman">Thanks,</font></div>
<div dir="ltr"><font face="times new roman">Jin-Gu Kang</font></div>
<div dir="ltr">
<hr tabindex="-1">
</div>
<div dir="ltr"><font size="2" face="Tahoma"><b>From:</b> Chandler Carruth [chandlerc@google.com]<br>
<b>Sent:</b> Friday, August 17, 2012 6:01 PM<br>
<b>To:</b> Jin Gu Kang<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm-commits] [llvm] r162090 - /llvm/trunk/include/llvm/Support/NoFolder.h<br>
</font><br>
</div>
<div></div>
<div>
<div class="gmail_extra">
<div class="gmail_quote">On Fri, Aug 17, 2012 at 1:54 AM, Jin-Gu Kang <span dir="ltr">
<<a class="cremed" href="mailto:jaykang10@imrc.kist.re.kr">jaykang10@imrc.kist.re.kr</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
Author: jaykang10<br>
Date: Fri Aug 17 03:54:57 2012<br>
New Revision: 162090<br>
<br>
URL: <a class="cremed" href="http://llvm.org/viewvc/llvm-project?rev=162090&view=rev" target="_blank">
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 class="cremed" href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/NoFolder.h?rev=162090&r1=162089&r2=162090&view=diff" target="_blank">
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 style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
+ 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 class="cremed" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a class="cremed" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>