コード例 #1
0
 public LLVMValueRef AllocateArrayLiteral(SmallType pElementType, LLVMValueRef pSize)
 {
     using (var b = new VariableDeclarationBuilder(this))
     {
         var alloc = LLVM.BuildArrayAlloca(b.Builder, SmallTypeCache.GetLLVMType(pElementType, this), pSize, "");
         //EmitDebugVariable(b.Builder, alloc, pName, pNode.Type, pNode.Span.Line);
         return(alloc);
     }
 }
コード例 #2
0
 public LLVMValueRef AllocateVariable(string pName, SmallType pType)
 {
     //Move to the start of the current function and emit the variable allocation
     using (var b = new VariableDeclarationBuilder(this))
     {
         var alloc = LLVM.BuildAlloca(b.Builder, SmallTypeCache.GetLLVMType(pType, this), pName);
         EmitDebugVariable(b.Builder, alloc, pName, pType, 0);
         return(alloc);
     }
 }