chore: llgen -abi flags (default 0)
This commit is contained in:
@@ -27,12 +27,12 @@ import (
|
||||
)
|
||||
|
||||
func GenFrom(fileOrPkg string) string {
|
||||
pkg, err := genFrom(fileOrPkg)
|
||||
pkg, err := genFrom(fileOrPkg, 0)
|
||||
check(err)
|
||||
return pkg.LPkg.String()
|
||||
}
|
||||
|
||||
func genFrom(pkgPath string) (build.Package, error) {
|
||||
func genFrom(pkgPath string, abiMode build.AbiMode) (build.Package, error) {
|
||||
oldDbg := os.Getenv("LLGO_DEBUG")
|
||||
oldDbgSyms := os.Getenv("LLGO_DEBUG_SYMBOLS")
|
||||
dbg := isDbgSymEnabled(filepath.Join(pkgPath, "flags.txt"))
|
||||
@@ -46,8 +46,9 @@ func genFrom(pkgPath string) (build.Package, error) {
|
||||
}()
|
||||
|
||||
conf := &build.Config{
|
||||
Mode: build.ModeGen,
|
||||
AppExt: build.DefaultAppExt(runtime.GOOS),
|
||||
Mode: build.ModeGen,
|
||||
AbiMode: abiMode,
|
||||
AppExt: build.DefaultAppExt(runtime.GOOS),
|
||||
}
|
||||
pkgs, err := build.Do([]string{pkgPath}, conf)
|
||||
if err != nil {
|
||||
@@ -77,7 +78,11 @@ func isDbgSymEnabled(flagsFile string) bool {
|
||||
}
|
||||
|
||||
func SmartDoFile(pkgPath string) {
|
||||
pkg, err := genFrom(pkgPath)
|
||||
SmartDoFileEx(pkgPath, 0)
|
||||
}
|
||||
|
||||
func SmartDoFileEx(pkgPath string, abiMode build.AbiMode) {
|
||||
pkg, err := genFrom(pkgPath, abiMode)
|
||||
check(err)
|
||||
|
||||
const autgenFile = "llgo_autogen.ll"
|
||||
|
||||
Reference in New Issue
Block a user