From 45820f4caaaea8d031397cff1d92841597c81301 Mon Sep 17 00:00:00 2001 From: Jean Perier Date: Tue, 10 Sep 2019 04:10:25 -0700 Subject: [PATCH] [flang] address comment: add ',' for better formatting Original-commit: flang-compiler/f18@0c854999853463b2113d672836cb343e98ae1c61 Reviewed-on: https://github.com/flang-compiler/f18/pull/699 --- flang/lib/evaluate/intrinsics-library.cc | 73 ++++++++++++++++-------- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/flang/lib/evaluate/intrinsics-library.cc b/flang/lib/evaluate/intrinsics-library.cc index 632f994d8797..16b93dce4ffa 100644 --- a/flang/lib/evaluate/intrinsics-library.cc +++ b/flang/lib/evaluate/intrinsics-library.cc @@ -57,19 +57,32 @@ static void AddLibmRealHostProcedures( HostIntrinsicProceduresLibrary &hostIntrinsicLibrary) { using F = FuncPointer; using F2 = FuncPointer; - HostRuntimeIntrinsicProcedure libmSymbols[]{{"acos", F{std::acos}, true}, - {"acosh", F{std::acosh}, true}, {"asin", F{std::asin}, true}, - {"asinh", F{std::asinh}, true}, {"atan", F{std::atan}, true}, - {"atan", F2{std::atan2}, true}, {"atanh", F{std::atanh}, true}, - {"cos", F{std::cos}, true}, {"cosh", F{std::cosh}, true}, - {"erf", F{std::erf}, true}, {"erfc", F{std::erfc}, true}, - {"exp", F{std::exp}, true}, {"gamma", F{std::tgamma}, true}, - {"hypot", F2{std::hypot}, true}, {"log", F{std::log}, true}, - {"log10", F{std::log10}, true}, {"log_gamma", F{std::lgamma}, true}, - {"mod", F2{std::fmod}, true}, {"pow", F2{std::pow}, true}, - {"sin", F{std::sin}, true}, {"sinh", F{std::sinh}, true}, - {"sqrt", F{std::sqrt}, true}, {"tan", F{std::tan}, true}, - {"tanh", F{std::tanh}, true}}; + HostRuntimeIntrinsicProcedure libmSymbols[]{ + {"acos", F{std::acos}, true}, + {"acosh", F{std::acosh}, true}, + {"asin", F{std::asin}, true}, + {"asinh", F{std::asinh}, true}, + {"atan", F{std::atan}, true}, + {"atan", F2{std::atan2}, true}, + {"atanh", F{std::atanh}, true}, + {"cos", F{std::cos}, true}, + {"cosh", F{std::cosh}, true}, + {"erf", F{std::erf}, true}, + {"erfc", F{std::erfc}, true}, + {"exp", F{std::exp}, true}, + {"gamma", F{std::tgamma}, true}, + {"hypot", F2{std::hypot}, true}, + {"log", F{std::log}, true}, + {"log10", F{std::log10}, true}, + {"log_gamma", F{std::lgamma}, true}, + {"mod", F2{std::fmod}, true}, + {"pow", F2{std::pow}, true}, + {"sin", F{std::sin}, true}, + {"sinh", F{std::sinh}, true}, + {"sqrt", F{std::sqrt}, true}, + {"tan", F{std::tan}, true}, + {"tanh", F{std::tanh}, true}, + }; // Note: cmath does not have modulo and erfc_scaled equivalent // Note regarding lack of bessel function support: @@ -101,15 +114,25 @@ static void AddLibmComplexHostProcedures( const HostT &>; HostRuntimeIntrinsicProcedure libmSymbols[]{ {"abs", FuncPointer &>{std::abs}, true}, - {"acos", F{std::acos}, true}, {"acosh", F{std::acosh}, true}, - {"asin", F{std::asin}, true}, {"asinh", F{std::asinh}, true}, - {"atan", F{std::atan}, true}, {"atanh", F{std::atanh}, true}, - {"cos", F{std::cos}, true}, {"cosh", F{std::cosh}, true}, - {"exp", F{std::exp}, true}, {"log", F{std::log}, true}, - {"pow", F2{std::pow}, true}, {"pow", F2a{std::pow}, true}, - {"pow", F2b{std::pow}, true}, {"sin", F{std::sin}, true}, - {"sinh", F{std::sinh}, true}, {"sqrt", F{std::sqrt}, true}, - {"tan", F{std::tan}, true}, {"tanh", F{std::tanh}, true}}; + {"acos", F{std::acos}, true}, + {"acosh", F{std::acosh}, true}, + {"asin", F{std::asin}, true}, + {"asinh", F{std::asinh}, true}, + {"atan", F{std::atan}, true}, + {"atanh", F{std::atanh}, true}, + {"cos", F{std::cos}, true}, + {"cosh", F{std::cosh}, true}, + {"exp", F{std::exp}, true}, + {"log", F{std::log}, true}, + {"pow", F2{std::pow}, true}, + {"pow", F2a{std::pow}, true}, + {"pow", F2b{std::pow}, true}, + {"sin", F{std::sin}, true}, + {"sinh", F{std::sinh}, true}, + {"sqrt", F{std::sqrt}, true}, + {"tan", F{std::tan}, true}, + {"tanh", F{std::tanh}, true}, + }; for (auto sym : libmSymbols) { if (!hostIntrinsicLibrary.HasEquivalentProcedure(sym)) { @@ -445,7 +468,8 @@ static void AddLibpgmathRealHostProcedures( {"sinh", Sym, true}, {"sqrt", Sym, true}, {"tan", Sym, true}, - {"tanh", Sym, true}}; + {"tanh", Sym, true}, + }; for (auto sym : pgmathSymbols) { hostIntrinsicLibrary.AddProcedure(std::move(sym)); @@ -509,7 +533,8 @@ static void AddLibpgmathComplexHostProcedures( {"sinh", ComplexCFuncWrapper>, true}, {"sqrt", ComplexCFuncWrapper>, true}, {"tan", ComplexCFuncWrapper>, true}, - {"tanh", ComplexCFuncWrapper>, true}}; + {"tanh", ComplexCFuncWrapper>, true}, + }; for (auto sym : pgmathSymbols) { hostIntrinsicLibrary.AddProcedure(std::move(sym));