From 293c13867ae768c9c51a8f5d8d7ddf59b9cff58e Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 25 Aug 2009 01:10:48 +0000 Subject: * 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. --- gold/options.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gold/options.h') diff --git a/gold/options.h b/gold/options.h index 359866e..3f14529 100644 --- a/gold/options.h +++ b/gold/options.h @@ -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_; -- cgit v1.1