* options.h (Command_line::Pre_options): New class.

(Command_line::pre_options): New member.
	* options.cc (gold::options::ready_to_register): New variable.
	(One_option::register_option): Do nothing if not registering options.
	Assert if same short option registered twice.
	(General_options::General_options): Turn off option registration when
	done constructing.
	(Command_line::Pre_options::Pre_options): New constructor.
This commit is contained in:
Cary Coutant
2009-08-25 01:10:48 +00:00
parent c1af96a0c5
commit 293c13867a
3 changed files with 42 additions and 1 deletions

View File

@@ -1479,6 +1479,16 @@ class Command_line
Command_line(const Command_line&);
Command_line& operator=(const Command_line&);
// This is a dummy class to provide a constructor that runs before
// the constructor for the General_options. The Pre_options constructor
// is used as a hook to set the flag enabling the options to register
// themselves.
struct Pre_options {
Pre_options();
};
// This must come before options_!
Pre_options pre_options_;
General_options options_;
Position_dependent_options position_options_;
Script_options script_options_;