title: How to create LLVM Array type using AllocaInst?
body: <p>I want to create LLVM ArrayType on stack so I wanted to use <code>AllocaInst (Type *Ty, Value *ArraySize=nullptr, const Twine &amp;Name="", Instruction *InsertBefore=nullptr)</code>. The problem is I don't understand this interface. I guessed that <code>Ty</code> will be something like <code>ArrayType::get(I.getType(), 4)</code>, but what should I give for <code>ArraySize</code>. Furthermore, it requires <code>Value*</code>, so it confused me a lot.</p>
  
  <p>Either I misunderstood llvm alloc or I need to provide a llvm constant as a value for array size. If I have to give the constant, isn't it little bit redundant since <code>ArrayType</code> contains the numElement as an information.</p>
  
  <p>As an example line of code, the way I am trying to:</p>
  
  <pre><code>AllocaInst* arr_alloc = new AllocaInst(ArrayType::get(I.getType(), num)
                                         /*, What is this parameter for?*/,
                                         "",
                                         funcEntry.getFirstInsertionPt());
  </code></pre>