1 // parameters.h -- general parameters for a link using gold -*- C++ -*-
3 #ifndef GOLD_PARAMETERS_H
4 #define GOLD_PARAMETERS_H
11 // Here we define the Parameters class which simply holds simple
12 // general parameters which apply to the entire link. We use a global
13 // variable for this. This is in contrast to the General_options
14 // class, which holds the complete state of position independent
15 // command line options. The hope is that Parameters will stay fairly
16 // simple, so that if this turns into a library it will be clear how
17 // these parameters should be set.
22 Parameters(const General_options*);
24 // Whether we are generating a regular executable.
26 output_is_executable() const
27 { return this->output_file_type_ == OUTPUT_EXECUTABLE; }
29 // Whether we are generating a shared library.
31 output_is_shared() const
32 { return this->output_file_type_ == OUTPUT_SHARED; }
34 // Whether we are generating an object file.
36 output_is_object() const
37 { return this->output_file_type_ == OUTPUT_OBJECT; }
39 // The general linker optimization level.
41 optimization_level() const
42 { return this->optimization_level_; }
45 // The types of output files.
48 // Generating executable.
50 // Generating shared library.
52 // Generating object file.
56 // The type of the output file.
57 Output_file_type output_file_type_;
58 // The optimization level.
59 int optimization_level_;
62 // This is a global variable.
63 extern const Parameters* parameters;
65 // Initialize the global variable.
66 extern void initialize_parameters(const General_options*);
68 } // End namespace gold.
70 #endif // !defined(GOLD_PARAMATERS_H)