Declare variable on first use.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 6 Jul 2014 14:31:22 +0000 (14:31 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 6 Jul 2014 14:31:22 +0000 (14:31 +0000)
llvm-svn: 212403

llvm/tools/gold/gold-plugin.cpp

index 343a739..6d52f62 100644 (file)
@@ -261,12 +261,11 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
   return LDPS_OK;
 }
 
-/// claim_file_hook - called by gold to see whether this file is one that
-/// our plugin can handle. We'll try to open it and register all the symbols
-/// with add_symbol if possible.
+/// Called by gold to see whether this file is one that our plugin can handle.
+/// We'll try to open it and register all the symbols with add_symbol if
+/// possible.
 static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
                                         int *claimed) {
-  LTOModule *M;
   const void *view;
   std::unique_ptr<MemoryBuffer> buffer;
   if (get_view) {
@@ -293,7 +292,8 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
     return LDPS_OK;
 
   std::string Error;
-  M = LTOModule::createFromBuffer(view, file->filesize, TargetOpts, Error);
+  LTOModule *M =
+      LTOModule::createFromBuffer(view, file->filesize, TargetOpts, Error);
   if (!M) {
     (*message)(LDPL_ERROR,
                "LLVM gold plugin has failed to create LTO module: %s",