Branch: refs/heads/main
Revision: ac493ce
Author: dlongnecke-cray
Link: compiler/next: Parse pragmas and deprecation statements by dlongnecke-cray · Pull Request #18701 · chapel-lang/chapel · GitHub
Log Message:
Merge pull request #18701 from dlongnecke-cray/next-add-pragmas-deprecated
This is for compiler/next
.
Adjust the compiler/next parser to parse pragma lists and deprecation
statements. The components are stashed in the internal parser state
and used to build a new uAST
node called Attributes
that is made
a child of the closest Decl
.
Create a new uAST
class called Attributes
. It currently stores
pragmas, whether or not the parent Decl
is deprecated, as well as
a custom deprecation message, if one exists.
Adjust all concrete children of Decl
to take an Attributes
as an
argument to their build
function.
Move all the flags declared in compiler/include/flags_list.h
into
the compiler library under next/include/chpl/uast/PragmaList.h
.
Remove the flags_list.h
header.
Rename three OPT_INFO flags that were causing trouble with macro
expansion (due to having different names that did not start with
FLAG_
).
Adjust the convert-uast
pass to attach attributes to symbols.
Reviewed by @daviditen, @mppf. Thanks!
TESTING:
- [x] Almost all primers with
--compiler-library-parser
- [x] The
chpldoc
primer with--compiler-library-parser
- [x] All on
linux64
withCOMM=none
Signed-off-by: David Longnecker dlongnecke-cray@users.noreply.github.com
Modified Files:
A compiler/next/include/chpl/uast/Attributes.h
A compiler/next/include/chpl/uast/Pragma.h
A compiler/next/include/chpl/uast/PragmaList.h
A compiler/next/lib/uast/Attributes.cpp
A compiler/next/lib/uast/Pragma.cpp
A compiler/next/test/parsing/testParseAttributes.cpp
R compiler/include/flags_list.h
M compiler/AST/flags.cpp
M compiler/AST/primitive.cpp
M compiler/include/flags.h
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/AggregateDecl.h
M compiler/next/include/chpl/uast/Class.h
M compiler/next/include/chpl/uast/Decl.h
M compiler/next/include/chpl/uast/Enum.h
M compiler/next/include/chpl/uast/EnumElement.h
M compiler/next/include/chpl/uast/Formal.h
M compiler/next/include/chpl/uast/Function.h
M compiler/next/include/chpl/uast/Module.h
M compiler/next/include/chpl/uast/MultiDecl.h
M compiler/next/include/chpl/uast/NamedDecl.h
M compiler/next/include/chpl/uast/Record.h
M compiler/next/include/chpl/uast/TaskVar.h
M compiler/next/include/chpl/uast/TupleDecl.h
M compiler/next/include/chpl/uast/TypeDecl.h
M compiler/next/include/chpl/uast/Union.h
M compiler/next/include/chpl/uast/VarArgFormal.h
M compiler/next/include/chpl/uast/VarLikeDecl.h
M compiler/next/include/chpl/uast/Variable.h
M compiler/next/include/chpl/uast/all-uast.h
M compiler/next/lib/parsing/ParserContext.h
M compiler/next/lib/parsing/ParserContextImpl.h
M compiler/next/lib/parsing/bison-chpl-lib.cpp
M compiler/next/lib/parsing/bison-chpl-lib.h
M compiler/next/lib/parsing/chpl.lex
M compiler/next/lib/parsing/chpl.ypp
M compiler/next/lib/parsing/flex-chpl-lib.cpp
M compiler/next/lib/parsing/flex-chpl-lib.h
M compiler/next/lib/uast/Builder.cpp
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/Class.cpp
M compiler/next/lib/uast/Enum.cpp
M compiler/next/lib/uast/EnumElement.cpp
M compiler/next/lib/uast/Formal.cpp
M compiler/next/lib/uast/Function.cpp
M compiler/next/lib/uast/Makefile.include
M compiler/next/lib/uast/Module.cpp
M compiler/next/lib/uast/MultiDecl.cpp
M compiler/next/lib/uast/Record.cpp
M compiler/next/lib/uast/TaskVar.cpp
M compiler/next/lib/uast/TupleDecl.cpp
M compiler/next/lib/uast/Union.cpp
M compiler/next/lib/uast/VarArgFormal.cpp
M compiler/next/lib/uast/Variable.cpp
M compiler/next/test/parsing/CMakeLists.txt
M compiler/next/test/uast/testBuildIDs.cpp
M compiler/optimizations/optimizeForallUnorderedOps.cpp
M compiler/passes/convert-uast.cpp
M doc/util/nitpick_ignore
Compare: https://github.com/chapel-lang/chapel/compare/c253b85c8f4e...ac493ce6e157