diff options
author | Caroline Concatto <caroline.concatto@arm.com> | 2020-02-28 15:11:03 +0000 |
---|---|---|
committer | Caroline Concatto <caroline.concatto@arm.com> | 2020-03-19 07:54:36 +0000 |
commit | 8670e49901d116b2094aeb0a5117edef9e69cdcf (patch) | |
tree | d6d88cdf50c3a747381d30a3f86ca451864b275f /flang/lib/Semantics/pointer-assignment.cpp | |
parent | fc23a1bb79a54d401c1af8cfd3edeccf39d2e474 (diff) | |
download | llvm-8670e49901d116b2094aeb0a5117edef9e69cdcf.zip llvm-8670e49901d116b2094aeb0a5117edef9e69cdcf.tar.gz llvm-8670e49901d116b2094aeb0a5117edef9e69cdcf.tar.bz2 |
[flang] [LLVMify F18] Replace the use std::ostream with LLVM streams llvm::ostream
This patch replaces the occurrence of std::ostream by llvm::raw_ostream.
In LLVM Coding Standards[1] "All new code should use raw_ostream
instead of ostream".[1]
As a consequence, this patch also replaces the use of:
std::stringstream by llvm::raw_string_ostream or llvm::raw_ostream*
std::ofstream by llvm::raw_fd_ostream
std::endl by '\n' and flush()[2]
std::cout by llvm::outs() and
std::cerr by llvm::errs()
It also replaces std::strerro by llvm::sys::StrError** , but NOT in Fortran
runtime libraries
*std::stringstream were replaced by llvm::raw_ostream in all methods that
used std::stringstream as a parameter. Moreover, it removes the pointers to
these streams.
[1]https://llvm.org/docs/CodingStandards.html
[2]https://releases.llvm.org/2.5/docs/CodingStandards.html#ll_avoidendl
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Running clang-format-7
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Removing residue of ostream library
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Original-commit: flang-compiler/f18@a3507d44b8911e6024033aa583c1dc54e0eb89fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/1047
Diffstat (limited to 'flang/lib/Semantics/pointer-assignment.cpp')
-rw-r--r-- | flang/lib/Semantics/pointer-assignment.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/flang/lib/Semantics/pointer-assignment.cpp b/flang/lib/Semantics/pointer-assignment.cpp index b59dc81..fdb6add 100644 --- a/flang/lib/Semantics/pointer-assignment.cpp +++ b/flang/lib/Semantics/pointer-assignment.cpp @@ -19,6 +19,7 @@ #include "flang/Semantics/expression.h" #include "flang/Semantics/symbol.h" #include "flang/Semantics/tools.h" +#include "llvm/Support/raw_ostream.h" #include <optional> #include <set> #include <string> @@ -232,7 +233,8 @@ void PointerAssignmentChecker::Check(const evaluate::Designator<T> &d) { if (msg) { auto restorer{common::ScopedSet(lhs_, last)}; if (auto *m{std::get_if<MessageFixedText>(&*msg)}) { - std::ostringstream ss; + std::string buf; + llvm::raw_string_ostream ss{buf}; d.AsFortran(ss); Say(*m, description_, ss.str()); } else { |