Skip to content

Commit

Permalink
Tweaks for v1.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ianamason committed Oct 13, 2020
1 parent 83f0074 commit d853576
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cmd/gparse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
2 changes: 1 addition & 1 deletion shared/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions shared/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion shared/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/parsing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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<parsed>%v</parsed>", &parsed)
if !parsed.IsLTO {
t.Errorf("Parsing of %v FAILED %v (not LTO)\n", input, parsed)
}
Expand All @@ -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<parsed>%v</parsed>", &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)
}
Expand Down

0 comments on commit d853576

Please sign in to comment.