<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><BASE href="x-msg://1694/">
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16671">
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-STYLE: normal; FONT-FAMILY: Verdana; COLOR: windowtext; FONT-WEIGHT: normal; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV><FONT color=#1b0000 size=2 face=Verdana>Than you John, It's very nice of 
you.</FONT></DIV>
<DIV><FONT color=#1b0000 size=2 face=Verdana></FONT> </DIV>
<DIV><FONT color=#1b0000 size=2 face=Verdana>Best Regards</FONT></DIV>
<DIV><FONT color=#1b0000></FONT> </DIV>
<DIV><FONT color=#1b0000 size=2 face=Verdana>2010-11-30 </FONT></DIV><FONT 
color=#1b0000 size=2 face=Verdana>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<DIV><FONT size=2 face=Verdana><FONT 
color=#1b0000><SPAN>-Wei</SPAN></FONT></FONT></DIV>
<HR color=#b5c4df SIZE=1>

<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG> John McCall </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发送时间:</STRONG> 2010-11-30  09:26:17 
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>收件人:</STRONG> huwei8717 </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG> llvmdev </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG> Re: [LLVMdev] the called 
function equal NULL </FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana><BR>
<DIV>
<DIV>On Nov 29, 2010, at 5:22 PM, huwei8717 wrote:</DIV><BR 
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite"><SPAN 
  style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" 
  class=Apple-style-span>
  <DIV style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
  <DIV><FONT size=2>Hi,</FONT></DIV>
  <DIV> </DIV>
  <DIV style="TEXT-INDENT: 2em">I have a llvm-pass in hand written by other 
  people. There are following statements that I couldn't understand:</DIV>
  <DIV style="TEXT-INDENT: 2em"> </DIV>
  <DIV 
  style="TEXT-INDENT: 2em">-------------------------------program----------------------------------------------------</DIV>
  <DIV style="TEXT-INDENT: 2em">
  <DIV>...</DIV>
  <DIV>if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) {</DIV>
  <DIV>    const CallSite cs(inst);</DIV>
  <DIV>    if (cs.getCalledFunction() == NULL)</DIV>
  <DIV>      return dealAtIndirectCall(cs);</DIV>
  <DIV>    else</DIV>
  <DIV>      return dealAtDirectCall(cs);</DIV>
  <DIV>}</DIV></DIV>
  <DIV style="TEXT-INDENT: 2em">...</DIV>
  <DIV 
  style="TEXT-INDENT: 2em">-------------------------------------------------------------------------------------------</DIV>
  <DIV style="TEXT-INDENT: 2em"> </DIV>
  <DIV style="TEXT-INDENT: 2em">My question is:</DIV>
  <DIV style="TEXT-INDENT: 2em"> </DIV>
  <DIV style="TEXT-INDENT: 2em">When does the called function equal NULL, 
  could you give an example?  I mean what kind of call in source code could 
  change to this case in llvm-IR, could you give an 
example?</DIV></DIV></SPAN></BLOCKQUOTE><BR></DIV>
<DIV>A call to a value of function-pointer type, e.g.</DIV>
<DIV>  void callit(void (*f)()) { f(); }</DIV><BR>
<DIV>Virtual calls in C++ would also have no known called function.</DIV>
<DIV><BR></DIV>
<DIV>John.</DIV></FONT></DIV></BODY></HTML>