Skip to content

Commit

Permalink
Document the -llvm-{as,llc,opt} compile-time options
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFluet committed Mar 15, 2024
1 parent a519b6e commit 5041fb4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
15 changes: 15 additions & 0 deletions doc/guide/src/CompileTimeOptions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,29 @@ e.g. `-link-opt '-Lpath -lfoo'`. If you wish to pass an option to the
linker, you must use `cc`’s `-Wl,` syntax, e.g.,
`-link-opt '-Wl,--export-dynamic'`.

* ``-llvm-as __llvm-as__``
+
Specify the executable for the LLVM `.ll` to `.bc` assembler;
can be used to select a specific version of the tool (e.g., `-llvm-as llvm-as-14`).

* ``-llvm-as-opt __option__``
+
Pass _option_ to `llvm-as` when assembling (`.ll` to `.bc`) LLVM code.

* ``-llvm-llc __llc__``
+
Specify the executable for the LLVM `.bc` to `.o` system compiler;
can be used to select a specific version of the tool (e.g., `-llvm-as llc-14`).

* ``-llvm-llc-opt __option__``
+
Pass _option_ to `llc` when compiling (`.bc` to `.o`) LLVM code.

* ``-llvm-opt __opt__``
+
Specify the executable for the LLVM `.bc` to `.bc` optimizer;
can be used to select a specific version of the tool (e.g., `-llvm-opt opt-14`).

* ``-llvm-opt-opt __option__``
+
Pass _option_ to `opt` when optimizing (`.bc` to `.bc`) LLVM code.
Expand Down
15 changes: 15 additions & 0 deletions man/mlton.1
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,29 @@ the same time, e.g. \fB\-link\-opt '\-Lpath \-lfoo'\fP. If you wish to
pass an option to the linker, you must use \fBgcc\fP's \fB\-Wl,\fP
syntax, e.g., \fB\-link\-opt '\-Wl,\-\-export\-dynamic'\fP.

.TP
\fB\-llvm\-as \fIllvm\-as\fP\R
Specify the executable for the LLVM \fB.ll\fP to \fB.bc\fP assembler;
can be used to select a specific version of the tool (e.g., \fB\-llvm\-as llvm\-as\-14\fP).

.TP
\fB\-llvm\-as\-opt \fIoption\fP\fR
Pass \fIoption\fP to \fBllvm-as\fP when assembling (\fB.ll\fP to \fB.bc\fP) LLVM code.

.TP
\fB\-llvm\-llc \fIllc\fP\R
Specify the executable for the LLVM \fB.bc\fP to \fB.o\fP system compiler;
can be used to select a specific version of the tool (e.g., \fB\-llvm\-llc llc\-14\fP).

.TP
\fB\-llvm\-llc\-opt \fIoption\fP\fR
Pass \fIoption\fP to \fBllc\fP when compiling (\fB.bc\fP to \fB.o\fP) LLVM code.

.TP
\fB\-llvm\-opt \fIopt\fP\R
Specify the executable for the LLVM \fB.bc\fP to \fB.bc\fP optimizer;
can be used to select a specific version of the tool (e.g., \fB\-llvm\-opt opt\-14\fP).

.TP
\fB\-llvm\-opt\-opt \fIoption\fP\fR
Pass \fIoption\fP to \fBopt\fP when optimizing (\fB.bc\fP to \fB.bc\fP) LLVM code.
Expand Down
8 changes: 4 additions & 4 deletions mlton/main/main.fun
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Copyright (C) 2010-2011,2013-2022 Matthew Fluet.
(* Copyright (C) 2010-2011,2013-2022,2024 Matthew Fluet.
* Copyright (C) 1999-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
Expand Down Expand Up @@ -584,7 +584,7 @@ fun makeOptions {usage} =
(Expert, "link-opt-quote", " <opt>", "pass (quoted) option to linker",
SpaceString
(fn s => List.push (linkOpts, {opt = s, pred = OptPred.Yes}))),
(Expert, "llvm-as", " <llvm-as>", "path to llvm .ll -> .bc assembler",
(Normal, "llvm-as", " <llvm-as>", "executable for llvm .ll -> .bc assembler",
SpaceString (fn s => llvm_as := s)),
(Normal, "llvm-as-opt", " <opt>", "pass option to llvm assembler",
(SpaceString o tokenizeOpt)
Expand All @@ -601,15 +601,15 @@ fun makeOptions {usage} =
| NONE => usage (concat ["invalid -llvm-aamd flag: ", s])))),
(Expert, "llvm-cc10", " {false|true}", "use llvm 'cc10' for interchunk transfers",
boolRef llvmCC10),
(Expert, "llvm-llc", " <llc>", "path to llvm .bc -> .o compiler",
(Normal, "llvm-llc", " <llc>", "executable for llvm .bc -> .o system compiler",
SpaceString (fn s => llvm_llc := s)),
(Normal, "llvm-llc-opt", " <opt>", "pass option to llvm compiler",
(SpaceString o tokenizeOpt)
(fn s => List.push (llvm_llcOpts, {opt = s, pred = OptPred.Yes}))),
(Expert, "llvm-llc-opt-quote", " <opt>", "pass (quoted) option to llvm compiler",
SpaceString
(fn s => List.push (llvm_llcOpts, {opt = s, pred = OptPred.Yes}))),
(Expert, "llvm-opt", " <llvm-as>", "path to llvm .bc -> .bc optimizer",
(Normal, "llvm-opt", " <opt>", "executable for llvm .bc -> .bc optimizer",
SpaceString (fn s => llvm_opt := s)),
(Normal, "llvm-opt-opt", " <opt>", "pass option to llvm optimizer",
(SpaceString o tokenizeOpt)
Expand Down

0 comments on commit 5041fb4

Please sign in to comment.