[PATCH] D101542: [NFC] Refactor ExecuteAssembler in cc1as_main.cpp

Scott Linder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 30 10:13:42 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcab19d84ce85: [NFC] Refactor ExecuteAssembler in cc1as_main.cpp (authored by scott.linder).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101542/new/

https://reviews.llvm.org/D101542

Files:
  clang/tools/driver/cc1as_main.cpp


Index: clang/tools/driver/cc1as_main.cpp
===================================================================
--- clang/tools/driver/cc1as_main.cpp
+++ clang/tools/driver/cc1as_main.cpp
@@ -333,8 +333,8 @@
   return Out;
 }
 
-static bool ExecuteAssembler(AssemblerInvocation &Opts,
-                             DiagnosticsEngine &Diags) {
+static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
+                                 DiagnosticsEngine &Diags) {
   // Get the target specific parser.
   std::string Error;
   const Target *TheTarget = TargetRegistry::lookupTarget(Opts.Triple, Error);
@@ -531,12 +531,12 @@
     Failed = Parser->Run(Opts.NoInitialTextSection);
   }
 
-  // Parser has a reference to the output stream (Str), so close Parser first.
-  Parser.reset();
-  Str.reset();
-  // Close the output stream early.
-  BOS.reset();
-  FDOS.reset();
+  return Failed;
+}
+
+static bool ExecuteAssembler(AssemblerInvocation &Opts,
+                             DiagnosticsEngine &Diags) {
+  bool Failed = ExecuteAssemblerImpl(Opts, Diags);
 
   // Delete output file if there were errors.
   if (Failed) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101542.341962.patch
Type: text/x-patch
Size: 1126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210430/26ad4bdf/attachment.bin>


More information about the cfe-commits mailing list