<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 6/10/17 9:39 AM, Dipanjan Das via
      llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CAEK-7JLmgDUtC2SGGsAFMBCrrx0nWszgaz6L4igQYw29aeH=1Q@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div><br>
        </div>
        From the documentation, I can't understand the difference
        between AllocaInst::getType() vs AllocaInst::getAllocatedType()
        methods. Can anyone please enlighten me?<br>
      </div>
    </blockquote>
    <br>
    The AllocaInst instruction allocates stack memory.  The value that
    it returns is always a pointer to memory.<br>
    <br>
    You should run an experiment to double-check this, but I believe
    AllocaInst::getType() returns the type of the value that is the
    result of the alloca while AllocaInst::getAllocatedType() returns
    the type of the value that is allocated.  For example, if the alloca
    allocates a struct {int ; int}, then getAllocatedType() returns a
    struct type and getType() return a "pointer to struct" type.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CAEK-7JLmgDUtC2SGGsAFMBCrrx0nWszgaz6L4igQYw29aeH=1Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr"><span>
              <div>
                <div dir="ltr">
                  <p>Thanks & Regards,</p>
                  <div>Dipanjan</div>
                </div>
              </div>
            </span></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>