[flang-commits] [PATCH] D158957: [flang][runtime] Avoid dependency on libc++ for `std::__libcpp_verbose_abort`

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Sep 1 09:47:50 PDT 2023


klausler added a comment.

Here's a patch that removes the usage of std::reference_wrapper from the runtime.

  Last login: Fri Aug 25 09:59:14 on ttys000
  pklausler at pklausler-mlt ~ % ssh rome1.pgi.net
  pklausler at rome1.pgi.net's password: 
  Last login: Fri Aug 25 09:58:00 2023 from 10.20.72.168
  linux86-64 module support enabled using version 'latest'.
  rome1 ~ λ scr
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  diff --git a/flang/runtime/io-stmt.h b/flang/runtime/io-stmt.h
  index fa432d07a680..128c137dd0f0 100644
  --- a/flang/runtime/io-stmt.h
  +++ b/flang/runtime/io-stmt.h
  @@ -16,6 +16,7 @@
   #include "format.h"
   #include "internal-unit.h"
   #include "io-error.h"
  +#include "flang/Common/reference.h"
   #include "flang/Common/visit.h"
   #include "flang/Runtime/descriptor.h"
   #include "flang/Runtime/io-api.h"
  @@ -200,39 +201,39 @@ public:
     }
   
   private:
  -  std::variant<std::reference_wrapper<OpenStatementState>,
  -      std::reference_wrapper<CloseStatementState>,
  -      std::reference_wrapper<NoopStatementState>,
  -      std::reference_wrapper<
  +  std::variant<common::Reference<OpenStatementState>,
  +      common::Reference<CloseStatementState>,
  +      common::Reference<NoopStatementState>,
  +      common::Reference<
             InternalFormattedIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<
  +      common::Reference<
             InternalFormattedIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<InternalListIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<InternalListIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<
  +      common::Reference<InternalListIoStatementState<Direction::Output>>,
  +      common::Reference<InternalListIoStatementState<Direction::Input>>,
  +      common::Reference<
             ExternalFormattedIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<
  +      common::Reference<
             ExternalFormattedIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<ExternalListIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<ExternalListIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<
  +      common::Reference<ExternalListIoStatementState<Direction::Output>>,
  +      common::Reference<ExternalListIoStatementState<Direction::Input>>,
  +      common::Reference<
             ExternalUnformattedIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<
  +      common::Reference<
             ExternalUnformattedIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<ChildFormattedIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<ChildFormattedIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<ChildListIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<ChildListIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<
  +      common::Reference<ChildFormattedIoStatementState<Direction::Output>>,
  +      common::Reference<ChildFormattedIoStatementState<Direction::Input>>,
  +      common::Reference<ChildListIoStatementState<Direction::Output>>,
  +      common::Reference<ChildListIoStatementState<Direction::Input>>,
  +      common::Reference<
             ChildUnformattedIoStatementState<Direction::Output>>,
  -      std::reference_wrapper<
  +      common::Reference<
             ChildUnformattedIoStatementState<Direction::Input>>,
  -      std::reference_wrapper<InquireUnitState>,
  -      std::reference_wrapper<InquireNoUnitState>,
  -      std::reference_wrapper<InquireUnconnectedFileState>,
  -      std::reference_wrapper<InquireIOLengthState>,
  -      std::reference_wrapper<ExternalMiscIoStatementState>,
  -      std::reference_wrapper<ErroneousIoStatementState>>
  +      common::Reference<InquireUnitState>,
  +      common::Reference<InquireNoUnitState>,
  +      common::Reference<InquireUnconnectedFileState>,
  +      common::Reference<InquireIOLengthState>,
  +      common::Reference<ExternalMiscIoStatementState>,
  +      common::Reference<ErroneousIoStatementState>>
         u_;
   };




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

https://reviews.llvm.org/D158957



More information about the flang-commits mailing list