[flang-commits] [flang] [flang] Improve warnings for invalid arguments when folding host runtime (PR #96807)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Fri Jun 28 08:04:08 PDT 2024
================
@@ -633,10 +633,243 @@ static DynamicType BiggerType(DynamicType type) {
return type;
}
+/// Structure to register intrinsic argument checks that must be performed.
+using ArgumentVerifierFunc = bool (*)(
+ const std::vector<Expr<SomeType>> &, FoldingContext &);
+struct ArgumentVerifier {
+ using Key = std::string_view;
+ // Needed for implicit compare with keys.
+ constexpr operator Key() const { return key; }
+ Key key; // intrinsic name
+ ArgumentVerifierFunc verifier;
+};
+
+static constexpr int lastArg{-1};
+static constexpr int firstArg{0};
+
+static const Expr<SomeType> &getArg(
----------------
klausler wrote:
`GetArg`
https://github.com/llvm/llvm-project/pull/96807
More information about the flang-commits
mailing list