public void EmitDebugLocation(Syntax.SyntaxNode pNode) { if (!_emitDebug) { return; } LLVMMetadataRef loc = GetCurrentDebugScope(); LLVMMetadataRef currentLine = Utils.LlvmPInvokes.LLVMDIBuilderCreateDebugLocation(_context, (uint)pNode.Span.Line, (uint)pNode.Span.Column, loc, default);
public LLVMValueRef AllocateVariable(string pName, Syntax.SyntaxNode pNode) { //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(pNode.Type, this), pName); EmitDebugVariable(b.Builder, alloc, pName, pNode.Type, pNode.Span.Line); return(alloc); } }
public void AddDeferredStatement(Syntax.SyntaxNode pNode) { Debug.Assert(_deferredStatements.Count > 0); _deferredStatements.Peek().Add(pNode); }