This is a follow-up to 
[JDK-8325877](https://bugs.openjdk.org/browse/JDK-8325877). I was careful in 
that bug not to change order of any lines, only split up the original file into 
parts.

In this PR, I use the new structure to improve the design. I collect the 
functionality into three clearly separate phases, preparation, compilation and 
linking. I use consistent naming to reveal whether a function just sets up 
variables, or create output. I simplify and split up a few extra hard to read 
functions. I move some code around so it is placed more logically.

It can be hard to convince yourself that the changes are correct if you just 
look at the end result. I have tried to make small and clear changes in each 
separate commit, and to explain in the commit title what I am doing. I 
recommend reviewing this PR [commit by 
commit](https://github.com/openjdk/jdk/pull/17873/commits).

-------------

Commit messages:
 - Inline SetupDebugSymbols into SetupCompilerFlags
 - Fix indentation in the new functions
 - Extract CreateStaticLibrary and CreateDynamicLibraryOrExecutable
 - Move GetEntitlement setup to SetupLinking. Inline GetSymbols (for static 
builds).
 - Simplify SetupCompileFileFlags by passing in $$($1_BASE) as $2
 - Clearly separate the steps into preparation, compilation and linking.
 - Be consistent (and explicit) about the use of Setup vs Create. Collect all 
Setup functions at the start.
 - Combine the linking preparations
 - Combine the three SetupBasicVariables functions

Changes: https://git.openjdk.org/jdk/pull/17873/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17873&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325963
  Stats: 385 lines in 6 files changed: 132 ins; 130 del; 123 mod
  Patch: https://git.openjdk.org/jdk/pull/17873.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17873/head:pull/17873

PR: https://git.openjdk.org/jdk/pull/17873

Reply via email to