From 232711df35cc20cf8a8b4ae7568335bdcc749c61 Mon Sep 17 00:00:00 2001 From: David Truby Date: Thu, 12 Mar 2020 16:38:59 +0000 Subject: [PATCH] [flang] Added documentation explaining the use of std::list (flang-compiler/f18#988) Original-commit: flang-compiler/f18@094f55890775362f093bb62c57c13b8d3436c82e Reviewed-on: https://github.com/flang-compiler/f18/pull/988 --- flang/documentation/Parsing.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flang/documentation/Parsing.md b/flang/documentation/Parsing.md index 4f584ee5aacd..b961cd630ae1 100644 --- a/flang/documentation/Parsing.md +++ b/flang/documentation/Parsing.md @@ -164,7 +164,12 @@ Parse tree entities should be viewed as values, not objects; their addresses should not be abused for purposes of identification. They are assembled with C++ move semantics during parse tree construction. Their default and copy constructors are deliberately deleted in their -declarations. +declarations. + +The std::list<> data type is used in the parse tree to reliably store pointers +to other relevant entries in the tree. Since the tree lists are moved and +spliced at certain points std::list<> provides the necessary guarantee of the +stability of pointers into these lists. There is a general purpose library by means of which parse trees may be traversed.