diff --git a/flang/documentation/C++style.md b/flang/documentation/C++style.md index a8c335303118..270c2ffb2f4d 100644 --- a/flang/documentation/C++style.md +++ b/flang/documentation/C++style.md @@ -11,6 +11,7 @@ Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. * Otherwise, where a good public C++ style guide is relevant and clear, follow it. [Google's](https://google.github.io/styleguide/cppguide.html) is pretty good and comes with lots of justifications for its rules. +* Reasonable exceptions to these guidelines can be made. ## In particular: ### Files 1. File names should use dashes, not underscores. C++ sources have the @@ -163,3 +164,13 @@ build time; don't solve build time problems by writing programs that produce source code when macros and templates suffice; don't write macros when templates suffice. Templates are statically typed, checked by the compiler, and are (or should be) visible to debuggers. +### Exceptions to these guidelines +Reasonable exceptions will be allowed; these guidelines cannot anticipate +all situations. +For example, names that come from other sources might be more clear if +their original spellings are preserved rather than mangled to conform +needlessly to the conventions here, as Google's C++ style guide does +in a way that leads to weirdly capitalized abbreviations in names +like `Http`. +Consistency is one of many aspects in the pursuit of clarity, +but not an end in itself. diff --git a/flang/lib/evaluate/intrinsics.cc b/flang/lib/evaluate/intrinsics.cc index dd4ec9dbcd0b..69d83ab51b9d 100644 --- a/flang/lib/evaluate/intrinsics.cc +++ b/flang/lib/evaluate/intrinsics.cc @@ -458,7 +458,8 @@ static const IntrinsicInterface genericIntrinsicFunction[]{ {"real", {{"a", AnyNumeric, Rank::elementalOrBOZ}, DefaultingKIND}, KINDReal}, // pmk WIP continue here with REDUCE - // TODO: repeat + {"repeat", {{"string", SameChar, Rank::scalar}, {"ncopies", AnyInt}}, + SameChar, Rank::scalar}, {"reshape", {{"source", SameType, Rank::array}, {"shape", AnyInt, Rank::shape}, {"pad", SameType, Rank::array, Optionality::optional}, @@ -471,9 +472,13 @@ static const IntrinsicInterface genericIntrinsicFunction[]{ {"back", AnyLogical, Rank::elemental, Optionality::optional}, DefaultingKIND}, KINDInt}, - // TODO: selected_char/int/real_kind + {"selected_char_kind", {{"name", DftChar, Rank::scalar}}, DftInt, + Rank::scalar}, + {"selected_int_kind", {{"r", AnyInt, Rank::scalar}}, DftInt, Rank::scalar}, + // TODO: selected_real_kind {"set_exponent", {{"x", SameReal}, {"i", AnyInt}}, SameReal}, - // TODO: shape + {"shape", {{"source", Anything, Rank::anyOrAssumedRank}, DefaultingKIND}, + KINDInt, Rank::vector}, {"shifta", {{"i", SameInt}, {"shift", AnyInt}}, SameInt}, {"shiftl", {{"i", SameInt}, {"shift", AnyInt}}, SameInt}, {"shiftr", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},