@@ -50,7 +50,7 @@ import (
50
50
"strings"
51
51
)
52
52
53
- //for distilling the desired commandline options
53
+ //ExtractionArgs encapsulate the results of parsing the commandline options
54
54
type ExtractionArgs struct {
55
55
Failure bool // indicates failure in parsing the cmd line args
56
56
Verbose bool // inform the user of what is going on
@@ -91,6 +91,7 @@ ea.ArchiverName: %v
91
91
ea .LlvmLinkerName , ea .ArchiverName )
92
92
}
93
93
94
+ //ParseSwitches parses the command line into an ExtractionArgs object.
94
95
func ParseSwitches (args []string ) (ea ExtractionArgs ) {
95
96
96
97
var flagSet * flag.FlagSet = flag .NewFlagSet (args [0 ], flag .ContinueOnError )
@@ -656,17 +657,16 @@ func linkBitcodeFiles(ea ExtractionArgs, filesToLink []string) (success bool) {
656
657
}
657
658
if getsize (filesToLink ) > argMax { //command line size too large for the OS (necessitated by chromium)
658
659
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 )
669
660
}
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 )
670
670
success = true
671
671
return
672
672
}
0 commit comments