https://github.com/klausler closed
https://github.com/llvm/llvm-project/pull/98083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/klausler created
https://github.com/llvm/llvm-project/pull/98083
Module files emitted by this Fortran compiler are valid Fortran source files.
Symbols that are USE-associated into modules are represented in their module
files with USE statements and special comments with
https://github.com/klausler closed
https://github.com/llvm/llvm-project/pull/91660
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/klausler created
https://github.com/llvm/llvm-project/pull/91660
This option is a compilation action that parses a source file and performs
semantic analysis on it, like the existing -fdebug-unparse option does. Its
output, however, is preceded by the effective contents of
klausler wrote:
See https://github.com/llvm/llvm-project/pull/90518, which I think would
greatly ease implementation of `-w`.
https://github.com/llvm/llvm-project/pull/90420
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
klausler wrote:
I am finishing up a patch that ensures that all warning messages are
conditional in Semantics.
https://github.com/llvm/llvm-project/pull/90420
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -0,0 +1,63 @@
+//===-- Main.cpp - generate main runtime API calls *- C++
klausler wrote:
This header comment needs to be cleaned up.
https://github.com/llvm/llvm-project/pull/89938
___
cfe-commits
https://github.com/klausler edited
https://github.com/llvm/llvm-project/pull/89938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/klausler approved this pull request.
https://github.com/llvm/llvm-project/pull/89938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/klausler approved this pull request.
https://github.com/llvm/llvm-project/pull/87627
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
klausler wrote:
> How is this code used outside of LLVM? Why do people want to use _without_
> LLVM? Just curious.
There are people who want to construct tools to analyze or restructure Fortran
programs outside of the context of compilation, and need to have access to a
good parse tree or
@@ -46,6 +49,38 @@ bool Definition::set_isDisabled(bool disable) {
return was;
}
+void Definition::Print(
+llvm::raw_ostream , llvm::StringRef macroName) const {
+ if (!isFunctionLike_) {
+// If it's not a function-like macro, then just print the replacement.
+
@@ -49,15 +51,21 @@ class Definition {
TokenSequence Apply(const std::vector , Prescanner &);
+ void Print(llvm::raw_ostream , llvm::StringRef macroName = "") const;
klausler wrote:
`const char *` would be a more portable type for `macroName` for those
@@ -49,15 +51,21 @@ class Definition {
TokenSequence Apply(const std::vector , Prescanner &);
+ void Print(llvm::raw_ostream , llvm::StringRef macroName = "") const;
+
private:
static TokenSequence Tokenize(const std::vector ,
const TokenSequence , std::size_t
https://github.com/klausler approved this pull request.
https://github.com/llvm/llvm-project/pull/81971
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/klausler approved this pull request.
https://github.com/llvm/llvm-project/pull/78286
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -122,10 +122,22 @@ void RTNAME(ExecuteCommandLine)(const Descriptor
, bool wait,
if (exitstat) {
RUNTIME_CHECK(terminator, IsValidIntDescriptor(exitstat));
+auto exitstatKind{exitstat->type().GetCategoryAndKind()->second};
+if (exitstatKind < 4) {
https://github.com/klausler commented:
Is there another patch that adds integer kind handling for these two arguments
to the runtime implementation?
https://github.com/llvm/llvm-project/pull/78286
___
cfe-commits mailing list
https://github.com/klausler edited
https://github.com/llvm/llvm-project/pull/74077
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -173,5 +173,72 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, std::size_t length, Terminator ) {
+ const
https://github.com/klausler approved this pull request.
https://github.com/llvm/llvm-project/pull/74077
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,206 @@
+//===-- runtime/execute.cpp
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,206 @@
+//===-- runtime/execute.cpp
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -22,6 +22,9 @@ extern "C" {
// CALL FLUSH(n) antedates the Fortran 2003 FLUSH statement.
void FORTRAN_PROCEDURE_NAME(flush)(const int );
+// GNU extension subroutine FDATE
+void FORTRAN_PROCEDURE_NAME(fdate)(std::byte *string, std::int64_t length);
@@ -43,6 +66,26 @@ void FORTRAN_PROCEDURE_NAME(flush)(const int ) {
}
} // namespace io
+// CALL FDATE(DATE)
+void FORTRAN_PROCEDURE_NAME(fdate)(std::byte *arg, std::int64_t length) {
+ // Day Mon dd hh:mm:ss \n\0 is 26 characters, e.g.
+ // Tue May 26 21:51:03 2015\n\0
@@ -43,6 +66,26 @@ void FORTRAN_PROCEDURE_NAME(flush)(const int ) {
}
} // namespace io
+// CALL FDATE(DATE)
+void FORTRAN_PROCEDURE_NAME(fdate)(std::byte *arg, std::int64_t length) {
+ // Day Mon dd hh:mm:ss \n\0 is 26 characters, e.g.
+ // Tue May 26 21:51:03 2015\n\0
@@ -22,6 +22,9 @@ extern "C" {
// CALL FLUSH(n) antedates the Fortran 2003 FLUSH statement.
void FORTRAN_PROCEDURE_NAME(flush)(const int );
+// GNU extension subroutine FDATE
+void FORTRAN_PROCEDURE_NAME(fdate)(std::byte *string, std::int64_t length);
@@ -173,5 +173,70 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, size_t length, Terminator ) {
@@ -0,0 +1,31 @@
+//===-- include/flang/Runtime/command.h -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,203 @@
+//===-- runtime/execute.cpp
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -411,6 +412,24 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ,
bool toIsContiguous, bool fromIsContiguous);
RT_API_ATTRS void ShallowCopy(const Descriptor , const Descriptor );
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char
@@ -0,0 +1,203 @@
+//===-- runtime/execute.cpp
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -173,5 +173,70 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, size_t length, Terminator ) {
+ if (length <=
@@ -173,5 +173,141 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, size_t length, Terminator ) {
+ if (length <=
@@ -173,5 +173,145 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, size_t length, Terminator ) {
+ if (length <=
@@ -411,6 +412,48 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ,
bool toIsContiguous, bool fromIsContiguous);
RT_API_ATTRS void ShallowCopy(const Descriptor , const Descriptor );
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char
@@ -173,5 +173,141 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, size_t length, Terminator ) {
+ if (length <=
@@ -173,5 +173,141 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ) {
ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
}
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char *str, size_t length, Terminator ) {
+ if (length <=
@@ -411,6 +412,48 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ,
bool toIsContiguous, bool fromIsContiguous);
RT_API_ATTRS void ShallowCopy(const Descriptor , const Descriptor );
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char
@@ -411,6 +412,48 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ,
bool toIsContiguous, bool fromIsContiguous);
RT_API_ATTRS void ShallowCopy(const Descriptor , const Descriptor );
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char
@@ -411,6 +412,48 @@ RT_API_ATTRS void ShallowCopy(const Descriptor , const
Descriptor ,
bool toIsContiguous, bool fromIsContiguous);
RT_API_ATTRS void ShallowCopy(const Descriptor , const Descriptor );
+RT_API_ATTRS const char *EnsureNullTerminated(
+const char
https://github.com/klausler approved this pull request.
https://github.com/llvm/llvm-project/pull/74628
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -10,13 +10,29 @@
// extensions that will eventually be implemented in Fortran.
#include "flang/Runtime/extensions.h"
+#include "flang/Runtime/character.h"
#include "flang/Runtime/command.h"
#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/io-api.h"
+#if
@@ -6,6 +6,37 @@
//
//===--===//
+// Defines a utility function for copying and padding characters
+#ifndef CHARACTER_H
+#define CHARACTER_H
klausler wrote:
Either way, the name of the
@@ -37,5 +79,34 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
(void)RTNAME(GetCommandArgument)(
n, , nullptr, nullptr, __FILE__, __LINE__);
}
+
+// CALL GETLOG(USRNAME)
+void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
+ const int
@@ -37,5 +79,34 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
(void)RTNAME(GetCommandArgument)(
n, , nullptr, nullptr, __FILE__, __LINE__);
}
+
+// CALL GETLOG(USRNAME)
+void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
+ const int
@@ -10,10 +10,52 @@
// extensions that will eventually be implemented in Fortran.
#include "flang/Runtime/extensions.h"
+#include "terminator.h"
+#include "flang/Runtime/character.h"
#include "flang/Runtime/command.h"
#include "flang/Runtime/descriptor.h"
#include
@@ -37,5 +79,34 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
(void)RTNAME(GetCommandArgument)(
n, , nullptr, nullptr, __FILE__, __LINE__);
}
+
+// CALL GETLOG(USRNAME)
+void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
+ const int
@@ -37,5 +79,34 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
(void)RTNAME(GetCommandArgument)(
n, , nullptr, nullptr, __FILE__, __LINE__);
}
+
+// CALL GETLOG(USRNAME)
+void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
+ const int
@@ -10,10 +10,52 @@
// extensions that will eventually be implemented in Fortran.
#include "flang/Runtime/extensions.h"
+#include "terminator.h"
+#include "flang/Runtime/character.h"
#include "flang/Runtime/command.h"
#include "flang/Runtime/descriptor.h"
#include
@@ -657,6 +657,11 @@ CALL CO_REDUCE
CALL CO_SUM
```
+### Library subroutine
klausler wrote:
Please put this new section later, after all of the non-standard intrinsics, so
the actual intrinsic procedures appear together.
@@ -37,5 +80,17 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
(void)RTNAME(GetCommandArgument)(
n, , nullptr, nullptr, __FILE__, __LINE__);
}
+
+void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
+ std::array str;
klausler wrote:
@@ -39,6 +39,17 @@
// overload will have a dummy parameter whose type indicates whether or not it
// should be preferred. Any other parameters required for SFINAE should have
// default values provided.
+
+// outside anonymous namespace, function reused
@@ -751,7 +751,7 @@ This phase currently supports all the intrinsic procedures
listed above but the
| Object characteristic inquiry functions | ALLOCATED, ASSOCIATED,
EXTENDS_TYPE_OF, IS_CONTIGUOUS, PRESENT, RANK, SAME_TYPE, STORAGE_SIZE |
| Type inquiry intrinsic functions |
@@ -9,6 +9,17 @@
// Defines the API between compiled code and the implementations of
time-related
// intrinsic subroutines in the runtime library.
+// time-intrinsic.h
+#ifndef TIME_INTRINSIC_H
+#define TIME_INTRINSIC_H
+
+#include
+
+void copyBufferAndPad(
@@ -9,6 +9,17 @@
// Defines the API between compiled code and the implementations of
time-related
// intrinsic subroutines in the runtime library.
+// time-intrinsic.h
+#ifndef TIME_INTRINSIC_H
+#define TIME_INTRINSIC_H
+
+#include
+
+void copyBufferAndPad(
+char *dest,
klausler wrote:
> Hello @klausler, could you please share your thoughts or comments on this
> patch, particularly with regard to the Windows side? Thanks in advance.
You should use modern C++ braced initialization in flang/runtime.
https://github.com/llvm/llvm-project/pull/70917
https://github.com/klausler closed
https://github.com/llvm/llvm-project/pull/72176
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
klausler wrote:
ping!
https://github.com/llvm/llvm-project/pull/72176
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/klausler updated
https://github.com/llvm/llvm-project/pull/72176
>From e2e0e60c5cf01b5e99cb2494e2444b91d1f6605d Mon Sep 17 00:00:00 2001
From: Peter Klausler
Date: Fri, 3 Nov 2023 13:04:01 -0700
Subject: [PATCH] [flang] Fold MATMUL()
Implements constant folding for matrix
Author: Peter Klausler
Date: 2021-11-22T10:06:38-08:00
New Revision: 996ef895cd3d1313665a42fc8e20d1d4e1cf2a28
URL:
https://github.com/llvm/llvm-project/commit/996ef895cd3d1313665a42fc8e20d1d4e1cf2a28
DIFF:
Author: peter klausler
Date: 2021-07-30T15:13:56-07:00
New Revision: 3338ef93b02837edf69abc203e15a42fa55aa1b3
URL:
https://github.com/llvm/llvm-project/commit/3338ef93b02837edf69abc203e15a42fa55aa1b3
DIFF:
62 matches
Mail list logo