diff --git a/cl/compile.go b/cl/compile.go new file mode 100644 index 00000000..fee33ce6 --- /dev/null +++ b/cl/compile.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023 The GoPlus Authors (goplus.org). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cl + +import ( + "github.com/goplus/llgo/loader" + llvm "tinygo.org/x/go-llvm" +) + +type Config struct { +} + +func NewPackage(pkg loader.Package, conf *Config) (ret llvm.Module, err error) { + return +} diff --git a/go.mod b/go.mod index aafa6d3c..1bba388f 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,8 @@ module github.com/goplus/llgo go 1.18 + +require ( + golang.org/x/tools v0.16.0 + tinygo.org/x/go-llvm v0.0.0-20231014233752-75a8a9fe6f74 +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..051066db --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= +golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +tinygo.org/x/go-llvm v0.0.0-20231014233752-75a8a9fe6f74 h1:tW8XhLI9gUZLL+2pG0HYb5dc6bpMj1aqtESpizXPnMY= +tinygo.org/x/go-llvm v0.0.0-20231014233752-75a8a9fe6f74/go.mod h1:GFbusT2VTA4I+l4j80b17KFK+6whv69Wtny5U+T8RR0= diff --git a/loader/loader.go b/loader/loader.go new file mode 100644 index 00000000..d252d88b --- /dev/null +++ b/loader/loader.go @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 The GoPlus Authors (goplus.org). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package loader + +import ( + "golang.org/x/tools/go/ssa" +) + +type Package struct { + SSA *ssa.Package +}