LinuxCommandLibrary

llvm-as

assembler that reads LLVM assembly language and outputs LLVM bitcode

TLDR

Assemble LLVM IR to bitcode

$ llvm-as [input.ll] -o [output.bc]
copy
Assemble from stdin
$ cat [input.ll] | llvm-as -o [output.bc]
copy
Check syntax only
$ llvm-as -disable-output [input.ll]
copy
Output to stdout
$ llvm-as [input.ll] -o -
copy

SYNOPSIS

llvm-as [options] [filename]

DESCRIPTION

llvm-as is the LLVM assembler that reads LLVM assembly language (.ll files) and outputs LLVM bitcode (.bc files). It's the inverse of llvm-dis.
The tool converts human-readable LLVM intermediate representation into the binary bitcode format used by other LLVM tools.

PARAMETERS

-o filename

Output filename.
-f
Enable binary on terminal.
-disable-output
Don't write output (syntax check).
-data-layout layout
Override data layout.
--help
Show help.
--version
Show version.

EXAMPLE

$ ; input.ll
define i32 @main() {
  ret i32 0
}
copy
$ llvm-as input.ll -o output.bc
copy

CAVEATS

Input must be valid LLVM IR. Bitcode format may change between LLVM versions. Use llvm-dis for reverse operation.

HISTORY

llvm-as has been part of LLVM since the project's inception by Chris Lattner at the University of Illinois in 2000.

SEE ALSO

llvm-dis(1), llc(1), opt(1), clang(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community