@@ -50,7 +50,7 @@ import (
5050 "strings"
5151)
5252
53- //for distilling the desired commandline options
53+ //ExtractionArgs encapsulate the results of parsing the commandline options
5454type ExtractionArgs struct {
5555 Failure bool // indicates failure in parsing the cmd line args
5656 Verbose bool // inform the user of what is going on
@@ -91,6 +91,7 @@ ea.ArchiverName: %v
9191 ea .LlvmLinkerName , ea .ArchiverName )
9292}
9393
94+ //ParseSwitches parses the command line into an ExtractionArgs object.
9495func ParseSwitches (args []string ) (ea ExtractionArgs ) {
9596
9697 var flagSet * flag.FlagSet = flag .NewFlagSet (args [0 ], flag .ContinueOnError )
@@ -656,17 +657,16 @@ func linkBitcodeFiles(ea ExtractionArgs, filesToLink []string) (success bool) {
656657 }
657658 if getsize (filesToLink ) > argMax { //command line size too large for the OS (necessitated by chromium)
658659 return linkBitcodeFilesIncrementally (ea , filesToLink , argMax , linkArgs )
659- } else {
660- var err error
661- linkArgs = append (linkArgs , "-o" , ea .OutputFile )
662- linkArgs = append (linkArgs , filesToLink ... )
663- success , err = execCmd (ea .LlvmLinkerName , linkArgs , "" )
664- if ! success {
665- LogError ("There was an error linking input files into %s because %v.\n " , ea .OutputFile , err )
666- return
667- }
668- informUser ("Bitcode file extracted to: %s.\n " , ea .OutputFile )
669660 }
661+ var err error
662+ linkArgs = append (linkArgs , "-o" , ea .OutputFile )
663+ linkArgs = append (linkArgs , filesToLink ... )
664+ success , err = execCmd (ea .LlvmLinkerName , linkArgs , "" )
665+ if ! success {
666+ LogError ("There was an error linking input files into %s because %v.\n " , ea .OutputFile , err )
667+ return
668+ }
669+ informUser ("Bitcode file extracted to: %s.\n " , ea .OutputFile )
670670 success = true
671671 return
672672}
0 commit comments