Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/go.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ jobs:
strategy:
matrix:
llvm: [14, 15, 16, 17, 18, 19]
go-version: [1.18.x, 1.21.x, 1.22.x]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
go-version: '1.22'
#- name: Update Homebrew
# if: matrix.llvm == 17 # needed as long as LLVM 17 is still fresh
# run: brew update
Expand Down
10 changes: 1 addition & 9 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Go bindings to system LLVM

[![Build Status](https://github.com/goplus/llvm/actions/workflows/go.yml/badge.svg)](https://github.com/goplus/llvm/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/goplus/llvm)](https://goreportcard.com/report/github.com/goplus/llvm)
[![GoDoc](https://pkg.go.dev/badge/github.com/goplus/llvm.svg)](https://pkg.go.dev/github.com/goplus/llvm)
<!--
[![GitHub release](https://img.shields.io/github/v/tag/goplus/llvm.svg?label=release)](https://github.com/goplus/llvm/releases)
[![Coverage Status](https://codecov.io/gh/goplus/llvm/branch/main/graph/badge.svg)](https://codecov.io/gh/goplus/llvm)
-->

This library provides bindings to a system-installed LLVM.

Currently supported:
Expand All @@ -24,7 +16,7 @@ to use LLVM 17.

If you have a supported LLVM installation, you should be able to do a simple `go get`:

go get github.com/goplus/llvm
go get tinygo.org/x/go-llvm

You can use build tags to select a LLVM version. For example, use `-tags=llvm15` to select LLVM 15. Setting a build tag for a LLVM version that is not supported will be ignored.

Expand Down
14 changes: 0 additions & 14 deletions backports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,3 @@ void LLVMGoDIBuilderInsertDbgValueRecordAtEnd(
LLVMDIBuilderInsertDbgValueAtEnd(Builder, Val, VarInfo, Expr, DebugLoc, Block);
#endif
}

void LLVMGoDIBuilderInsertDbgDeclareRecordAtEnd(
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block) {
#if LLVM_VERSION_MAJOR >= 19
// Note: this returns a LLVMDbgRecordRef. Previously, InsertDeclareAtEnd would
// return a Declare. But since the type changed, and I'd like to keep the API
// consistent across LLVM versions, I decided to drop the return value.
LLVMDIBuilderInsertDeclareRecordAtEnd(Builder, Val, VarInfo, Expr, DebugLoc, Block);
#else
// Old llvm.dbg.* API.
LLVMDIBuilderInsertDeclareAtEnd(Builder, Val, VarInfo, Expr, DebugLoc, Block);
#endif
}
4 changes: 0 additions & 4 deletions backports.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ void LLVMGoDIBuilderInsertDbgValueRecordAtEnd(
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);

void LLVMGoDIBuilderInsertDbgDeclareRecordAtEnd(
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);

#ifdef __cplusplus
}
#endif /* defined(__cplusplus) */
8 changes: 0 additions & 8 deletions dibuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,6 @@ func (d *DIBuilder) CreateExpression(addr []uint64) Metadata {
return Metadata{C: result}
}

// InsertDeclareAtEnd inserts a call to llvm.dbg.declare at the end of the
// specified basic block for the given value and associated debug metadata.
func (d *DIBuilder) InsertDeclareAtEnd(v Value, diVarInfo, expr Metadata, l DebugLoc, bb BasicBlock) {
loc := C.LLVMDIBuilderCreateDebugLocation(
d.m.Context().C, C.uint(l.Line), C.uint(l.Col), l.Scope.C, l.InlinedAt.C)
C.LLVMGoDIBuilderInsertDbgDeclareRecordAtEnd(d.ref, v.C, diVarInfo.C, expr.C, loc, bb.C)
}

// InsertValueAtEnd inserts a call to llvm.dbg.value at the end of the
// specified basic block for the given value and associated debug metadata.
func (d *DIBuilder) InsertValueAtEnd(v Value, diVarInfo, expr Metadata, l DebugLoc, bb BasicBlock) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/goplus/llvm
module tinygo.org/x/go-llvm

go 1.14
10 changes: 0 additions & 10 deletions llvm_config_windows_llvm20.go

This file was deleted.

6 changes: 2 additions & 4 deletions llvm_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package llvm_test

import (
"testing"
import "tinygo.org/x/go-llvm"

"github.com/goplus/llvm"
)
import "testing"

// Dummy test function.
// All it does is test whether we can use LLVM at all.
Expand Down
234 changes: 0 additions & 234 deletions z_llvmext.go

This file was deleted.

Loading