From 8483dacfd804c71adc73764cee7f1304d1c8977c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 20 Jun 2014 01:37:35 +0000 Subject: Small clanups: Use static instead of anonymous namespace. Delete write only variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211335 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/gold/gold-plugin.cpp | 58 ++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) (limited to 'tools/gold/gold-plugin.cpp') diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 4e273de340..3c2da94af5 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -50,35 +50,30 @@ using namespace llvm; namespace { - ld_plugin_status discard_message(int level, const char *format, ...) { - // Die loudly. Recent versions of Gold pass ld_plugin_message as the first - // callback in the transfer vector. This should never be called. - abort(); - } +struct claimed_file { + void *handle; + std::vector syms; +}; +} - ld_plugin_add_symbols add_symbols = NULL; - ld_plugin_get_symbols get_symbols = NULL; - ld_plugin_add_input_file add_input_file = NULL; - ld_plugin_add_input_library add_input_library = NULL; - ld_plugin_set_extra_library_path set_extra_library_path = NULL; - ld_plugin_get_view get_view = NULL; - ld_plugin_message message = discard_message; - - int api_version = 0; - int gold_version = 0; - - struct claimed_file { - void *handle; - std::vector syms; - }; - - lto_codegen_model output_type = LTO_CODEGEN_PIC_MODEL_STATIC; - std::string output_name = ""; - std::list Modules; - std::vector Cleanup; - LTOCodeGenerator *CodeGen = nullptr; - StringSet<> CannotBeHidden; +static ld_plugin_status discard_message(int level, const char *format, ...) { + // Die loudly. Recent versions of Gold pass ld_plugin_message as the first + // callback in the transfer vector. This should never be called. + abort(); } + +static ld_plugin_add_symbols add_symbols = NULL; +static ld_plugin_get_symbols get_symbols = NULL; +static ld_plugin_add_input_file add_input_file = NULL; +static ld_plugin_set_extra_library_path set_extra_library_path = NULL; +static ld_plugin_get_view get_view = NULL; +static ld_plugin_message message = discard_message; +static lto_codegen_model output_type = LTO_CODEGEN_PIC_MODEL_STATIC; +static std::string output_name = ""; +static std::list Modules; +static std::vector Cleanup; +static LTOCodeGenerator *CodeGen = nullptr; +static StringSet<> CannotBeHidden; static llvm::TargetOptions TargetOpts; namespace options { @@ -151,12 +146,6 @@ ld_plugin_status onload(ld_plugin_tv *tv) { for (; tv->tv_tag != LDPT_NULL; ++tv) { switch (tv->tv_tag) { - case LDPT_API_VERSION: - api_version = tv->tv_u.tv_val; - break; - case LDPT_GOLD_VERSION: // major * 100 + minor - gold_version = tv->tv_u.tv_val; - break; case LDPT_OUTPUT_NAME: output_name = tv->tv_u.tv_string; break; @@ -213,9 +202,6 @@ ld_plugin_status onload(ld_plugin_tv *tv) { case LDPT_ADD_INPUT_FILE: add_input_file = tv->tv_u.tv_add_input_file; break; - case LDPT_ADD_INPUT_LIBRARY: - add_input_library = tv->tv_u.tv_add_input_file; - break; case LDPT_SET_EXTRA_LIBRARY_PATH: set_extra_library_path = tv->tv_u.tv_set_extra_library_path; break; -- cgit v1.2.3