From d853576c9596ec7cd3379b1e8d42430f708e1b49 Mon Sep 17 00:00:00 2001 From: "Ian A. Mason" Date: Tue, 13 Oct 2020 08:46:41 -0700 Subject: [PATCH] Tweaks for v1.2.8 --- cmd/gparse/main.go | 3 ++- shared/compiler.go | 2 +- shared/constants.go | 5 +++-- shared/parser.go | 3 ++- tests/parsing_test.go | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/gparse/main.go b/cmd/gparse/main.go index ea0b3f8..c742a00 100644 --- a/cmd/gparse/main.go +++ b/cmd/gparse/main.go @@ -45,5 +45,6 @@ func main() { args = args[1:] parsed := shared.Parse(args) // Print out the result - fmt.Printf("Parsed: %v", &parsed) + fmt.Printf("parsed: %v\n", &parsed) + fmt.Printf("parsed.SkipBitcodeGeneration() = %v\n", parsed.SkipBitcodeGeneration()) } diff --git a/shared/compiler.go b/shared/compiler.go index 2c17c7b..7485797 100644 --- a/shared/compiler.go +++ b/shared/compiler.go @@ -67,7 +67,7 @@ func Compile(args []string, compiler string) (exitCode int) { LogDebug("Compile using parsed arguments:%v\n", &pr) // If configure only, emit-llvm, flto, or print only are set, just execute the compiler - if pr.skipBitcodeGeneration() { + if pr.SkipBitcodeGeneration() { wg.Add(1) go execCompile(compilerExecName, pr, &wg, &ok) wg.Wait() diff --git a/shared/constants.go b/shared/constants.go index 60dd211..1448cb0 100644 --- a/shared/constants.go +++ b/shared/constants.go @@ -54,10 +54,11 @@ package shared // // 1.2.7 August 4 2020 William Woodruff's (@woodruffw) tweaks to the get-bc command (a strict mode). // -// 1.2.8 October 12 2020 Wensheng Tang's (@legendtang) requests and fixes to the -flto issues. +// 1.2.8 October 13 2020 Wensheng Tang's (@legendtang) requests and fixes to the -flto issues (issue #39). +// Added support for the LTO_LINKING_FLAGS environment variable. const gllvmVersion = "1.2.8" -const gllvmReleaseDate = "October 12 2020" +const gllvmReleaseDate = "October 13 2020" const osDARWIN = "darwin" const osLINUX = "linux" diff --git a/shared/parser.go b/shared/parser.go index a632dbc..6b18a93 100644 --- a/shared/parser.go +++ b/shared/parser.go @@ -112,7 +112,8 @@ type argPattern struct { finfo flagInfo } -func (pr *ParserResult) skipBitcodeGeneration() bool { +//SkipBitcodeGeneration indicates whether or not we should generate bitcode for these command line options. +func (pr *ParserResult) SkipBitcodeGeneration() bool { reason := "No particular reason" retval := false squark := LogDebug diff --git a/tests/parsing_test.go b/tests/parsing_test.go index a5693ba..a25f3ee 100644 --- a/tests/parsing_test.go +++ b/tests/parsing_test.go @@ -18,6 +18,7 @@ const input3 = `1.c 2.c 3.c 4.c 5.c -Wl,--start-group 7.o 8.o 9.o -Wl,--end-grou func plto(input string, t *testing.T) { cmds := strings.Fields(input) parsed := shared.Parse(cmds) + shared.LogInfo("\n%v", &parsed) if !parsed.IsLTO { t.Errorf("Parsing of %v FAILED %v (not LTO)\n", input, parsed) } @@ -26,6 +27,7 @@ func plto(input string, t *testing.T) { func pl(input string, t *testing.T, expected int) { cmds := strings.Fields(input) parsed := shared.Parse(cmds) + shared.LogInfo("\n%v", &parsed) if expected != len(parsed.LinkArgs) { t.Errorf("Linking args %v of length %v NOT the expected length %v\n", parsed.LinkArgs, len(parsed.LinkArgs), expected) }