forked from OSchip/llvm-project
[flang] a few more intrinsics and some style guide comments
Original-commit: flang-compiler/f18@b6696ef923 Reviewed-on: https://github.com/flang-compiler/f18/pull/212 Tree-same-pre-rewrite: false
This commit is contained in:
parent
8efb8972c2
commit
24379cc0fc
|
@ -11,6 +11,7 @@ Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||||
* Otherwise, where a good public C++ style guide is relevant and clear,
|
* Otherwise, where a good public C++ style guide is relevant and clear,
|
||||||
follow it. [Google's](https://google.github.io/styleguide/cppguide.html)
|
follow it. [Google's](https://google.github.io/styleguide/cppguide.html)
|
||||||
is pretty good and comes with lots of justifications for its rules.
|
is pretty good and comes with lots of justifications for its rules.
|
||||||
|
* Reasonable exceptions to these guidelines can be made.
|
||||||
## In particular:
|
## In particular:
|
||||||
### Files
|
### Files
|
||||||
1. File names should use dashes, not underscores. C++ sources have the
|
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
|
produce source code when macros and templates suffice; don't write macros
|
||||||
when templates suffice. Templates are statically typed, checked by the
|
when templates suffice. Templates are statically typed, checked by the
|
||||||
compiler, and are (or should be) visible to debuggers.
|
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.
|
||||||
|
|
|
@ -458,7 +458,8 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
|
||||||
{"real", {{"a", AnyNumeric, Rank::elementalOrBOZ}, DefaultingKIND},
|
{"real", {{"a", AnyNumeric, Rank::elementalOrBOZ}, DefaultingKIND},
|
||||||
KINDReal},
|
KINDReal},
|
||||||
// pmk WIP continue here with REDUCE
|
// pmk WIP continue here with REDUCE
|
||||||
// TODO: repeat
|
{"repeat", {{"string", SameChar, Rank::scalar}, {"ncopies", AnyInt}},
|
||||||
|
SameChar, Rank::scalar},
|
||||||
{"reshape",
|
{"reshape",
|
||||||
{{"source", SameType, Rank::array}, {"shape", AnyInt, Rank::shape},
|
{{"source", SameType, Rank::array}, {"shape", AnyInt, Rank::shape},
|
||||||
{"pad", SameType, Rank::array, Optionality::optional},
|
{"pad", SameType, Rank::array, Optionality::optional},
|
||||||
|
@ -471,9 +472,13 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
|
||||||
{"back", AnyLogical, Rank::elemental, Optionality::optional},
|
{"back", AnyLogical, Rank::elemental, Optionality::optional},
|
||||||
DefaultingKIND},
|
DefaultingKIND},
|
||||||
KINDInt},
|
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},
|
{"set_exponent", {{"x", SameReal}, {"i", AnyInt}}, SameReal},
|
||||||
// TODO: shape
|
{"shape", {{"source", Anything, Rank::anyOrAssumedRank}, DefaultingKIND},
|
||||||
|
KINDInt, Rank::vector},
|
||||||
{"shifta", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},
|
{"shifta", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},
|
||||||
{"shiftl", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},
|
{"shiftl", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},
|
||||||
{"shiftr", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},
|
{"shiftr", {{"i", SameInt}, {"shift", AnyInt}}, SameInt},
|
||||||
|
|
Loading…
Reference in New Issue