<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Hi list</div>
<div> </div>
<div>As discussed on previous threads, we need to propose a plan for making F18 more LLVM-like in style and use of LLVM APIs and facilities. David is working on getting the permissions to put this into a github project in LLVM so we can collaborate . In order
to make progress ahead of that happening, I'd like to have a go on email.</div>
<div> </div>
<div>For each area I would like to capture a list of work items we'll commit to doing before merge to monorepo. I want us to be happy we can achieve these in a short time period so we can propose a new merging date. I'd also like to create a list of items we'll
commit to fixing after merging to the monorepo and a timeline for getting that done.</div>
<div><font face="Times New Roman"> </font></div>
<div>Note that I'll only cover API and coding style work items in this thread. The other initiatives we can discuss in other threads. I'll just say that we'll propose cmake changes and porting test suite to lit in the pre-merge stuff and setting up build bots
in the post-merge stuff.</div>
<div> </div>
<div>When he has access, David can create two projects one for pre-merge and one for post-merge and we'll put everything in there.</div>
<div> </div>
<div>Please consider the below a strawman. All dates can change, all list items can change position, new ones can be added, items can be deleted, etc. </div>
<div> </div>
<div>What do people think about these lists? Do we think those two dates are do-able?</div>
<div> </div>
<div>Ta</div>
<div>Rich</div>
<div> </div>
<div>Proposal:</div>
<div>We will make the following style changes <b>before merging to the monorepo</b></div>
<div> </div>
<div>F18 changes to make it more LLVM-like in code style</div>
<div>1. Rationalise headers to put public headers in /include and not /lib</div>
<div>2. Unify F18's clang-format file to match LLVMs</div>
<div>3. Rename all .cc files to .cpp</div>
<div>4. Switch module names to starting with capital letters</div>
<div> </div>
<div>Increase use of LLVM APIs and utilities in F18</div>
<div>a. Switch F18 custom File handling to LLVM's File handling (helps with non-POSIX platform support)</div>
<div>b. Change uses of <iostream> to LLVM's streams</div>
<div>c. Migrate use of std::list to a suitable alternative in LLVM's API</div>
<div>d. Use llvm_unreachable with an error message for unreachable cases</div>
<div>e. Use llvm::Error instead of error codes if and when error codes are used.</div>
<div> </div>
<div>We would like to aim for a merge date of <b>Monday 24th Feb to merge to the monorepo</b> with all of the above changes committed to F18 master.</div>
<div> </div>
<div>We then propose to make the following changes <b>after merging to the monorepo</b>. </div>
<div> </div>
<div>F18 changes to make it more LLVM-like in code style</div>
<div>We will commit to a perform a one-off exercise where we automatically audit the code to find these instances and bring them in line.</div>
<div>1. Eliminate braces from all single-line if statements</div>
<div>2. Eliminate all uses of else-after-return</div>
<div>3. Add doxygen infrastructure so we can generate docs</div>
<div> </div>
<div>Increase use of LLVM APIs and utilities in F18</div>
<div>a. std::string $B"*(B StringRef where appropriate</div>
<div>b. std::vector $B"*(B llvm::SmallVector where appropriate</div>
<div>c. std::set $B"*(B llvm::SmallSet/llvm::StringSet/llvm::DenseSet where appropriate</div>
<div>d. std::map $B"*(B llvm::StringMap/llvm::DenseMap where appropriate</div>
<div>e. Audit functions in include/flang/common and port to LLVM equivalents (e.g. builtin_popcount)</div>
<div> </div>
<div>Assuming we hit the above merge date, we think we can commit to making these changes <b>before the LLVM11 branch is taken in June</b>.</div>
<div> </div>
<div><b>After that date</b>, we will continue to make progress towards LLVM style and API usage by fixing things as we find them during development and enforce the new style through code review.</div>
<div> </div>
<div>A few specific areas that have been mentioned before that we will tackle in this way are:</div>
<div>   - Add doxygen style comments and file comments</div>
<div>   - Find more expressive names for classes, files, etc.</div>
<div>   - Refactor code to use early exits</div>
<div><font face="Times New Roman"> </font></div>
</span></font>
</body>
</html>