[flang-commits] [flang] [flang] flang manpage overhaul (PR #144948)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Fri Jun 20 09:05:17 PDT 2025


================
@@ -1,22 +1,61 @@
-Flang Manual Page (In Progress)
-==================================================
-
-.. note::
-    This man page is under development.
-
-For full documentation, please see the online HTML docs:
-
-https://flang.llvm.org/docs/
-
-..  
-  The placeholder text "FlangCommandLineReference" below should eventually be replaced with the actual man page contents.  
-
-----
-
-Flang Command Line Reference
-----------------------------
+flang - the Fortran compiler
+============================
+
+SYNOPSIS
+--------
+
+:program:`flang` [*options*] *filename ...*
+
+DESCRIPTION
+-----------
+
+:program:`flang` is a Fortran compiler which encompasses preprocessing, parsing,
+optimization, code generation, assembly, and linking.  Depending on which
+high-level mode setting is passed, Flang will stop before doing a full link.
+While Flang is highly integrated, it is important to understand the stages of
+compilation, to understand how to invoke it.  These stages are:
+
+Driver
+    The flang executable is actually a small driver which controls the overall
+    execution of other tools such as the compiler, assembler and linker.
+    Typically you do not need to interact with the driver, but you
+    transparently use it to run the other tools.
+
+Preprocessing
+    This stage handles tokenization of the input source file, macro expansion,
+    #include expansion and handling of other preprocessor directives.
+
+Parsing and Semantic Analysis
+    This stage parses the input file, translating preprocessor tokens into a
+    parse tree.  Once in the form of a parse tree, it applies semantic
+    analysis to compute types for expressions as well and determine whether
+    the code is well formed. This stage is responsible for generating most of
+    the compiler warnings as well as parse errors.
+
+Code Generation and Optimization
+    This stage creates the intermediate code (known as "LLVM IR") and ultimately
+    to machine code.  This phase is responsible for optimizing the generated
+    code and handling target-specific code generation. The output of this stage
+    is typically called a ".s" file or "assembly" file.
----------------
tarunprabhu wrote:

```suggestion
    This stage translates the parse tree into intermediate code (known as "LLVM IR")
    and, ultimately, machine code.  It also optimizes this intermediate code and
    handles target-specific code generation. The output of this stage
    is typically a ".s" file, referred to as an "assembly" file.
```

https://github.com/llvm/llvm-project/pull/144948


More information about the flang-commits mailing list