| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang] CUDA Fortran - part 5/5: statement semantics Canonicalize !$CUF KERNEL DO loop nests, similar to OpenACC/OpenMP canonicalization. Check statements and expressions in device contexts for usage that isn't supported. Add more tests, and include some tweaks to standard modules needed to build CUDA Fortran modules. Depends on https://reviews.llvm.org/D150159, https://reviews.llvm.org/D150161, https://reviews.llvm.org/D150162, & https://reviews.llvm.org/D150163. Differential Revision: https://reviews.llvm.org/D150164 | 3 年前 | |
[flang] Finer control over warnings Establish a set of optional usage warnings, and enable some only in "-pedantic" mode that, in our subjective experience with application codes, seem to issue frequently without indicating usage that really needs to be corrected. By default, with this patch the compiler should appear to be somewhat less persnickety but not less informative. Differential Revision: https://reviews.llvm.org/D150710 | 3 年前 | |
[flang] Fix pointer definition semantic checking via refactoring The infrastructure in semantics that is used to check that the left-hand sides of normal assignment statements are really definable variables was not being used to check whether the LHSs of pointer assignments are modifiable, and so most cases of unmodifiable pointers are left undiagnosed. Rework the semantics checking for pointer assignments, NULLIFY statements, pointer dummy arguments, &c. so that cases of unmodifiable pointers are properly caught. This has been done by extracting all the various definability checking code that has been implemented for different contexts in Fortran into one new facility. The new consolidated definability checking code returns messages meant to be attached as "because: " explanations to context-dependent errors like "left-hand side of assignment is not definable". These new error message texts and their attached explanations affect many existing tests, which have been updated. The testing infrastructure was extended by another patch to properly compare warnings and explanatory messages, which had been ignored until recently. Differential Revision: https://reviews.llvm.org/D136979 | 3 年前 | |
[flang] Restore ENUM_CLASS() to be compilation-time code Rework some recent changes to the ENUM_CLASS() macro so that all of the construction of enumerator-to-name string mapping data structures is again performed at compilation time. Differential Revision: https://reviews.llvm.org/D137859 | 3 年前 | |
[flang][openacc] Relax rule for end directive on combined construct Make the keyword loop optional for the end driective on combined construct. This done to extend compatibility with other compiler that allow this. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D151856 | 3 年前 | |
[flang][openacc] Semantic checks for OpenACC 3.0 clauses validity Summary: This patch adds semantic checking for the OpenACC 3.0 clauses validity. Reviewers: sscalpone, tskeith, klausler, ichoyjx, DavidTruby, jdoerfert Reviewed By: tskeith, klausler Subscribers: mgorny, llvm-commits Tags: #llvm, #flang Differential Revision: https://reviews.llvm.org/D83807 | 5 年前 | |
[flang] Add & use a better visit() (take 2) Adds flang/include/flang/Common/log2-visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit(). Modifies most use sites in the front-end and runtime to use common::visit(). The C++ standard mandates that std::visit() have O(1) execution time, which forces implementations to build dispatch tables. This new common::visit() is O(log2 N) in the number of alternatives in a variant<>, but that N tends to be small and so this change produces a fairly significant improvement in compiler build memory requirements, a 5-10% improvement in compiler build time, and a small improvement in compiler execution time. Building with -DFLANG_USE_STD_VISIT causes common::visit() to be an alias for std::visit(). Calls to common::visit() with multiple variant arguments are referred to std::visit(), pending further work. This change is enabled only for GCC builds with GCC >= 9; an earlier attempt (D122441) ran into bugs in some versions of clang and was reverted rather than simply disabled; and it is not well tested with MSVC. In non-GCC and older GCC builds, common::visit() is simply an alias for std::visit(). | 4 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] OpenMP allocate directive parse tree fix Addresses the same issue as the following abandoned revision: D104391. Rewrite leading declarative allocations so they are nested within their respective executable allocate directive Original: ExecutionPartConstruct -> OpenMPDeclarativeAllocate ExecutionPartConstruct -> OpenMPDeclarativeAllocate ExecutionPartConstruct -> OpenMPExecutableAllocate After rewriting: ExecutionPartConstruct -> OpenMPExecutableAllocate | ExecutionPartConstruct -> OpenMPDeclarativeAllocate | ExecutionPartConstruct -> OpenMPDeclarativeAllocate Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D148409 Co-authored-by: Isaac Perry <isaac.perry@arm.com> | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang][openacc] Add semantic check for reduction operator and types Check the combination of reduction operator and types. This is currently not checking common block and composite types. Depends on D155105 Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D155106 | 3 年前 | |
[openacc][NFC] Bump parser support number to OpenACC 3.3 Parser support reached OpenACC 3.3 specification. Bump the numbers to reflect the latest specs. Reviewed By: razvanlupusoru, awarzynski Differential Revision: https://reviews.llvm.org/D154249 | 3 年前 | |
[flang] Add optional portability warning for upcoming Fortran 202X/3 breaking change The soon-to-be-published next revision of the ISO Fortran language standard contains a couple of breaking changes to previous specifications that may cause existing programs to silently change their behavior. For the change that introduces automatic reallocation of deferred length allocatable character scalar variables when they appear as the targets of internal WRITE statements, as IOMSG=/ERRMSG= variables, as outputs of INQUIRE specifiers, or as INTENT(OUT) arguments to intrinsic procedures, this patch adds an optional portability warning. Differential Revision: https://reviews.llvm.org/D154242 | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Finer control over error recovery with GetExpr() Prior to this patch, the semantics utility GetExpr() will crash unconditionally if it encounters a typed expression in the parse tree that has not been set by expression semantics. This is the right behavior when called from lowering, by which time it is known that the program had no fatal user errors, since it signifies a fatal internal error. However, prior to lowering, in the statement semantics checking code, a more nuanced test should be used before crashing -- specifically, we should not crash in the face of a missing typed expression when in error recovery mode. Getting this right requires GetExpr() and its helper class to have access to the semantics context, so that it can check AnyFatalErrors() before crashing. So this patch touches nearly all of its call sites. Differential Revision: https://reviews.llvm.org/D123873 | 4 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Ensure that NULL(without MOLD=) not passed to dummy argument with assumed type parameters A dummy argument with an assumed (*) character length or derived type parameter value specification needs to be associated with an actual argument that can supply a value for it, so make sure that a NULL without a MOLD= is not being passed. Differential Revision: https://reviews.llvm.org/D155971 | 2 年前 | |
[flang] Finer control over warnings Establish a set of optional usage warnings, and enable some only in "-pedantic" mode that, in our subjective experience with application codes, seem to issue frequently without indicating usage that really needs to be corrected. By default, with this patch the compiler should appear to be somewhat less persnickety but not less informative. Differential Revision: https://reviews.llvm.org/D150710 | 3 年前 | |
[flang] Downgrade a fatal error to a warning A non-CHARACTER expression in a CASE statement is allowed to have a distinct kind (not type) from the expression in its SELECT CASE. If a value in a CASE statement is out of range for the SELECT CASE type, emit a warning, but it should not be a fatal error. Differential Revision: https://reviews.llvm.org/D124544 | 4 年前 | |
[flang] Semantics for SELECT CASE Prep for review Respond to review comments Fix first line in new test Original-commit: flang-compiler/f18@12f6f30600db4cb3902677cd42764450ddeda5e0 Reviewed-on: https://github.com/flang-compiler/f18/pull/1089 | 6 年前 | |
[flang] Add optional portability warning for upcoming Fortran 202X/3 breaking change The soon-to-be-published next revision of the ISO Fortran language standard contains a couple of breaking changes to previous specifications that may cause existing programs to silently change their behavior. For the change that introduces automatic reallocation of deferred length allocatable character scalar variables when they appear as the targets of internal WRITE statements, as IOMSG=/ERRMSG= variables, as outputs of INQUIRE specifiers, or as INTENT(OUT) arguments to intrinsic procedures, this patch adds an optional portability warning. Differential Revision: https://reviews.llvm.org/D154242 | 3 年前 | |
[flang] Apply the check for the constraint C1172 to more stmts Apply the check for the constraint C1172 to unlock-stmt, change-team-stmt, end-team-stmt, and critical-stmt, which all have sync-stat-lists and so C1172 applies to them. Add a test to check the sync-stat-lists for these 4 statements. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D150745 | 3 年前 | |
[flang] CUDA Fortran - part 5/5: statement semantics Canonicalize !$CUF KERNEL DO loop nests, similar to OpenACC/OpenMP canonicalization. Check statements and expressions in device contexts for usage that isn't supported. Add more tests, and include some tweaks to standard modules needed to build CUDA Fortran modules. Depends on https://reviews.llvm.org/D150159, https://reviews.llvm.org/D150161, https://reviews.llvm.org/D150162, & https://reviews.llvm.org/D150163. Differential Revision: https://reviews.llvm.org/D150164 | 3 年前 | |
[flang] CUDA Fortran - part 5/5: statement semantics Canonicalize !$CUF KERNEL DO loop nests, similar to OpenACC/OpenMP canonicalization. Check statements and expressions in device contexts for usage that isn't supported. Add more tests, and include some tweaks to standard modules needed to build CUDA Fortran modules. Depends on https://reviews.llvm.org/D150159, https://reviews.llvm.org/D150161, https://reviews.llvm.org/D150162, & https://reviews.llvm.org/D150163. Differential Revision: https://reviews.llvm.org/D150164 | 3 年前 | |
[flang][runtime] Initialize uninitialized pointer components Pointer components without default initialization pose some difficult (or impossible) problems when they appear as right-hand side targets in pointer assignment statements; they may contain garbage or stale data that looks enough like a valid descriptor to cause a crash. Solve the problem by avoiding it -- ensure that pointers' descriptors are at least minimally established. Differential Revision: https://reviews.llvm.org/D149979 | 3 年前 | |
[flang] Implement semantics for DEC STRUCTURE/RECORD Implements part of the legacy "DEC structures" feature from VMS Fortran. STRUCTUREs are processed as if they were derived types with SEQUENCE. DATA-like object entity initialization is supported as well (e.g., INTEGER FOO/666/) since it was used for default component initialization in structures. Anonymous components (named %FILL) are also supported. These features, and UNION/MAP, were already being parsed. An omission in the collection of structure field names in the case of nested structures with entity declarations was fixed in the parser. Structures are supported in modules, but this is mostly for testing purposes. The names of fields in structures accessed via USE association cannot appear with dot notation in client code (at least not yet). DEC structures antedate Fortran 90, so their actual use in applications should not involve modules. This patch does not implement UNION/MAP, since that feature would impose difficulties later in lowering them to MLIR types. In the meantime, if they appear, semantics will issue a "not yet implemented" error message. Differential Revision: https://reviews.llvm.org/D117151 | 4 年前 | |
[flang] Add optional portability warning for upcoming Fortran 202X/3 breaking change The soon-to-be-published next revision of the ISO Fortran language standard contains a couple of breaking changes to previous specifications that may cause existing programs to silently change their behavior. For the change that introduces automatic reallocation of deferred length allocatable character scalar variables when they appear as the targets of internal WRITE statements, as IOMSG=/ERRMSG= variables, as outputs of INQUIRE specifiers, or as INTENT(OUT) arguments to intrinsic procedures, this patch adds an optional portability warning. Differential Revision: https://reviews.llvm.org/D154242 | 3 年前 | |
[flang] Use definability tests for better PURE constraint checking Many semantic checks for constraints related to PURE subprograms can be implemented in terms of Semantics' "definable.h" utilities, slightly expanded. Replace some particular PURE constraint checks with calls to WhyNotDefinable(), except for cases that had better specific error messages, and start checking some missing constraints with DEALLOCATE statements and local variable declarations. Differential Revision: https://reviews.llvm.org/D147389 | 3 年前 | |
[flang] Fix portability warning that was incorrectly an "else if" A semantics check for an assumed-length dummy procedure pointer was inappropriately part of an "else" clause for a preceding check, causing it to not be applied in all situations. Differential Revision: https://reviews.llvm.org/D155975 | 2 年前 | |
[flang] Improve initializer semantics, esp. for component default values This patch plugs many holes in static initializer semantics, improves error messages for default initial values and other component properties in parameterized derived type instantiations, and cleans up several small issues noticed during development. We now do proper scalar expansion, folding, and type, rank, and shape conformance checking for component default initializers in derived types and PDT instantiations. The initial values of named constants are now guaranteed to have been folded when installed in the symbol table, and are no longer folded or scalar-expanded at each use in expression folding. Semantics documentation was extended with information about the various kinds of initializations in Fortran and when each of them are processed in the compiler. Some necessary concomitant changes have bulked this patch out a bit: * contextual messages attachments, which are now produced for parameterized derived type instantiations so that the user can figure out which instance caused a problem with a component, have been added as part of ContextualMessages, and their implementation was debugged * several APIs in evaluate::characteristics was changed so that a FoldingContext is passed as an argument rather than just its intrinsic procedure table; this affected client call sites in many files * new tools in Evaluate/check-expression.cpp to determine when an Expr actually is a single constant value and to validate a non-pointer variable initializer or object component default value * shape conformance checking has additional arguments that control whether scalar expansion is allowed * several now-unused functions and data members noticed and removed * several crashes and bogus errors exposed by testing this new code were fixed * a -fdebug-stack-trace option to enable LLVM's stack tracing on a crash, which might be useful in the future TL;DR: Initialization processing does more and takes place at the right times for all of the various kinds of things that can be initialized. Differential Review: https://reviews.llvm.org/D92783 | 5 年前 | |
Use llvm::is_contained (NFC) | 3 年前 | |
[flang] Catch impure specifics called in DO CONCURRENT Rework the code used to check for calls to impure procedures in DO CONCURRENT constructs. The current code wasn't checking the representation of the procedure references in the strongly typed expressions, so it was missing calls to impure subprograms made via generic interfaces. While here, improve error messages, and fix some minor issues exposed by testing the improved checks. Differential Revision: https://reviews.llvm.org/D155489 | 3 年前 | |
[flang] Fix crash on erroneous expressions Summary: If you create an expression with parse errors, the parser::Expr.typedExpr will be empty, which causes a compiler crash. The crash is caused by the check in check-do-forall.cpp that scans all expresssions to see if DO variables are being modified. It turned out that the problem was that I was fetching subexpressions of type parser::Expr, which are not guaranteed to have a non-null typedExpr. I fixed this by only grabbing the top-level expression from which to gather arguments as part of the DO loop analysis. This, in turn, exposed a problem where I wasn't collecting all of the actual arguments in an expression. This was caused by the fact that I wasn't recursing through the rest of the expression after finding an argument. I fixed this by recursing through the argument in the member function in CollectActualArgumentsHelper. Reviewers: klausler, tskeith, DavidTruby Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81101 | 6 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Add optional portability warning for upcoming Fortran 202X/3 breaking change The soon-to-be-published next revision of the ISO Fortran language standard contains a couple of breaking changes to previous specifications that may cause existing programs to silently change their behavior. For the change that introduces automatic reallocation of deferred length allocatable character scalar variables when they appear as the targets of internal WRITE statements, as IOMSG=/ERRMSG= variables, as outputs of INQUIRE specifiers, or as INTENT(OUT) arguments to intrinsic procedures, this patch adds an optional portability warning. Differential Revision: https://reviews.llvm.org/D154242 | 3 年前 | |
[flang] Rework handling of non-type-bound user-defined I/O A fairly recent introduction of runtime I/O APIs called OutputDerivedType() and InputDerivedType() didn't cover NAMELIST I/O's need to access non-type-bound generic interfaces for user-defined derived type I/O when those generic interfaces are defined in some scope other than the one that defines the derived type. The patch adds a new data structure shared between lowering and the runtime that can represent all of the cases that can arise with non-type-bound defined I/O. It can represent scopes in which non-type-bound defined I/O generic interfaces are inaccessible, too, due to IMPORT statements. The data structure is now an operand to OutputDerivedType() and InputDerivedType() as well as a data member in the NamelistGroup structure. Differential Revision: https://reviews.llvm.org/D148257 | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Fix pointer definition semantic checking via refactoring The infrastructure in semantics that is used to check that the left-hand sides of normal assignment statements are really definable variables was not being used to check whether the LHSs of pointer assignments are modifiable, and so most cases of unmodifiable pointers are left undiagnosed. Rework the semantics checking for pointer assignments, NULLIFY statements, pointer dummy arguments, &c. so that cases of unmodifiable pointers are properly caught. This has been done by extracting all the various definability checking code that has been implemented for different contexts in Fortran into one new facility. The new consolidated definability checking code returns messages meant to be attached as "because: " explanations to context-dependent errors like "left-hand side of assignment is not definable". These new error message texts and their attached explanations affect many existing tests, which have been updated. The testing infrastructure was extended by another patch to properly compare warnings and explanatory messages, which had been ignored until recently. Differential Revision: https://reviews.llvm.org/D136979 | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[Flang] [OpenMP] [Semantics] Change SIMD ALIGNED clause support from parsing a std::list<Name> to OmpObjectlist This is an assisting patch which is implemented to address review comment to switch std::list<Name> to OmpObjectlist from https://reviews.llvm.org/D142722. Also addressed a semantic check https://github.com/llvm/llvm-project/issues/61161 OpenMP 5.2 standard states that only pointer variables (C_PTR, Cray pointers, POINTER or ALLOCATABLE items) can appear in SIMD aligned clause (section 5.11). And not to allow common block names on an ALIGNED clause. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D152637 | 3 年前 | |
[Flang][OpenMP][Sema] More gracefully handle undefined symbol in a no implicit module for declare target Prior to this change, if you define a module as such with a declare target in it: module test_0 implicit none !$omp declare target(no_implicit_materialization_1) end module test_0 The compiler will crash rather than give some form of reasonable diagnostic. This patch attempts to fix that. Reviewers: kiranchandramohan Differential Revision: https://reviews.llvm.org/D149913 | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Fix semantics check for RETURN statement The RETURN statement is allowed in functions and subroutines, but not in main programs. It is however a common extension, which we also implement, to allow RETURN from main programs -- we only issue a portability warning when -pedantic or -std=f2018 are set. This patch fixes false positives for this portability warning, where it was triggered also when RETURN was present in functions or subroutines. Fixexs #55080 Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D124732 | 4 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Add & use a better visit() (take 2) Adds flang/include/flang/Common/log2-visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit(). Modifies most use sites in the front-end and runtime to use common::visit(). The C++ standard mandates that std::visit() have O(1) execution time, which forces implementations to build dispatch tables. This new common::visit() is O(log2 N) in the number of alternatives in a variant<>, but that N tends to be small and so this change produces a fairly significant improvement in compiler build memory requirements, a 5-10% improvement in compiler build time, and a small improvement in compiler execution time. Building with -DFLANG_USE_STD_VISIT causes common::visit() to be an alias for std::visit(). Calls to common::visit() with multiple variant arguments are referred to std::visit(), pending further work. This change is enabled only for GCC builds with GCC >= 9; an earlier attempt (D122441) ran into bugs in some versions of clang and was reverted rather than simply disabled; and it is not well tested with MSVC. In non-GCC and older GCC builds, common::visit() is simply an alias for std::visit(). | 4 年前 | |
[flang]Semantics for SELECT RANK. Summary: Initially on github I worked on semantic checks.Then I tried some compile-time test of the rank value, they were failing as there were no symbols generated for them inside SELECT RANK's scope.So I went further to add new symbol in each scope, also added the respective 'rank: ' field for a symbol when we dump the symboltable. I added a field to keep track of the rank in AssocEntityDetails class.This caused shape analysis framework to become inconsistent. So shape analysis framework was updated to handle this new representation. * I added more tests for above changes. * On phabricator I addressed some minor changes. * Lastly I worked on review comments. Reviewers: klausler,sscalpone,DavidTruby,kiranchandramohan,tskeith,anchu-rajendran,kiranktp Reviewed By:klausler, DavidTruby, tskeith Subscribers:#flang-commits, #llvm-commits Tags: #flang, #llvm Differential Revision: https://reviews.llvm.org/D78623 | 6 年前 | |
[flang] Check that a SELECT TYPE selector is not a procedure A SELECT TYPE statement's selector must be a variable or expression, not a procedure; specifically, a function with a polymorphic result is unacceptable. Differential Revision: https://reviews.llvm.org/D145742 | 3 年前 | |
[flang] Semantics for SELECT TYPE Summary: Added support for all semantic checks except C1157 was previously implemented. Address review comments. Reviewers: PeteSteinfeld, tskeith, klausler, DavidTruby, kiranktp, anchu-rajendran, sscalpone Subscribers: kiranchandramohan, llvm-commits, flang-commits Tags: #llvm, #flang Differential Revision: https://reviews.llvm.org/D79851 | 6 年前 | |
[flang] Finer control over error recovery with GetExpr() Prior to this patch, the semantics utility GetExpr() will crash unconditionally if it encounters a typed expression in the parse tree that has not been set by expression semantics. This is the right behavior when called from lowering, by which time it is known that the program had no fatal user errors, since it signifies a fatal internal error. However, prior to lowering, in the statement semantics checking code, a more nuanced test should be used before crashing -- specifically, we should not crash in the face of a missing typed expression when in error recovery mode. Getting this right requires GetExpr() and its helper class to have access to the semantics context, so that it can check AnyFatalErrors() before crashing. So this patch touches nearly all of its call sites. Differential Revision: https://reviews.llvm.org/D123873 | 4 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Ensure that CLASS(*) component descriptors have addenda In the calculation of derived type component byte sizes, ensure that CLASS(*) unlimited polymorphic components have space allocated for their addenda. Differential Revision: https://reviews.llvm.org/D145248 | 3 年前 | |
[flang] Implement STORAGE_SIZE(), SIZEOF(), C_SIZEOF() STORAGE_SIZE() is a standard inquiry intrinsic (size in bits of an array element of the same type as the argument); SIZEOF() is a common extension that returns the size in bytes of its argument; C_SIZEOF() is a renaming of SIZEOF() in module ISO_C_BINDING. STORAGE_SIZE() and SIZEOF() are implemented via rewrites to expressions; these expressions will be constant when the necessary type parameters and bounds are also constant. Code to calculate the sizes of types (with and without alignment) was isolated into Evaluate/type.* and /characteristics.*. Code in Semantics/compute-offsets.* to calculate sizes and alignments of derived types' scopes was exposed so that it can be called at type instantiation time (earlier than before) so that these inquiry intrinsics could be called from specification expressions. Differential Revision: https://reviews.llvm.org/D93322 | 5 年前 | |
[flang] Fix crash from bug#63099 (gfortran/regression/oldstyle_3.f90) In InitElement() in flang/lib/Semantics/data-to-inits.cpp, don't assume that values_.Location() can be called until after it has been verified that values_.IsAtEnd() is not true. Fixes https://github.com/llvm/llvm-project/issues/63099. Differential Revision: https://reviews.llvm.org/D152183 | 3 年前 | |
[Flang] Run clang-format on all flang files This will make it easier for me to do reviews. Differential Revision: https://reviews.llvm.org/D137291 | 3 年前 | |
[flang] Emit errors on vector subscripts with duplicated elements when object must be definable When the left-hand side of an assignment, or any other context demanding definability, comprises a designator with a vector subscript that is known at compilation time to have one or more duplicated elements, emit an error message. Differential Revision: https://reviews.llvm.org/D155492 | 3 年前 | |
[flang] Emit errors on vector subscripts with duplicated elements when object must be definable When the left-hand side of an assignment, or any other context demanding definability, comprises a designator with a vector subscript that is known at compilation time to have one or more duplicated elements, emit an error message. Differential Revision: https://reviews.llvm.org/D155492 | 3 年前 | |
[flang] Enforce F'2023 C7125 An item whose declared type is ABSTRACT may not appear in an array constructor. Differential Revision: https://reviews.llvm.org/D155969 | 2 年前 | |
[flang] CUDA Fortran - part 2/5: symbols & scopes Add representations of CUDA Fortran data and subprogram attributes to the symbol table and scopes of semantics. Set them in name resolution, and emit them to module files. Depends on https://reviews.llvm.org/D150159. Differential Revision: https://reviews.llvm.org/D150161 | 3 年前 | |
[flang] BIND(C,NAME=...) corrections The Fortran standard's various restrictions on the use of BIND(C) often depend more on the presence or absence of an explicit NAME= specification rather than on its value, but semantics and module file generation aren't making distinctions between explicit NAME= specifications that happen to match the default name and declarations that don't have NAME=. Tweak semantics and module file generation to conform, and also complain when named BIND(C) attributes are erroneously applied to entities that can't support them, like ABSTRACT interfaces. Differential Revision: https://reviews.llvm.org/D145107 | 3 年前 | |
[flang] Finer control over warnings Establish a set of optional usage warnings, and enable some only in "-pedantic" mode that, in our subjective experience with application codes, seem to issue frequently without indicating usage that really needs to be corrected. By default, with this patch the compiler should appear to be somewhat less persnickety but not less informative. Differential Revision: https://reviews.llvm.org/D150710 | 3 年前 | |
[flang] Finer control over warnings Establish a set of optional usage warnings, and enable some only in "-pedantic" mode that, in our subjective experience with application codes, seem to issue frequently without indicating usage that really needs to be corrected. By default, with this patch the compiler should appear to be somewhat less persnickety but not less informative. Differential Revision: https://reviews.llvm.org/D150710 | 3 年前 | |
[flang] Fix spurious errors from MODULE subprograms When an explicit MODULE procedure is defined in the same (sub)module as its interface, and the interface was defined in a generic interface of the same name, bogus errors about symbols already having been defined will ensue. Cleaning up this aspect of name resolution and symbol table management requires marking the place-holding SubprogramNameDetails symbols of explicit MODULE subprograms as such, ensuring that that attribute is not inherited if the SubprogramNameDetails symbol is recycled as a SubprogramDetails, and gathering some code that should have been common between BeginSubprogram() and BeginMpSubprogram() together in one new routine. Differential Revision: https://reviews.llvm.org/D134446 | 3 年前 | |
[flang] Avoid global name conflict when BIND(C,NAME=) is used At the top level of program units in a source file, two subprograms are allowed to have the same name if at least one of them has a distinct interoperable binding name. F18's symbol table requires (most) symbols in a scope to have distinct names, though. Solve by using compiler-created names for the symbols of global scope subprograms that have interoperable binding names. Differential Revision: https://reviews.llvm.org/D124295 | 4 年前 | |
[flang][NFC] Remove duplicate of getDesignatorNameIfDataRef function Remove duplicate of the getDesignatorNameIfDataRef() function. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D155105 | 3 年前 | |
[flang][NFC] Extract name resolution for OpenACC & OpenMP into new file Move ResolveAccParts and ResolveOmpParts from resolve-names.cpp to resolve-directives.{h,cpp}. Move the implementation in the classes DirectiveAttributeVisitor, AccAttributeVisitor, and OmpAttributeVisitor to resolve-directives.cpp as well. To allow this to happen, move EvaluateIntExpr and introduce EvaluateInt64 to resolve-names-utils.h. The latter is also useful elsewhere in resolve-names.cpp for converting an Expr to std::int64_t. The other problem was that ResolveDesignator was called from the code that was moved. At the moment it doesn't seem to be doing anything so I removed the calls (and no tests failed). If it proves to be needed, we can either resolve those designators in resolve-names.cpp or pass the ResolveDesignator function in to the code that needs to call it. Differential Revision: https://reviews.llvm.org/D84768 | 5 年前 | |
[flang] Finer control over warnings Establish a set of optional usage warnings, and enable some only in "-pedantic" mode that, in our subjective experience with application codes, seem to issue frequently without indicating usage that really needs to be corrected. By default, with this patch the compiler should appear to be somewhat less persnickety but not less informative. Differential Revision: https://reviews.llvm.org/D150710 | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Support for PowerPC vector type The following PowerPC vector type syntax is added: VECTOR ( element-type-spec ) where element-type-sec is integer-type-spec, real-type-sec or unsigned-type-spec. Two opaque types (__VECTOR_PAIR and __VECTOR_QUAD) are also added. A finite set of functionalities are implemented in order to support the new types: 1. declare objects 2. declare function result 3. declare type dummy arguments 4. intrinsic assignment between the new type objects (e.g. v1=v2) 5. reference functions that return the new types Submit on behalf of @tislam @danielcchen Authors: @tislam @danielcchen Differential Revision: https://reviews.llvm.org/D150876 | 3 年前 | |
[flang] Map symbols in expressions when copying interface symbols Given a MODULE SUBROUTINE or MODULE FUNCTION interface followed later by a corresponding separate module subprogram definition in a MODULE PROCEDURE, the copies of the interface's dummy argument and function result symbols that populate the initial scope of that MODULE PROCEDURE need to have any symbol references in their types or bounds adjusted to point to their new counterparts. Differential Revision: https://reviews.llvm.org/D139200 | 3 年前 | |
[flang] Support implicit global external as procedure pointer target A name that has been used to reference an undeclared global external procedure should be accepted as the target of a procedure pointer assignment statement. Fixes llvm-test-suite/Fortran/gfortran/regression/proc_ptr_45.f90. Differential Revision: https://reviews.llvm.org/D155963 | 2 年前 | |
[flang] Distinguish intrinsic from non-intrinsic modules For "USE, INTRINSIC", search only for intrinsic modules; for "USE, NON_INTRINSIC", do not recognize intrinsic modules. Allow modules of both kinds with the same name to be used in the same source file (but not in the same scoping unit, a constraint of the standard that is now enforced). The symbol table's scope tree now has a single instance of a scope with a new kind, IntrinsicModules, whose children are the USE'd intrinsic modules (explicit or not). This separate "top-level" scope is a child of the single global scope and it allows both intrinsic and non-intrinsic modules of the same name to exist in the symbol table. Intrinsic modules' scopes' symbols now have the INTRINSIC attribute set. The search path directories need to make a distinction between regular directories and the one(s) that point(s) to intrinsic modules. I allow for multiple intrinsic module directories in the second search path, although only one is needed today. Differential Revision: https://reviews.llvm.org/D118631 | 4 年前 | |
[flang] Delay parse tree rewriting for I/O UNIT=func() When an I/O statement's UNIT= specifier is a variable that is a function reference, parse tree rewriting may determine the wrong type of the result because generic resolution has not yet been performed. So move this bit of parse tree rewriting into I/O semantic checking so that the right handling (integer -> external file unit number, character pointer -> internal I/O) applies. Differential Revision: https://reviews.llvm.org/D135210 | 3 年前 | |
[flang] Reformat with latest clang-format and .clang-format Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094 | 6 年前 | |
[flang] Finalize &/or destroy ABSTRACT types The runtime type information tables always flag ABSTRACT types as needing neither destruction in general nor finalization in particular. This is incorrect. Although an ABSTRACT type may not itself have a FINAL procedure -- its argument cannot be polymorphic, but ABSTRACT types in declarations must always be so -- it can still have finalizable components &/or components requiring deallocation. Differential Revision: https://reviews.llvm.org/D155965 | 2 年前 | |
[flang] CUDA Fortran - part 2/5: symbols & scopes Add representations of CUDA Fortran data and subprogram attributes to the symbol table and scopes of semantics. Set them in name resolution, and emit them to module files. Depends on https://reviews.llvm.org/D150159. Differential Revision: https://reviews.llvm.org/D150161 | 3 年前 | |
[flang] Honor #line and related preprocessing directives Extend the SourceFile class to take account of #line directives when computing source file positions for error messages. Adjust the output of #line directives to -E output so that they reflect any #line directives that were in the input. Differential Revision: https://reviews.llvm.org/D153910 | 3 年前 | |
[flang] CUDA Fortran - part 2/5: symbols & scopes Add representations of CUDA Fortran data and subprogram attributes to the symbol table and scopes of semantics. Set them in name resolution, and emit them to module files. Depends on https://reviews.llvm.org/D150159. Differential Revision: https://reviews.llvm.org/D150161 | 3 年前 | |
[flang] Correct disambiguation of possible statement function definitions The statement "A(J) = expr" could be an assignment to an element of an array A, an assignment to the target of a pointer-valued function A, or the definition of a new statement function in the local scope named A, depending on whether it appears in (what might still be) the specification part of a program or subprogram and what other declarations and definitions for A might exist in the local scope or have been imported into it. The standard requires that the name of a statement function appear in an earlier type declaration statement if it is also the name of an entity in the enclosing scope. Some other Fortran compilers mistakenly enforce that rule in the case of an assignment to the target of a pointer-valued function in the containing scope, after misinterpreting the assignment as a new local statement function definition. This patch cleans up the handling of the various possibilities and resolves what was a crash in the case of a statement function definition whose name was the same as that of a procedure in the outer scope whose result is *not* a pointer. Differential Revision: https://reviews.llvm.org/D155493 | 3 年前 | |
[flang] Add DerivedTypeSpec::VectorTypeAsFortran for PPC vector type VectorTypeAsFortran is added for writing PPC vector types to modules. Coauthor: @tislam Differential Revision: https://reviews.llvm.org/D151757 | 3 年前 | |
[flang][openacc] Basic name resolution infrastructure for OpenACC construct Reviewed By: tskeith, klausler, ichoyjx Differential Revision: https://reviews.llvm.org/D83998 | 5 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 5 年前 |