TTobias Hieta[flang] Install runtime libs with the toolchain
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang] Install runtime libs with the toolchain Make sure that FortranDecimal, FortranRuntime and Fortran_main are installed/packaged even when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled. They are used by flang to link executables, so they should be provided even with minimal installs. Differential Revision: https://reviews.llvm.org/D131670 (cherry picked from commit 467abac2046d037f8d4cf428e76b77e5b06c187f) | 3 年前 | |
[flang] Install runtime libs with the toolchain Make sure that FortranDecimal, FortranRuntime and Fortran_main are installed/packaged even when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled. They are used by flang to link executables, so they should be provided even with minimal installs. Differential Revision: https://reviews.llvm.org/D131670 (cherry picked from commit 467abac2046d037f8d4cf428e76b77e5b06c187f) | 3 年前 | |
[flang] LBOUND() edge case: empty dimension LBOUND must return 1 for an empty dimension, no matter what explicit expression might appear in a declaration or arrive in a descriptor. Differential Revision: https://reviews.llvm.org/D121488 | 4 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Make subscript list argument a nullable pointer Component::CreatePointerDescriptor unconditionally expects a vector of subscripts to be passed as an argument, but is called from NAMELIST input with a null pointer. Make that argument a nullable pointer, move it to the end of the argument list, and give it a default value of nullptr. Differential Revision: https://reviews.llvm.org/D113312 | 4 年前 | |
[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC We should only need to spell the language out in .h files. Differential Revision: https://reviews.llvm.org/D109138 | 4 年前 | |
[flang][runtime] Keep frame buffer in sync with file when truncating When the I/O runtime is truncating an external file due to an implied ENDFILE or explicit ENDFILE, ensure that the unit's frame buffer for the file discards any data that have become obsolete. This bug caused trouble with ACCESS='STREAM' I/O using POS= on a WRITE, but it may have not been limited to that scenario. Differential Revision: https://reviews.llvm.org/D129673 | 3 年前 | |
[flang][runtime] Make NCOPIES= argument of REPEAT a signed integer, & check it NCOPIES= is currently a std::size_t in the API. If a negative value is used, the memory allocation will fail. Change it to be a signed integer, and crash with a message instead if it be negative. Differential Revision: https://reviews.llvm.org/D127795 | 3 年前 | |
Fix invalid overflow check in flang Statically checking for overflow with if constexpr (sizeof(std::size_t) <= sizeof(std::int64_t)) { return static_cast<std::int64_t>(length); } Doesn't work if sizeof(std::size_t) == sizeof(std::int64_t) because std::size_t is unsigned. if length == std::numeric_limits<size_t> casting it to int64_t is going to overflow. This code would be much simpler if returning a uint64_t instead of a signed value... Differential Revision: https://reviews.llvm.org/D122705 | 4 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang] Change complex type define in runtime for clang-cl When compiling the runtime with a version of clang-cl newer than 12, we define CMPLXF as __builtin_complex, which returns a float _Complex type. This errors out in contexts where the result of CMPLXF is expected to be a float_Complex_t. This is defined as _Fcomplex whenever _MSC_VER is defined (and as float _Complex otherwise). This patch defines float_Complex_t & friends as _Fcomplex only when we're using "true" MSVC, and not just clang-pretending-to-be-MSVC. This should only affect clang-cl >= 12. Differential Revision: https://reviews.llvm.org/D110139 | 4 年前 | |
[flang] Support platforms without strerror_r Original-commit: flang-compiler/f18@0575b54cc79110ae03f73b136e704f6313e2d63f Reviewed-on: https://github.com/flang-compiler/f18/pull/1068 | 6 年前 | |
[flang] Honor RECL= in list-directed/namelist output Advancement to new output lines was taking fixed-sized direct-access and internal character array element lengths into account, but not RECL= settings from OPEN statements. Differential Revision: https://reviews.llvm.org/D120837 | 4 年前 | |
[flang][runtime] Don't pad CHARACTER input at end of record unless PAD='YES' When formatted CHARACTER input runs into the end of an input record, the runtime usually fills the remainder of the variable with spaces, but this should be conditional, and not done when PAD='NO'. And while here, add some better comments to two members of connection.h to make their non-obvious relationship more clear. Differential Revision: https://reviews.llvm.org/D125053 | 4 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Fix extent computation in finalization The code that computed the extent of a dimension of a non-allocatable/non-automatic component array during finalization had a reversed subtraction; fix, and use variables to make the code a little more readable. Differential Revision: https://reviews.llvm.org/D121163 | 4 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Fix repeated "DT" editing User-defined derived type editing in formatted I/O wasn't working with repeat counts; e.g., "2DT(10)". The solution required some code to be moved from GetNextDataEdit() to CueUpNextDataEdit() so that a stack entry for a nonparenthesized repeated data edit descriptor would work correctly -- all other data edit descriptors are capable of dealing with repetition in their callees, so the bug hadn't been exposed before. Debugging this problem led to some improvements in error messages for bad format strings, and those changes have been retained; also, a dead member function was discovered and expunged. Differential Revision: https://reviews.llvm.org/D117904 | 4 年前 | |
[flang][runtime] Signal END from character input There's code in EditCharacterInput() that causes that template function to silently return false if it is invoked at the end of the input file. This overrides other checks that properly call SignalEnd() later. Differential Revision: https://reviews.llvm.org/D127786 | 3 年前 | |
[flang][runtime] Ensure PointerDeallocate actually deallocate pointers PointerDeallocate was silently doing nothing because it relied on Destroy that doe not do anything for Pointers. Add an option to Destroy in order to destroy pointers. Add a unit test for PointerDeallocate. Differential Revision: https://reviews.llvm.org/D122492 | 4 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang][runtime] Complete list-directed character input with DECIMAL='COMMA' Most of the infrastructure for DECIMAL='COMMA' mode was in place in the I/O runtime support library, but I dropped the ball for list-directed character input, which has its own detection of input separators. Finish the job. Differential Revision: https://reviews.llvm.org/D129679 | 3 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 | |
[flang][runtime] Refine list-directed REAL(2) output The rule used by list-directed REAL output editing to select between Ew.d and Fw.d output editing breaks down for 16-bit floating-point data, since the number of significant decimal digits is so low that Ew,d output editing is nearly always selected. Cap the test so that five-digit values will be output with Fw.d editing. Differential Revision: https://reviews.llvm.org/D129672 | 3 年前 | |
[flang][runtime] Detect overflow of fixed-sized exponent output field When Ew.dEe or Gw.dEe output has an exponent requiring more than 'e' digits, the whole output field must overflow to asterisks. The runtime was detecting short fields and padding them with zeroes, but not overflow. Differential Revision: https://reviews.llvm.org/D127428 | 3 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 | |
[flang] Add CALL FLUSH(n) legacy extension Prior to the introduction of the FLUSH statement in Fortran 2003, implementations provided a FLUSH subroutine. We can't yet put Fortran code into the runtime, so this subroutine is in C++ with a Fortran-mangled entry point name. Differential Revision: https://reviews.llvm.org/D115289 | 4 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang][runtime] Catch OPEN of connected file Diagnose OPEN(FILE=f) when f is already connected by the same name to a distinct external I/O unit. Differential Revision: https://reviews.llvm.org/D127035 | 3 年前 | |
[flang][runtime] Catch OPEN of connected file Diagnose OPEN(FILE=f) when f is already connected by the same name to a distinct external I/O unit. Differential Revision: https://reviews.llvm.org/D127035 | 3 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang][runtime] Fix handling of output FORMAT('x' 'y') I'm emitting "x'y" because the space-separated apostrophes are misinterpreted as being adjacent repeated quotation marks. Fix to ensure no space skipping is applied when checking for repeated quotation marks. Differential Revision: https://reviews.llvm.org/D127792 | 3 年前 | |
[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC We should only need to spell the language out in .h files. Differential Revision: https://reviews.llvm.org/D109138 | 4 年前 | |
[flang][runtime] Trim FORMATs echoed to error messages Since dynamic FORMAT strings usually come from blank-padded fixed-length CHARACTER variables, trim leading and trailing blanks from them when they are echoed to error messages for better readability. Differential Revision: https://reviews.llvm.org/D129024 | 3 年前 | |
[flang] Improve runtime crash messages Where possible, I added additional information to the messages to help programmers figure out what went wrong. I also removed all uses of the word "bad" from the messages since (to me) that implies a moral judgement rather than a programming error. I replaced it with either "invalid" or "unsupported" where appropriate. Differential Revision: https://reviews.llvm.org/D121493 | 4 年前 | |
[flang][runtime] Don't crash after surviving internal output overflow After the program has survived its attempt to overflow the output buffer with an internal WRITE using ERR=, IOSTAT=, &/or IOMSG=, don't crash by accidentally blank-filling the next record that usually doesn't exist. Differential Revision: https://reviews.llvm.org/D127024 | 3 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 | |
[flang][runtime] FLUSH(bad or unconnected unit number) is an error Some I/O control statements are no-ops when attempted on a bad or unconnected UNIT=, but the standard says that FLUSH is an error in that case. Differential Revision: https://reviews.llvm.org/D128392 | 3 年前 | |
[flang] Error recovery improvement in runtime (IOMSG=) Some refactoring and related fixes for more accurate user program error recovery in the I/O runtime, especially for error recovery with IOMSG= character values. 1) Move any work in an EndIoStatement() implementation that may raise an error into a new CompleteOperation() member function. This allows error handling APIs like GetIoMsg() to complete a pending I/O statement and harvest any errors that may result. 2) Move the pending error code from ErroneousIoStatementState to a new pendingError_ data member in IoErrorHandler. This allows IoErrorHandler::InError() to return a correct result when there is a pending error that will be recovered from so that I/O list data transfers don't crash in the meantime. 3) Don't create and leak a unit for a failed OPEN(NEWUNIT=n) with error recovery, and don't modify 'n'. (Depends on changes to API call ordering in lowering, in a separate patch; code was added to ensure that OPEN statement control list specifiers, e.g. SetFile(), must be passed before GetNewUnit().) 4) Fix the code that calls a form of strerror to fill an IOMSG= variable so that it actually works for Fortran's character type: blank fill with no null or newline termination. Differential Revision: https://reviews.llvm.org/D122036 | 4 年前 | |
[flang][runtime] Clean up asynchronous I/O APIs Now that the requirements and implementation of asynchronous I/O are better understood, adjust their I/O runtime APIs. In particular: 1) Remove the BeginAsynchronousOutput/Input APIs; they're not needed, since any data transfer statement might have ASYNCHRONOUS= and (if ASYNCHRONOUS='YES') ID= control list specifiers that need to at least be checked. 2) Add implementations for BeginWait(All) to check for the error case of a bad unit number and nonzero ID=. 3) Rearrange and comment SetAsynchronous so that it's clear that it can be called for READ/WRITE as well as for OPEN. The implementation remains completely synchronous, but should be conforming. Where opportunities make sense for true asynchronous implementations of some big block transfers without SIZE= in the future, we'll need to add a GetAsynchronousId API to capture ID= on a READ or WRITE; add sourceFile and sourceLine arguments to BeginWait(All) for good error reporting; track pending operations in unit.h; and add code to force synchronization to non-asynchronous I/O operations. Lowering should call SetAsynchronous when ASYNCHRONOUS= appears as a control list specifier. It should also set ID=x variables to 0 until such time as we support asynchronous operations, if ever. This patch only removes the removed APIs from lowering. Differential Revision: https://reviews.llvm.org/D126143 | 4 年前 | |
[flang][runtime] Complete list-directed character input with DECIMAL='COMMA' Most of the infrastructure for DECIMAL='COMMA' mode was in place in the I/O runtime support library, but I dropped the ball for list-directed character input, which has its own detection of input separators. Finish the job. Differential Revision: https://reviews.llvm.org/D129679 | 3 年前 | |
[flang][runtime] Allow recovery from BACKSPACE(badUnit) When an unconnected unit number is used in a BACKSPACE statement with ERR=, IOSTAT=, &/or IOMSG= control specifiers, don't crash, but let the program deal with the error. Differential Revision: https://reviews.llvm.org/D127782 | 3 年前 | |
[flang][runtime] FLUSH(bad or unconnected unit number) is an error Some I/O control statements are no-ops when attempted on a bad or unconnected UNIT=, but the standard says that FLUSH is an error in that case. Differential Revision: https://reviews.llvm.org/D128392 | 3 年前 | |
[flang][runtime] Remove dependency on C++ <mutex> on Windows The implementation of the Lock class on Windows currently uses C++ mutexes. That introduces a dependency on the C++ runtime on that platform. Use a Windows CriticalSection instead of a std::mutex to avoid that dependency. This works for me with MinGW (tested in a CLANG64 environment of MSYS2). See also D126291. Differential Revision: https://reviews.llvm.org/D127316 | 3 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Speed common runtime cases of DOT_PRODUCT & MATMUL Look for contiguous numeric argument arrays at runtime and use specialized code for them. Differential Revision: https://reviews.llvm.org/D112239 | 4 年前 | |
[flang] Move runtime API headers to flang/include/flang/Runtime Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107 | 4 年前 | |
[flang] Error detection/avoidance for TRANSFER with empty MOLD= type When MOLD= is an array and there is no SIZE= in a call to TRANSFER(), the size of an element of the MOLD= is used as the denominator in a division to establish the extent of the vector result. When the total storage size of the SOURCE= is known to be zero, the result is empty and no division is needed. To avoid a division by zero at runtime, we need to check for a zero-sized MOLD= element type when the storage size of SOURCE= is nonzero and there is no SIZE=. Further, in the compilation-time rewriting of calls to SHAPE(TRANSFER(...)) and SIZE(TRANSFER(...)) for constant folding and simplification purposes, we can't replace the call with an arithmetic element count expression when the storage size of SOURCE= is not known to be zero and the element size of MOLD= is not known to be nonzero at compilation time. These changes mostly affect tests using a MOLD= argument that is an assumed-length character. Differential Revision: https://reviews.llvm.org/D129680 | 3 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 | |
[flang] Support NAMELIST input of short arrays NAMELIST array input does not need to fully define an array. If another input item begins after at least one element, it ends input into the array and the remaining items are not modified. The tricky part of supporting this feature is that it's not always easy to determine whether the next non-blank thing in the input is a value or the next item's name, esp. in the case of logical data where T and F can be names. E.g., &group logicalArray = t f f t = 1 / should read three elements into "logicalArray" and then read an integer or real variable named "t". So the I/O runtime has to do some look-ahead to determine whether the next thing in the input is a name followed by '=', '(', or '%'. Since the '=' may be on a later record, possibly with intervening NAMELIST comments, the runtime has to support a general form of saving and restoring its current position. The infrastructure in the I/O runtime already has to support repositioning for list-directed repetition, even on non-positionable input sources like terminals and sockets; this patch adds an internal RAII API to make it easier to save a position and then do arbitrary look-ahead. Differential Revision: https://reviews.llvm.org/D112245 | 4 年前 | |
[flang] Support intrinsic selected_int_kind for variables As Fortran 2018 16.9.169, the argument of selected_int_kind is integer scalar, and result is default integer scalar. The constant expression in this intrinsic has been supported by folding the constant expression. This supports lowering and runtime for variables in this intrinsic. Reviewed By: Jean Perier Differential Revision: https://reviews.llvm.org/D129959 | 3 年前 | |
[flang][runtime] Make ASSOCIATED() conform with standard ASSOCIATED() must be false for zero-sized arrays, and the strides on a dimension are irrelevant when the extent is unitary. Differential Revision: https://reviews.llvm.org/D127793 | 3 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang] Simplify RaggedArrayHeader and make it plain C struct - Join indirection and rank into a single value flags - Make the struct a plain C struct. Reviewed By: schweitz Differential Revision: https://reviews.llvm.org/D115464 | 4 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang] Improve runtime crash messages Where possible, I added additional information to the messages to help programmers figure out what went wrong. I also removed all uses of the word "bad" from the messages since (to me) that implies a moral judgement rather than a programming error. I replaced it with either "invalid" or "unsupported" where appropriate. Differential Revision: https://reviews.llvm.org/D121493 | 4 年前 | |
[flang] Improve runtime crash messages Where possible, I added additional information to the messages to help programmers figure out what went wrong. I also removed all uses of the word "bad" from the messages since (to me) that implies a moral judgement rather than a programming error. I replaced it with either "invalid" or "unsupported" where appropriate. Differential Revision: https://reviews.llvm.org/D121493 | 4 年前 | |
[flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) Implement the second entry point for GET_ENVIRONMENT_VARIABLE. Reuse existing bits and pieces wherever possible. This patch also increases CFI_* error codes in order to avoid conflicts. GET_ENVIRONMENT_VARIABLE is required to return a status of 1 if an environment variable does not exist and 2 if environment variables are not supported. However, if we add status codes for that they will conflict with CFI_ERROR_BASE_ADDR_NULL and CFI_ERROR_BASE_ADDR_NOT_NULL, which are also 1 and 2 at the moment. We therefore move all CFI error codes up (an arbitrary) 10 spots to make room. Hopefully this isn't a problem, since we weren't matching the CFI error codes that gfortran uses anyway. It may still be an issue if any other runtime functions will need to return a status of 1 or 2, but we should probably deal with that when/if it occurs. Differential Revision: https://reviews.llvm.org/D112698 | 4 年前 | |
[flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) Implement the second entry point for GET_ENVIRONMENT_VARIABLE. Reuse existing bits and pieces wherever possible. This patch also increases CFI_* error codes in order to avoid conflicts. GET_ENVIRONMENT_VARIABLE is required to return a status of 1 if an environment variable does not exist and 2 if environment variables are not supported. However, if we add status codes for that they will conflict with CFI_ERROR_BASE_ADDR_NULL and CFI_ERROR_BASE_ADDR_NOT_NULL, which are also 1 and 2 at the moment. We therefore move all CFI error codes up (an arbitrary) 10 spots to make room. Hopefully this isn't a problem, since we weren't matching the CFI error codes that gfortran uses anyway. It may still be an issue if any other runtime functions will need to return a status of 1 or 2, but we should probably deal with that when/if it occurs. Differential Revision: https://reviews.llvm.org/D112698 | 4 年前 | |
[flang] Rename the runtime routine that reports a fatal user error As per Steve Scalpone's suggestion, I've renamed the runtime routine to better evoke its purpose. I implemented a routine called "Crash" and added a test. Differential Revision: https://reviews.llvm.org/D118703 | 4 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang] Define & implement a lowering support API IsContiguous() in runtime Create a new flang/runtime/support.cpp module to hold miscellaneous runtime APIs to support lowering, and define an API IsContiguous() to wrap the member function predicate Descriptor::IsContiguous(). And do a little clean-up of other API headers that don't need to expose Runtime/descriptor.h. Differential Revision: https://reviews.llvm.org/D114752 | 4 年前 | |
[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC We should only need to spell the language out in .h files. Differential Revision: https://reviews.llvm.org/D109138 | 4 年前 | |
[flang] Define & implement a lowering support API IsContiguous() in runtime Create a new flang/runtime/support.cpp module to hold miscellaneous runtime APIs to support lowering, and define an API IsContiguous() to wrap the member function predicate Descriptor::IsContiguous(). And do a little clean-up of other API headers that don't need to expose Runtime/descriptor.h. Differential Revision: https://reviews.llvm.org/D114752 | 4 年前 | |
[flang][MSVC] Fix building with /permissive- flag CLOCK_REALTIME is POSIX defined and never available with MSVC, even without /permissive-. The difference is that the template is never instantiated and the compiler ignores the undefined identifier. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D125262 | 4 年前 | |
[flang] Change "bad kind" messages in the runtime to "not yet implemented" Similar to change D125046. If a programmer is able to compile and link a program that contains types that are not yet supported by the runtime, it must be because they're not yet implemented. This change will make it easier to find unimplemented code in tests. Differential Revision: https://reviews.llvm.org/D125267 | 4 年前 | |
[flang][runtime] Use __float128 where possible & needed in runtime On targets with __float128 available and distinct from long double, use it to support more kind=16 entry points. This affects mostly x86-64 targets. This means that more runtime entry points are defined for lowering to call. Delete Common/long-double.h and its LONG_DOUBLE macro in favor of testing the standard macro LDBL_MANT_DIG. Differential Revision: https://reviews.llvm.org/D127025 | 3 年前 | |
[flang][runtime] Fix runtime CSHIFT of rank>1 array case of negative shift count The calculation of the source index was incorrect when a CSHIFT shift count value is negative, for the implementation of CSHIFT for arrays with rank >= 2. (The vector CSHIFT is fine.) Differential Revision: https://reviews.llvm.org/D127424 | 3 年前 | |
[flang][runtime] Fix KIND=16 real/complex component I/O Don't treat KIND=16 as 80-bit extended floating-point any more on x86. Differential Revision: https://reviews.llvm.org/D124400 | 4 年前 | |
[flang] Fix character length calculation for Unicode component The character length value in the derived type component information table entry is already in units of characters, not bytes, so don't divide by the per-character byte size. Differential Revision: https://reviews.llvm.org/D126139 | 4 年前 | |
[flang] Allow for deferred-length character in EstablishDescriptor When the runtime is initializing an instance of a derived type, don't crash if an allocatable character component has deferred length. Differential Revision: https://reviews.llvm.org/D119731 | 4 年前 | |
[flang][runtime] Catch OPEN of connected file Diagnose OPEN(FILE=f) when f is already connected by the same name to a distinct external I/O unit. Differential Revision: https://reviews.llvm.org/D127035 | 3 年前 | |
[flang][runtime] Catch more (all?) negative unit number errors Fortran does have negative unit numbers -- they show up in child I/O subroutines for defined I/O and for OPEN(NEWUNIT=) -- but the runtime needs to catch the cases where a negative unit number that wasn't generated by the runtime is passed in for OPEN or for an I/O statement that would ordinarily create an anonymous "fort.NNN" file for a hitherto unseen unit. Differential Revision: https://reviews.llvm.org/D127788 | 3 年前 | |
[flang][runtime] Reset unit frame buffer when re-opening An OPEN statement that implies closing a connection must invalidate the unit's frame buffer so as to prevent stale data from the old connection from being read into the newly-connected unit. Differential Revision: https://reviews.llvm.org/D130430 | 3 年前 | |
[flang] Fix READ/WRITE with POS= on stream units, with refactoring First, ExternalFileUnit::SetPosition was being used both as a utility within the class' member functions as well as an API from I/O statement processing. Make it private, and add APIs for SetStreamPos and SetDirectRec. Second, ensure that SetStreamPos for POS= positioning in a stream doesn't leave the current record number and endfile record number in an arbitrary state. In stream I/O they are used only to manage end-of-file detection, and shouldn't produce false positive results from IsAtEnd() after repositioning. Differential Revision: https://reviews.llvm.org/D128388 | 3 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 | |
[flang] Initial UTF-8 support in runtime I/O Implements UTF-8 encoding and decoding for external units with OPEN(ENCODING='UTF-8'). This encoding applies to default CHARACTER values that are not 7-bit ASCII as well as to the wide CHARACTER kinds 2 and 4. Basic testing is in place via direct calls to the runtime I/O APIs, but serious checkout awaits lowering support of the wide CHARACTER kinds. Differential Revision: https://reviews.llvm.org/D122038 | 4 年前 |