Exemplo n.º 1
0
        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);
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 public void AddDeferredStatement(Syntax.SyntaxNode pNode)
 {
     Debug.Assert(_deferredStatements.Count > 0);
     _deferredStatements.Peek().Add(pNode);
 }