Compare commits
39 Commits
llvmorg-9.
...
llvmorg-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45d5bd27cb | ||
|
|
755a21f3ae | ||
|
|
688d4d27cf | ||
|
|
0df7b6319f | ||
|
|
5764e55d63 | ||
|
|
b5c059b832 | ||
|
|
bd43fcf5c5 | ||
|
|
1dc0dbf64d | ||
|
|
8c32fe0e61 | ||
|
|
2e406e7d52 | ||
|
|
1f6d36ff77 | ||
|
|
a5bea192e3 | ||
|
|
28c87da11f | ||
|
|
539eba2303 | ||
|
|
16c912d5f0 | ||
|
|
5e6d2c1282 | ||
|
|
ac864c0f53 | ||
|
|
35fb6225a6 | ||
|
|
b73b303f76 | ||
|
|
25c7375e28 | ||
|
|
9a8bae25b7 | ||
|
|
9eb9228a7b | ||
|
|
cbf56c683f | ||
|
|
407e88833c | ||
|
|
70c8b4ce40 | ||
|
|
9a3b80ebb8 | ||
|
|
d1e8ff86b5 | ||
|
|
05c9c7203d | ||
|
|
990c707d71 | ||
|
|
43195b190b | ||
|
|
d29e402cca | ||
|
|
02ac6f3362 | ||
|
|
ad4bf2f82b | ||
|
|
200b3953c2 | ||
|
|
e43c50a1a4 | ||
|
|
09489a21d9 | ||
|
|
1c81a16ffc | ||
|
|
357259b227 | ||
|
|
15fe03a879 |
@@ -1359,15 +1359,12 @@ all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs)
|
||||
%.h: %.y
|
||||
|
||||
# Rule for building the bison based parsers...
|
||||
$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
|
||||
ifneq ($(BISON),)
|
||||
$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
|
||||
$(Echo) "Bisoning $*.y"
|
||||
$(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
|
||||
$(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp
|
||||
$(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
|
||||
else
|
||||
$(Echo) "Bison of $*.y SKIPPED -- bison not found"
|
||||
endif
|
||||
|
||||
# IFF the .y file has changed since it was last checked into CVS, copy the .y
|
||||
# file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs. We use this
|
||||
@@ -1380,6 +1377,16 @@ $(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
|
||||
$(CP) $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs; \
|
||||
$(CP) $(PROJ_SRC_DIR)/$*.h $(PROJ_SRC_DIR)/$*.h.cvs)
|
||||
|
||||
else
|
||||
$(PROJ_SRC_DIR)/%.cpp : $(PROJ_SRC_DIR)/%.cpp.cvs
|
||||
$(Echo) "Bison of $*.y SKIPPED, bison not found -- copying .cpp.cvs"
|
||||
$(Verb)$(CP) $(PROJ_SRC_DIR)/$*.cpp.cvs $(PROJ_SRC_DIR)/$*.cpp
|
||||
|
||||
$(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.h.cvs
|
||||
$(Echo) "Bison of $*.y SKIPPED, bison not found -- copying .h.cvs"
|
||||
$(Verb)$(CP) $(PROJ_SRC_DIR)/$*.h.cvs $(PROJ_SRC_DIR)/$*.h
|
||||
endif
|
||||
|
||||
|
||||
$(YaccFiles:%.y=$(ObjDir)/%.o): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ dnl===
|
||||
dnl===-----------------------------------------------------------------------===
|
||||
dnl Initialize autoconf and define the package name, version number and
|
||||
dnl email address for reporting bugs.
|
||||
AC_INIT([[llvm]],[[2.0cvs]],[llvmbugs@cs.uiuc.edu])
|
||||
AC_INIT([[llvm]],[[2.0]],[llvmbugs@cs.uiuc.edu])
|
||||
|
||||
dnl Provide a copyright substitution and ensure the copyright notice is included
|
||||
dnl in the output of --version option of the generated configure script.
|
||||
@@ -495,6 +495,7 @@ LLVM_PROG_PERL([5.006])
|
||||
AC_SUBST(PERL)
|
||||
if test x"$PERL" = xnone; then
|
||||
AC_SUBST(HAVE_PERL,0)
|
||||
AC_MSG_ERROR([perl is required but was not found, please install it])
|
||||
else
|
||||
AC_SUBST(HAVE_PERL,1)
|
||||
fi
|
||||
|
||||
69
llvm/configure
vendored
69
llvm/configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.60 for llvm 2.0cvs.
|
||||
# Generated by GNU Autoconf 2.60 for llvm 2.0.
|
||||
#
|
||||
# Report bugs to <llvmbugs@cs.uiuc.edu>.
|
||||
#
|
||||
@@ -715,8 +715,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='llvm'
|
||||
PACKAGE_TARNAME='-llvm-'
|
||||
PACKAGE_VERSION='2.0cvs'
|
||||
PACKAGE_STRING='llvm 2.0cvs'
|
||||
PACKAGE_VERSION='2.0'
|
||||
PACKAGE_STRING='llvm 2.0'
|
||||
PACKAGE_BUGREPORT='llvmbugs@cs.uiuc.edu'
|
||||
|
||||
ac_unique_file="lib/VMCore/Module.cpp"
|
||||
@@ -1450,7 +1450,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures llvm 2.0cvs to adapt to many kinds of systems.
|
||||
\`configure' configures llvm 2.0 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1516,7 +1516,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of llvm 2.0cvs:";;
|
||||
short | recursive ) echo "Configuration of llvm 2.0:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1641,7 +1641,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
llvm configure 2.0cvs
|
||||
llvm configure 2.0
|
||||
generated by GNU Autoconf 2.60
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -1657,7 +1657,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by llvm $as_me 2.0cvs, which was
|
||||
It was created by llvm $as_me 2.0, which was
|
||||
generated by GNU Autoconf 2.60. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -7374,6 +7374,9 @@ fi
|
||||
if test x"$PERL" = xnone; then
|
||||
HAVE_PERL=0
|
||||
|
||||
{ { echo "$as_me:$LINENO: error: perl is required but was not found, please install it" >&5
|
||||
echo "$as_me: error: perl is required but was not found, please install it" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
else
|
||||
HAVE_PERL=1
|
||||
|
||||
@@ -10340,7 +10343,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 10343 "configure"
|
||||
#line 10346 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -12484,7 +12487,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 12487 "configure"' > conftest.$ac_ext
|
||||
echo '#line 12490 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@@ -14202,11 +14205,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:14205: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:14208: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:14209: \$? = $ac_status" >&5
|
||||
echo "$as_me:14212: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -14470,11 +14473,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:14473: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:14476: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:14477: \$? = $ac_status" >&5
|
||||
echo "$as_me:14480: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -14574,11 +14577,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:14577: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:14580: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:14581: \$? = $ac_status" >&5
|
||||
echo "$as_me:14584: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -17026,7 +17029,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17029 "configure"
|
||||
#line 17032 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -17126,7 +17129,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17129 "configure"
|
||||
#line 17132 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -19494,11 +19497,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19497: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:19500: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:19501: \$? = $ac_status" >&5
|
||||
echo "$as_me:19504: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -19598,11 +19601,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19601: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:19604: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:19605: \$? = $ac_status" >&5
|
||||
echo "$as_me:19608: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -21168,11 +21171,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:21171: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:21174: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:21175: \$? = $ac_status" >&5
|
||||
echo "$as_me:21178: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -21272,11 +21275,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:21275: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:21278: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:21279: \$? = $ac_status" >&5
|
||||
echo "$as_me:21282: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -23507,11 +23510,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:23510: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:23513: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:23514: \$? = $ac_status" >&5
|
||||
echo "$as_me:23517: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -23775,11 +23778,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:23778: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:23781: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:23782: \$? = $ac_status" >&5
|
||||
echo "$as_me:23785: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -23879,11 +23882,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:23882: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:23885: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:23886: \$? = $ac_status" >&5
|
||||
echo "$as_me:23889: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -34017,7 +34020,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by llvm $as_me 2.0cvs, which was
|
||||
This file was extended by llvm $as_me 2.0, which was
|
||||
generated by GNU Autoconf 2.60. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -34070,7 +34073,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
llvm config.status 2.0cvs
|
||||
llvm config.status 2.0
|
||||
configured by $0, generated by GNU Autoconf 2.60,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
@@ -1,59 +1,612 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>LLVM Bitcode File Format</title>
|
||||
<link rel="stylesheet" href="llvm.css" type="text/css">
|
||||
<style type="text/css">
|
||||
TR, TD { border: 2px solid gray; padding-left: 4pt; padding-right: 4pt;
|
||||
padding-top: 2pt; padding-bottom: 2pt; }
|
||||
TH { border: 2px solid gray; font-weight: bold; font-size: 105%; }
|
||||
TABLE { text-align: center; border: 2px solid black;
|
||||
border-collapse: collapse; margin-top: 1em; margin-left: 1em;
|
||||
margin-right: 1em; margin-bottom: 1em; }
|
||||
.td_left { border: 2px solid gray; text-align: left; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="doc_title"> LLVM Bitcode File Format </div>
|
||||
<ol>
|
||||
<li><a href="#abstract">Abstract</a></li>
|
||||
<li><a href="#concepts">Concepts</a></li>
|
||||
<li><a href="#overview">Overview</a></li>
|
||||
<li><a href="#bitstream">Bitstream Format</a>
|
||||
<ol>
|
||||
<li><a href="#magic">Magic Numbers</a></li>
|
||||
<li><a href="#primitives">Primitives</a></li>
|
||||
<li><a href="#abbrevid">Abbreviation IDs</a></li>
|
||||
<li><a href="#blocks">Blocks</a></li>
|
||||
<li><a href="#datarecord">Data Records</a></li>
|
||||
<li><a href="#abbreviations">Abbreviations</a></li>
|
||||
<li><a href="#stdblocks">Standard Blocks</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#llvmir">LLVM IR Encoding</a>
|
||||
<ol>
|
||||
<li><a href="#basics">Basics</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
<div class="doc_author">
|
||||
<p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a> and
|
||||
<a href="mailto:sabre@nondot.org">Chris Lattner</a>.
|
||||
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
<div class="doc_section"> <a name="abstract">Abstract </a></div>
|
||||
<div class="doc_section"> <a name="abstract">Abstract</a></div>
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
<div class="doc_text">
|
||||
<p>This document describes the LLVM bitcode file format. It specifies
|
||||
the binary encoding rules of the bitcode file format so that
|
||||
equivalent systems can encode bitcode files correctly. The LLVM
|
||||
bitcode representation is used to store the intermediate
|
||||
representation on disk in a compacted form.</p>
|
||||
<p>This document supercedes the LLVM bytecode file format for the 2.0
|
||||
release.</p>
|
||||
|
||||
<p>This document describes the LLVM bitstream file format and the encoding of
|
||||
the LLVM IR into it.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
<div class="doc_section"> <a name="concepts">Concepts</a> </div>
|
||||
<div class="doc_section"> <a name="overview">Overview</a></div>
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
<div class="doc_text">
|
||||
<p>This section describes the general concepts of the bitcode file
|
||||
format without getting into specific layout details. It is recommended
|
||||
that you read this section thoroughly before interpreting the detailed
|
||||
descriptions.</p>
|
||||
|
||||
<p>
|
||||
What is commonly known as the LLVM bitcode file format (also, sometimes
|
||||
anachronistically known as bytecode) is actually two things: a <a
|
||||
href="#bitstream">bitstream container format</a>
|
||||
and an <a href="#llvmir">encoding of LLVM IR</a> into the container format.</p>
|
||||
|
||||
<p>
|
||||
The bitstream format is an abstract encoding of structured data, very
|
||||
similar to XML in some ways. Like XML, bitstream files contain tags, and nested
|
||||
structures, and you can parse the file without having to understand the tags.
|
||||
Unlike XML, the bitstream format is a binary encoding, and unlike XML it
|
||||
provides a mechanism for the file to self-describe "abbreviations", which are
|
||||
effectively size optimizations for the content.</p>
|
||||
|
||||
<p>This document first describes the LLVM bitstream format, then describes the
|
||||
record structure used by LLVM IR files.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
<div class="doc_section"> <a name="bitstream">Bitstream Format</a></div>
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
The bitstream format is literally a stream of bits, with a very simple
|
||||
structure. This structure consists of the following concepts:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>A "<a href="#magic">magic number</a>" that identifies the contents of
|
||||
the stream.</li>
|
||||
<li>Encoding <a href="#primitives">primitives</a> like variable bit-rate
|
||||
integers.</li>
|
||||
<li><a href="#blocks">Blocks</a>, which define nested content.</li>
|
||||
<li><a href="#datarecord">Data Records</a>, which describe entities within the
|
||||
file.</li>
|
||||
<li>Abbreviations, which specify compression optimizations for the file.</li>
|
||||
</ul>
|
||||
|
||||
<p>Note that the <a
|
||||
href="CommandGuide/html/llvm-bcanalyzer.html">llvm-bcanalyzer</a> tool can be
|
||||
used to dump and inspect arbitrary bitstreams, which is very useful for
|
||||
understanding the encoding.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="magic">Magic Numbers</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>The first four bytes of the stream identify the encoding of the file. This
|
||||
is used by a reader to know what is contained in the file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="primitives">Primitives</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
A bitstream literally consists of a stream of bits. This stream is made up of a
|
||||
number of primitive values that encode a stream of unsigned integer values.
|
||||
These
|
||||
integers are are encoded in two ways: either as <a href="#fixedwidth">Fixed
|
||||
Width Integers</a> or as <a href="#variablewidth">Variable Width
|
||||
Integers</a>.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="fixedwidth">Fixed Width Integers</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>Fixed-width integer values have their low bits emitted directly to the file.
|
||||
For example, a 3-bit integer value encodes 1 as 001. Fixed width integers
|
||||
are used when there are a well-known number of options for a field. For
|
||||
example, boolean values are usually encoded with a 1-bit wide integer.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="variablewidth">Variable Width
|
||||
Integers</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>Variable-width integer (VBR) values encode values of arbitrary size,
|
||||
optimizing for the case where the values are small. Given a 4-bit VBR field,
|
||||
any 3-bit value (0 through 7) is encoded directly, with the high bit set to
|
||||
zero. Values larger than N-1 bits emit their bits in a series of N-1 bit
|
||||
chunks, where all but the last set the high bit.</p>
|
||||
|
||||
<p>For example, the value 27 (0x1B) is encoded as 1011 0011 when emitted as a
|
||||
vbr4 value. The first set of four bits indicates the value 3 (011) with a
|
||||
continuation piece (indicated by a high bit of 1). The next word indicates a
|
||||
value of 24 (011 << 3) with no continuation. The sum (3+24) yields the value
|
||||
27.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="char6">6-bit characters</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>6-bit characters encode common characters into a fixed 6-bit field. They
|
||||
represent the following characters with the following 6-bit values:</p>
|
||||
|
||||
<ul>
|
||||
<li>'a' .. 'z' - 0 .. 25</li>
|
||||
<li>'A' .. 'Z' - 26 .. 52</li>
|
||||
<li>'0' .. '9' - 53 .. 61</li>
|
||||
<li>'.' - 62</li>
|
||||
<li>'_' - 63</li>
|
||||
</ul>
|
||||
|
||||
<p>This encoding is only suitable for encoding characters and strings that
|
||||
consist only of the above characters. It is completely incapable of encoding
|
||||
characters not in the set.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="wordalign">Word Alignment</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>Occasionally, it is useful to emit zero bits until the bitstream is a
|
||||
multiple of 32 bits. This ensures that the bit position in the stream can be
|
||||
represented as a multiple of 32-bit words.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="abbrevid">Abbreviation IDs</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
A bitstream is a sequential series of <a href="#blocks">Blocks</a> and
|
||||
<a href="#datarecord">Data Records</a>. Both of these start with an
|
||||
abbreviation ID encoded as a fixed-bitwidth field. The width is specified by
|
||||
the current block, as described below. The value of the abbreviation ID
|
||||
specifies either a builtin ID (which have special meanings, defined below) or
|
||||
one of the abbreviation IDs defined by the stream itself.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The set of builtin abbrev IDs is:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>0 - <a href="#END_BLOCK">END_BLOCK</a> - This abbrev ID marks the end of the
|
||||
current block.</li>
|
||||
<li>1 - <a href="#ENTER_SUBBLOCK">ENTER_SUBBLOCK</a> - This abbrev ID marks the
|
||||
beginning of a new block.</li>
|
||||
<li>2 - <a href="#DEFINE_ABBREV">DEFINE_ABBREV</a> - This defines a new
|
||||
abbreviation.</li>
|
||||
<li>3 - <a href="#UNABBREV_RECORD">UNABBREV_RECORD</a> - This ID specifies the
|
||||
definition of an unabbreviated record.</li>
|
||||
</ul>
|
||||
|
||||
<p>Abbreviation IDs 4 and above are defined by the stream itself, and specify
|
||||
an <a href="#abbrev_records">abbreviated record encoding</a>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="blocks">Blocks</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
Blocks in a bitstream denote nested regions of the stream, and are identified by
|
||||
a content-specific id number (for example, LLVM IR uses an ID of 12 to represent
|
||||
function bodies). Nested blocks capture the hierachical structure of the data
|
||||
encoded in it, and various properties are associated with blocks as the file is
|
||||
parsed. Block definitions allow the reader to efficiently skip blocks
|
||||
in constant time if the reader wants a summary of blocks, or if it wants to
|
||||
efficiently skip data they do not understand. The LLVM IR reader uses this
|
||||
mechanism to skip function bodies, lazily reading them on demand.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When reading and encoding the stream, several properties are maintained for the
|
||||
block. In particular, each block maintains:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>A current abbrev id width. This value starts at 2, and is set every time a
|
||||
block record is entered. The block entry specifies the abbrev id width for
|
||||
the body of the block.</li>
|
||||
|
||||
<li>A set of abbreviations. Abbreviations may be defined within a block, or
|
||||
they may be associated with all blocks of a particular ID.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>As sub blocks are entered, these properties are saved and the new sub-block
|
||||
has its own set of abbreviations, and its own abbrev id width. When a sub-block
|
||||
is popped, the saved values are restored.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="ENTER_SUBBLOCK">ENTER_SUBBLOCK
|
||||
Encoding</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p><tt>[ENTER_SUBBLOCK, blockid<sub>vbr8</sub>, newabbrevlen<sub>vbr4</sub>,
|
||||
<align32bits>, blocklen<sub>32</sub>]</tt></p>
|
||||
|
||||
<p>
|
||||
The ENTER_SUBBLOCK abbreviation ID specifies the start of a new block record.
|
||||
The <tt>blockid</tt> value is encoded as a 8-bit VBR identifier, and indicates
|
||||
the type of block being entered (which is application specific). The
|
||||
<tt>newabbrevlen</tt> value is a 4-bit VBR which specifies the
|
||||
abbrev id width for the sub-block. The <tt>blocklen</tt> is a 32-bit aligned
|
||||
value that specifies the size of the subblock, in 32-bit words. This value
|
||||
allows the reader to skip over the entire block in one jump.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="END_BLOCK">END_BLOCK
|
||||
Encoding</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p><tt>[END_BLOCK, <align32bits>]</tt></p>
|
||||
|
||||
<p>
|
||||
The END_BLOCK abbreviation ID specifies the end of the current block record.
|
||||
Its end is aligned to 32-bits to ensure that the size of the block is an even
|
||||
multiple of 32-bits.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="datarecord">Data Records</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
<p>
|
||||
Data records consist of a record code and a number of (up to) 64-bit integer
|
||||
values. The interpretation of the code and values is application specific and
|
||||
there are multiple different ways to encode a record (with an unabbrev record
|
||||
or with an abbreviation). In the LLVM IR format, for example, there is a record
|
||||
which encodes the target triple of a module. The code is MODULE_CODE_TRIPLE,
|
||||
and the values of the record are the ascii codes for the characters in the
|
||||
string.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="UNABBREV_RECORD">UNABBREV_RECORD
|
||||
Encoding</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p><tt>[UNABBREV_RECORD, code<sub>vbr6</sub>, numops<sub>vbr6</sub>,
|
||||
op0<sub>vbr6</sub>, op1<sub>vbr6</sub>, ...]</tt></p>
|
||||
|
||||
<p>An UNABBREV_RECORD provides a default fallback encoding, which is both
|
||||
completely general and also extremely inefficient. It can describe an arbitrary
|
||||
record, by emitting the code and operands as vbrs.</p>
|
||||
|
||||
<p>For example, emitting an LLVM IR target triple as an unabbreviated record
|
||||
requires emitting the UNABBREV_RECORD abbrevid, a vbr6 for the
|
||||
MODULE_CODE_TRIPLE code, a vbr6 for the length of the string (which is equal to
|
||||
the number of operands), and a vbr6 for each character. Since there are no
|
||||
letters with value less than 32, each letter would need to be emitted as at
|
||||
least a two-part VBR, which means that each letter would require at least 12
|
||||
bits. This is not an efficient encoding, but it is fully general.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="abbrev_records">Abbreviated Record
|
||||
Encoding</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p><tt>[<abbrevid>, fields...]</tt></p>
|
||||
|
||||
<p>An abbreviated record is a abbreviation id followed by a set of fields that
|
||||
are encoded according to the <a href="#abbreviations">abbreviation
|
||||
definition</a>. This allows records to be encoded significantly more densely
|
||||
than records encoded with the <a href="#UNABBREV_RECORD">UNABBREV_RECORD</a>
|
||||
type, and allows the abbreviation types to be specified in the stream itself,
|
||||
which allows the files to be completely self describing. The actual encoding
|
||||
of abbreviations is defined below.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="abbreviations">Abbreviations</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
<p>
|
||||
Abbreviations are an important form of compression for bitstreams. The idea is
|
||||
to specify a dense encoding for a class of records once, then use that encoding
|
||||
to emit many records. It takes space to emit the encoding into the file, but
|
||||
the space is recouped (hopefully plus some) when the records that use it are
|
||||
emitted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Abbreviations can be determined dynamically per client, per file. Since the
|
||||
abbreviations are stored in the bitstream itself, different streams of the same
|
||||
format can contain different sets of abbreviations if the specific stream does
|
||||
not need it. As a concrete example, LLVM IR files usually emit an abbreviation
|
||||
for binary operators. If a specific LLVM module contained no or few binary
|
||||
operators, the abbreviation does not need to be emitted.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"><a name="DEFINE_ABBREV">DEFINE_ABBREV
|
||||
Encoding</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p><tt>[DEFINE_ABBREV, numabbrevops<sub>vbr5</sub>, abbrevop0, abbrevop1,
|
||||
...]</tt></p>
|
||||
|
||||
<p>An abbreviation definition consists of the DEFINE_ABBREV abbrevid followed
|
||||
by a VBR that specifies the number of abbrev operands, then the abbrev
|
||||
operands themselves. Abbreviation operands come in three forms. They all start
|
||||
with a single bit that indicates whether the abbrev operand is a literal operand
|
||||
(when the bit is 1) or an encoding operand (when the bit is 0).</p>
|
||||
|
||||
<ol>
|
||||
<li>Literal operands - <tt>[1<sub>1</sub>, litvalue<sub>vbr8</sub>]</tt> -
|
||||
Literal operands specify that the value in the result
|
||||
is always a single specific value. This specific value is emitted as a vbr8
|
||||
after the bit indicating that it is a literal operand.</li>
|
||||
<li>Encoding info without data - <tt>[0<sub>1</sub>, encoding<sub>3</sub>]</tt>
|
||||
- Operand encodings that do not have extra data are just emitted as their code.
|
||||
</li>
|
||||
<li>Encoding info with data - <tt>[0<sub>1</sub>, encoding<sub>3</sub>,
|
||||
value<sub>vbr5</sub>]</tt> - Operand encodings that do have extra data are
|
||||
emitted as their code, followed by the extra data.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>The possible operand encodings are:</p>
|
||||
|
||||
<ul>
|
||||
<li>1 - Fixed - The field should be emitted as a <a
|
||||
href="#fixedwidth">fixed-width value</a>, whose width
|
||||
is specified by the encoding operand.</li>
|
||||
<li>2 - VBR - The field should be emitted as a <a
|
||||
href="#variablewidth">variable-width value</a>, whose width
|
||||
is specified by the encoding operand.</li>
|
||||
<li>3 - Array - This field is an array of values. The element type of the array
|
||||
is specified by the next encoding operand.</li>
|
||||
<li>4 - Char6 - This field should be emitted as a <a href="#char6">char6-encoded
|
||||
value</a>.</li>
|
||||
</ul>
|
||||
|
||||
<p>For example, target triples in LLVM modules are encoded as a record of the
|
||||
form <tt>[TRIPLE, 'a', 'b', 'c', 'd']</tt>. Consider if the bitstream emitted
|
||||
the following abbrev entry:</p>
|
||||
|
||||
<ul>
|
||||
<li><tt>[0, Fixed, 4]</tt></li>
|
||||
<li><tt>[0, Array]</tt></li>
|
||||
<li><tt>[0, Char6]</tt></li>
|
||||
</ul>
|
||||
|
||||
<p>When emitting a record with this abbreviation, the above entry would be
|
||||
emitted as:</p>
|
||||
|
||||
<p><tt>[4<sub>abbrevwidth</sub>, 2<sub>4</sub>, 4<sub>vbr6</sub>,
|
||||
0<sub>6</sub>, 1<sub>6</sub>, 2<sub>6</sub>, 3<sub>6</sub>]</tt></p>
|
||||
|
||||
<p>These values are:</p>
|
||||
|
||||
<ol>
|
||||
<li>The first value, 4, is the abbreviation ID for this abbreviation.</li>
|
||||
<li>The second value, 2, is the code for TRIPLE in LLVM IR files.</li>
|
||||
<li>The third value, 4, is the length of the array.</li>
|
||||
<li>The rest of the values are the char6 encoded values for "abcd".</li>
|
||||
</ol>
|
||||
|
||||
<p>With this abbreviation, the triple is emitted with only 37 bits (assuming a
|
||||
abbrev id width of 3). Without the abbreviation, significantly more space would
|
||||
be required to emit the target triple. Also, since the TRIPLE value is not
|
||||
emitted as a literal in the abbreviation, the abbreviation can also be used for
|
||||
any other string value.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="stdblocks">Standard Blocks</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
In addition to the basic block structure and record encodings, the bitstream
|
||||
also defines specific builtin block types. These block types specify how the
|
||||
stream is to be decoded or other metadata. In the future, new standard blocks
|
||||
may be added.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"><a name="BLOCKINFO">#0 - BLOCKINFO
|
||||
Block</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>The BLOCKINFO block allows the description of metadata for other blocks. The
|
||||
currently specified records are:</p>
|
||||
|
||||
<ul>
|
||||
<li><tt>[SETBID (#1), blockid]</tt></li>
|
||||
<li><tt>[DEFINE_ABBREV, ...]</tt></li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The SETBID record indicates which block ID is being described. The standard
|
||||
DEFINE_ABBREV record specifies an abbreviation. The abbreviation is associated
|
||||
with the record ID, and any records with matching ID automatically get the
|
||||
abbreviation.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
<div class="doc_section"> <a name="llvmir">LLVM IR Encoding</a></div>
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>LLVM IR is encoded into a bitstream by defining blocks and records. It uses
|
||||
blocks for things like constant pools, functions, symbol tables, etc. It uses
|
||||
records for things like instructions, global variable descriptors, type
|
||||
descriptions, etc. This document does not describe the set of abbreviations
|
||||
that the writer uses, as these are fully self-described in the file, and the
|
||||
reader is not allowed to build in any knowledge of this.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="basics">Basics</a>
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"><a name="ir_magic">LLVM IR Magic Number</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
The magic number for LLVM IR files is:
|
||||
</p>
|
||||
|
||||
<p><tt>['B'<sub>8</sub>, 'C'<sub>8</sub>, 0x0<sub>4</sub>, 0xC<sub>4</sub>,
|
||||
0xE<sub>4</sub>, 0xD<sub>4</sub>]</tt></p>
|
||||
|
||||
<p>When viewed as bytes, this is "BC 0xC0DE".</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"><a name="ir_signed_vbr">Signed VBRs</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
<a href="#variablewidth">Variable Width Integers</a> are an efficient way to
|
||||
encode arbitrary sized unsigned values, but is an extremely inefficient way to
|
||||
encode signed values (as signed values are otherwise treated as maximally large
|
||||
unsigned values).</p>
|
||||
|
||||
<p>As such, signed vbr values of a specific width are emitted as follows:</p>
|
||||
|
||||
<ul>
|
||||
<li>Positive values are emitted as vbrs of the specified width, but with their
|
||||
value shifted left by one.</li>
|
||||
<li>Negative values are emitted as vbrs of the specified width, but the negated
|
||||
value is shifted left by one, and the low bit is set.</li>
|
||||
</ul>
|
||||
|
||||
<p>With this encoding, small positive and small negative values can both be
|
||||
emitted efficiently.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"><a name="ir_blocks">LLVM IR Blocks</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
LLVM IR is defined with the following blocks:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>8 - MODULE_BLOCK - This is the top-level block that contains the
|
||||
entire module, and describes a variety of per-module information.</li>
|
||||
<li>9 - PARAMATTR_BLOCK - This enumerates the parameter attributes.</li>
|
||||
<li>10 - TYPE_BLOCK - This describes all of the types in the module.</li>
|
||||
<li>11 - CONSTANTS_BLOCK - This describes constants for a module or
|
||||
function.</li>
|
||||
<li>12 - FUNCTION_BLOCK - This describes a function body.</li>
|
||||
<li>13 - TYPE_SYMTAB_BLOCK - This describes the type symbol table.</li>
|
||||
<li>14 - VALUE_SYMTAB_BLOCK - This describes a value symbol table.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection"><a name="MODULE_BLOCK">MODULE_BLOCK Contents</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
<hr>
|
||||
<address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
|
||||
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
|
||||
<a href="http://validator.w3.org/check/referer"><img
|
||||
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
|
||||
<a href="mailto:rspencer@x10sys.com">Reid Spencer</a> and <a
|
||||
href="mailto:sabre@nondot.org">Chris Lattner</a><br>
|
||||
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
|
||||
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
|
||||
Last modified: $Date$
|
||||
</address>
|
||||
|
||||
240
llvm/docs/CommandGuide/man/man1/bugpoint.1
Normal file
240
llvm/docs/CommandGuide/man/man1/bugpoint.1
Normal file
@@ -0,0 +1,240 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BUGPOINT 1"
|
||||
.TH BUGPOINT 1 "2006-09-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
bugpoint \- automatic test case reduction tool
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBbugpoint\fR [\fIoptions\fR] [\fIinput \s-1LLVM\s0 ll/bc files\fR] [\fI\s-1LLVM\s0 passes\fR] \fB\-\-args\fR
|
||||
\&\fIprogram arguments\fR
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBbugpoint\fR narrows down the source of problems in \s-1LLVM\s0 tools and passes. It
|
||||
can be used to debug three types of failures: optimizer crashes, miscompilations
|
||||
by optimizers, or bad native code generation (including problems in the static
|
||||
and \s-1JIT\s0 compilers). It aims to reduce large test cases to small, useful ones.
|
||||
For more information on the design and inner workings of \fBbugpoint\fR, as well as
|
||||
advice for using bugpoint, see \fIllvm/docs/Bugpoint.html\fR in the \s-1LLVM\s0
|
||||
distribution.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-\-additional\-so\fR \fIlibrary\fR" 4
|
||||
.IX Item "--additional-so library"
|
||||
Load the dynamic shared object \fIlibrary\fR into the test program whenever it is
|
||||
run. This is useful if you are debugging programs which depend on non-LLVM
|
||||
libraries (such as the X or curses libraries) to run.
|
||||
.IP "\fB\-\-args\fR \fIprogram args\fR" 4
|
||||
.IX Item "--args program args"
|
||||
Pass all arguments specified after \-args to the test program whenever it runs.
|
||||
Note that if any of the \fIprogram args\fR start with a '\-', you should use:
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& bugpoint [bugpoint args] --args -- [program args]
|
||||
.Ve
|
||||
.Sp
|
||||
The \*(L"\-\-\*(R" right after the \fB\-\-args\fR option tells \fBbugpoint\fR to consider any
|
||||
options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-args\fR option, not as options to
|
||||
\&\fBbugpoint\fR itself.
|
||||
.IP "\fB\-\-tool\-args\fR \fItool args\fR" 4
|
||||
.IX Item "--tool-args tool args"
|
||||
Pass all arguments specified after \-\-tool\-args to the \s-1LLVM\s0 tool under test
|
||||
(\fBllc\fR, \fBlli\fR, etc.) whenever it runs. You should use this option in the
|
||||
following way:
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& bugpoint [bugpoint args] --tool-args -- [tool args]
|
||||
.Ve
|
||||
.Sp
|
||||
The \*(L"\-\-\*(R" right after the \fB\-\-tool\-args\fR option tells \fBbugpoint\fR to consider any
|
||||
options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-tool\-args\fR option, not as
|
||||
options to \fBbugpoint\fR itself. (See \fB\-\-args\fR, above.)
|
||||
.IP "\fB\-\-check\-exit\-code\fR=\fI{true,false}\fR" 4
|
||||
.IX Item "--check-exit-code={true,false}"
|
||||
Assume a non-zero exit code or core dump from the test program is a failure.
|
||||
Defaults to true.
|
||||
.IP "\fB\-\-disable\-{dce,simplifycfg}\fR" 4
|
||||
.IX Item "--disable-{dce,simplifycfg}"
|
||||
Do not run the specified passes to clean up and reduce the size of the test
|
||||
program. By default, \fBbugpoint\fR uses these passes internally when attempting to
|
||||
reduce test programs. If you're trying to find a bug in one of these passes,
|
||||
\&\fBbugpoint\fR may crash.
|
||||
.IP "\fB\-find\-bugs\fR" 4
|
||||
.IX Item "-find-bugs"
|
||||
Continually randomize the specified passes and run them on the test program
|
||||
until a bug is found or the user kills \fBbugpoint\fR.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-\-input\fR \fIfilename\fR" 4
|
||||
.IX Item "--input filename"
|
||||
Open \fIfilename\fR and redirect the standard input of the test program, whenever
|
||||
it runs, to come from that file.
|
||||
.IP "\fB\-\-load\fR \fIplugin\fR" 4
|
||||
.IX Item "--load plugin"
|
||||
Load the dynamic object \fIplugin\fR into \fBbugpoint\fR itself. This object should
|
||||
register new optimization passes. Once loaded, the object will add new command
|
||||
line options to enable various optimizations. To see the new complete list of
|
||||
optimizations, use the \fB\-\-help\fR and \fB\-\-load\fR options together; for example:
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& bugpoint --load myNewPass.so --help
|
||||
.Ve
|
||||
.IP "\fB\-\-output\fR \fIfilename\fR" 4
|
||||
.IX Item "--output filename"
|
||||
Whenever the test program produces output on its standard output stream, it
|
||||
should match the contents of \fIfilename\fR (the \*(L"reference output\*(R"). If you
|
||||
do not use this option, \fBbugpoint\fR will attempt to generate a reference output
|
||||
by compiling the program with the C backend and running it.
|
||||
.IP "\fB\-\-profile\-info\-file\fR \fIfilename\fR" 4
|
||||
.IX Item "--profile-info-file filename"
|
||||
Profile file loaded by \fB\-\-profile\-loader\fR.
|
||||
.IP "\fB\-\-run\-{int,jit,llc,cbe}\fR" 4
|
||||
.IX Item "--run-{int,jit,llc,cbe}"
|
||||
Whenever the test program is compiled, \fBbugpoint\fR should generate code for it
|
||||
using the specified code generator. These options allow you to choose the
|
||||
interpreter, the \s-1JIT\s0 compiler, the static native code compiler, or the C
|
||||
backend, respectively.
|
||||
.IP "\fB\-\-enable\-valgrind\fR" 4
|
||||
.IX Item "--enable-valgrind"
|
||||
Use valgrind to find faults in the optimization phase. This will allow
|
||||
bugpoint to find otherwise asymptomatic problems caused by memory
|
||||
mis\-management.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBbugpoint\fR succeeds in finding a problem, it will exit with 0. Otherwise,
|
||||
if an error occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
opt
|
||||
.SH "AUTHOR"
|
||||
.IX Header "AUTHOR"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
277
llvm/docs/CommandGuide/man/man1/llc.1
Normal file
277
llvm/docs/CommandGuide/man/man1/llc.1
Normal file
@@ -0,0 +1,277 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLC 1"
|
||||
.TH LLC 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llc \- LLVM static compiler
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllc\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllc\fR command compiles \s-1LLVM\s0 bytecode into assembly language for a
|
||||
specified architecture. The assembly language output can then be passed through
|
||||
a native assembler and linker to generate a native executable.
|
||||
.PP
|
||||
The choice of architecture for the output assembly code is automatically
|
||||
determined from the input bytecode file, unless the \fB\-march\fR option is used to
|
||||
override the default.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
If \fIfilename\fR is \- or omitted, \fBllc\fR reads \s-1LLVM\s0 bytecode from standard input.
|
||||
Otherwise, it will read \s-1LLVM\s0 bytecode from \fIfilename\fR.
|
||||
.PP
|
||||
If the \fB\-o\fR option is omitted, then \fBllc\fR will send its output to standard
|
||||
output if the input is from standard input. If the \fB\-o\fR option specifies \-,
|
||||
then the output will also be sent to standard output.
|
||||
.PP
|
||||
If no \fB\-o\fR option is specified and an input file other than \- is specified,
|
||||
then \fBllc\fR creates the output filename by taking the input filename,
|
||||
removing any existing \fI.bc\fR extension, and adding a \fI.s\fR suffix.
|
||||
.PP
|
||||
Other \fBllc\fR options are as follows:
|
||||
.Sh "End-user Options"
|
||||
.IX Subsection "End-user Options"
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Overwrite output files. By default, \fBllc\fR will refuse to overwrite
|
||||
an output file which already exists.
|
||||
.IP "\fB\-mtriple\fR=\fItarget triple\fR" 4
|
||||
.IX Item "-mtriple=target triple"
|
||||
Override the target triple specified in the input bytecode file with the
|
||||
specified string.
|
||||
.IP "\fB\-march\fR=\fIarch\fR" 4
|
||||
.IX Item "-march=arch"
|
||||
Specify the architecture for which to generate assembly, overriding the target
|
||||
encoded in the bytecode file. See the output of \fBllc \-\-help\fR for a list of
|
||||
valid architectures. By default this is inferred from the target triple or
|
||||
autodetected to the current architecture.
|
||||
.IP "\fB\-mcpu\fR=\fIcpuname\fR" 4
|
||||
.IX Item "-mcpu=cpuname"
|
||||
Specify a specific chip in the current architecture to generate code for.
|
||||
By default this is inferred from the target triple and autodetected to
|
||||
the current architecture. For a list of available CPUs, use:
|
||||
\&\fBllvm-as < /dev/null | llc \-march=xyz \-mcpu=help\fR
|
||||
.IP "\fB\-mattr\fR=\fIa1,+a2,\-a3,...\fR" 4
|
||||
.IX Item "-mattr=a1,+a2,-a3,..."
|
||||
Override or control specific attributes of the target, such as whether \s-1SIMD\s0
|
||||
operations are enabled or not. The default set of attributes is set by the
|
||||
current \s-1CPU\s0. For a list of available attributes, use:
|
||||
\&\fBllvm-as < /dev/null | llc \-march=xyz \-mattr=help\fR
|
||||
.IP "\fB\-\-disable\-fp\-elim\fR" 4
|
||||
.IX Item "--disable-fp-elim"
|
||||
Disable frame pointer elimination optimization.
|
||||
.IP "\fB\-\-disable\-excess\-fp\-precision\fR" 4
|
||||
.IX Item "--disable-excess-fp-precision"
|
||||
Disable optimizations that may produce excess precision for floating point.
|
||||
Note that this option can dramatically slow down code on some systems
|
||||
(e.g. X86).
|
||||
.IP "\fB\-\-enable\-unsafe\-fp\-math\fR" 4
|
||||
.IX Item "--enable-unsafe-fp-math"
|
||||
Enable optimizations that make unsafe assumptions about \s-1IEEE\s0 math (e.g. that
|
||||
addition is associative) or may not work for all input ranges. These
|
||||
optimizations allow the code generator to make use of some instructions which
|
||||
would otherwise not be usable (such as fsin on X86).
|
||||
.IP "\fB\-\-enable\-correct\-eh\-support\fR" 4
|
||||
.IX Item "--enable-correct-eh-support"
|
||||
Instruct the \fBlowerinvoke\fR pass to insert code for correct exception handling
|
||||
support. This is expensive and is by default omitted for efficiency.
|
||||
.IP "\fB\-\-stats\fR" 4
|
||||
.IX Item "--stats"
|
||||
Print statistics recorded by code-generation passes.
|
||||
.IP "\fB\-\-time\-passes\fR" 4
|
||||
.IX Item "--time-passes"
|
||||
Record the amount of time needed for each pass and print a report to standard
|
||||
error.
|
||||
.IP "\fB\-\-load\fR=\fIdso_path\fR" 4
|
||||
.IX Item "--load=dso_path"
|
||||
Dynamically load \fIdso_path\fR (a path to a dynamically shared object) that
|
||||
implements an \s-1LLVM\s0 target. This will permit the target name to be used with the
|
||||
\&\fB\-march\fR option so that code can be generated for that target.
|
||||
.Sh "Tuning/Configuration Options"
|
||||
.IX Subsection "Tuning/Configuration Options"
|
||||
.IP "\fB\-\-print\-machineinstrs\fR" 4
|
||||
.IX Item "--print-machineinstrs"
|
||||
Print generated machine code between compilation phases (useful for debugging).
|
||||
.IP "\fB\-\-regalloc\fR=\fIallocator\fR" 4
|
||||
.IX Item "--regalloc=allocator"
|
||||
Specify the register allocator to use. The default \fIallocator\fR is \fIlocal\fR.
|
||||
Valid register allocators are:
|
||||
.RS 4
|
||||
.IP "\fIsimple\fR" 4
|
||||
.IX Item "simple"
|
||||
Very simple \*(L"always spill\*(R" register allocator
|
||||
.IP "\fIlocal\fR" 4
|
||||
.IX Item "local"
|
||||
Local register allocator
|
||||
.IP "\fIlinearscan\fR" 4
|
||||
.IX Item "linearscan"
|
||||
Linear scan global register allocator
|
||||
.IP "\fIiterativescan\fR" 4
|
||||
.IX Item "iterativescan"
|
||||
Iterative scan global register allocator
|
||||
.RE
|
||||
.RS 4
|
||||
.RE
|
||||
.IP "\fB\-\-spiller\fR=\fIspiller\fR" 4
|
||||
.IX Item "--spiller=spiller"
|
||||
Specify the spiller to use for register allocators that support it. Currently
|
||||
this option is used only by the linear scan register allocator. The default
|
||||
\&\fIspiller\fR is \fIlocal\fR. Valid spillers are:
|
||||
.RS 4
|
||||
.IP "\fIsimple\fR" 4
|
||||
.IX Item "simple"
|
||||
Simple spiller
|
||||
.IP "\fIlocal\fR" 4
|
||||
.IX Item "local"
|
||||
Local spiller
|
||||
.RE
|
||||
.RS 4
|
||||
.RE
|
||||
.Sh "Intel IA\-32\-specific Options"
|
||||
.IX Subsection "Intel IA-32-specific Options"
|
||||
.IP "\fB\-\-x86\-asm\-syntax=att|intel\fR" 4
|
||||
.IX Item "--x86-asm-syntax=att|intel"
|
||||
Specify whether to emit assembly code in \s-1AT&T\s0 syntax (the default) or intel
|
||||
syntax.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllc\fR succeeds, it will exit with 0. Otherwise, if an error occurs,
|
||||
it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
lli
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
206
llvm/docs/CommandGuide/man/man1/lli.1
Normal file
206
llvm/docs/CommandGuide/man/man1/lli.1
Normal file
@@ -0,0 +1,206 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLI 1"
|
||||
.TH LLI 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
lli \- directly execute programs from LLVM bytecode
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBlli\fR [\fIoptions\fR] [\fIfilename\fR] [\fIprogram args\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBlli\fR directly executes programs in \s-1LLVM\s0 bytecode format. It takes a program
|
||||
in \s-1LLVM\s0 bytecode format and executes it using a just-in-time compiler, if one is
|
||||
available for the current architecture, or an interpreter. \fBlli\fR takes all of
|
||||
the same code generator options as llc, but they are only effective when
|
||||
\&\fBlli\fR is using the just-in-time compiler.
|
||||
.PP
|
||||
If \fIfilename\fR is not specified, then \fBlli\fR reads the \s-1LLVM\s0 bytecode for the
|
||||
program from standard input.
|
||||
.PP
|
||||
The optional \fIargs\fR specified on the command line are passed to the program as
|
||||
arguments.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-help\fR" 4
|
||||
.IX Item "-help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-stats\fR" 4
|
||||
.IX Item "-stats"
|
||||
Print statistics from the code-generation passes. This is only meaningful for
|
||||
the just-in-time compiler, at present.
|
||||
.IP "\fB\-time\-passes\fR" 4
|
||||
.IX Item "-time-passes"
|
||||
Record the amount of time needed for each code-generation pass and print it to
|
||||
standard error.
|
||||
.IP "\fB\-mtriple\fR=\fItarget triple\fR" 4
|
||||
.IX Item "-mtriple=target triple"
|
||||
Override the target triple specified in the input bytecode file with the
|
||||
specified string. This may result in a crash if you pick an
|
||||
architecture which is not compatible with the current system.
|
||||
.IP "\fB\-march\fR=\fIarch\fR" 4
|
||||
.IX Item "-march=arch"
|
||||
Specify the architecture for which to generate assembly, overriding the target
|
||||
encoded in the bytecode file. See the output of \fBllc \-\-help\fR for a list of
|
||||
valid architectures. By default this is inferred from the target triple or
|
||||
autodetected to the current architecture.
|
||||
.IP "\fB\-mcpu\fR=\fIcpuname\fR" 4
|
||||
.IX Item "-mcpu=cpuname"
|
||||
Specify a specific chip in the current architecture to generate code for.
|
||||
By default this is inferred from the target triple and autodetected to
|
||||
the current architecture. For a list of available CPUs, use:
|
||||
\&\fBllvm-as < /dev/null | llc \-march=xyz \-mcpu=help\fR
|
||||
.IP "\fB\-mattr\fR=\fIa1,+a2,\-a3,...\fR" 4
|
||||
.IX Item "-mattr=a1,+a2,-a3,..."
|
||||
Override or control specific attributes of the target, such as whether \s-1SIMD\s0
|
||||
operations are enabled or not. The default set of attributes is set by the
|
||||
current \s-1CPU\s0. For a list of available attributes, use:
|
||||
\&\fBllvm-as < /dev/null | llc \-march=xyz \-mattr=help\fR
|
||||
.IP "\fB\-force\-interpreter\fR=\fI{false,true}\fR" 4
|
||||
.IX Item "-force-interpreter={false,true}"
|
||||
If set to true, use the interpreter even if a just-in-time compiler is available
|
||||
for this architecture. Defaults to false.
|
||||
.IP "\fB\-f\fR=\fIname\fR" 4
|
||||
.IX Item "-f=name"
|
||||
Call the function named \fIname\fR to start the program. Note: The
|
||||
function is assumed to have the C signature \f(CW\*(C`int\*(C'\fR \fIname\fR \f(CW\*(C`(int,
|
||||
char **, char **)\*(C'\fR. If you try to use this option to call a function of
|
||||
incompatible type, undefined behavior may result. Defaults to \f(CW\*(C`main\*(C'\fR.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBlli\fR fails to load the program, it will exit with an exit code of 1.
|
||||
Otherwise, it will return the exit code of the program it executes.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llc
|
||||
.SH "AUTHOR"
|
||||
.IX Header "AUTHOR"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
461
llvm/docs/CommandGuide/man/man1/llvm-ar.1
Normal file
461
llvm/docs/CommandGuide/man/man1/llvm-ar.1
Normal file
@@ -0,0 +1,461 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-AR 1"
|
||||
.TH LLVM-AR 1 "2006-11-20" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-ar \- LLVM archiver
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-ar\fR [\-]{dmpqrtx}[Rabfikouz] [relpos] [count] <archive> [files...]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-ar\fR command is similar to the common Unix utility, \f(CW\*(C`ar\*(C'\fR. It
|
||||
archives several files together into a single file. The intent for this is
|
||||
to produce archive libraries by \s-1LLVM\s0 bytecode that can be linked into an
|
||||
\&\s-1LLVM\s0 program. However, the archive can contain any kind of file. By default,
|
||||
\&\fBllvm-ar\fR generates a symbol table that makes linking faster because
|
||||
only the symbol table needs to be consulted, not each individual file member
|
||||
of the archive.
|
||||
.PP
|
||||
The \fBllvm-ar\fR command can be used to \fIread\fR both \s-1SVR4\s0 and \s-1BSD\s0 style archive
|
||||
files. However, it cannot be used to write them. While the \fBllvm-ar\fR command
|
||||
produces files that are \fIalmost\fR identical to the format used by other \f(CW\*(C`ar\*(C'\fR
|
||||
implementations, it has two significant departures in order to make the
|
||||
archive appropriate for \s-1LLVM\s0. The first departure is that \fBllvm-ar\fR only
|
||||
uses \s-1BSD4\s0.4 style long path names (stored immediately after the header) and
|
||||
never contains a string table for long names. The second departure is that the
|
||||
symbol table is formated for efficient construction of an in-memory data
|
||||
structure that permits rapid (red\-black tree) lookups. Consequently, archives
|
||||
produced with \fBllvm-ar\fR usually won't be readable or editable with any
|
||||
\&\f(CW\*(C`ar\*(C'\fR implementation or useful for linking. Using the \f(CW\*(C`f\*(C'\fR modifier to flatten
|
||||
file names will make the archive readable by other \f(CW\*(C`ar\*(C'\fR implementations
|
||||
but not for linking because the symbol table format for \s-1LLVM\s0 is unique. If an
|
||||
\&\s-1SVR4\s0 or \s-1BSD\s0 style archive is used with the \f(CW\*(C`r\*(C'\fR (replace) or \f(CW\*(C`q\*(C'\fR (quick
|
||||
update) operations, the archive will be reconstructed in \s-1LLVM\s0 format. This
|
||||
means that the string table will be dropped (in deference to \s-1BSD\s0 4.4 long names)
|
||||
and an \s-1LLVM\s0 symbol table will be added (by default). The system symbol table
|
||||
will be retained.
|
||||
.PP
|
||||
Here's where \fBllvm-ar\fR departs from previous \f(CW\*(C`ar\*(C'\fR implementations:
|
||||
.IP "\fISymbol Table\fR" 4
|
||||
.IX Item "Symbol Table"
|
||||
Since \fBllvm-ar\fR is intended to archive bytecode files, the symbol table
|
||||
won't make much sense to anything but \s-1LLVM\s0. Consequently, the symbol table's
|
||||
format has been simplified. It consists simply of a sequence of pairs
|
||||
of a file member index number as an \s-1LSB\s0 4byte integer and a null-terminated
|
||||
string.
|
||||
.IP "\fILong Paths\fR" 4
|
||||
.IX Item "Long Paths"
|
||||
Some \f(CW\*(C`ar\*(C'\fR implementations (\s-1SVR4\s0) use a separate file member to record long
|
||||
path names (> 15 characters). \fBllvm-ar\fR takes the \s-1BSD\s0 4.4 and Mac \s-1OS\s0 X
|
||||
approach which is to simply store the full path name immediately preceding
|
||||
the data for the file. The path name is null terminated and may contain the
|
||||
slash (/) character.
|
||||
.IP "\fICompression\fR" 4
|
||||
.IX Item "Compression"
|
||||
\&\fBllvm-ar\fR can compress the members of an archive to save space. The
|
||||
compression used depends on what's available on the platform and what choices
|
||||
the \s-1LLVM\s0 Compressor utility makes. It generally favors bzip2 but will select
|
||||
between \*(L"no compression\*(R" or bzip2 depending on what makes sense for the
|
||||
file's content.
|
||||
.IP "\fIDirectory Recursion\fR" 4
|
||||
.IX Item "Directory Recursion"
|
||||
Most \f(CW\*(C`ar\*(C'\fR implementations do not recurse through directories but simply
|
||||
ignore directories if they are presented to the program in the \fIfiles\fR
|
||||
option. \fBllvm-ar\fR, however, can recurse through directory structures and
|
||||
add all the files under a directory, if requested.
|
||||
.IP "\fI\s-1TOC\s0 Verbose Output\fR" 4
|
||||
.IX Item "TOC Verbose Output"
|
||||
When \fBllvm-ar\fR prints out the verbose table of contents (\f(CW\*(C`tv\*(C'\fR option), it
|
||||
precedes the usual output with a character indicating the basic kind of
|
||||
content in the file. A blank means the file is a regular file. A 'Z' means
|
||||
the file is compressed. A 'B' means the file is an \s-1LLVM\s0 bytecode file. An
|
||||
\&'S' means the file is the symbol table.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
The options to \fBllvm-ar\fR are compatible with other \f(CW\*(C`ar\*(C'\fR implementations.
|
||||
However, there are a few modifiers (\fIzR\fR) that are not found in other
|
||||
\&\f(CW\*(C`ar\*(C'\fRs. The options to \fBllvm-ar\fR specify a single basic operation to
|
||||
perform on the archive, a variety of modifiers for that operation, the
|
||||
name of the archive file, and an optional list of file names. These options
|
||||
are used to determine how \fBllvm-ar\fR should process the archive file.
|
||||
.PP
|
||||
The Operations and Modifiers are explained in the sections below. The minimal
|
||||
set of options is at least one operator and the name of the archive. Typically
|
||||
archive files end with a \f(CW\*(C`.a\*(C'\fR suffix, but this is not required. Following
|
||||
the \fIarchive-name\fR comes a list of \fIfiles\fR that indicate the specific members
|
||||
of the archive to operate on. If the \fIfiles\fR option is not specified, it
|
||||
generally means either \*(L"none\*(R" or \*(L"all\*(R" members, depending on the operation.
|
||||
.Sh "Operations"
|
||||
.IX Subsection "Operations"
|
||||
.IP "d" 4
|
||||
.IX Item "d"
|
||||
Delete files from the archive. No modifiers are applicable to this operation.
|
||||
The \fIfiles\fR options specify which members should be removed from the
|
||||
archive. It is not an error if a specified file does not appear in the archive.
|
||||
If no \fIfiles\fR are specified, the archive is not modified.
|
||||
.IP "m[abi]" 4
|
||||
.IX Item "m[abi]"
|
||||
Move files from one location in the archive to another. The \fIa\fR, \fIb\fR, and
|
||||
\&\fIi\fR modifiers apply to this operation. The \fIfiles\fR will all be moved
|
||||
to the location given by the modifiers. If no modifiers are used, the files
|
||||
will be moved to the end of the archive. If no \fIfiles\fR are specified, the
|
||||
archive is not modified.
|
||||
.IP "p[k]" 4
|
||||
.IX Item "p[k]"
|
||||
Print files to the standard output. The \fIk\fR modifier applies to this
|
||||
operation. This operation simply prints the \fIfiles\fR indicated to the
|
||||
standard output. If no \fIfiles\fR are specified, the entire archive is printed.
|
||||
Printing bytecode files is ill-advised as they might confuse your terminal
|
||||
settings. The \fIp\fR operation never modifies the archive.
|
||||
.IP "q[Rfz]" 4
|
||||
.IX Item "q[Rfz]"
|
||||
Quickly append files to the end of the archive. The \fIR\fR, \fIf\fR, and \fIz\fR
|
||||
modifiers apply to this operation. This operation quickly adds the
|
||||
\&\fIfiles\fR to the archive without checking for duplicates that should be
|
||||
removed first. If no \fIfiles\fR are specified, the archive is not modified.
|
||||
Because of the way that \fBllvm-ar\fR constructs the archive file, its dubious
|
||||
whether the \fIq\fR operation is any faster than the \fIr\fR operation.
|
||||
.IP "r[Rabfuz]" 4
|
||||
.IX Item "r[Rabfuz]"
|
||||
Replace or insert file members. The \fIR\fR, \fIa\fR, \fIb\fR, \fIf\fR, \fIu\fR, and \fIz\fR
|
||||
modifiers apply to this operation. This operation will replace existing
|
||||
\&\fIfiles\fR or insert them at the end of the archive if they do not exist. If no
|
||||
\&\fIfiles\fR are specified, the archive is not modified.
|
||||
.IP "t[v]" 4
|
||||
.IX Item "t[v]"
|
||||
Print the table of contents. Without any modifiers, this operation just prints
|
||||
the names of the members to the standard output. With the \fIv\fR modifier,
|
||||
\&\fBllvm-ar\fR also prints out the file type (B=bytecode, Z=compressed, S=symbol
|
||||
table, blank=regular file), the permission mode, the owner and group, the
|
||||
size, and the date. If any \fIfiles\fR are specified, the listing is only for
|
||||
those files. If no \fIfiles\fR are specified, the table of contents for the
|
||||
whole archive is printed.
|
||||
.IP "x[oP]" 4
|
||||
.IX Item "x[oP]"
|
||||
Extract archive members back to files. The \fIo\fR modifier applies to this
|
||||
operation. This operation retrieves the indicated \fIfiles\fR from the archive
|
||||
and writes them back to the operating system's file system. If no
|
||||
\&\fIfiles\fR are specified, the entire archive is extract.
|
||||
.Sh "Modifiers (operation specific)"
|
||||
.IX Subsection "Modifiers (operation specific)"
|
||||
The modifiers below are specific to certain operations. See the Operations
|
||||
section (above) to determine which modifiers are applicable to which operations.
|
||||
.IP "[a]" 4
|
||||
.IX Item "[a]"
|
||||
When inserting or moving member files, this option specifies the destination of
|
||||
the new files as being \f(CW\*(C`a\*(C'\fRfter the \fIrelpos\fR member. If \fIrelpos\fR is not found,
|
||||
the files are placed at the end of the archive.
|
||||
.IP "[b]" 4
|
||||
.IX Item "[b]"
|
||||
When inserting or moving member files, this option specifies the destination of
|
||||
the new files as being \f(CW\*(C`b\*(C'\fRefore the \fIrelpos\fR member. If \fIrelpos\fR is not
|
||||
found, the files are placed at the end of the archive. This modifier is
|
||||
identical to the the \fIi\fR modifier.
|
||||
.IP "[f]" 4
|
||||
.IX Item "[f]"
|
||||
Normally, \fBllvm-ar\fR stores the full path name to a file as presented to it on
|
||||
the command line. With this option, truncated (15 characters max) names are
|
||||
used. This ensures name compatibility with older versions of \f(CW\*(C`ar\*(C'\fR but may also
|
||||
thwart correct extraction of the files (duplicates may overwrite). If used with
|
||||
the \fIR\fR option, the directory recursion will be performed but the file names
|
||||
will all be \f(CW\*(C`f\*(C'\fRlattened to simple file names.
|
||||
.IP "[i]" 4
|
||||
.IX Item "[i]"
|
||||
A synonym for the \fIb\fR option.
|
||||
.IP "[k]" 4
|
||||
.IX Item "[k]"
|
||||
Normally, \fBllvm-ar\fR will not print the contents of bytecode files when the
|
||||
\&\fIp\fR operation is used. This modifier defeats the default and allows the
|
||||
bytecode members to be printed.
|
||||
.IP "[N]" 4
|
||||
.IX Item "[N]"
|
||||
This option is ignored by \fBllvm-ar\fR but provided for compatibility.
|
||||
.IP "[o]" 4
|
||||
.IX Item "[o]"
|
||||
When extracting files, this option will cause \fBllvm-ar\fR to preserve the
|
||||
original modification times of the files it writes.
|
||||
.IP "[P]" 4
|
||||
.IX Item "[P]"
|
||||
use full path names when matching
|
||||
.IP "[R]" 4
|
||||
.IX Item "[R]"
|
||||
This modifier instructions the \fIr\fR option to recursively process directories.
|
||||
Without \fIR\fR, directories are ignored and only those \fIfiles\fR that refer to
|
||||
files will be added to the archive. When \fIR\fR is used, any directories specified
|
||||
with \fIfiles\fR will be scanned (recursively) to find files to be added to the
|
||||
archive. Any file whose name begins with a dot will not be added.
|
||||
.IP "[u]" 4
|
||||
.IX Item "[u]"
|
||||
When replacing existing files in the archive, only replace those files that have
|
||||
a time stamp than the time stamp of the member in the archive.
|
||||
.IP "[z]" 4
|
||||
.IX Item "[z]"
|
||||
When inserting or replacing any file in the archive, compress the file first.
|
||||
This
|
||||
modifier is safe to use when (previously) compressed bytecode files are added to
|
||||
the archive; the compressed bytecode files will not be doubly compressed.
|
||||
.Sh "Modifiers (generic)"
|
||||
.IX Subsection "Modifiers (generic)"
|
||||
The modifiers below may be applied to any operation.
|
||||
.IP "[c]" 4
|
||||
.IX Item "[c]"
|
||||
For all operations, \fBllvm-ar\fR will always create the archive if it doesn't
|
||||
exist. Normally, \fBllvm-ar\fR will print a warning message indicating that the
|
||||
archive is being created. Using this modifier turns off that warning.
|
||||
.IP "[s]" 4
|
||||
.IX Item "[s]"
|
||||
This modifier requests that an archive index (or symbol table) be added to the
|
||||
archive. This is the default mode of operation. The symbol table will contain
|
||||
all the externally visible functions and global variables defined by all the
|
||||
bytecode files in the archive. Using this modifier is more efficient that using
|
||||
llvm-ranlib which also creates the symbol table.
|
||||
.IP "[S]" 4
|
||||
.IX Item "[S]"
|
||||
This modifier is the opposite of the \fIs\fR modifier. It instructs \fBllvm-ar\fR to
|
||||
not build the symbol table. If both \fIs\fR and \fIS\fR are used, the last modifier to
|
||||
occur in the options will prevail.
|
||||
.IP "[v]" 4
|
||||
.IX Item "[v]"
|
||||
This modifier instructs \fBllvm-ar\fR to be verbose about what it is doing. Each
|
||||
editing operation taken against the archive will produce a line of output saying
|
||||
what is being done.
|
||||
.SH "STANDARDS"
|
||||
.IX Header "STANDARDS"
|
||||
The \fBllvm-ar\fR utility is intended to provide a superset of the \s-1IEEE\s0 Std 1003.2
|
||||
(\s-1POSIX\s0.2) functionality for \f(CW\*(C`ar\*(C'\fR. \fBllvm-ar\fR can read both \s-1SVR4\s0 and \s-1BSD4\s0.4 (or
|
||||
Mac \s-1OS\s0 X) archives. If the \f(CW\*(C`f\*(C'\fR modifier is given to the \f(CW\*(C`x\*(C'\fR or \f(CW\*(C`r\*(C'\fR operations
|
||||
then \fBllvm-ar\fR will write \s-1SVR4\s0 compatible archives. Without this modifier,
|
||||
\&\fBllvm-ar\fR will write \s-1BSD4\s0.4 compatible archives that have long names
|
||||
immediately after the header and indicated using the \*(L"#1/ddd\*(R" notation for the
|
||||
name in the header.
|
||||
.SH "FILE FORMAT"
|
||||
.IX Header "FILE FORMAT"
|
||||
The file format for \s-1LLVM\s0 Archive files is similar to that of \s-1BSD\s0 4.4 or Mac \s-1OSX\s0
|
||||
archive files. In fact, except for the symbol table, the \f(CW\*(C`ar\*(C'\fR commands on those
|
||||
operating systems should be able to read \s-1LLVM\s0 archive files. The details of the
|
||||
file format follow.
|
||||
.PP
|
||||
Each archive begins with the archive magic number which is the eight printable
|
||||
characters \*(L"!<arch>\en\*(R" where \en represents the newline character (0x0A).
|
||||
Following the magic number, the file is composed of even length members that
|
||||
begin with an archive header and end with a \en padding character if necessary
|
||||
(to make the length even). Each file member is composed of a header (defined
|
||||
below), an optional newline-terminated \*(L"long file name\*(R" and the contents of
|
||||
the file.
|
||||
.PP
|
||||
The fields of the header are described in the items below. All fields of the
|
||||
header contain only \s-1ASCII\s0 characters, are left justified and are right padded
|
||||
with space characters.
|
||||
.IP "name \- char[16]" 4
|
||||
.IX Item "name - char[16]"
|
||||
This field of the header provides the name of the archive member. If the name is
|
||||
longer than 15 characters or contains a slash (/) character, then this field
|
||||
contains \f(CW\*(C`#1/nnn\*(C'\fR where \f(CW\*(C`nnn\*(C'\fR provides the length of the name and the \f(CW\*(C`#1/\*(C'\fR
|
||||
is literal. In this case, the actual name of the file is provided in the \f(CW\*(C`nnn\*(C'\fR
|
||||
bytes immediately following the header. If the name is 15 characters or less, it
|
||||
is contained directly in this field and terminated with a slash (/) character.
|
||||
.IP "date \- char[12]" 4
|
||||
.IX Item "date - char[12]"
|
||||
This field provides the date of modification of the file in the form of a
|
||||
decimal encoded number that provides the number of seconds since the epoch
|
||||
(since 00:00:00 Jan 1, 1970) per Posix specifications.
|
||||
.IP "uid \- char[6]" 4
|
||||
.IX Item "uid - char[6]"
|
||||
This field provides the user id of the file encoded as a decimal \s-1ASCII\s0 string.
|
||||
This field might not make much sense on non-Unix systems. On Unix, it is the
|
||||
same value as the st_uid field of the stat structure returned by the \fIstat\fR\|(2)
|
||||
operating system call.
|
||||
.IP "gid \- char[6]" 4
|
||||
.IX Item "gid - char[6]"
|
||||
This field provides the group id of the file encoded as a decimal \s-1ASCII\s0 string.
|
||||
This field might not make much sense on non-Unix systems. On Unix, it is the
|
||||
same value as the st_gid field of the stat structure returned by the \fIstat\fR\|(2)
|
||||
operating system call.
|
||||
.IP "mode \- char[8]" 4
|
||||
.IX Item "mode - char[8]"
|
||||
This field provides the access mode of the file encoded as an octal \s-1ASCII\s0
|
||||
string. This field might not make much sense on non-Unix systems. On Unix, it
|
||||
is the same value as the st_mode field of the stat structure returned by the
|
||||
\&\fIstat\fR\|(2) operating system call.
|
||||
.IP "size \- char[10]" 4
|
||||
.IX Item "size - char[10]"
|
||||
This field provides the size of the file, in bytes, encoded as a decimal \s-1ASCII\s0
|
||||
string. If the size field is negative (starts with a minus sign, 0x02D), then
|
||||
the archive member is stored in compressed form. The first byte of the archive
|
||||
member's data indicates the compression type used. A value of 0 (0x30) indicates
|
||||
that no compression was used. A value of 2 (0x32) indicates that bzip2
|
||||
compression was used.
|
||||
.IP "fmag \- char[2]" 4
|
||||
.IX Item "fmag - char[2]"
|
||||
This field is the archive file member magic number. Its content is always the
|
||||
two characters back tick (0x60) and newline (0x0A). This provides some measure
|
||||
utility in identifying archive files that have been corrupted.
|
||||
.PP
|
||||
The \s-1LLVM\s0 symbol table has the special name \*(L"#_LLVM_SYM_TAB_#\*(R". It is presumed
|
||||
that no regular archive member file will want this name. The \s-1LLVM\s0 symbol table
|
||||
is simply composed of a sequence of triplets: byte offset, length of symbol,
|
||||
and the symbol itself. Symbols are not null or newline terminated. Here are
|
||||
the details on each of these items:
|
||||
.IP "offset \- vbr encoded 32\-bit integer" 4
|
||||
.IX Item "offset - vbr encoded 32-bit integer"
|
||||
The offset item provides the offset into the archive file where the bytecode
|
||||
member is stored that is associated with the symbol. The offset value is 0
|
||||
based at the start of the first \*(L"normal\*(R" file member. To derive the actual
|
||||
file offset of the member, you must add the number of bytes occupied by the file
|
||||
signature (8 bytes) and the symbol tables. The value of this item is encoded
|
||||
using variable bit rate encoding to reduce the size of the symbol table.
|
||||
Variable bit rate encoding uses the high bit (0x80) of each byte to indicate
|
||||
if there are more bytes to follow. The remaining 7 bits in each byte carry bits
|
||||
from the value. The final byte does not have the high bit set.
|
||||
.IP "length \- vbr encoded 32\-bit integer" 4
|
||||
.IX Item "length - vbr encoded 32-bit integer"
|
||||
The length item provides the length of the symbol that follows. Like this
|
||||
\&\fIoffset\fR item, the length is variable bit rate encoded.
|
||||
.IP "symbol \- character array" 4
|
||||
.IX Item "symbol - character array"
|
||||
The symbol item provides the text of the symbol that is associated with the
|
||||
\&\fIoffset\fR. The symbol is not terminated by any character. Its length is provided
|
||||
by the \fIlength\fR field. Note that is allowed (but unwise) to use non-printing
|
||||
characters (even 0x00) in the symbol. This allows for multiple encodings of
|
||||
symbol names.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-ar\fR succeeds, it will exit with 0. A usage error, results
|
||||
in an exit code of 1. A hard (file system typically) error results in an
|
||||
exit code of 2. Miscellaneous or unknown errors result in an
|
||||
exit code of 3.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-ranlib, \fIar\fR\|(1)
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
182
llvm/docs/CommandGuide/man/man1/llvm-as.1
Normal file
182
llvm/docs/CommandGuide/man/man1/llvm-as.1
Normal file
@@ -0,0 +1,182 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-AS 1"
|
||||
.TH LLVM-AS 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-as \- LLVM assembler
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-as\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBllvm-as\fR is the \s-1LLVM\s0 assembler. It reads a file containing human-readable
|
||||
\&\s-1LLVM\s0 assembly language, translates it to \s-1LLVM\s0 bytecode, and writes the result
|
||||
into a file or to standard output.
|
||||
.PP
|
||||
If \fIfilename\fR is omitted or is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-as\fR reads its input from
|
||||
standard input.
|
||||
.PP
|
||||
If an output file is not specified with the \fB\-o\fR option, then
|
||||
\&\fBllvm-as\fR sends its output to a file or standard output by following
|
||||
these rules:
|
||||
.IP "\(bu" 4
|
||||
If the input is standard input, then the output is standard output.
|
||||
.IP "\(bu" 4
|
||||
If the input is a file that ends with \f(CW\*(C`.ll\*(C'\fR, then the output file is of
|
||||
the same name, except that the suffix is changed to \f(CW\*(C`.bc\*(C'\fR.
|
||||
.IP "\(bu" 4
|
||||
If the input is a file that does not end with the \f(CW\*(C`.ll\*(C'\fR suffix, then the
|
||||
output file has the same name as the input file, except that the \f(CW\*(C`.bc\*(C'\fR
|
||||
suffix is appended.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force overwrite. Normally, \fBllvm-as\fR will refuse to overwrite an
|
||||
output file that already exists. With this option, \fBllvm-as\fR
|
||||
will overwrite the output file and replace it with new bytecode.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-as\fR
|
||||
sends its output to standard output.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-as\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-dis, gccas
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
370
llvm/docs/CommandGuide/man/man1/llvm-bcanalyzer.1
Normal file
370
llvm/docs/CommandGuide/man/man1/llvm-bcanalyzer.1
Normal file
@@ -0,0 +1,370 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-BCANALYZER 1"
|
||||
.TH LLVM-BCANALYZER 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-bcanalyzer \- LLVM bytecode analyzer
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-bcanalyzer\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-bcanalyzer\fR command is a small utility for analyzing bytecode files.
|
||||
The tool reads a bytecode file (such as generated with the \fBllvm-as\fR tool) and
|
||||
produces a statistical report on the contents of the byteocde file. The tool
|
||||
can also dump a low level but human readable version of the bytecode file.
|
||||
This tool is probably not of much interest or utility except for those working
|
||||
directly with the bytecode file format. Most \s-1LLVM\s0 users can just ignore
|
||||
this tool.
|
||||
.PP
|
||||
If \fIfilename\fR is omitted or is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-bcanalyzer\fR reads its input
|
||||
from standard input. This is useful for combining the tool into a pipeline.
|
||||
Output is written to the standard output.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-nodetails\fR" 4
|
||||
.IX Item "-nodetails"
|
||||
Causes \fBllvm-bcanalyzer\fR to abbreviate its output by writing out only a module
|
||||
level summary. The details for individual functions are not displayed.
|
||||
.IP "\fB\-dump\fR" 4
|
||||
.IX Item "-dump"
|
||||
Causes \fBllvm-bcanalyzer\fR to dump the bytecode in a human readable format. This
|
||||
format is significantly different from \s-1LLVM\s0 assembly and provides details about
|
||||
the encoding of the bytecode file.
|
||||
.IP "\fB\-verify\fR" 4
|
||||
.IX Item "-verify"
|
||||
Causes \fBllvm-bcanalyzer\fR to verify the module produced by reading the
|
||||
bytecode. This ensures that the statistics generated are based on a consistent
|
||||
module.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-bcanalyzer\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value, usually 1.
|
||||
.SH "SUMMARY OUTPUT DEFINITIONS"
|
||||
.IX Header "SUMMARY OUTPUT DEFINITIONS"
|
||||
The following items are always printed by llvm\-bcanalyzer. They comprize the
|
||||
summary output.
|
||||
.IP "\fBBytecode Analysis Of Module\fR" 4
|
||||
.IX Item "Bytecode Analysis Of Module"
|
||||
This just provides the name of the module for which bytecode analysis is being
|
||||
generated.
|
||||
.IP "\fBBytecode Version Number\fR" 4
|
||||
.IX Item "Bytecode Version Number"
|
||||
The bytecode version (not \s-1LLVM\s0 version) of the file read by the analyzer.
|
||||
.IP "\fBFile Size\fR" 4
|
||||
.IX Item "File Size"
|
||||
The size, in bytes, of the entire bytecode file.
|
||||
.IP "\fBModule Bytes\fR" 4
|
||||
.IX Item "Module Bytes"
|
||||
The size, in bytes, of the module block. Percentage is relative to File Size.
|
||||
.IP "\fBFunction Bytes\fR" 4
|
||||
.IX Item "Function Bytes"
|
||||
The size, in bytes, of all the function blocks. Percentage is relative to File
|
||||
Size.
|
||||
.IP "\fBGlobal Types Bytes\fR" 4
|
||||
.IX Item "Global Types Bytes"
|
||||
The size, in bytes, of the Global Types Pool. Percentage is relative to File
|
||||
Size. This is the size of the definitions of all types in the bytecode file.
|
||||
.IP "\fBConstant Pool Bytes\fR" 4
|
||||
.IX Item "Constant Pool Bytes"
|
||||
The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
|
||||
Size.
|
||||
.IP "\fBModule Globals Bytes\fR" 4
|
||||
.IX Item "Module Globals Bytes"
|
||||
Ths size, in bytes, of the Global Variable Definitions and their initializers.
|
||||
Percentage is relative to File Size.
|
||||
.IP "\fBInstruction List Bytes\fR" 4
|
||||
.IX Item "Instruction List Bytes"
|
||||
The size, in bytes, of all the instruction lists in all the functions.
|
||||
Percentage is relative to File Size. Note that this value is also included in
|
||||
the Function Bytes.
|
||||
.IP "\fBCompaction Table Bytes\fR" 4
|
||||
.IX Item "Compaction Table Bytes"
|
||||
The size, in bytes, of all the compaction tables in all the functions.
|
||||
Percentage is relative to File Size. Note that this value is also included in
|
||||
the Function Bytes.
|
||||
.IP "\fBSymbol Table Bytes\fR" 4
|
||||
.IX Item "Symbol Table Bytes"
|
||||
The size, in bytes, of all the symbol tables in all the functions. Percentage is
|
||||
relative to File Size. Note that this value is also included in the Function
|
||||
Bytes.
|
||||
.IP "\fBDependent Libraries Bytes\fR" 4
|
||||
.IX Item "Dependent Libraries Bytes"
|
||||
The size, in bytes, of the list of dependent libraries in the module. Percentage
|
||||
is relative to File Size. Note that this value is also included in the Module
|
||||
Global Bytes.
|
||||
.IP "\fBNumber Of Bytecode Blocks\fR" 4
|
||||
.IX Item "Number Of Bytecode Blocks"
|
||||
The total number of blocks of any kind in the bytecode file.
|
||||
.IP "\fBNumber Of Functions\fR" 4
|
||||
.IX Item "Number Of Functions"
|
||||
The total number of function definitions in the bytecode file.
|
||||
.IP "\fBNumber Of Types\fR" 4
|
||||
.IX Item "Number Of Types"
|
||||
The total number of types defined in the Global Types Pool.
|
||||
.IP "\fBNumber Of Constants\fR" 4
|
||||
.IX Item "Number Of Constants"
|
||||
The total number of constants (of any type) defined in the Constant Pool.
|
||||
.IP "\fBNumber Of Basic Blocks\fR" 4
|
||||
.IX Item "Number Of Basic Blocks"
|
||||
The total number of basic blocks defined in all functions in the bytecode file.
|
||||
.IP "\fBNumber Of Instructions\fR" 4
|
||||
.IX Item "Number Of Instructions"
|
||||
The total number of instructions defined in all functions in the bytecode file.
|
||||
.IP "\fBNumber Of Long Instructions\fR" 4
|
||||
.IX Item "Number Of Long Instructions"
|
||||
The total number of long instructions defined in all functions in the bytecode
|
||||
file. Long instructions are those taking greater than 4 bytes. Typically long
|
||||
instructions are GetElementPtr with several indices, \s-1PHI\s0 nodes, and calls to
|
||||
functions with large numbers of arguments.
|
||||
.IP "\fBNumber Of Operands\fR" 4
|
||||
.IX Item "Number Of Operands"
|
||||
The total number of operands used in all instructions in the bytecode file.
|
||||
.IP "\fBNumber Of Compaction Tables\fR" 4
|
||||
.IX Item "Number Of Compaction Tables"
|
||||
The total number of compaction tables in all functions in the bytecode file.
|
||||
.IP "\fBNumber Of Symbol Tables\fR" 4
|
||||
.IX Item "Number Of Symbol Tables"
|
||||
The total number of symbol tables in all functions in the bytecode file.
|
||||
.IP "\fBNumber Of Dependent Libs\fR" 4
|
||||
.IX Item "Number Of Dependent Libs"
|
||||
The total number of dependent libraries found in the bytecode file.
|
||||
.IP "\fBTotal Instruction Size\fR" 4
|
||||
.IX Item "Total Instruction Size"
|
||||
The total size of the instructions in all functions in the bytecode file.
|
||||
.IP "\fBAverage Instruction Size\fR" 4
|
||||
.IX Item "Average Instruction Size"
|
||||
The average number of bytes per instruction across all functions in the bytecode
|
||||
file. This value is computed by dividing Total Instruction Size by Number Of
|
||||
Instructions.
|
||||
.IP "\fBMaximum Type Slot Number\fR" 4
|
||||
.IX Item "Maximum Type Slot Number"
|
||||
The maximum value used for a type's slot number. Larger slot number values take
|
||||
more bytes to encode.
|
||||
.IP "\fBMaximum Value Slot Number\fR" 4
|
||||
.IX Item "Maximum Value Slot Number"
|
||||
The maximum value used for a value's slot number. Larger slot number values take
|
||||
more bytes to encode.
|
||||
.IP "\fBBytes Per Value\fR" 4
|
||||
.IX Item "Bytes Per Value"
|
||||
The average size of a Value definition (of any type). This is computed by
|
||||
dividing File Size by the total number of values of any type.
|
||||
.IP "\fBBytes Per Global\fR" 4
|
||||
.IX Item "Bytes Per Global"
|
||||
The average size of a global definition (constants and global variables).
|
||||
.IP "\fBBytes Per Function\fR" 4
|
||||
.IX Item "Bytes Per Function"
|
||||
The average number of bytes per function definition. This is computed by
|
||||
dividing Function Bytes by Number Of Functions.
|
||||
.IP "\fB# of \s-1VBR\s0 32\-bit Integers\fR" 4
|
||||
.IX Item "# of VBR 32-bit Integers"
|
||||
The total number of 32\-bit integers encoded using the Variable Bit Rate
|
||||
encoding scheme.
|
||||
.IP "\fB# of \s-1VBR\s0 64\-bit Integers\fR" 4
|
||||
.IX Item "# of VBR 64-bit Integers"
|
||||
The total number of 64\-bit integers encoded using the Variable Bit Rate encoding
|
||||
scheme.
|
||||
.IP "\fB# of \s-1VBR\s0 Compressed Bytes\fR" 4
|
||||
.IX Item "# of VBR Compressed Bytes"
|
||||
The total number of bytes consumed by the 32\-bit and 64\-bit integers that use
|
||||
the Variable Bit Rate encoding scheme.
|
||||
.IP "\fB# of \s-1VBR\s0 Expanded Bytes\fR" 4
|
||||
.IX Item "# of VBR Expanded Bytes"
|
||||
The total number of bytes that would have been consumed by the 32\-bit and 64\-bit
|
||||
integers had they not been compressed with the Variable Bit Rage encoding
|
||||
scheme.
|
||||
.IP "\fBBytes Saved With \s-1VBR\s0\fR" 4
|
||||
.IX Item "Bytes Saved With VBR"
|
||||
The total number of bytes saved by using the Variable Bit Rate encoding scheme.
|
||||
The percentage is relative to # of \s-1VBR\s0 Expanded Bytes.
|
||||
.SH "DETAILED OUTPUT DEFINITIONS"
|
||||
.IX Header "DETAILED OUTPUT DEFINITIONS"
|
||||
The following definitions occur only if the \-nodetails option was not given.
|
||||
The detailed output provides additional information on a per-function basis.
|
||||
.IP "\fBType\fR" 4
|
||||
.IX Item "Type"
|
||||
The type signature of the function.
|
||||
.IP "\fBByte Size\fR" 4
|
||||
.IX Item "Byte Size"
|
||||
The total number of bytes in the function's block.
|
||||
.IP "\fBBasic Blocks\fR" 4
|
||||
.IX Item "Basic Blocks"
|
||||
The number of basic blocks defined by the function.
|
||||
.IP "\fBInstructions\fR" 4
|
||||
.IX Item "Instructions"
|
||||
The number of instructions defined by the function.
|
||||
.IP "\fBLong Instructions\fR" 4
|
||||
.IX Item "Long Instructions"
|
||||
The number of instructions using the long instruction format in the function.
|
||||
.IP "\fBOperands\fR" 4
|
||||
.IX Item "Operands"
|
||||
The number of operands used by all instructions in the function.
|
||||
.IP "\fBInstruction Size\fR" 4
|
||||
.IX Item "Instruction Size"
|
||||
The number of bytes consumed by instructions in the function.
|
||||
.IP "\fBAverage Instruction Size\fR" 4
|
||||
.IX Item "Average Instruction Size"
|
||||
The average number of bytes consumed by the instructions in the funtion. This
|
||||
value is computed by dividing Instruction Size by Instructions.
|
||||
.IP "\fBBytes Per Instruction\fR" 4
|
||||
.IX Item "Bytes Per Instruction"
|
||||
The average number of bytes used by the function per instruction. This value is
|
||||
computed by dividing Byte Size by Instructions. Note that this is not the same
|
||||
as Average Instruction Size. It computes a number relative to the total function
|
||||
size not just the size of the instruction list.
|
||||
.IP "\fBNumber of \s-1VBR\s0 32\-bit Integers\fR" 4
|
||||
.IX Item "Number of VBR 32-bit Integers"
|
||||
The total number of 32\-bit integers found in this function (for any use).
|
||||
.IP "\fBNumber of \s-1VBR\s0 64\-bit Integers\fR" 4
|
||||
.IX Item "Number of VBR 64-bit Integers"
|
||||
The total number of 64\-bit integers found in this function (for any use).
|
||||
.IP "\fBNumber of \s-1VBR\s0 Compressed Bytes\fR" 4
|
||||
.IX Item "Number of VBR Compressed Bytes"
|
||||
The total number of bytes in this function consumed by the 32\-bit and 64\-bit
|
||||
integers that use the Variable Bit Rate encoding scheme.
|
||||
.IP "\fBNumber of \s-1VBR\s0 Expanded Bytes\fR" 4
|
||||
.IX Item "Number of VBR Expanded Bytes"
|
||||
The total number of bytes in this function that would have been consumed by
|
||||
the 32\-bit and 64\-bit integers had they not been compressed with the Variable
|
||||
Bit Rate encoding scheme.
|
||||
.IP "\fBBytes Saved With \s-1VBR\s0\fR" 4
|
||||
.IX Item "Bytes Saved With VBR"
|
||||
The total number of bytes saved in this function by using the Variable Bit
|
||||
Rate encoding scheme. The percentage is relative to # of \s-1VBR\s0 Expanded Bytes.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-dis, <http://llvm.org/docs/BytecodeFormat.html>
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
227
llvm/docs/CommandGuide/man/man1/llvm-config.1
Normal file
227
llvm/docs/CommandGuide/man/man1/llvm-config.1
Normal file
@@ -0,0 +1,227 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-CONFIG 1"
|
||||
.TH LLVM-CONFIG 1 "2006-08-01" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-config \- Print LLVM compilation options
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-config\fR \fIoption\fR [\fIcomponents\fR...]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBllvm-config\fR makes it easier to build applications that use \s-1LLVM\s0. It can
|
||||
print the compiler flags, linker flags and object libraries needed to link
|
||||
against \s-1LLVM\s0.
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
To link against the \s-1JIT:\s0
|
||||
.PP
|
||||
.Vb 3
|
||||
\& g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
|
||||
\& g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \e
|
||||
\& `llvm-config --libs engine bcreader scalaropts`
|
||||
.Ve
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-\-version\fR" 4
|
||||
.IX Item "--version"
|
||||
Print the version number of \s-1LLVM\s0.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of \fBllvm-config\fR arguments.
|
||||
.IP "\fB\-\-prefix\fR" 4
|
||||
.IX Item "--prefix"
|
||||
Print the installation prefix for \s-1LLVM\s0.
|
||||
.IP "\fB\-\-src\-root\fR" 4
|
||||
.IX Item "--src-root"
|
||||
Print the source root from which \s-1LLVM\s0 was built.
|
||||
.IP "\fB\-\-obj\-root\fR" 4
|
||||
.IX Item "--obj-root"
|
||||
Print the object root used to build \s-1LLVM\s0.
|
||||
.IP "\fB\-\-bindir\fR" 4
|
||||
.IX Item "--bindir"
|
||||
Print the installation directory for \s-1LLVM\s0 binaries.
|
||||
.IP "\fB\-\-includedir\fR" 4
|
||||
.IX Item "--includedir"
|
||||
Print the installation directory for \s-1LLVM\s0 headers.
|
||||
.IP "\fB\-\-libdir\fR" 4
|
||||
.IX Item "--libdir"
|
||||
Print the installation directory for \s-1LLVM\s0 libraries.
|
||||
.IP "\fB\-\-cxxflags\fR" 4
|
||||
.IX Item "--cxxflags"
|
||||
Print the \*(C+ compiler flags needed to use \s-1LLVM\s0 headers.
|
||||
.IP "\fB\-\-ldflags\fR" 4
|
||||
.IX Item "--ldflags"
|
||||
Print the flags needed to link against \s-1LLVM\s0 libraries.
|
||||
.IP "\fB\-\-libs\fR" 4
|
||||
.IX Item "--libs"
|
||||
Print all the libraries needed to link against the specified \s-1LLVM\s0
|
||||
\&\fIcomponents\fR, including any dependencies.
|
||||
.IP "\fB\-\-libnames\fR" 4
|
||||
.IX Item "--libnames"
|
||||
Similar to \fB\-\-libs\fR, but prints the bare filenames of the libraries
|
||||
without \fB\-l\fR or pathnames. Useful for linking against a not-yet-installed
|
||||
copy of \s-1LLVM\s0.
|
||||
.IP "\fB\-\-libfiles\fR" 4
|
||||
.IX Item "--libfiles"
|
||||
Similar to \fB\-\-libs\fR, but print the full path to each library file. This is
|
||||
useful when creating makefile dependencies, to ensure that a tool is relinked if
|
||||
any library it uses changes.
|
||||
.IP "\fB\-\-components\fR" 4
|
||||
.IX Item "--components"
|
||||
Print all valid component names.
|
||||
.IP "\fB\-\-targets\-built\fR" 4
|
||||
.IX Item "--targets-built"
|
||||
Print the component names for all targets supported by this copy of \s-1LLVM\s0.
|
||||
.IP "\fB\-\-build\-mode\fR" 4
|
||||
.IX Item "--build-mode"
|
||||
Print the build mode used when \s-1LLVM\s0 was built (e.g. Debug or Release)
|
||||
.SH "COMPONENTS"
|
||||
.IX Header "COMPONENTS"
|
||||
To print a list of all available components, run \fBllvm-config
|
||||
\&\-\-components\fR. In most cases, components correspond directly to \s-1LLVM\s0
|
||||
libraries. Useful \*(L"virtual\*(R" components include:
|
||||
.IP "\fBall\fR" 4
|
||||
.IX Item "all"
|
||||
Includes all \s-1LLVM\s0 libaries. The default if no components are specified.
|
||||
.IP "\fBbackend\fR" 4
|
||||
.IX Item "backend"
|
||||
Includes either a native backend or the C backend.
|
||||
.IP "\fBengine\fR" 4
|
||||
.IX Item "engine"
|
||||
Includes either a native \s-1JIT\s0 or the bytecode interpreter.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-config\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
141
llvm/docs/CommandGuide/man/man1/llvm-db.1
Normal file
141
llvm/docs/CommandGuide/man/man1/llvm-db.1
Normal file
@@ -0,0 +1,141 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-DB 1"
|
||||
.TH LLVM-DB 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-db \- LLVM debugger (alpha)
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
Details coming soon. Please see
|
||||
<http://llvm.org/docs/SourceLevelDebugging.html> in the meantime.
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
175
llvm/docs/CommandGuide/man/man1/llvm-dis.1
Normal file
175
llvm/docs/CommandGuide/man/man1/llvm-dis.1
Normal file
@@ -0,0 +1,175 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-DIS 1"
|
||||
.TH LLVM-DIS 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-dis \- LLVM disassembler
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-dis\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-dis\fR command is the \s-1LLVM\s0 disassembler. It takes an \s-1LLVM\s0
|
||||
bytecode file and converts it into human-readable \s-1LLVM\s0 assembly language.
|
||||
.PP
|
||||
If filename is omitted or specified as \f(CW\*(C`\-\*(C'\fR, \fBllvm-dis\fR reads its
|
||||
input from standard input.
|
||||
.PP
|
||||
If the input is being read from standard input, then \fBllvm-dis\fR
|
||||
will send its output to standard output by default. Otherwise, the
|
||||
output will be written to a file named after the input file, with
|
||||
a \f(CW\*(C`.ll\*(C'\fR suffix added (any existing \f(CW\*(C`.bc\*(C'\fR suffix will first be
|
||||
removed). You can override the choice of output file using the
|
||||
\&\fB\-o\fR option.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force overwrite. Normally, \fBllvm-dis\fR will refuse to overwrite
|
||||
an output file that already exists. With this option, \fBllvm-dis\fR
|
||||
will overwrite the output file.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \-, then the output is sent
|
||||
to standard output.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-dis\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-as
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
177
llvm/docs/CommandGuide/man/man1/llvm-extract.1
Normal file
177
llvm/docs/CommandGuide/man/man1/llvm-extract.1
Normal file
@@ -0,0 +1,177 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-EXTRACT 1"
|
||||
.TH LLVM-EXTRACT 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-extract \- extract a function from an LLVM module
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-extract\fR [\fIoptions\fR] \fB\-\-func\fR \fIfunction-name\fR [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-extract\fR command takes the name of a function and extracts it from
|
||||
the specified \s-1LLVM\s0 bytecode file. It is primarily used as a debugging tool to
|
||||
reduce test cases from larger programs that are triggering a bug.
|
||||
.PP
|
||||
In addition to extracting the bytecode of the specified function,
|
||||
\&\fBllvm-extract\fR will also remove unreachable global variables, prototypes, and
|
||||
unused types.
|
||||
.PP
|
||||
The \fBllvm-extract\fR command reads its input from standard input if filename is
|
||||
omitted or if filename is \-. The output is always written to standard output,
|
||||
unless the \fB\-o\fR option is specified (see below).
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force overwrite. Normally, \fBllvm-extract\fR will refuse to overwrite an
|
||||
output file that already exists. With this option, \fBllvm-extract\fR
|
||||
will overwrite the output file and replace it with new bytecode.
|
||||
.IP "\fB\-\-func\fR \fIfunction-name\fR" 4
|
||||
.IX Item "--func function-name"
|
||||
Extract the function named \fIfunction-name\fR from the \s-1LLVM\s0 bytecode.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output filename. If filename is \*(L"\-\*(R" (the default), then
|
||||
\&\fBllvm-extract\fR sends its output to standard output.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-extract\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
bugpoint
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
348
llvm/docs/CommandGuide/man/man1/llvm-ld.1
Normal file
348
llvm/docs/CommandGuide/man/man1/llvm-ld.1
Normal file
@@ -0,0 +1,348 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-LD 1"
|
||||
.TH LLVM-LD 1 "2007-05-06" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-ld \- LLVM linker
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-ld\fR <options> <files>
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-ld\fR tool takes a set of \s-1LLVM\s0 bytecode files and links them
|
||||
together into a single \s-1LLVM\s0 bytecode file. The output bytecode file can be
|
||||
another bytecode file or an executable bytecode program. Using additional
|
||||
options, \fBllvm-ld\fR is able to produce native code executables.
|
||||
.PP
|
||||
The \fBllvm-ld\fR tool is the main linker for \s-1LLVM\s0. It is used to link together
|
||||
the output of \s-1LLVM\s0 front-end compilers and run \*(L"link time\*(R" optimizations (mostly
|
||||
the inter-procedural kind).
|
||||
.PP
|
||||
The \fBllvm-ld\fR tools attemps to mimic the interface provided by the default
|
||||
system linker so that it can act as a \fIdrop-in\fR replacement.
|
||||
.Sh "Search Order"
|
||||
.IX Subsection "Search Order"
|
||||
When looking for objects specified on the command line, \fBllvm-ld\fR will search
|
||||
for the object first in the current directory and then in the directory
|
||||
specified by the \fB\s-1LLVM_LIB_SEARCH_PATH\s0\fR environment variable. If it cannot
|
||||
find the object, it fails.
|
||||
.PP
|
||||
When looking for a library specified with the \fB\-l\fR option, \fBllvm-ld\fR first
|
||||
attempts to load a file with that name from the current directory. If that
|
||||
fails, it looks for lib\fIlibrary\fR.bc, lib\fIlibrary\fR.a, or lib\fIlibrary\fR.\fIshared
|
||||
library extension\fR, in that order, in each directory added to the library search
|
||||
path with the \fB\-L\fR option. These directories are searched in the order they
|
||||
are specified. If the library cannot be located, then \fBllvm-ld\fR looks in the
|
||||
directory specified by the \fB\s-1LLVM_LIB_SEARCH_PATH\s0\fR environment variable. If it
|
||||
does not find a library there, it fails.
|
||||
.PP
|
||||
The \fIshared library extension\fR may be \fI.so\fR, \fI.dyld\fR, \fI.dll\fR, or something
|
||||
different, depending upon the system.
|
||||
.PP
|
||||
The \fB\-L\fR option is global. It does not matter where it is specified in the
|
||||
list of command line arguments; the directory is simply added to the search path
|
||||
and is applied to all libraries, preceding or succeeding, in the command line.
|
||||
.Sh "Link order"
|
||||
.IX Subsection "Link order"
|
||||
All object and bytecode files are linked first in the order they were
|
||||
specified on the command line. All library files are linked next.
|
||||
Some libraries may not be linked into the object program; see below.
|
||||
.Sh "Library Linkage"
|
||||
.IX Subsection "Library Linkage"
|
||||
Object files and static bytecode objects are always linked into the output
|
||||
file. Library archives (.a files) load only the objects within the archive
|
||||
that define symbols needed by the output file. Hence, libraries should be
|
||||
listed after the object files and libraries which need them; otherwise, the
|
||||
library may not be linked in, and the dependent library will not have its
|
||||
undefined symbols defined.
|
||||
.Sh "Native code generation"
|
||||
.IX Subsection "Native code generation"
|
||||
The \fBllvm-ld\fR program has limited support for native code generation, when
|
||||
using the \fB\-native\fR or \fB\-native\-cbe\fR options. Native code generation is
|
||||
perfomed by converting the linked bytecode into native assembly (.s) or C code
|
||||
and running the system compiler (typically gcc) on the result.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.Sh "General Options"
|
||||
.IX Subsection "General Options"
|
||||
.IP "\fB\-help\fR" 4
|
||||
.IX Item "-help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-v\fR" 4
|
||||
.IX Item "-v"
|
||||
Specifies verbose mode. In this mode the linker will print additional
|
||||
information about the actions it takes, programs it executes, etc.
|
||||
.IP "\fB\-stats\fR" 4
|
||||
.IX Item "-stats"
|
||||
Print statistics.
|
||||
.IP "\fB\-time\-passes\fR" 4
|
||||
.IX Item "-time-passes"
|
||||
Record the amount of time needed for each pass and print it to standard
|
||||
error.
|
||||
.Sh "Input/Output Options"
|
||||
.IX Subsection "Input/Output Options"
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
This overrides the default output file and specifies the name of the file that
|
||||
should be generated by the linker. By default, \fBllvm-ld\fR generates a file named
|
||||
\&\fIa.out\fR for compatibility with \fBld\fR. The output will be written to
|
||||
\&\fIfilename\fR.
|
||||
.IP "\fB\-l\fR\fIname\fR" 4
|
||||
.IX Item "-lname"
|
||||
This option specifies the \fIname\fR of a library to search when resolving symbols
|
||||
for the program. Only the base name should be specified as \fIname\fR, without a
|
||||
\&\fIlib\fR prefix or any suffix.
|
||||
.IP "\fB\-L\fR\fIPath\fR" 4
|
||||
.IX Item "-LPath"
|
||||
This option tells \fBllvm-ld\fR to look in \fIPath\fR to find any library subsequently
|
||||
specified with the \fB\-l\fR option. The paths will be searched in the order in
|
||||
which they are specified on the command line. If the library is still not found,
|
||||
a small set of system specific directories will also be searched. Note that
|
||||
libraries specified with the \fB\-l\fR option that occur \fIbefore\fR any \fB\-L\fR options
|
||||
will not search the paths given by the \fB\-L\fR options following it.
|
||||
.IP "\fB\-link\-as\-library\fR" 4
|
||||
.IX Item "-link-as-library"
|
||||
Link the bytecode files together as a library, not an executable. In this mode,
|
||||
undefined symbols will be permitted.
|
||||
.IP "\fB\-r\fR" 4
|
||||
.IX Item "-r"
|
||||
An alias for \-link\-as\-library.
|
||||
.ie n .IP "\fB\-march=\fR""target""" 4
|
||||
.el .IP "\fB\-march=\fR\f(CWtarget\fR" 4
|
||||
.IX Item "-march=target"
|
||||
Specifies the kind of machine for which code or assembly should be generated.
|
||||
.IP "\fB\-native\fR" 4
|
||||
.IX Item "-native"
|
||||
Generate a native machine code executable.
|
||||
.Sp
|
||||
When generating native executables, \fBllvm-ld\fR first checks for a bytecode
|
||||
version of the library and links it in, if necessary. If the library is
|
||||
missing, \fBllvm-ld\fR skips it. Then, \fBllvm-ld\fR links in the same
|
||||
libraries as native code.
|
||||
.Sp
|
||||
In this way, \fBllvm-ld\fR should be able to link in optimized bytecode
|
||||
subsets of common libraries and then link in any part of the library that
|
||||
hasn't been converted to bytecode.
|
||||
.IP "\fB\-native\-cbe\fR" 4
|
||||
.IX Item "-native-cbe"
|
||||
Generate a native machine code executable with the \s-1LLVM\s0 C backend.
|
||||
.Sp
|
||||
This option is identical to the \fB\-native\fR option, but uses the
|
||||
C backend to generate code for the program instead of an \s-1LLVM\s0 native
|
||||
code generator.
|
||||
.Sh "Optimization Options"
|
||||
.IX Subsection "Optimization Options"
|
||||
.IP "\fB\-O0\fR" 4
|
||||
.IX Item "-O0"
|
||||
An alias for the \-O1 option.
|
||||
.IP "\fB\-O1\fR" 4
|
||||
.IX Item "-O1"
|
||||
Optimize for linking speed, not execution speed. The optimizer will attempt to
|
||||
reduce the size of the linked program to reduce I/O but will not otherwise
|
||||
perform any link-time optimizations.
|
||||
.IP "\fB\-O2\fR" 4
|
||||
.IX Item "-O2"
|
||||
Perform only the minimal or required set of scalar optimizations.
|
||||
.IP "\fB\-03\fR" 4
|
||||
.IX Item "-03"
|
||||
An alias for the \-O2 option.
|
||||
.IP "\fB\-04\fR" 4
|
||||
.IX Item "-04"
|
||||
Perform the standard link time inter-procedural optimizations. This will
|
||||
attempt to optimize the program taking the entire program into consideration.
|
||||
.IP "\fB\-O5\fR" 4
|
||||
.IX Item "-O5"
|
||||
Perform aggressive link time optimizations. This is the same as \-O4 but works
|
||||
more aggressively to optimize the program.
|
||||
.IP "\fB\-disable\-inlining\fR" 4
|
||||
.IX Item "-disable-inlining"
|
||||
Do not run the inlining pass. Functions will not be inlined into other
|
||||
functions.
|
||||
.IP "\fB\-disable\-opt\fR" 4
|
||||
.IX Item "-disable-opt"
|
||||
Completely disable optimization. The various \fB\-On\fR options will be ignored and
|
||||
no link time optimization passes will be run.
|
||||
.IP "\fB\-disable\-internalize\fR" 4
|
||||
.IX Item "-disable-internalize"
|
||||
Do not mark all symbols as internal.
|
||||
.IP "\fB\-verify\-each\fR" 4
|
||||
.IX Item "-verify-each"
|
||||
Run the verification pass after each of the passes to verify intermediate
|
||||
results.
|
||||
.IP "\fB\-strip\-all\fR" 4
|
||||
.IX Item "-strip-all"
|
||||
Strip all debug and symbol information from the executable to make it smaller.
|
||||
.IP "\fB\-strip\-debug\fR" 4
|
||||
.IX Item "-strip-debug"
|
||||
Strip all debug information from the executable to make it smaller.
|
||||
.IP "\fB\-s\fR" 4
|
||||
.IX Item "-s"
|
||||
An alias for \fB\-strip\-all\fR.
|
||||
.IP "\fB\-S\fR" 4
|
||||
.IX Item "-S"
|
||||
An alias for \fB\-strip\-debug\fR.
|
||||
.IP "\fB\-export\-dynamic\fR" 4
|
||||
.IX Item "-export-dynamic"
|
||||
An alias for \fB\-disable\-internalize\fR
|
||||
.IP "\fB\-load\fR \fImodule\fR" 4
|
||||
.IX Item "-load module"
|
||||
Load an optimization module, \fImodule\fR, which is expected to be a dynamic
|
||||
library that provides the function name \f(CW\*(C`RunOptimizations\*(C'\fR. This function will
|
||||
be passed the PassManager, and the optimization level (values 0\-5 based on the
|
||||
\&\fB\-On\fR option). This function may add passes to the PassManager that should be
|
||||
run. This feature allows the optimization passes of \fBllvm-ld\fR to be extended.
|
||||
.IP "\fB\-post\-link\-opt\fR\fIPath\fR" 4
|
||||
.IX Item "-post-link-optPath"
|
||||
Run post-link optimization program. After linking is completed a bytecode file
|
||||
will be generated. It will be passed to the program specified by \fIPath\fR as the
|
||||
first argument. The second argument to the program will be the name of a
|
||||
temporary file into which the program should place its optimized output. For
|
||||
example, the \*(L"no\-op optimization\*(R" would be a simple shell script:
|
||||
.Sp
|
||||
.Vb 2
|
||||
\& #!/bin/bash
|
||||
\& cp $1 $2
|
||||
.Ve
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-ld\fR succeeds, it will exit with 0 return code. If an error occurs,
|
||||
it will exit with a non-zero return code.
|
||||
.SH "ENVIRONMENT"
|
||||
.IX Header "ENVIRONMENT"
|
||||
The \f(CW\*(C`LLVM_LIB_SEARCH_PATH\*(C'\fR environment variable is used to find bytecode
|
||||
libraries. Any paths specified in this variable will be searched after the \f(CW\*(C`\-L\*(C'\fR
|
||||
options.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-link
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
186
llvm/docs/CommandGuide/man/man1/llvm-link.1
Normal file
186
llvm/docs/CommandGuide/man/man1/llvm-link.1
Normal file
@@ -0,0 +1,186 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-LINK 1"
|
||||
.TH LLVM-LINK 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-link \- LLVM linker
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-link\fR [\fIoptions\fR] \fIfilename ...\fR
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBllvm-link\fR takes several \s-1LLVM\s0 bytecode files and links them together into a
|
||||
single \s-1LLVM\s0 bytecode file. It writes the output file to standard output, unless
|
||||
the \fB\-o\fR option is used to specify a filename.
|
||||
.PP
|
||||
\&\fBllvm-link\fR attempts to load the input files from the current directory. If
|
||||
that fails, it looks for each file in each of the directories specified by the
|
||||
\&\fB\-L\fR options on the command line. The library search paths are global; each
|
||||
one is searched for every input file if necessary. The directories are searched
|
||||
in the order they were specified on the command line.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-L\fR \fIdirectory\fR" 4
|
||||
.IX Item "-L directory"
|
||||
Add the specified \fIdirectory\fR to the library search path. When looking for
|
||||
libraries, \fBllvm-link\fR will look in pathname for libraries. This option can be
|
||||
specified multiple times; \fBllvm-link\fR will search inside these directories in
|
||||
the order in which they were specified on the command line.
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Overwrite output files. By default, \fBllvm-link\fR will not overwrite an output
|
||||
file if it alreadys exists.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-link\fR will
|
||||
write its output to standard output.
|
||||
.IP "\fB\-d\fR" 4
|
||||
.IX Item "-d"
|
||||
If specified, \fBllvm-link\fR prints a human-readable version of the output
|
||||
bytecode file to standard error.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-v\fR" 4
|
||||
.IX Item "-v"
|
||||
Verbose mode. Print information about what \fBllvm-link\fR is doing. This
|
||||
typically includes a message for each bytecode file linked in and for each
|
||||
library found.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-link\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
gccld
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
219
llvm/docs/CommandGuide/man/man1/llvm-nm.1
Normal file
219
llvm/docs/CommandGuide/man/man1/llvm-nm.1
Normal file
@@ -0,0 +1,219 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-NM 1"
|
||||
.TH LLVM-NM 1 "2006-11-20" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-nm \- list LLVM bytecode file's symbol table
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-nm\fR [\fIoptions\fR] [\fIfilenames...\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-nm\fR utility lists the names of symbols from the \s-1LLVM\s0 bytecode files,
|
||||
or \fBar\fR archives containing \s-1LLVM\s0 bytecode files, named on the command line.
|
||||
Each symbol is listed along with some simple information about its provenance.
|
||||
If no filename is specified, or \fI\-\fR is used as a filename, \fBllvm-nm\fR will
|
||||
process a bytecode file on its standard input stream.
|
||||
.PP
|
||||
\&\fBllvm-nm\fR's default output format is the traditional \s-1BSD\s0 \fBnm\fR output format.
|
||||
Each such output record consists of an (optional) 8\-digit hexadecimal address,
|
||||
followed by a type code character, followed by a name, for each symbol. One
|
||||
record is printed per line; fields are separated by spaces. When the address is
|
||||
omitted, it is replaced by 8 spaces.
|
||||
.PP
|
||||
Type code characters currently supported, and their meanings, are as follows:
|
||||
.IP "U" 4
|
||||
.IX Item "U"
|
||||
Named object is referenced but undefined in this bytecode file
|
||||
.IP "C" 4
|
||||
.IX Item "C"
|
||||
Common (multiple defs link together into one def)
|
||||
.IP "W" 4
|
||||
.IX Item "W"
|
||||
Weak reference (multiple defs link together into zero or one defs)
|
||||
.IP "t" 4
|
||||
.IX Item "t"
|
||||
Local function (text) object
|
||||
.IP "T" 4
|
||||
.IX Item "T"
|
||||
Global function (text) object
|
||||
.IP "d" 4
|
||||
.IX Item "d"
|
||||
Local data object
|
||||
.IP "D" 4
|
||||
.IX Item "D"
|
||||
Global data object
|
||||
.IP "?" 4
|
||||
Something unrecognizable
|
||||
.PP
|
||||
Because \s-1LLVM\s0 bytecode files typically contain objects that are not considered to
|
||||
have addresses until they are linked into an executable image or dynamically
|
||||
compiled \*(L"just\-in\-time\*(R", \fBllvm-nm\fR does not print an address for any symbol,
|
||||
even symbols which are defined in the bytecode file.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-P\fR" 4
|
||||
.IX Item "-P"
|
||||
Use \s-1POSIX\s0.2 output format. Alias for \fB\-\-format=posix\fR.
|
||||
.IP "\fB\-B\fR (default)" 4
|
||||
.IX Item "-B (default)"
|
||||
Use \s-1BSD\s0 output format. Alias for \fB\-\-format=bsd\fR.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command-line options and their meanings.
|
||||
.IP "\fB\-\-defined\-only\fR" 4
|
||||
.IX Item "--defined-only"
|
||||
Print only symbols defined in this bytecode file (as opposed to
|
||||
symbols which may be referenced by objects in this file, but not
|
||||
defined in this file.)
|
||||
.IP "\fB\-\-extern\-only\fR, \fB\-g\fR" 4
|
||||
.IX Item "--extern-only, -g"
|
||||
Print only symbols whose definitions are external; that is, accessible
|
||||
from other bytecode files.
|
||||
.IP "\fB\-\-undefined\-only\fR, \fB\-u\fR" 4
|
||||
.IX Item "--undefined-only, -u"
|
||||
Print only symbols referenced but not defined in this bytecode file.
|
||||
.IP "\fB\-\-format=\fR\fIfmt\fR, \fB\-f\fR" 4
|
||||
.IX Item "--format=fmt, -f"
|
||||
Select an output format; \fIfmt\fR may be \fIsysv\fR, \fIposix\fR, or \fIbsd\fR. The
|
||||
default is \fIbsd\fR.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
\&\fBllvm-nm\fR cannot demangle \*(C+ mangled names, like \s-1GNU\s0 \fBnm\fR can.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
\&\fBllvm-nm\fR exits with an exit code of zero.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-dis, \fIar\fR\|(1), \fInm\fR\|(1)
|
||||
.SH "AUTHOR"
|
||||
.IX Header "AUTHOR"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
173
llvm/docs/CommandGuide/man/man1/llvm-prof.1
Normal file
173
llvm/docs/CommandGuide/man/man1/llvm-prof.1
Normal file
@@ -0,0 +1,173 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-PROF 1"
|
||||
.TH LLVM-PROF 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-prof \- print execution profile of LLVM program
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-prof\fR [\fIoptions\fR] [\fIbytecode file\fR] [\fIllvmprof.out\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-prof\fR tool reads in an \fIllvmprof.out\fR file (which can
|
||||
optionally use a specific file with the third program argument), a bytecode file
|
||||
for the program, and produces a human readable report, suitable for determining
|
||||
where the program hotspots are.
|
||||
.PP
|
||||
This program is often used in conjunction with the \fIutils/profile.pl\fR
|
||||
script. This script automatically instruments a program, runs it with the \s-1JIT\s0,
|
||||
then runs \fBllvm-prof\fR to format a report. To get more information about
|
||||
\&\fIutils/profile.pl\fR, execute it with the \fB\-\-help\fR option.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-\-annotated\-llvm\fR or \fB\-A\fR" 4
|
||||
.IX Item "--annotated-llvm or -A"
|
||||
In addition to the normal report printed, print out the code for the
|
||||
program, annotated with execution frequency information. This can be
|
||||
particularly useful when trying to visualize how frequently basic blocks
|
||||
are executed. This is most useful with basic block profiling
|
||||
information or better.
|
||||
.IP "\fB\-\-print\-all\-code\fR" 4
|
||||
.IX Item "--print-all-code"
|
||||
Using this option enables the \fB\-\-annotated\-llvm\fR option, but it
|
||||
prints the entire module, instead of just the most commonly executed
|
||||
functions.
|
||||
.IP "\fB\-\-time\-passes\fR" 4
|
||||
.IX Item "--time-passes"
|
||||
Record the amount of time needed for each pass and print it to standard
|
||||
error.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
\&\fBllvm-prof\fR returns 1 if it cannot load the bytecode file or the profile
|
||||
information. Otherwise, it exits with zero.
|
||||
.SH "AUTHOR"
|
||||
.IX Header "AUTHOR"
|
||||
\&\fBllvm-prof\fR is maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
167
llvm/docs/CommandGuide/man/man1/llvm-ranlib.1
Normal file
167
llvm/docs/CommandGuide/man/man1/llvm-ranlib.1
Normal file
@@ -0,0 +1,167 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-RANLIB 1"
|
||||
.TH LLVM-RANLIB 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-ranlib \- Generate index for LLVM archive
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-ranlib\fR [\-\-version] [\-\-help] <archive\-file>
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-ranlib\fR command is similar to the common Unix utility, \f(CW\*(C`ranlib\*(C'\fR. It
|
||||
adds or updates the symbol table in an \s-1LLVM\s0 archive file. Note that using the
|
||||
\&\fBllvm-ar\fR modifier \fIs\fR is usually more efficient than running \fBllvm-ranlib\fR
|
||||
which is only provided only for completness and compatibility. Unlike other
|
||||
implementations of \f(CW\*(C`ranlib\*(C'\fR, \fBllvm-ranlib\fR indexes \s-1LLVM\s0 bytecode files, not
|
||||
native object modules. You can list the contents of the symbol table with the
|
||||
\&\f(CW\*(C`llvm\-nm \-s\*(C'\fR command.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fIarchive-file\fR" 4
|
||||
.IX Item "archive-file"
|
||||
Specifies the archive-file to which the symbol table is added or updated.
|
||||
.IP "\fI\-\-version\fR" 4
|
||||
.IX Item "--version"
|
||||
Print the version of \fBllvm-ranlib\fR and exit without building a symbol table.
|
||||
.IP "\fI\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print usage help for \fBllvm-ranlib\fR and exit without building a symbol table.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-ranlib\fR succeeds, it will exit with 0. If an error occurs, a non-zero
|
||||
exit code will be returned.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-ar, \fIranlib\fR\|(1)
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
179
llvm/docs/CommandGuide/man/man1/llvm-upgrade.1
Normal file
179
llvm/docs/CommandGuide/man/man1/llvm-upgrade.1
Normal file
@@ -0,0 +1,179 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM-UPGRADE 1"
|
||||
.TH LLVM-UPGRADE 1 "2006-12-02" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-upgrade \- LLVM assembly upgrader
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-upgrade\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBllvm-upgrade\fR is the \s-1LLVM\s0 assembly upgrader. It reads a file containing
|
||||
human-readable \s-1LLVM\s0 assembly language, and upgrades that assembly to the current
|
||||
version of \s-1LLVM\s0. If the input is in the form currently accepted by \s-1LLVM\s0, then
|
||||
no upgrades are performed.
|
||||
.PP
|
||||
The expected usage of this tool is as a filter, like this:
|
||||
.Sp
|
||||
.RS 4
|
||||
\&\fBllvm\-1.9/bin/llvm\-dis < 1.9.bc | llvm-upgrade | llvm\-2.0/bin/llvm\-as \-o 2.0.bc\fR
|
||||
.RE
|
||||
.PP
|
||||
If \fIfilename\fR is omitted or is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-upgrade\fR reads its input from
|
||||
standard input.
|
||||
.PP
|
||||
If an output file is not specified with the \fB\-o\fR option, then
|
||||
\&\fBllvm-upgrade\fR sends its output to standard output.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force overwrite. Normally, \fBllvm-upgrade\fR will refuse to overwrite an
|
||||
output file that already exists. With this option, \fBllvm-upgrade\fR
|
||||
will overwrite the output file.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-upgrade\fR
|
||||
sends its output to standard output.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-upgrade\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-as, llvm-dis
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
301
llvm/docs/CommandGuide/man/man1/llvm2cpp.1
Normal file
301
llvm/docs/CommandGuide/man/man1/llvm2cpp.1
Normal file
@@ -0,0 +1,301 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVM2CPP 1"
|
||||
.TH LLVM2CPP 1 "2006-08-10" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm2xpp \- LLVM bytecode to LLVM C++ IR translator
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm2cpp\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBllvm2cpp\fR translates from \s-1LLVM\s0 bytecode (.bc files) to a
|
||||
corresponding \*(C+ source file that will make calls against the \s-1LLVM\s0 \*(C+ \s-1API\s0 to
|
||||
build the same module as the input. By default, the \*(C+ output is a complete
|
||||
program that builds the module, verifies it and then emits the module as
|
||||
\&\s-1LLVM\s0 assembly. This technique assists with testing because the input to
|
||||
\&\fBllvm2cpp\fR and the output of the generated \*(C+ program should be identical.
|
||||
.PP
|
||||
If \fIfilename\fR is omitted or is \f(CW\*(C`\-\*(C'\fR, then \fBllvm2cpp\fR reads its input from
|
||||
standard input.
|
||||
.PP
|
||||
If an output file is not specified with the \fB\-o\fR option, then
|
||||
\&\fBllvm2cpp\fR sends its output to a file or standard output by following
|
||||
these rules:
|
||||
.IP "\(bu" 4
|
||||
If the input is standard input, then the output is standard output.
|
||||
.IP "\(bu" 4
|
||||
If the input is a file that ends with \f(CW\*(C`.bc\*(C'\fR, then the output file is of
|
||||
the same name, except that the suffix is changed to \f(CW\*(C`.cpp\*(C'\fR.
|
||||
.IP "\(bu" 4
|
||||
If the input is a file that does not end with the \f(CW\*(C`.bc\*(C'\fR suffix, then the
|
||||
output file has the same name as the input file, except that the \f(CW\*(C`.cpp\*(C'\fR
|
||||
suffix is appended.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force overwrite. Normally, \fBllvm2cpp\fR will refuse to overwrite an
|
||||
output file that already exists. With this option, \fBllvm2cpp\fR
|
||||
will overwrite the output file and replace it with new \*(C+ source code.
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Normally, \fBllvm2cpp\fR will not overwrite an existing output file. With this
|
||||
option, that default behavior is changed and the program will overwrite existing
|
||||
output files.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \f(CW\*(C`\-\*(C'\fR, then \fBllvm2cpp\fR
|
||||
sends its output to standard output.
|
||||
.IP "\fB\-funcname\fR \fIfunctionName\fR" 4
|
||||
.IX Item "-funcname functionName"
|
||||
Specify the name of the function to be generated. The generated code contains a
|
||||
single function that produces the input module. By default its name is
|
||||
\&\fImakeLLVMModule\fR. The \fB\-funcname\fR option overrides this default and allows
|
||||
you to control the name of the generated function. This is handy in conjunction
|
||||
with the \fB\-fragment\fR option when you only want \fBllvm2cpp\fR to generate a
|
||||
single function that produces the module. With both options, such generated code
|
||||
could be \fI#included\fR into another program.
|
||||
.IP "\fB\-for\fR" 4
|
||||
.IX Item "-for"
|
||||
Specify the name of the thing for which \*(C+ code should be generated. By default
|
||||
the entire input module is re\-generated. However, use of the various \fB\-gen\-*\fR
|
||||
options can restrict what is produced. This option indicates what that
|
||||
restriction is.
|
||||
.IP "\fB\-gen\-program\fR" 4
|
||||
.IX Item "-gen-program"
|
||||
Specify that the output should be a complete program. Such program will recreate
|
||||
\&\fBllvm2cpp\fR's input as an \s-1LLVM\s0 module, verify that module, and then write out
|
||||
the module in \s-1LLVM\s0 assembly format. This is useful for doing identity tests
|
||||
where the output of the generated program is identical to the input to
|
||||
\&\fBllvm2cpp\fR. The \s-1LLVM\s0 DejaGnu test suite can make use of this fact. This is the
|
||||
default form of generated output.
|
||||
.Sp
|
||||
If the \fB\-for\fR option is given with this option, it specifies the module
|
||||
identifier to use for the module created.
|
||||
.IP "\fB\-gen\-module\fR" 4
|
||||
.IX Item "-gen-module"
|
||||
Specify that the output should be a function that regenerates the module. It is
|
||||
assumed that this output will be #included into another program that has already
|
||||
arranged for the correct header files to be #included. The function generated
|
||||
takes no arguments and returns a \fIModule*\fR.
|
||||
.Sp
|
||||
If the \fB\-for\fR option is given with this option, it specifies the module
|
||||
identifier to use in creating the module returned by the generated function.
|
||||
.IP "\fB\-gen\-contents\fR" 4
|
||||
.IX Item "-gen-contents"
|
||||
Specify that the output should be a function that adds the contents of the input
|
||||
module to another module. It is assumed that the output will be #included into
|
||||
another program that has already arranged for the correct header files to be
|
||||
#included. The function generated takes a single argument of type \fIModule*\fR and
|
||||
returns that argument. Note that Module level attributes such as endianess,
|
||||
pointer size, target triple and inline asm are not passed on from the input
|
||||
module to the destination module. Only the sub-elements of the module (types,
|
||||
constants, functions, global variables) will be added to the input module.
|
||||
.Sp
|
||||
If the \fB\-for\fR option is given with this option, it specifies the module
|
||||
identifier to set in the input module by the generated function.
|
||||
.IP "\fB\-gen\-function\fR" 4
|
||||
.IX Item "-gen-function"
|
||||
Specify that the output should be a function that produces the definitions
|
||||
necessary for a specific function to be added to a module. It is assumed that
|
||||
the output will be #included into another program that has already arranged
|
||||
for the correct header files to be #included. The function generated takes a
|
||||
single argument of type \fIModule*\fR and returns the \fIFunction*\fR that it added to
|
||||
the module. Note that only those things (types, constants, etc.) directly
|
||||
needed in the definition of the function will be placed in the generated
|
||||
function.
|
||||
.Sp
|
||||
The \fB\-for\fR option must be given with this option or an error will be produced.
|
||||
The value of the option must be the name of a function in the input module for
|
||||
which code should be generated. If the named function does not exist an error
|
||||
will be produced.
|
||||
.IP "\fB\-gen\-inline\fR" 4
|
||||
.IX Item "-gen-inline"
|
||||
This option is very analagous to \fB\-gen\-function\fR except that the generated
|
||||
function will not re-produce the target function's definition. Instead, the body
|
||||
of the target function is inserted into some other function passed as an
|
||||
argument to the generated function. Similarly any arguments to the function must
|
||||
be passed to the generated function. The result of the generated function is the
|
||||
first basic block of the target function.
|
||||
.Sp
|
||||
The \fB\-for\fR option works the same way as it does for \fB\-gen\-function\fR.
|
||||
.IP "\fB\-gen\-variable\fR" 4
|
||||
.IX Item "-gen-variable"
|
||||
Specify that the output should be a function that produces the definitions
|
||||
necessary for a specific global variable to be added to a module. It is assumed
|
||||
that the output will be #included into another program that has already arranged
|
||||
for the correct header files to be #included. The function generated takes a
|
||||
single argument of type \fIModule*\fR and returns the \fIGlobalVariable*\fR that it
|
||||
added to the module. Note that only those things (types, constants, etc.)
|
||||
directly needed in the definition of the global variable will be placed in the
|
||||
generated function.
|
||||
.Sp
|
||||
The \fB\-for\fR option must be given with this option or an error will be produced.
|
||||
THe value of the option must be the name of a global variable in the input
|
||||
module for which code should be generated. If the named global variable does not
|
||||
exist an error will be produced.
|
||||
.IP "\fB\-gen\-type\fR" 4
|
||||
.IX Item "-gen-type"
|
||||
Specify that the output should be a function that produces the definitions
|
||||
necessary for specific type to be added to a module. It is assumed that the
|
||||
otuput will be #included into another program that has already arranged for the
|
||||
correct header files to be #included. The function generated take a single
|
||||
argument of type \fIModule*\fR and returns the \fIType*\fR that it added to the
|
||||
module. Note that the generated function will only add the necessary type
|
||||
definitions to (possibly recursively) define the requested type.
|
||||
.Sp
|
||||
The \fB\-for\fR option must be given with this option or an error will be produced.
|
||||
The value of the option must be the name of a global type in the input module
|
||||
for which code should be generated. If the named type does not exist an error
|
||||
will be produced.
|
||||
.IP "\fB\-stats\fR" 4
|
||||
.IX Item "-stats"
|
||||
Show pass statistics (not interesting in this program).
|
||||
.IP "\fB\-time\-passes\fR" 4
|
||||
.IX Item "-time-passes"
|
||||
Show pass timing statistics (not interesting in this program).
|
||||
.IP "\fB\-version\fR" 4
|
||||
.IX Item "-version"
|
||||
Show the version number of this program.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm2cpp\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-as tblgen
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Written by Reid Spencer (<http://hlvm.org>).
|
||||
455
llvm/docs/CommandGuide/man/man1/llvmc.1
Normal file
455
llvm/docs/CommandGuide/man/man1/llvmc.1
Normal file
@@ -0,0 +1,455 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVMC 1"
|
||||
.TH LLVMC 1 "2007-02-11" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvmc \- The LLVM Compiler Driver (experimental)
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvmc\fR [\fIoptions\fR] [\fIfilenames\fR...]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBllvmc\fR is a configurable driver for invoking other \s-1LLVM\s0 (and non\-LLVM) tools
|
||||
in order to compile, optimize and link software for multiple languages. For
|
||||
those familiar with \s-1FSF\s0's \fBgcc\fR tool, it is very similar. Please note that
|
||||
\&\fBllvmc\fR is considered an experimental tool. \fBllvmc\fR has the following goals:
|
||||
.IP "* provide a single point of access to the \s-1LLVM\s0 tool set," 4
|
||||
.IX Item "provide a single point of access to the LLVM tool set,"
|
||||
.PD 0
|
||||
.IP "* hide the complexities of the \s-1LLVM\s0 tools through a single interface," 4
|
||||
.IX Item "hide the complexities of the LLVM tools through a single interface,"
|
||||
.IP "* make integration of existing non-LLVM tools simple," 4
|
||||
.IX Item "make integration of existing non-LLVM tools simple,"
|
||||
.IP "* extend the capabilities of minimal front ends, and" 4
|
||||
.IX Item "extend the capabilities of minimal front ends, and"
|
||||
.IP "* make the interface for compiling consistent for all languages." 4
|
||||
.IX Item "make the interface for compiling consistent for all languages."
|
||||
.PD
|
||||
.PP
|
||||
The tool itself does nothing with a user's program. It merely invokes other
|
||||
tools to get the compilation tasks done.
|
||||
.PP
|
||||
The options supported by \fBllvmc\fR generalize the compilation process and
|
||||
provide a consistent and simple interface for multiple programming languages.
|
||||
This makes it easier for developers to get their software compiled with \s-1LLVM\s0.
|
||||
Without \fBllvmc\fR, developers would need to understand how to invoke the
|
||||
front-end compiler, optimizer, assembler, and linker in order to compile their
|
||||
programs. \fBllvmc\fR's sole mission is to trivialize that process.
|
||||
.Sh "Basic Operation"
|
||||
.IX Subsection "Basic Operation"
|
||||
\&\fBllvmc\fR always takes the following basic actions:
|
||||
.IP "* Command line options and filenames are collected." 4
|
||||
.IX Item "Command line options and filenames are collected."
|
||||
The command line options provide the marching orders to \fBllvmc\fR on what actions
|
||||
it should perform. This is the \fIrequest\fR the user is making of \fBllvmc\fR and it
|
||||
is interpreted first.
|
||||
.IP "* Configuration files are read." 4
|
||||
.IX Item "Configuration files are read."
|
||||
Based on the options and the suffixes of the filenames presented, a set of
|
||||
configuration files are read to configure the actions \fBllvmc\fR will take.
|
||||
Configuration files are provided by either \s-1LLVM\s0 or the front end compiler tools
|
||||
that \fBllvmc\fR invokes. Users generally don't need to be concerned with the
|
||||
contents of the configuration files.
|
||||
.IP "* Determine actions to take." 4
|
||||
.IX Item "Determine actions to take."
|
||||
The tool chain needed to complete the task is determined. This is the primary
|
||||
work of \fBllvmc\fR. It breaks the request specified by the command line options
|
||||
into a set of basic actions to be done:
|
||||
.RS 4
|
||||
.IP "* Pre\-processing: gathering/filtering compiler input (optional)." 4
|
||||
.IX Item "Pre-processing: gathering/filtering compiler input (optional)."
|
||||
.PD 0
|
||||
.IP "* Translation: source language to bytecode conversion." 4
|
||||
.IX Item "Translation: source language to bytecode conversion."
|
||||
.IP "* Assembly: bytecode to native code conversion." 4
|
||||
.IX Item "Assembly: bytecode to native code conversion."
|
||||
.IP "* Optimization: conversion of bytecode to something that runs faster." 4
|
||||
.IX Item "Optimization: conversion of bytecode to something that runs faster."
|
||||
.IP "* Linking: combining multiple bytecodes to produce executable program." 4
|
||||
.IX Item "Linking: combining multiple bytecodes to produce executable program."
|
||||
.RE
|
||||
.RS 4
|
||||
.RE
|
||||
.IP "* Execute actions." 4
|
||||
.IX Item "Execute actions."
|
||||
.PD
|
||||
The actions determined previously are executed sequentially and then
|
||||
\&\fBllvmc\fR terminates.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.Sh "Control Options"
|
||||
.IX Subsection "Control Options"
|
||||
Control options tell \fBllvmc\fR what to do at a high level. The
|
||||
following control options are defined:
|
||||
.IP "\fB\-c\fR or \fB\-\-compile\fR" 4
|
||||
.IX Item "-c or --compile"
|
||||
This option specifies that the linking phase is not to be run. All
|
||||
previous phases, if applicable will run. This is generally how a given
|
||||
bytecode file is compiled and optimized for a source language module.
|
||||
.IP "\fB\-k\fR or \fB\-\-link\fR or default" 4
|
||||
.IX Item "-k or --link or default"
|
||||
This option (or the lack of any control option) specifies that all stages
|
||||
of compilation, optimization, and linking should be attempted. Source files
|
||||
specified on the command line will be compiled and linked with objects and
|
||||
libraries also specified.
|
||||
.IP "\fB\-S\fR" 4
|
||||
.IX Item "-S"
|
||||
This option specifies that compilation should end in the creation of
|
||||
an \s-1LLVM\s0 assembly file that can be later converted to an \s-1LLVM\s0 object
|
||||
file.
|
||||
.IP "\fB\-E\fR" 4
|
||||
.IX Item "-E"
|
||||
This option specifies that no compilation or linking should be
|
||||
performed. Only pre\-processing, if applicable to the language being
|
||||
compiled, is performed. For languages that support it, this will
|
||||
result in the output containing the raw input to the compiler.
|
||||
.Sh "Optimization Options"
|
||||
.IX Subsection "Optimization Options"
|
||||
Optimization with \fBllvmc\fR is based on goals and specified with
|
||||
the following \-O options. The specific details of which
|
||||
optimizations run is controlled by the configuration files because
|
||||
each source language will have different needs.
|
||||
.IP "\fB\-O1\fR or \fB\-O0\fR (default, fast compilation)" 4
|
||||
.IX Item "-O1 or -O0 (default, fast compilation)"
|
||||
Only those optimizations that will hasten the compilation (mostly by reducing
|
||||
the output) are applied. In general these are extremely fast and simple
|
||||
optimizations that reduce emitted code size. The goal here is not to make the
|
||||
resulting program fast but to make the compilation fast. If not specified,
|
||||
this is the default level of optimization.
|
||||
.IP "\fB\-O2\fR (basic optimization)" 4
|
||||
.IX Item "-O2 (basic optimization)"
|
||||
This level of optimization specifies a balance between generating good code
|
||||
that will execute reasonably quickly and not spending too much time optimizing
|
||||
the code to get there. For example, this level of optimization may include
|
||||
things like global common subexpression elimination, aggressive dead code
|
||||
elimination, and scalar replication.
|
||||
.IP "\fB\-O3\fR (aggressive optimization)" 4
|
||||
.IX Item "-O3 (aggressive optimization)"
|
||||
This level of optimization aggressively optimizes each set of files compiled
|
||||
together. However, no link-time inter-procedural optimization is performed.
|
||||
This level implies all the optimizations of the \fB\-O1\fR and \fB\-O2\fR optimization
|
||||
levels, and should also provide loop optimizations and compile time
|
||||
inter-procedural optimizations. Essentially, this level tries to do as much
|
||||
as it can with the input it is given but doesn't do any link time \s-1IPO\s0.
|
||||
.IP "\fB\-O4\fR (link time optimization)" 4
|
||||
.IX Item "-O4 (link time optimization)"
|
||||
In addition to the previous three levels of optimization, this level of
|
||||
optimization aggressively optimizes each program at link time. It employs
|
||||
basic analysis and basic link-time inter-procedural optimizations,
|
||||
considering the program as a whole.
|
||||
.IP "\fB\-O5\fR (aggressive link time optimization)" 4
|
||||
.IX Item "-O5 (aggressive link time optimization)"
|
||||
This is the same as \fB\-O4\fR except it employs aggressive analyses and
|
||||
aggressive inter-procedural optimization.
|
||||
.IP "\fB\-O6\fR (profile guided optimization: not implemented)" 4
|
||||
.IX Item "-O6 (profile guided optimization: not implemented)"
|
||||
This is the same as \fB\-O5\fR except that it employs profile-guided
|
||||
re-optimization of the program after it has executed. Note that this implies
|
||||
a single level of re-optimization based on runtime profile analysis. Once
|
||||
the re-optimization has completed, the profiling instrumentation is
|
||||
removed and final optimizations are employed.
|
||||
.IP "\fB\-O7\fR (lifelong optimization: not implemented)" 4
|
||||
.IX Item "-O7 (lifelong optimization: not implemented)"
|
||||
This is the same as \fB\-O5\fR and similar to \fB\-O6\fR except that re-optimization
|
||||
is performed through the life of the program. That is, each run will update
|
||||
the profile by which future re-optimizations are directed.
|
||||
.Sh "Input Options"
|
||||
.IX Subsection "Input Options"
|
||||
.IP "\fB\-l\fR \fI\s-1LIBRARY\s0\fR" 4
|
||||
.IX Item "-l LIBRARY"
|
||||
This option instructs \fBllvmc\fR to locate a library named \fI\s-1LIBRARY\s0\fR and search
|
||||
it for unresolved symbols when linking the program.
|
||||
.IP "\fB\-L\fR \fIpath\fR" 4
|
||||
.IX Item "-L path"
|
||||
This option instructs \fBllvmc\fR to add \fIpath\fR to the list of places in which
|
||||
the linker will
|
||||
.IP "\fB\-x\fR \fI\s-1LANGUAGE\s0\fR" 4
|
||||
.IX Item "-x LANGUAGE"
|
||||
This option instructs \fBllvmc\fR to regard the following input files as
|
||||
containing programs in the language \fI\s-1LANGUAGE\s0\fR. Normally, input file languages
|
||||
are identified by their suffix but this option will override that default
|
||||
behavior. The \fB\-x\fR option stays in effect until the end of the options or
|
||||
a new \fB\-x\fR option is encountered.
|
||||
.Sh "Output Options"
|
||||
.IX Subsection "Output Options"
|
||||
.IP "\fB\-m\fR\fIarch\fR" 4
|
||||
.IX Item "-march"
|
||||
This option selects the back end code generator to use. The \fIarch\fR portion
|
||||
of the option names the back end to use.
|
||||
.IP "\fB\-\-native\fR" 4
|
||||
.IX Item "--native"
|
||||
Normally, \fBllvmc\fR produces bytecode files at most stages of compilation.
|
||||
With this option, \fBllvmc\fR will arrange for native object files to be
|
||||
generated with the \fB\-c\fR option, native assembly files to be generated
|
||||
with the \fB\-S\fR option, and native executables to be generated with the
|
||||
\&\fB\-\-link\fR option. In the case of the \fB\-E\fR option, the output will not
|
||||
differ as there is no \fInative\fR version of pre-processed output.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. The contents of the file depend on other
|
||||
options.
|
||||
.Sh "Information Options"
|
||||
.IX Subsection "Information Options"
|
||||
.IP "\fB\-n\fR or \fB\-\-no\-op\fR" 4
|
||||
.IX Item "-n or --no-op"
|
||||
This option tells \fBllvmc\fR to do everything but actually execute the
|
||||
resulting tools. In combination with the \fB\-v\fR option, this causes \fBllvmc\fR
|
||||
to merely print out what it would have done.
|
||||
.IP "\fB\-v\fR or \fB\-\-verbose\fR" 4
|
||||
.IX Item "-v or --verbose"
|
||||
This option will cause \fBllvmc\fR to print out (on standard output) each of the
|
||||
actions it takes to accomplish the objective. The output will immediately
|
||||
precede the invocation of other tools.
|
||||
.IP "\fB\-\-stats\fR" 4
|
||||
.IX Item "--stats"
|
||||
Print all statistics gathered during the compilation to the standard error.
|
||||
Note that this option is merely passed through to the sub-tools to do with
|
||||
as they please.
|
||||
.IP "\fB\-\-time\-passes\fR" 4
|
||||
.IX Item "--time-passes"
|
||||
Record the amount of time needed for each optimization pass and print it
|
||||
to standard error. Like \fB\-\-stats\fR this option is just passed through to
|
||||
the sub-tools to do with as they please.
|
||||
.IP "\fB\-\-time\-programs\fR" 4
|
||||
.IX Item "--time-programs"
|
||||
Record the amount of time each program (compilation tool) takes and print
|
||||
it to the standard error.
|
||||
.Sh "Language Specific Options"
|
||||
.IX Subsection "Language Specific Options"
|
||||
.IP "\fB\-T,pre\fR=\fIoptions\fR" 4
|
||||
.IX Item "-T,pre=options"
|
||||
Pass an arbitrary option to the pre\-processor.
|
||||
.IP "\fB\-T,opt\fR=\fIoptions\fR" 4
|
||||
.IX Item "-T,opt=options"
|
||||
Pass an arbitrary option to the optimizer.
|
||||
.IP "\fB\-T,lnk\fR=\fIoptions\fR" 4
|
||||
.IX Item "-T,lnk=options"
|
||||
Pass an arbitrary option to the linker.
|
||||
.IP "\fB\-T,asm\fR=\fIoptions\fR" 4
|
||||
.IX Item "-T,asm=options"
|
||||
Pass an arbitrary option to the code generator.
|
||||
.Sh "C/\*(C+ Specific Options"
|
||||
.IX Subsection "C/ Specific Options"
|
||||
.IP "\fB\-I\fR\fIpath\fR" 4
|
||||
.IX Item "-Ipath"
|
||||
This option is just passed through to a C or \*(C+ front end compiler to tell it
|
||||
where include files can be found.
|
||||
.IP "\fB\-D\fR\fIsymbol\fR" 4
|
||||
.IX Item "-Dsymbol"
|
||||
This option is just passed through to a C or \*(C+ front end compiler to tell it
|
||||
to define a symbol.
|
||||
.Sh "Miscellaneous Options"
|
||||
.IX Subsection "Miscellaneous Options"
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-\-version\fR" 4
|
||||
.IX Item "--version"
|
||||
This option will cause \fBllvmc\fR to print out its version number and terminate.
|
||||
.Sh "Advanced Options"
|
||||
.IX Subsection "Advanced Options"
|
||||
You better know what you're doing if you use these options. Improper use
|
||||
of these options can produce drastically wrong results.
|
||||
.IP "\fB\-\-config\-dir\fR \fIdirname\fR" 4
|
||||
.IX Item "--config-dir dirname"
|
||||
This option tells \fBllvmc\fR to read configuration data from the \fIdirectory\fR
|
||||
named \fIdirname\fR. Data from such directories will be read in the order
|
||||
specified on the command line after all other standard configuration files have
|
||||
been read. This allows users or groups of users to conveniently create
|
||||
their own configuration directories in addition to the standard ones to which
|
||||
they may not have write access.
|
||||
.Sh "Unimplemented Options"
|
||||
.IX Subsection "Unimplemented Options"
|
||||
The options below are not currently implemented in \fBllvmc\fR but will be
|
||||
eventually. They are documented here as \*(L"future design\*(R".
|
||||
.IP "\fB\-\-show\-config\fR \fI[suffixes...]\fR" 4
|
||||
.IX Item "--show-config [suffixes...]"
|
||||
When this option is given, the only action taken by \fBllvmc\fR is to show its
|
||||
final configuration state in the form of a configuration file. No compilation
|
||||
tasks will be conducted when this option is given; processing will stop once
|
||||
the configuration has been printed. The optional (comma separated) list of
|
||||
suffixes controls what is printed. Without any suffixes, the configuration
|
||||
for all languages is printed. With suffixes, only the languages pertaining
|
||||
to those file suffixes will be printed. The configuration information is
|
||||
printed after all command line options and configuration files have been
|
||||
read and processed. This allows the user to verify that the correct
|
||||
configuration data has been read by \fBllvmc\fR.
|
||||
.IP "\fB\-\-config\fR :\fIsection\fR:\fIname\fR=\fIvalue\fR" 4
|
||||
.IX Item "--config :section:name=value"
|
||||
This option instructs \fBllvmc\fR to accept \fIvalue\fR as the value for configuration
|
||||
item \fIname\fR in the section named \fIsection\fR. This is a quick way to override
|
||||
a configuration item on the command line without resorting to changing the
|
||||
configuration files.
|
||||
.IP "\fB\-\-config\-only\-from\fR \fIdirname\fR" 4
|
||||
.IX Item "--config-only-from dirname"
|
||||
This option tells \fBllvmc\fR to skip the normal processing of configuration
|
||||
files and only configure from the contents of the \fIdirname\fR directory. Multiple
|
||||
\&\fB\-\-config\-only\-from\fR options may be given in which case the directories are
|
||||
read in the order given on the command line.
|
||||
.IP "\fB\-\-emit\-raw\-code\fR" 4
|
||||
.IX Item "--emit-raw-code"
|
||||
No optimization is done whatsoever. The compilers invoked by \fBllvmc\fR with
|
||||
this option given will be instructed to produce raw, unoptimized code. This
|
||||
option is useful only to front end language developers and therefore does not
|
||||
participate in the list of \fB\-O\fR options. This is distinctly different from
|
||||
the \fB\-O0\fR option (a synonym for \fB\-O1\fR) because those optimizations will
|
||||
reduce code size to make compilation faster. With \fB\-\-emit\-raw\-code\fR, only
|
||||
the full raw code produced by the compiler will be generated.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvmc\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value and no compilation actions
|
||||
will be taken. If one of the compilation tools returns a non-zero
|
||||
status, pending actions will be discarded and \fBllvmc\fR will return the
|
||||
same result code as the failing compilation tool.
|
||||
.SH "DEFICIENCIES"
|
||||
.IX Header "DEFICIENCIES"
|
||||
\&\fBllvmc\fR is considered an experimental \s-1LLVM\s0 tool because it has these
|
||||
deficiencies:
|
||||
.IP "Insufficient support for native linking" 4
|
||||
.IX Item "Insufficient support for native linking"
|
||||
Because \fBllvm-ld\fR doesn't handle native linking, neither can \fBllvmc\fR
|
||||
.IP "Poor configuration support" 4
|
||||
.IX Item "Poor configuration support"
|
||||
The support for configuring new languages, etc. is weak. There are many
|
||||
command line configurations that cannot be achieved with the current
|
||||
support. Furthermore the grammar is cumbersome for configuration files.
|
||||
Please see <http://llvm.org/PR686> for further details.
|
||||
.IP "Does not handle target specific configurations" 4
|
||||
.IX Item "Does not handle target specific configurations"
|
||||
This is one of the major deficiencies, also addressed in
|
||||
<http://llvm.org/PR686>
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-as, llvm-dis, llc, llvm-link
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
194
llvm/docs/CommandGuide/man/man1/llvmgcc.1
Normal file
194
llvm/docs/CommandGuide/man/man1/llvmgcc.1
Normal file
@@ -0,0 +1,194 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVMGCC 1"
|
||||
.TH LLVMGCC 1 "2007-02-11" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-gcc \- LLVM C front\-end
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm-gcc\fR [\fIoptions\fR] \fIfilename\fR
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm-gcc\fR command is the \s-1LLVM\s0 C front end. It is a modified
|
||||
version of gcc that compiles C/ObjC programs into native objects, \s-1LLVM\s0
|
||||
bytecode or \s-1LLVM\s0 assembly language, depending upon the options.
|
||||
.PP
|
||||
By default, \fBllvm-gcc\fR compiles to native objects just like \s-1GCC\s0 does. If the
|
||||
\&\fB\-emit\-llvm\fR option is given then it will generate \s-1LLVM\s0 bytecode files instead.
|
||||
If \fB\-S\fR (assembly) is also given, then it will generate \s-1LLVM\s0 assembly.
|
||||
.PP
|
||||
Being derived from the \s-1GNU\s0 Compiler Collection, \fBllvm-gcc\fR has many
|
||||
of gcc's features and accepts most of gcc's options. It handles a
|
||||
number of gcc's extensions to the C programming language.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-S\fR" 4
|
||||
.IX Item "-S"
|
||||
Do not generate an \s-1LLVM\s0 bytecode file. Rather, compile the source
|
||||
file into an \s-1LLVM\s0 assembly language file.
|
||||
.IP "\fB\-c\fR" 4
|
||||
.IX Item "-c"
|
||||
Do not generate a linked executable. Rather, compile the source
|
||||
file into an \s-1LLVM\s0 bytecode file. This bytecode file can then be
|
||||
linked with other bytecode files later on to generate a full \s-1LLVM\s0
|
||||
executable.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file to be \fIfilename\fR.
|
||||
.IP "\fB\-I\fR \fIdirectory\fR" 4
|
||||
.IX Item "-I directory"
|
||||
Add a directory to the header file search path. This option can be
|
||||
repeated.
|
||||
.IP "\fB\-L\fR \fIdirectory\fR" 4
|
||||
.IX Item "-L directory"
|
||||
Add \fIdirectory\fR to the library search path. This option can be
|
||||
repeated.
|
||||
.IP "\fB\-l\fR\fIname\fR" 4
|
||||
.IX Item "-lname"
|
||||
Link in the library lib\fIname\fR.[bc | a | so]. This library should
|
||||
be a bytecode library.
|
||||
.IP "\fB\-emit\-llvm\fR" 4
|
||||
.IX Item "-emit-llvm"
|
||||
Make the output be \s-1LLVM\s0 bytecode (or assembly) instead of native object (or
|
||||
assembly).
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm-gcc\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm\-g++
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
194
llvm/docs/CommandGuide/man/man1/llvmgxx.1
Normal file
194
llvm/docs/CommandGuide/man/man1/llvmgxx.1
Normal file
@@ -0,0 +1,194 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LLVMGXX 1"
|
||||
.TH LLVMGXX 1 "2007-02-11" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
llvm\-g++ \- LLVM C++ front\-end
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBllvm\-g++\fR [\fIoptions\fR] \fIfilename\fR
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBllvm\-g++\fR command is the \s-1LLVM\s0 \*(C+ front end. It is a modified
|
||||
version of g++ that compiles \*(C+/ObjC++ programs into native code,
|
||||
\&\s-1LLVM\s0 bytecode or assembly language, depending upon the options.
|
||||
.PP
|
||||
By default, \fBllvm\-g++\fR compiles to native objects just like \s-1GCC\s0 does. If the
|
||||
\&\fB\-emit\-llvm\fR option is given then it will generate \s-1LLVM\s0 bytecode files instead.
|
||||
If \fB\-S\fR (assembly) is also given, then it will generate \s-1LLVM\s0 assembly.
|
||||
.PP
|
||||
Being derived from the \s-1GNU\s0 Compiler Collection, \fBllvm\-g++\fR has many
|
||||
of g++'s features and accepts most of g++'s options. It handles a
|
||||
number of g++'s extensions to the \*(C+ programming language.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-S\fR" 4
|
||||
.IX Item "-S"
|
||||
Do not generate an \s-1LLVM\s0 bytecode file. Rather, compile the source
|
||||
file into an \s-1LLVM\s0 assembly language file.
|
||||
.IP "\fB\-c\fR" 4
|
||||
.IX Item "-c"
|
||||
Do not generate a linked executable. Rather, compile the source
|
||||
file into an \s-1LLVM\s0 bytecode file. This bytecode file can then be
|
||||
linked with other bytecode files later on to generate a full \s-1LLVM\s0
|
||||
executable.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file to be \fIfilename\fR.
|
||||
.IP "\fB\-I\fR \fIdirectory\fR" 4
|
||||
.IX Item "-I directory"
|
||||
Add a directory to the header file search path. This option can be
|
||||
repeated.
|
||||
.IP "\fB\-L\fR \fIdirectory\fR" 4
|
||||
.IX Item "-L directory"
|
||||
Add \fIdirectory\fR to the library search path. This option can be
|
||||
repeated.
|
||||
.IP "\fB\-l\fR\fIname\fR" 4
|
||||
.IX Item "-lname"
|
||||
Link in the library lib\fIname\fR.[bc | a | so]. This library should
|
||||
be a bytecode library.
|
||||
.IP "\fB\-emit\-llvm\fR" 4
|
||||
.IX Item "-emit-llvm"
|
||||
Make the output be \s-1LLVM\s0 bytecode (or assembly) instead of native object (or
|
||||
assembly).
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBllvm\-g++\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-gcc
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
246
llvm/docs/CommandGuide/man/man1/opt.1
Normal file
246
llvm/docs/CommandGuide/man/man1/opt.1
Normal file
@@ -0,0 +1,246 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "OPT 1"
|
||||
.TH OPT 1 "2007-02-02" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
opt \- LLVM optimizer
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBopt\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBopt\fR command is the modular \s-1LLVM\s0 optimizer and analyzer. It takes \s-1LLVM\s0
|
||||
bytecode as input, runs the specified optimizations or analyses on it, and then
|
||||
outputs the optimized \s-1LLVM\s0 bytecode or the analysis results. The function of
|
||||
\&\fBopt\fR depends on whether the \fB\-analyze\fR option is given.
|
||||
.PP
|
||||
When \fB\-analyze\fR is specified, \fBopt\fR performs various analyses of \s-1LLVM\s0
|
||||
bytecode. It will usually print the results on standard output, but in a few
|
||||
cases, it will print output to standard error or generate a file with the
|
||||
analysis output, which is usually done when the output is meant for another
|
||||
program.
|
||||
.PP
|
||||
While \fB\-analyze\fR is \fInot\fR given, \fBopt\fR attempts to produce an optimized
|
||||
bytecode file. The optimizations available via \fBopt\fR depend upon what
|
||||
libraries were linked into it as well as any additional libraries that have
|
||||
been loaded with the \fB\-load\fR option. Use the \fB\-help\fR option to determine
|
||||
what optimizations you can use.
|
||||
.PP
|
||||
If \fIfilename\fR is omitted from the command line or is \fI\-\fR, \fBopt\fR reads its
|
||||
input from standard input. The input must be an \s-1LLVM\s0 bytecode file.
|
||||
.PP
|
||||
If an output filename is not specified with the \fB\-o\fR option, \fBopt\fR
|
||||
writes its output to the standard output.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force overwrite. Normally, \fBopt\fR will refuse to overwrite an
|
||||
output file that already exists. With this option, \fBopt\fR will
|
||||
overwrite the output file and replace it with new bytecode.
|
||||
.IP "\fB\-help\fR" 4
|
||||
.IX Item "-help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output filename.
|
||||
.IP "\fB\-{passname}\fR" 4
|
||||
.IX Item "-{passname}"
|
||||
\&\fBopt\fR provides the ability to run any of \s-1LLVM\s0's optimization or analysis passes
|
||||
in any order. The \fB\-help\fR option lists all the passes available. The order in
|
||||
which the options occur on the command line are the order in which they are
|
||||
executed (within pass constraints).
|
||||
.IP "\fB\-std\-compile\-opts\fR" 4
|
||||
.IX Item "-std-compile-opts"
|
||||
This is short hand for a standard list of \fIcompile time optimization\fR passes.
|
||||
This is typically used to optimize the output from the llvm-gcc front end. It
|
||||
might be useful for other front end compilers as well. To discover the full set
|
||||
of options available, use the following command:
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& llvm-as < /dev/null | opt -std-compile-opts -disable-output -debug-pass=Arguments
|
||||
.Ve
|
||||
.IP "\fB\-disable\-inlining\fR" 4
|
||||
.IX Item "-disable-inlining"
|
||||
This option is only meaningful when \fB\-std\-compile\-opts\fR is given. It simply
|
||||
removes the inlining pass from the standard list.
|
||||
.IP "\fB\-disable\-opt\fR" 4
|
||||
.IX Item "-disable-opt"
|
||||
This option is only meaningful when \fB\-std\-compile\-opts\fR is given. It disables
|
||||
most, but not all, of the \fB\-std\-compile\-opts\fR. The ones that remain are
|
||||
\&\fB\-verify\fR, \fB\-lower\-setjmp\fR, and \fB\-funcresolve\fR.
|
||||
.IP "\fB\-strip\-debug\fR" 4
|
||||
.IX Item "-strip-debug"
|
||||
This option causes opt to strip debug information from the module before
|
||||
applying other optimizations. It is essentially the same as \fB\-strip\fR but it
|
||||
ensures that stripping of debug information is done first.
|
||||
.IP "\fB\-verify\-each\fR" 4
|
||||
.IX Item "-verify-each"
|
||||
This option causes opt to add a verify pass after every pass otherwise specified
|
||||
on the command line (including \fB\-verify\fR). This is useful for cases where it
|
||||
is suspected that a pass is creating an invalid module but it is not clear which
|
||||
pass is doing it. The combination of \fB\-std\-compile\-opts\fR and \fB\-verify\-each\fR
|
||||
can quickly track down this kind of problem.
|
||||
.IP "\fB\-profile\-info\-file\fR \fIfilename\fR" 4
|
||||
.IX Item "-profile-info-file filename"
|
||||
Specify the name of the file loaded by the \-profile\-loader option.
|
||||
.IP "\fB\-stats\fR" 4
|
||||
.IX Item "-stats"
|
||||
Print statistics.
|
||||
.IP "\fB\-time\-passes\fR" 4
|
||||
.IX Item "-time-passes"
|
||||
Record the amount of time needed for each pass and print it to standard
|
||||
error.
|
||||
.IP "\fB\-debug\fR" 4
|
||||
.IX Item "-debug"
|
||||
If this is a debug build, this option will enable debug printouts
|
||||
from passes which use the \fI\s-1\fIDEBUG\s0()\fI\fR macro. See the \fB\s-1LLVM\s0 Programmer's
|
||||
Manual\fR, section \fI#DEBUG\fR for more information.
|
||||
.IP "\fB\-load\fR=\fIplugin\fR" 4
|
||||
.IX Item "-load=plugin"
|
||||
Load the dynamic object \fIplugin\fR. This object should register new optimization
|
||||
or analysis passes. Once loaded, the object will add new command line options to
|
||||
enable various optimizations or analyses. To see the new complete list of
|
||||
optimizations, use the \fB\-help\fR and \fB\-load\fR options together. For example:
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& opt -load=plugin.so -help
|
||||
.Ve
|
||||
.IP "\fB\-p\fR" 4
|
||||
.IX Item "-p"
|
||||
Print module after each transformation.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBopt\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
198
llvm/docs/CommandGuide/man/man1/stkrc.1
Normal file
198
llvm/docs/CommandGuide/man/man1/stkrc.1
Normal file
@@ -0,0 +1,198 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "STKRC 1"
|
||||
.TH STKRC 1 "2006-03-13" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
stkrc \- Stacker Compiler
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBstkrc\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fBstkrc\fR command is the compiler for the Stacker language. Stacker is a
|
||||
simple stack based, Forth-like language that was written as a demonstration
|
||||
language for \s-1LLVM\s0. For details on the language, please see
|
||||
<http://llvm.org/docs/Stacker.html> . The \fBstkrc\fR compiler is fairly
|
||||
minimal. It compiles to bytecode only and doesn't perform any optimizations.
|
||||
The output of stkrc (a bytecode file) can be piped through other \s-1LLVM\s0 tools
|
||||
for optimization and linking.
|
||||
.PP
|
||||
If \fIfilename\fR is omitted or is \f(CW\*(C`\-\*(C'\fR, then \fBstkrc\fR reads its input
|
||||
from standard input. This is useful for combining the tool into a pipeline.
|
||||
.PP
|
||||
If an output file is not specified with the \fB\-o\fR option, then
|
||||
\&\fBllvm-as\fR sends its output to a file or standard output by following
|
||||
these rules:
|
||||
.IP "\(bu" 4
|
||||
If the input is standard input, then the output is standard output.
|
||||
.IP "\(bu" 4
|
||||
If the input is a file that ends with \f(CW\*(C`.st\*(C'\fR, then the output file is of
|
||||
the same name, except that the suffix is changed to \f(CW\*(C`.bc\*(C'\fR.
|
||||
.IP "\(bu" 4
|
||||
If the input is a file that does not end with the \f(CW\*(C`.st\*(C'\fR suffix, then the
|
||||
output file has the same name as the input file, except that the \f(CW\*(C`.bc\*(C'\fR
|
||||
suffix is appended.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \f(CW\*(C`\-\*(C'\fR, then \fBllvm-as\fR
|
||||
sends its output to standard output.
|
||||
.IP "\fB\-stats\fR" 4
|
||||
.IX Item "-stats"
|
||||
Print statistics acquired during compilation.
|
||||
.IP "\fB\-time\-passes\fR" 4
|
||||
.IX Item "-time-passes"
|
||||
Record the amount of time needed for each pass and print it to standard
|
||||
error.
|
||||
.IP "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
Force the output to be written. Normally, \fBstkrc\fR won't overwrite an existing
|
||||
bytecode file. This option overrides that behavior.
|
||||
.IP "\fB\-s\fR \fIstacksize\fR" 4
|
||||
.IX Item "-s stacksize"
|
||||
Specify the stack size for the program. The default stack size, 1024, should be
|
||||
sufficient for most programs. For very large programs, especially those that
|
||||
recurse a lot, you might want to provide a larger value. Each unit of this
|
||||
value consumes 8 bytes of memory.
|
||||
.IP "\fB\-help\fR" 4
|
||||
.IX Item "-help"
|
||||
Print a summary of command line options.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBstkrc\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value, usually 1.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
llvm-as, <http://llvm.org/docs/Stacker.html>
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by the \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
215
llvm/docs/CommandGuide/man/man1/tblgen.1
Normal file
215
llvm/docs/CommandGuide/man/man1/tblgen.1
Normal file
@@ -0,0 +1,215 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "TBLGEN 1"
|
||||
.TH TBLGEN 1 "2006-06-02" "CVS" "LLVM Command Guide"
|
||||
.SH "NAME"
|
||||
tblgen \- Target Description To C++ Code Generator
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fBtblgen\fR [\fIoptions\fR] [\fIfilename\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBtblgen\fR translates from target description (.td) files into \*(C+ code that can
|
||||
be included in the definition of an \s-1LLVM\s0 target library. Most users of \s-1LLVM\s0 will
|
||||
not need to use this program. It is only for assisting with writing an \s-1LLVM\s0
|
||||
target backend.
|
||||
.PP
|
||||
The input and output of \fBtblgen\fR is beyond the scope of this short
|
||||
introduction. Please see the \fICodeGeneration\fR page in the \s-1LLVM\s0 documentation.
|
||||
.PP
|
||||
The \fIfilename\fR argument specifies the name of a Target Description (.td) file
|
||||
to read as input.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.IP "\fB\-\-help\fR" 4
|
||||
.IX Item "--help"
|
||||
Print a summary of command line options.
|
||||
.IP "\fB\-o\fR \fIfilename\fR" 4
|
||||
.IX Item "-o filename"
|
||||
Specify the output file name. If \fIfilename\fR is \f(CW\*(C`\-\*(C'\fR, then \fBtblgen\fR
|
||||
sends its output to standard output.
|
||||
.IP "\fB\-I\fR \fIdirectory\fR" 4
|
||||
.IX Item "-I directory"
|
||||
Specify where to find other target description files for inclusion. The
|
||||
\&\fIdirectory\fR value should be a full or partial path to a directory that contains
|
||||
target description files.
|
||||
.IP "\fB\-asmwriternum\fR \fIN\fR" 4
|
||||
.IX Item "-asmwriternum N"
|
||||
Make \-gen\-asm\-writer emit assembly writer number \fIN\fR.
|
||||
.IP "\fB\-class\fR \fIclass Name\fR" 4
|
||||
.IX Item "-class class Name"
|
||||
Print the enumeration list for this class.
|
||||
.IP "\fB\-print\-records\fR" 4
|
||||
.IX Item "-print-records"
|
||||
Print all records to standard output (default).
|
||||
.IP "\fB\-print\-enums\fR" 4
|
||||
.IX Item "-print-enums"
|
||||
Print enumeration values for a class
|
||||
.IP "\fB\-gen\-emitter\fR" 4
|
||||
.IX Item "-gen-emitter"
|
||||
Generate machine code emitter.
|
||||
.IP "\fB\-gen\-register\-enums\fR" 4
|
||||
.IX Item "-gen-register-enums"
|
||||
Generate the enumeration values for all registers.
|
||||
.IP "\fB\-gen\-register\-desc\fR" 4
|
||||
.IX Item "-gen-register-desc"
|
||||
Generate a register info description for each register.
|
||||
.IP "\fB\-gen\-register\-desc\-header\fR" 4
|
||||
.IX Item "-gen-register-desc-header"
|
||||
Generate a register info description header for each register.
|
||||
.IP "\fB\-gen\-instr\-enums\fR" 4
|
||||
.IX Item "-gen-instr-enums"
|
||||
Generate enumeration values for instructions.
|
||||
.IP "\fB\-gen\-instr\-desc\fR" 4
|
||||
.IX Item "-gen-instr-desc"
|
||||
Generate instruction descriptions.
|
||||
.IP "\fB\-gen\-asm\-writer\fR" 4
|
||||
.IX Item "-gen-asm-writer"
|
||||
Generate the assembly writer.
|
||||
.IP "\fB\-gen\-dag\-isel\fR" 4
|
||||
.IX Item "-gen-dag-isel"
|
||||
Generate a \s-1DAG\s0 (Directed Acycle Graph) instruction selector.
|
||||
.IP "\fB\-gen\-subtarget\fR" 4
|
||||
.IX Item "-gen-subtarget"
|
||||
Generate subtarget enumerations.
|
||||
.IP "\fB\-gen\-intrinsic\fR" 4
|
||||
.IX Item "-gen-intrinsic"
|
||||
Generate intrinsic information.
|
||||
.IP "\fB\-version\fR" 4
|
||||
.IX Item "-version"
|
||||
Show the version number of this program.
|
||||
.SH "EXIT STATUS"
|
||||
.IX Header "EXIT STATUS"
|
||||
If \fBtblgen\fR succeeds, it will exit with 0. Otherwise, if an error
|
||||
occurs, it will exit with a non-zero value.
|
||||
.SH "AUTHORS"
|
||||
.IX Header "AUTHORS"
|
||||
Maintained by The \s-1LLVM\s0 Team (<http://llvm.org>).
|
||||
@@ -499,8 +499,8 @@ href="CFEBuildInstrs.html">try to compile it</a> on your platform.</p>
|
||||
<p>LLVM is very demanding of the host C++ compiler, and as such tends to expose
|
||||
bugs in the compiler. In particular, several versions of GCC crash when trying
|
||||
to compile LLVM. We routinely use GCC 3.3.3, 3.4.0, and Apple 4.0.1
|
||||
successfully with them (however, see below). Other versions of GCC will
|
||||
probably work as well. GCC versions listed
|
||||
successfully with them (however, see important notes below). Other versions
|
||||
of GCC will probably work as well. GCC versions listed
|
||||
here are known to not work. If you are using one of these versions, please try
|
||||
to upgrade your GCC to something more recent. If you run into a problem with a
|
||||
version of GCC not listed here, please <a href="mailto:llvmdev@cs.uiuc.edu">let
|
||||
@@ -525,6 +525,13 @@ the "<tt>convert_from_eh_region_ranges_1</tt>" GCC function.</p>
|
||||
possibly others) does not compile LLVM correctly (it appears that exception
|
||||
handling is broken in some cases). Please download the FSF 3.3.3 or upgrade
|
||||
to a newer version of GCC.</p>
|
||||
<p><b>GCC 3.4.0</b> on linux/x86 (32-bit)</b>: GCC miscompiles portions of the
|
||||
code generator, causing an infinite loop in the llvm-gcc build when built
|
||||
with optimizations enabled (i.e. a release build).</p>
|
||||
<p><b>GCC 3.4.2</b> on linux/x86 (32-bit)</b>: GCC miscompiles portions of the
|
||||
code generator at -O3, as with 3.4.0. However gcc 3.4.2 (unlike 3.4.0)
|
||||
correctly compiles LLVM at -O2. A work around is to build release LLVM
|
||||
builds with "make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 ..."</p>
|
||||
<p><b>GCC 3.4.x</b> on X86-64/amd64</b>: GCC <a href="http://llvm.org/PR1056">
|
||||
miscompiles portions of LLVM</a>.</p>
|
||||
<p><b>IA-64 GCC 4.0.0</b>: The IA-64 version of GCC 4.0.0 is known to
|
||||
|
||||
@@ -908,9 +908,6 @@ system. The current set of primitive types is as follows:</p>
|
||||
<tbody>
|
||||
<tr><th>Type</th><th>Description</th></tr>
|
||||
<tr><td><tt><a name="t_void">void</a></tt></td><td>No value</td></tr>
|
||||
<tr><td><tt>i8</tt></td><td>8-bit value</td></tr>
|
||||
<tr><td><tt>i32</tt></td><td>32-bit value</td></tr>
|
||||
<tr><td><tt>float</tt></td><td>32-bit floating point value</td></tr>
|
||||
<tr><td><tt>label</tt></td><td>Branch destination</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -919,9 +916,7 @@ system. The current set of primitive types is as follows:</p>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Type</th><th>Description</th></tr>
|
||||
<tr><td><tt>i1</tt></td><td>True or False value</td></tr>
|
||||
<tr><td><tt>i16</tt></td><td>16-bit value</td></tr>
|
||||
<tr><td><tt>i64</tt></td><td>64-bit value</td></tr>
|
||||
<tr><td><tt>float</tt></td><td>32-bit floating point value</td></tr>
|
||||
<tr><td><tt>double</tt></td><td>64-bit floating point value</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -942,7 +937,7 @@ classifications:</p>
|
||||
<tr><th>Classification</th><th>Types</th></tr>
|
||||
<tr>
|
||||
<td><a name="t_integer">integer</a></td>
|
||||
<td><tt>i1, i8, i16, i32, i64</tt></td>
|
||||
<td><tt>i1, i2, i3, ... i8, ... i16, ... i32, ... i64, ... </tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="t_floating">floating point</a></td>
|
||||
@@ -950,7 +945,7 @@ classifications:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="t_firstclass">first class</a></td>
|
||||
<td><tt>i1, i8, i16, i32, i64, float, double, <br/>
|
||||
<td><tt>i1, ..., float, double, <br/>
|
||||
<a href="#t_pointer">pointer</a>,<a href="#t_vector">vector</a></tt>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -976,6 +971,51 @@ recursive: For example, it is possible to have a two dimensional array.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="t_integer">Integer Type</a> </div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<h5>Overview:</h5>
|
||||
<p>The integer type is a very simple derived type that simply specifies an
|
||||
arbitrary bit width for the integer type desired. Any bit width from 1 bit to
|
||||
2^23-1 (about 8 million) can be specified.</p>
|
||||
|
||||
<h5>Syntax:</h5>
|
||||
|
||||
<pre>
|
||||
iN
|
||||
</pre>
|
||||
|
||||
<p>The number of bits the integer will occupy is specified by the <tt>N</tt>
|
||||
value.</p>
|
||||
|
||||
<h5>Examples:</h5>
|
||||
<table class="layout">
|
||||
<tr class="layout">
|
||||
<td class="left">
|
||||
<tt>i1</tt><br/>
|
||||
<tt>i4</tt><br/>
|
||||
<tt>i8</tt><br/>
|
||||
<tt>i16</tt><br/>
|
||||
<tt>i32</tt><br/>
|
||||
<tt>i42</tt><br/>
|
||||
<tt>i64</tt><br/>
|
||||
<tt>i1942652</tt><br/>
|
||||
</td>
|
||||
<td class="left">
|
||||
A boolean integer of 1 bit<br/>
|
||||
A nibble sized integer of 4 bits.<br/>
|
||||
A byte sized integer of 8 bits.<br/>
|
||||
A half word sized integer of 16 bits.<br/>
|
||||
A word sized integer of 32 bits.<br/>
|
||||
An integer whose bit width is the answer. <br/>
|
||||
A double word sized integer of 64 bits.<br/>
|
||||
A really big integer of over 1 million bits.<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection"> <a name="t_array">Array Type</a> </div>
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" href="llvm.css" type="text/css">
|
||||
<title>LLVM 1.9 Release Notes</title>
|
||||
<title>LLVM 2.0 Release Notes</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="doc_title">LLVM 1.9 Release Notes</div>
|
||||
<div class="doc_title">LLVM 2.0 Release Notes</div>
|
||||
|
||||
<ol>
|
||||
<li><a href="#intro">Introduction</a></li>
|
||||
@@ -32,13 +32,10 @@
|
||||
<div class="doc_text">
|
||||
|
||||
<p>This document contains the release notes for the LLVM compiler
|
||||
infrastructure, release 1.9. Here we describe the status of LLVM, including any
|
||||
known problems and major improvements from the previous release. The most
|
||||
up-to-date version of this document (corresponding to LLVM CVS) can be found
|
||||
on the <a
|
||||
href="http://llvm.org/releases/">LLVM releases web site</a>. If you are
|
||||
not reading this on the LLVM web pages, you should probably go there because
|
||||
this document may be updated after the release.</p>
|
||||
infrastructure, release 2.0. Here we describe the status of LLVM, including
|
||||
major improvements from the previous release and any known problems. All LLVM
|
||||
releases may be downloaded from the <a href="http://llvm.org/releases/">LLVM
|
||||
releases web site</a>.</p>
|
||||
|
||||
<p>For more information about LLVM, including information about the latest
|
||||
release, please check out the <a href="http://llvm.org/">main LLVM
|
||||
@@ -61,67 +58,175 @@ href="http://llvm.org/releases/">releases page</a>.</p>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>This is the tenth public release of the LLVM Compiler Infrastructure. This
|
||||
release incorporates a large number of enhancements, new features, and bug
|
||||
fixes. We recommend that all users of previous LLVM versions upgrade.
|
||||
</p>
|
||||
<p>This is the eleventh public release of the LLVM Compiler Infrastructure.
|
||||
Being the first major release since 1.0, this release is different in several
|
||||
ways from our previous releases:</p>
|
||||
|
||||
<ol>
|
||||
<li>We took this as an opportunity to
|
||||
break backwards compatibility with the LLVM 1.x bytecode and .ll file format.
|
||||
If you have LLVM 1.9 .ll files that you would like to upgrade to LLVM 2.x, we
|
||||
recommend the use of the stand alone <a href="#llvm-upgrade">llvm-upgrade</a>
|
||||
tool (which is included with 2.0). We intend to keep compatibility with .ll
|
||||
and .bc formats within the 2.x release series, like we did within the 1.x
|
||||
series.</li>
|
||||
<li>There are several significant change to the LLVM IR and internal APIs, such
|
||||
as a major overhaul of the type system, the completely new bitcode file
|
||||
format, etc (described below).</li>
|
||||
<li>We designed the release around a 6 month release cycle instead of the usual
|
||||
3-month cycle. This gave us extra time to develop and test some of the
|
||||
more invasive features in this release.</li>
|
||||
<li>LLVM 2.0 no longer supports the llvm-gcc3 front-end. Users are required to
|
||||
upgrade to llvm-gcc4. llvm-gcc4 includes many features over
|
||||
llvm-gcc3, is faster, and is <a href="CFEBuildInstrs.html">much easier to
|
||||
build from source</a>.</li>
|
||||
</ol>
|
||||
|
||||
<p>Note that while this is a major version bump, this release has been
|
||||
extensively tested on a wide range of software. It is easy to say that this
|
||||
is our best release yet, in terms of both features and correctness. This is
|
||||
the first LLVM release to correctly compile and optimize major software like
|
||||
LLVM itself, Mozilla/Seamonkey, Qt 4.3rc1, kOffice, etc out of the box on
|
||||
linux/x86.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--=========================================================================-->
|
||||
<div class="doc_subsection">
|
||||
<a name="newfeatures">New Features in LLVM 1.9</a>
|
||||
<a name="newfeatures">New Features in LLVM 2.0</a>
|
||||
</div>
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="x86-64">New X86-64 Backend</a></div>
|
||||
<div class="doc_subsubsection"><a name="majorchanges">Major Changes</a></div>
|
||||
<div class="doc_text">
|
||||
<p>LLVM 1.9 now fully supports the x86-64 instruction set on Mac OS/X, and
|
||||
supports it on Linux (and other operating systems) when compiling in -static
|
||||
mode. LLVM includes JIT support for X86-64, and supports both Intel EMT-64T
|
||||
and AMD-64 architectures. The X86-64 instruction set permits addressing a
|
||||
64-bit addressing space and provides the compiler with twice the
|
||||
number of integer registers to use.</p>
|
||||
|
||||
<p>Changes to the LLVM IR itself:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Integer types are now completely signless. This means that we
|
||||
have types like i8/i16/i32 instead of ubyte/sbyte/short/ushort/int
|
||||
etc. LLVM operations that depend on sign have been split up into
|
||||
separate instructions (<a href="http://llvm.org/PR950">PR950</a>). This
|
||||
eliminates cast instructions that just change the sign of the operands (e.g.
|
||||
int -> uint), which reduces the size of the IR and makes optimizers
|
||||
simpler to write.</li>
|
||||
|
||||
<li>Integer types with arbitrary bitwidths (e.g. i13, i36, i42, i1057, etc) are
|
||||
now supported in the LLVM IR and optimizations (<a
|
||||
href="http://llvm.org/PR1043">PR1043</a>). However, neither llvm-gcc
|
||||
(<a href="http://llvm.org/PR1284">PR1284</a>) nor the native code generators
|
||||
(<a href="http://llvm.org/PR1270">PR1270</a>) support non-standard width
|
||||
integers yet.</li>
|
||||
|
||||
<li>'Type planes' have been removed (<a href="http://llvm.org/PR411">PR411</a>).
|
||||
It is no longer possible to have two values with the same name in the
|
||||
same symbol table. This simplifies LLVM internals, allowing significant
|
||||
speedups.</li>
|
||||
|
||||
<li>Global variables and functions in .ll files are now prefixed with
|
||||
@ instead of % (<a href="http://llvm.org/PR645">PR645</a>).</li>
|
||||
|
||||
<li>The LLVM 1.x "bytecode" format has been replaced with a
|
||||
completely new binary representation, named 'bitcode'. The <a
|
||||
href="BitCodeFormat.html">Bitcode Format</a> brings a
|
||||
number of advantages to the LLVM over the old bytecode format: it is denser
|
||||
(files are smaller), more extensible, requires less memory to read,
|
||||
is easier to keep backwards compatible (so LLVM 2.5 will read 2.0 .bc
|
||||
files), and has many other nice features.</li>
|
||||
|
||||
<li>Load and store instructions now track the alignment of their pointer
|
||||
(<a href="http://www.llvm.org/PR400">PR400</a>). This allows the IR to
|
||||
express loads that are not sufficiently aligned (e.g. due to '<tt>#pragma
|
||||
packed</tt>') or to capture extra alignment information.</li>
|
||||
</ul>
|
||||
|
||||
<p>Major new features:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>A number of ELF features are now supported by LLVM, including 'visibility',
|
||||
extern weak linkage, Thread Local Storage (TLS) with the <tt>__thread</tt>
|
||||
keyword, and symbol aliases.
|
||||
Among other things, this means that many of the special options needed to
|
||||
configure llvm-gcc on linux are no longer needed, and special hacks to build
|
||||
large C++ libraries like Qt are not needed.</li>
|
||||
|
||||
<li>LLVM now has a new MSIL backend. <tt>llc -march=msil</tt> will now turn LLVM
|
||||
into MSIL (".net") bytecode. This is still fairly early development
|
||||
with a number of limitations.</li>
|
||||
|
||||
<li>A new <a href="CommandGuide/html/llvm-upgrade.html">llvm-upgrade</a> tool
|
||||
exists to migrates LLVM 1.9 .ll files to LLVM 2.0 syntax.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="lto">Link-Time Optimization integration
|
||||
with native linkers</a></div>
|
||||
<div class="doc_text">
|
||||
<p>LLVM now includes <a href="LinkTimeOptimization.html">liblto</a> which can
|
||||
be used to integrate LLVM Link-Time Optimization support into a native linker.
|
||||
This allows LLVM .bc to transparently participate with linking an application,
|
||||
even when some .o files are in LLVM form and some are not.</p>
|
||||
</div>
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="dwarf">DWARF debugging
|
||||
support for Linux, Cygwin and MinGW on X86</a></div>
|
||||
<div class="doc_subsubsection"><a name="llvmgccfeatures">llvm-gcc
|
||||
Improvements</a></div>
|
||||
<div class="doc_text">
|
||||
<p>llvm-gcc4 now supports generating debugging info for Linux, Cygwin and MinGW.
|
||||
This extends the PPC/Darwin and X86/Darwin debugging support available in the
|
||||
1.8 release. DWARF is a standard debugging format used on many platforms.</p>
|
||||
<p>New features include:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Precompiled Headers (PCH) are now supported.</li>
|
||||
|
||||
<li>"<tt>#pragma packed</tt>" is now supported, as are the various features
|
||||
described above (visibility, extern weak linkage, __thread, aliases,
|
||||
etc).</li>
|
||||
|
||||
<li>Tracking function parameter/result attributes is now possible.</li>
|
||||
|
||||
<li>Many internal enhancements have been added, such as improvements to
|
||||
NON_LVALUE_EXPR, arrays with non-zero base, structs with variable sized
|
||||
fields, VIEW_CONVERT_EXPR, CEIL_DIV_EXPR, nested functions, and many other
|
||||
things. This is primarily to supports non-C GCC front-ends, like Ada.</li>
|
||||
|
||||
<li>It is simpler to configure llvm-gcc for linux.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="optimizer">Optimizer
|
||||
Improvements</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
<p>The mid-level optimizer is now faster and produces better code in many cases.
|
||||
Significant changes include:</p>
|
||||
<p>New features include:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>LLVM includes a new 'predicate simplifier' pass, which
|
||||
currently performs dominator tree-based optimizations.</li>
|
||||
<li>The complete loop unroll pass now supports unrolling of
|
||||
multiple basic block loops.</li>
|
||||
<li>The 'globalopt' pass can now perform the scalar replacement of
|
||||
aggregates transformation on some heap allocations.</li>
|
||||
<li>The globalsmodref-aa alias analysis can now track 'indirect pointer
|
||||
globals' more accurately.</li>
|
||||
<li>The instruction combiner can now perform element propagation
|
||||
analysis of vector expressions, eliminating computation of vector elements
|
||||
that are not used.</li>
|
||||
<li>The <a href="WritingAnLLVMPass.html">pass manager</a> has been entirely
|
||||
rewritten, making it significantly smaller, simpler, and more extensible.
|
||||
Support has been added to run <tt>FunctionPass</tt>es interlaced with
|
||||
<tt>CallGraphSCCPass</tt>es, we now support loop transformations
|
||||
explicitly with <tt>LoopPass</tt>, and <tt>ModulePass</tt>es may now use the
|
||||
result of <tt>FunctionPass</tt>es.</li>
|
||||
|
||||
<li>LLVM 2.0 includes a new loop rotation pass, which converts "for loops" into
|
||||
"do/while loops", where the condition is at the bottom of the loop.</li>
|
||||
|
||||
<li>The Loop Strength Reduction pass has been improved, and we now support
|
||||
sinking expressions across blocks to reduce register pressure.</li>
|
||||
|
||||
<li>The <tt>-scalarrepl</tt> pass can now promote unions containing FP values
|
||||
into a register, it can also handle unions of vectors of the same
|
||||
size.</li>
|
||||
|
||||
<li>The [Post]DominatorSet classes have been removed from LLVM and clients
|
||||
switched to use the more-efficient ETForest class instead.</li>
|
||||
|
||||
<li>The ImmediateDominator class has also been removed, and clients have been
|
||||
switched to use DominatorTree instead.</li>
|
||||
|
||||
<li>The predicate simplifier pass has been improved, making it able to do
|
||||
simple value range propagation and eliminate more conditionals. However,
|
||||
note that predsimplify is not enabled by default in llvm-gcc.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -132,96 +237,233 @@ Generator Enhancements</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
<p>
|
||||
The LLVM Target-Independent code generator now supports more target features and
|
||||
optimizes many cases more aggressively. New features include:
|
||||
New features include:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>LLVM now includes a late branch folding pass which optimizes code
|
||||
layout, performs several branch optzns, and deletes unreachable code.</li>
|
||||
<li>The code generator now support targets that have pre/post-increment
|
||||
addressing modes.</li>
|
||||
<li>LLVM now supports dynamically-loadable register allocators and
|
||||
schedulers.</li>
|
||||
<li>LLVM 1.9 includes several improvements to inline asm support,
|
||||
including support for new constraints and modifiers.</li>
|
||||
<li>The register coalescer is now more aggressive than before,
|
||||
allowing it to eliminate more copies.</li>
|
||||
|
||||
<li>LLVM now supports software floating point, which allows LLVM to target
|
||||
chips that don't have hardware FPUs (e.g. ARM thumb mode).</li>
|
||||
|
||||
<li>A new register scavenger has been implemented, which is useful for
|
||||
finding free registers after register allocation. This is useful when
|
||||
rewriting frame references on RISC targets, for example.</li>
|
||||
|
||||
<li>Heuristics have been added to avoid coalescing vregs with very large live
|
||||
ranges to physregs. This was bad because it effectively pinned the physical
|
||||
register for the entire lifetime of the virtual register (<a
|
||||
href="http://llvm.org/PR711">PR711</a>).</li>
|
||||
|
||||
<li>Support now exists for very simple (but still very useful)
|
||||
rematerialization the register allocator, enough to move
|
||||
instructions like "load immediate" and constant pool loads.</li>
|
||||
|
||||
<li>Switch statement lowering is significantly better, improving codegen for
|
||||
sparse switches that have dense subregions, and implemented support
|
||||
for the shift/and trick.</li>
|
||||
|
||||
<li>LLVM now supports tracking physreg sub-registers and super-registers
|
||||
in the code generator, and includes extensive register
|
||||
allocator changes to track them.</li>
|
||||
|
||||
<li>There is initial support for virtreg sub-registers
|
||||
(<a href="http://llvm.org/PR1350">PR1350</a>).</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Other improvements include:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Inline assembly support is much more solid that before.
|
||||
The two primary features still missing are support for 80-bit floating point
|
||||
stack registers on X86 (<a href="http://llvm.org/PR879">PR879</a>), and
|
||||
support for inline asm in the C backend (<a
|
||||
href="http://llvm.org/PR802">PR802</a>).</li>
|
||||
|
||||
<li>DWARF debug information generation has been improved. LLVM now passes
|
||||
most of the GDB testsuite on MacOS and debug info is more dense.</li>
|
||||
|
||||
<li>Codegen support for Zero-cost DWARF exception handling has been added (<a
|
||||
href="http://llvm.org/PR592">PR592</a>). It is mostly
|
||||
complete and just in need of continued bug fixes and optimizations at
|
||||
this point. However, support in llvm-g++ is disabled with an
|
||||
#ifdef for the 2.0 release (<a
|
||||
href="http://llvm.org/PR870">PR870</a>).</li>
|
||||
|
||||
<li>The code generator now has more accurate and general hooks for
|
||||
describing addressing modes ("isLegalAddressingMode") to
|
||||
optimizations like loop strength reduction and code sinking.</li>
|
||||
|
||||
<li>Progress has been made on a direct Mach-o .o file writer. Many small
|
||||
apps work, but it is still not quite complete.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>In addition, the LLVM target description format has itself been extended in
|
||||
several ways:</p>
|
||||
|
||||
<ul>
|
||||
<li>tblgen now allows definition of '<a
|
||||
href="TableGenFundamentals.html#multiclass">multiclasses</a>' which can be
|
||||
used to factor instruction patterns more aggressively in .td files.</li>
|
||||
<li>LLVM has a new TargetAsmInfo class which captures a variety of
|
||||
information about the target assembly language format.</li>
|
||||
<li>.td files now support "<tt>${:foo}</tt>" syntax for encoding
|
||||
subtarget-specific assembler syntax into instruction descriptions.</li>
|
||||
</ul>
|
||||
<li>TargetData now supports better target parameterization in
|
||||
the .ll/.bc files, eliminating the 'pointersize/endianness' attributes
|
||||
in the files (<a href="http://llvm.org/PR761">PR761</a>).</li>
|
||||
|
||||
<p>Further, several significant target-specific enhancements are included in
|
||||
LLVM 1.9:</p>
|
||||
<li>TargetData was generalized for finer grained alignment handling,
|
||||
handling of vector alignment, and handling of preferred alignment</li>
|
||||
|
||||
<li>LLVM now supports describing target calling conventions
|
||||
explicitly in .td files, reducing the amount of C++ code that needs
|
||||
to be written for a port.</li>
|
||||
|
||||
<ul>
|
||||
<li>The LLVM ARM backend now supports more instructions
|
||||
and the use of a frame pointer. It is now possible to build
|
||||
libgcc and a simple cross compiler, but it is not considered "complete" yet.
|
||||
</li>
|
||||
<li>LLVM supports the Win32 dllimport/dllexport linkage and
|
||||
stdcall/fastcall calling conventions.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="specifictargets">Target-Specific
|
||||
Improvements</a></div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>X86-specific Code Generator Enhancements:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>The MMX instruction set is now supported through intrinsics.</li>
|
||||
<li>The scheduler was improved to better reduce register pressure on
|
||||
X86 and other targets that are register pressure sensitive.</li>
|
||||
<li>Linux/x86-64 support is much better.</li>
|
||||
<li>PIC support for linux/x86 has been added.</li>
|
||||
<li>The X86 backend now supports the GCC regparm attribute.</li>
|
||||
<li>LLVM now supports inline asm with multiple constraint letters per operand
|
||||
(like "mri") which is common in X86 inline asms.</li>
|
||||
</ul>
|
||||
|
||||
<p>ARM-specific Code Generator Enhancements:</p>
|
||||
|
||||
<ul>
|
||||
<li>The ARM code generator is now stable and fully supported.</li>
|
||||
|
||||
<li>There are major new features, including support for ARM
|
||||
v4-v6 chips, vfp support, soft float point support, pre/postinc support,
|
||||
load/store multiple generation, constant pool entry motion (to support
|
||||
large functions), inline asm support, weak linkage support, static
|
||||
ctor/dtor support and many bug fixes.</li>
|
||||
|
||||
<li>Added support for Thumb code generation (<tt>llc -march=thumb</tt>).</li>
|
||||
|
||||
<li>The ARM backend now supports the ARM AAPCS/EABI ABI and PIC codegen on
|
||||
arm/linux.</li>
|
||||
|
||||
<li>Several bugs were fixed for DWARF debug info generation on arm/linux.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>PowerPC-specific Code Generator Enhancements:</p>
|
||||
|
||||
<ul>
|
||||
<li>The PowerPC 64 JIT now supports addressing code loaded above the 2G
|
||||
boundary.</li>
|
||||
|
||||
<li>Improved support for the Linux/ppc ABI and the linux/ppc JIT is fully
|
||||
functional now. llvm-gcc and static compilation are not fully supported
|
||||
yet though.</li>
|
||||
|
||||
<li>Many PowerPC 64 bug fixes.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="other">Other Improvements</a></div>
|
||||
<div class="doc_text">
|
||||
<p>This release includes many other improvements, including improvements to
|
||||
the optimizers and code generators (improving the generated code) changes to
|
||||
speed up the compiler in many ways (improving algorithms and fine tuning
|
||||
code), and changes to reduce the code size of the compiler itself.</p>
|
||||
|
||||
<p>More specific changes include:</p>
|
||||
|
||||
<ul>
|
||||
<li>The llvm-test framework now supports SPEC2006.</li>
|
||||
<li>LLVM now includes a <a href="GetElementPtr.html">FAQ about the
|
||||
<tt>getelementptr</tt> instruction</a>.</li>
|
||||
<li>Bugpoint now supports a new "<tt>-find-bugs</tt>" mode. This mode makes
|
||||
bugpoint permute pass sequences to try to expose bugs due to pass
|
||||
sequencing.</li>
|
||||
<li>The JIT now supports lazily streaming code from multiple modules at a
|
||||
time, implicitly linking the code as it goes.</li>
|
||||
<li>LLVM no longer relies on static destructors to shut itself down. Instead,
|
||||
it lazily initializes itself and shuts down when <tt>llvm_shutdown()</tt> is
|
||||
explicitly called.</li>
|
||||
|
||||
<li>LLVM now has significantly fewer static constructors, reducing startup time.
|
||||
</li>
|
||||
|
||||
<li>Several classes have been refactored to reduce the amount of code that
|
||||
gets linked into apps that use the JIT.</li>
|
||||
|
||||
<li>Construction of intrinsic function declarations has been simplified.</li>
|
||||
|
||||
<li>The gccas/gccld tools have been replaced with small shell scripts.</li>
|
||||
|
||||
<li>Support has been added to llvm-test for running on low-memory
|
||||
or slow machines (make SMALL_PROBLEM_SIZE=1).</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!--=========================================================================-->
|
||||
<div class="doc_subsection">
|
||||
<a name="apichanges">Significant API Changes in LLVM 1.9</a>
|
||||
</div>
|
||||
|
||||
<!--_________________________________________________________________________-->
|
||||
<div class="doc_subsubsection"><a name="apichanges">API Changes</a></div>
|
||||
<div class="doc_text">
|
||||
|
||||
<p>Several significant API changes have been made. If you are maintaining
|
||||
out-of-tree code, please be aware that:</p>
|
||||
<p>LLVM 2.0 contains a revamp of the type system and several other significant
|
||||
internal changes. If you are programming to the C++ API, be aware of the
|
||||
following major changes:</p>
|
||||
|
||||
<ul>
|
||||
<li>The ConstantSInt and ConstantUInt classes have been merged into the
|
||||
ConstantInt class.</li>
|
||||
<li><p>As a step towards making LLVM's integer types signless, several new
|
||||
instructions have been added to LLVM. The <tt>Div</tt> instruction is now
|
||||
<tt>UDiv</tt>, <tt>SDiv</tt>, and <tt>FDiv</tt>. The <tt>Rem</tt> instruction
|
||||
is now <tt>URem</tt>, <tt>SRem</tt> and <tt>FRem</tt>. See the
|
||||
<a href="LangRef.html">Language Reference</a> for details on these new
|
||||
instructions.</p>
|
||||
<li><p><tt>ConstantBool::True</tt> and <tt>ConstantBool::False</tt> have been
|
||||
renamed to <tt>ConstantBool::getTrue()</tt> and
|
||||
<tt>ConstantBool::getFalse()</tt>.</p></li>
|
||||
<li>The 'analyze' tool has been merged into the 'opt' tool.</li>
|
||||
<li>Pass registration is slightly different in LLVM 2.0 (you now need an
|
||||
<tt>intptr_t</tt> in your constructor), as explained in the <a
|
||||
href="WritingAnLLVMPass.html#basiccode">Writing an LLVM Pass</a>
|
||||
document.</li>
|
||||
|
||||
<li><tt>ConstantBool</tt>, <tt>ConstantIntegral</tt> and <tt>ConstantInt</tt>
|
||||
classes have been merged together, we now just have
|
||||
<tt>ConstantInt</tt>.</li>
|
||||
|
||||
<li><tt>Type::IntTy</tt>, <tt>Type::UIntTy</tt>, <tt>Type::SByteTy</tt>, ... are
|
||||
replaced by <tt>Type::Int8Ty</tt>, <tt>Type::Int16Ty</tt>, etc. LLVM types
|
||||
have always corresponded to fixed size types
|
||||
(e.g. long was always 64-bits), but the type system no longer includes
|
||||
information about the sign of the type. Also, the
|
||||
<tt>Type::isPrimitiveType()</tt> method now returns false for integers.</li>
|
||||
|
||||
<li>Several classes (<tt>CallInst</tt>, <tt>GetElementPtrInst</tt>,
|
||||
<tt>ConstantArray</tt>, etc), that once took <tt>std::vector</tt> as
|
||||
arguments now take ranges instead. For example, you can create a
|
||||
<tt>GetElementPtrInst</tt> with code like:
|
||||
|
||||
<pre>
|
||||
Value *Ops[] = { Op1, Op2, Op3 };
|
||||
GEP = new GetElementPtrInst(BasePtr, Ops, 3);
|
||||
</pre>
|
||||
|
||||
This avoids creation of a temporary vector (and a call to malloc/free). If
|
||||
you have an <tt>std::vector</tt>, use code like this:
|
||||
<pre>
|
||||
std::vector<Value*> Ops = ...;
|
||||
GEP = new GetElementPtrInst(BasePtr, &Ops[0], Ops.size());
|
||||
</pre>
|
||||
|
||||
</li>
|
||||
|
||||
<li><tt>CastInst</tt> is now abstract and its functionality is split into
|
||||
several parts, one for each of the <a href="LangRef.html#convertops">new
|
||||
cast instructions</a>.</li>
|
||||
|
||||
<li><tt>Instruction::getNext()/getPrev()</tt> are now private (along with
|
||||
<tt>BasicBlock::getNext</tt>, etc), for efficiency reasons (they are now no
|
||||
longer just simple pointers). Please use <tt>BasicBlock::iterator</tt>, etc
|
||||
instead.
|
||||
</li>
|
||||
|
||||
<li><tt>Module::getNamedFunction()</tt> is now called
|
||||
<tt>Module::getFunction()</tt>.</li>
|
||||
|
||||
<li><tt>SymbolTable.h</tt> has been split into <tt>ValueSymbolTable.h</tt> and
|
||||
<tt>TypeSymbolTable.h</tt>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -237,14 +479,14 @@ instructions.</p>
|
||||
<p>LLVM is known to work on the following platforms:</p>
|
||||
|
||||
<ul>
|
||||
<li>Intel and AMD machines running Red Hat Linux, Fedora Core and FreeBSD
|
||||
<li>Intel and AMD machines running Red Hat Linux, Fedora Core and FreeBSD
|
||||
(and probably other unix-like systems).</li>
|
||||
<li>Intel and AMD machines running on Win32 using MinGW libraries (native)</li>
|
||||
<li>Sun UltraSPARC workstations running Solaris 8.</li>
|
||||
<li>Intel and AMD machines running on Win32 with the Cygwin libraries (limited
|
||||
support is available for native builds with Visual C++).</li>
|
||||
<li>PowerPC and X86-based Mac OS X systems, running 10.2 and above in 32-bit and
|
||||
64-bit modes.</li>
|
||||
<li>Intel and AMD machines running on Win32 using MinGW libraries (native)</li>
|
||||
<li>Intel and AMD machines running on Win32 with the Cygwin libraries (limited
|
||||
support is available for native builds with Visual C++).</li>
|
||||
<li>Sun UltraSPARC workstations running Solaris 8.</li>
|
||||
<li>Alpha-based machines running Debian GNU/Linux.</li>
|
||||
<li>Itanium-based machines running Linux and HP-UX.</li>
|
||||
</ul>
|
||||
@@ -289,8 +531,9 @@ components, please contact us on the <a href="http://lists.cs.uiuc.edu/mailman/l
|
||||
<ul>
|
||||
<li>The <tt>-cee</tt> pass is known to be buggy, and may be removed in in a
|
||||
future release.</li>
|
||||
<li>C++ EH support is disabled for this release.</li>
|
||||
<li>The MSIL backend is experimental.</li>
|
||||
<li>The IA64 code generator is experimental.</li>
|
||||
<li>The ARM code generator is experimental.</li>
|
||||
<li>The Alpha JIT is experimental.</li>
|
||||
<li>"<tt>-filetype=asm</tt>" (the default) is the only supported value for the
|
||||
<tt>-filetype</tt> llc option.</li>
|
||||
@@ -307,9 +550,7 @@ components, please contact us on the <a href="http://lists.cs.uiuc.edu/mailman/l
|
||||
|
||||
<ul>
|
||||
<li>The X86 backend does not yet support <a href="http://llvm.org/PR879">inline
|
||||
assembly that uses the X86 floating point stack</a>. See the <a
|
||||
href="http://llvm.org/PR879">bug</a> for details on workarounds on
|
||||
Linux.</li>
|
||||
assembly that uses the X86 floating point stack</a>.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -324,8 +565,27 @@ components, please contact us on the <a href="http://lists.cs.uiuc.edu/mailman/l
|
||||
<ul>
|
||||
<li><a href="http://llvm.org/PR642">PowerPC backend does not correctly
|
||||
implement ordered FP comparisons</a>.</li>
|
||||
<li>The 64-bit PowerPC backend is not fully stable. If you desire PPC64 support,
|
||||
please use mainline CVS LLVM, which has several important bug fixes.</li>
|
||||
<li>The Linux PPC32/ABI support needs testing for the interpreter and static
|
||||
compilation, and lacks support for debug information.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection">
|
||||
<a name="arm-be">Known problems with the ARM back-end</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<ul>
|
||||
<li>Thumb mode works only on ARMv6 or higher processors. On sub-ARMv6
|
||||
processors, thumb program can crash or produces wrong
|
||||
results (<a href="http://llvm.org/PR1388">PR1388</a>).</li>
|
||||
<li>Compilation for ARM Linux OABI (old ABI) is supported, but not fully tested.
|
||||
</li>
|
||||
<li>There is a bug in QEMU-ARM (<= 0.9.0) which causes it to incorrectly execute
|
||||
programs compiled with LLVM. Please use more recent versions of QEMU.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -344,36 +604,6 @@ implement ordered FP comparisons</a>.</li>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection">
|
||||
<a name="c-be">Known problems with the C back-end</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<ul>
|
||||
|
||||
<li>The C back-end produces code that violates the ANSI C Type-Based Alias
|
||||
Analysis rules. As such, special options may be necessary to compile the code
|
||||
(for example, GCC requires the <tt>-fno-strict-aliasing</tt> option). This
|
||||
problem probably cannot be fixed.</li>
|
||||
|
||||
<li><a href="http://llvm.org/PR56">Zero arg vararg functions are not
|
||||
supported</a>. This should not affect LLVM produced by the C or C++
|
||||
frontends.</li>
|
||||
|
||||
<li>The C backend does not correctly implement the <a
|
||||
href="LangRef.html#int_stacksave"><tt>llvm.stacksave</tt></a> or
|
||||
<a href="LangRef.html#int_stackrestore"><tt>llvm.stackrestore</tt></a>
|
||||
intrinsics. This means that some code compiled by it can run out of stack
|
||||
space if they depend on these (e.g. C99 varargs).</li>
|
||||
|
||||
<li><a href="http://llvm.org/PR802">The C backend does not support inline
|
||||
assembly code</a>.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection">
|
||||
<a name="alpha-be">Known problems with the Alpha back-end</a>
|
||||
@@ -415,36 +645,25 @@ programs.</li>
|
||||
|
||||
<li>Defining vararg functions is not supported (but calling them is ok).</li>
|
||||
|
||||
<li>The Itanium backend has bitrotted somewhat.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection">
|
||||
<a name="arm-be">Known problems with the ARM back-end</a>
|
||||
<a name="c-be">Known problems with the C back-end</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<ul>
|
||||
<li>The ARM backend is currently in early development stages, it is not
|
||||
ready for production use.</li>
|
||||
<li><a href="http://llvm.org/PR802">The C backend does not support inline
|
||||
assembly code</a>.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection">
|
||||
<a name="core">Known problems with the LLVM Core</a>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<ul>
|
||||
<li>In the JIT, <tt>dlsym()</tt> on a symbol compiled by the JIT will not
|
||||
work.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<div class="doc_subsection">
|
||||
@@ -456,15 +675,9 @@ ready for production use.</li>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>
|
||||
|
||||
<p>llvm-gcc4 is far more stable and produces better code than llvm-gcc3, but
|
||||
does not currently support <a href="http://llvm.org/PR869">Link-Time
|
||||
Optimization</a> or <a href="http://llvm.org/PR870">C++ Exception Handling</a>,
|
||||
which llvm-gcc3 does.</p>
|
||||
|
||||
<p>llvm-gcc4 does not support the <a href="http://llvm.org/PR947">GCC indirect
|
||||
goto extension</a>, but llvm-gcc3 does.</p>
|
||||
<p>llvm-gcc4 does not currently support <a href="http://llvm.org/PR869">Link-Time
|
||||
Optimization</a> on most platforms "out-of-the-box". Please inquire on the
|
||||
llvmdev mailing list if you are interested.</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -474,86 +687,52 @@ goto extension</a>, but llvm-gcc3 does.</p>
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<ul>
|
||||
|
||||
<li>"long double" is transformed by the front-end into "double". There is no
|
||||
support for floating point data types of any size other than 32 and 64
|
||||
bits.</li>
|
||||
<li><p>"long double" is silently transformed by the front-end into "double". There
|
||||
is no support for floating point data types of any size other than 32 and 64
|
||||
bits.</p></li>
|
||||
|
||||
<li>Although many GCC extensions are supported, some are not. In particular,
|
||||
the following extensions are known to <b>not be</b> supported:
|
||||
<ol>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Local-Labels.html#Local%20Labels">Local Labels</a>: Labels local to a block.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions">Nested Functions</a>: As in Algol and Pascal, lexical scoping of functions.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls">Constructing Calls</a>: Dispatching a call to another function.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Thread_002dLocal.html">Thread-Local</a>: Per-thread variables.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html#Pragmas">Pragmas</a>: Pragmas accepted by GCC.</li>
|
||||
</ol>
|
||||
|
||||
<p>The following GCC extensions are <b>partially</b> supported. An ignored
|
||||
attribute means that the LLVM compiler ignores the presence of the attribute,
|
||||
but the code should still work. An unsupported attribute is one which is
|
||||
ignored by the LLVM compiler and will cause a different interpretation of
|
||||
the program.</p>
|
||||
<li><p>llvm-gcc does <b>not</b> support <tt>__builtin_apply</tt> yet.
|
||||
See <a href="http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls">Constructing Calls</a>: Dispatching a call to another function.</p>
|
||||
</li>
|
||||
|
||||
<li><p>llvm-gcc <b>partially</b> supports these GCC extensions:</p>
|
||||
<ol>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html#Variable%20Length">Variable Length</a>:
|
||||
Arrays whose length is computed at run time.<br>
|
||||
Supported, but allocated stack space is not freed until the function returns (noted above).</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions">Nested Functions</a>: As in Algol and Pascal, lexical scoping of functions.<br>
|
||||
Nested functions are supported, but llvm-gcc does not support non-local
|
||||
gotos or taking the address of a nested function.</li>
|
||||
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function%20Attributes">Function Attributes</a>:
|
||||
|
||||
Declaring that functions have no side effects or that they can never
|
||||
return.<br>
|
||||
|
||||
<b>Supported:</b> <tt>constructor</tt>, <tt>destructor</tt>,
|
||||
<b>Supported:</b> <tt>alias</tt>, <tt>always_inline</tt>, <tt>cdecl</tt>,
|
||||
<tt>constructor</tt>, <tt>destructor</tt>,
|
||||
<tt>deprecated</tt>, <tt>fastcall</tt>, <tt>format</tt>,
|
||||
<tt>format_arg</tt>, <tt>non_null</tt>, <tt>noreturn</tt>,
|
||||
<tt>format_arg</tt>, <tt>non_null</tt>, <tt>noreturn</tt>, <tt>regparm</tt>
|
||||
<tt>section</tt>, <tt>stdcall</tt>, <tt>unused</tt>, <tt>used</tt>,
|
||||
<tt>visibility</tt>, <tt>warn_unused_result</tt>, <tt>weak</tt><br>
|
||||
|
||||
<b>Ignored:</b> <tt>noinline</tt>,
|
||||
<tt>always_inline</tt>, <tt>pure</tt>, <tt>const</tt>, <tt>nothrow</tt>,
|
||||
<tt>malloc</tt>, <tt>no_instrument_function</tt>, <tt>cdecl</tt><br>
|
||||
|
||||
<b>Unsupported:</b> <tt>alias</tt>, <tt>regparm</tt>, all other target specific
|
||||
attributes</li>
|
||||
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html#Variable%20Attributes">Variable Attributes</a>:
|
||||
Specifying attributes of variables.<br>
|
||||
<b>Supported:</b> <tt>cleanup</tt>, <tt>common</tt>, <tt>nocommon</tt>,
|
||||
<tt>deprecated</tt>, <tt>dllimport</tt>, <tt>dllexport</tt>,
|
||||
<tt>section</tt>, <tt>transparent_union</tt>, <tt>unused</tt>,
|
||||
<tt>used</tt>, <tt>weak</tt><br>
|
||||
|
||||
<b>Unsupported:</b> <tt>aligned</tt>, <tt>mode</tt>, <tt>packed</tt>,
|
||||
<tt>shared</tt>, <tt>tls_model</tt>,
|
||||
<tt>vector_size</tt>, all target specific attributes.
|
||||
</li>
|
||||
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html#Type%20Attributes">Type Attributes</a>: Specifying attributes of types.<br>
|
||||
<b>Supported:</b> <tt>transparent_union</tt>, <tt>unused</tt>,
|
||||
<tt>deprecated</tt>, <tt>may_alias</tt><br>
|
||||
|
||||
<b>Unsupported:</b> <tt>aligned</tt>, <tt>packed</tt>,
|
||||
all target specific attributes.</li>
|
||||
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other%20Builtins">Other Builtins</a>:
|
||||
Other built-in functions.<br>
|
||||
We support all builtins which have a C language equivalent (e.g.,
|
||||
<tt>__builtin_cos</tt>), <tt>__builtin_alloca</tt>,
|
||||
<tt>__builtin_types_compatible_p</tt>, <tt>__builtin_choose_expr</tt>,
|
||||
<tt>__builtin_constant_p</tt>, and <tt>__builtin_expect</tt>
|
||||
(currently ignored). We also support builtins for ISO C99 floating
|
||||
point comparison macros (e.g., <tt>__builtin_islessequal</tt>),
|
||||
<tt>__builtin_prefetch</tt>, <tt>__builtin_popcount[ll]</tt>,
|
||||
<tt>__builtin_clz[ll]</tt>, and <tt>__builtin_ctz[ll]</tt>.</li>
|
||||
<b>Ignored:</b> <tt>noinline</tt>, <tt>pure</tt>, <tt>const</tt>, <tt>nothrow</tt>,
|
||||
<tt>malloc</tt>, <tt>no_instrument_function</tt></li>
|
||||
</ol>
|
||||
</li>
|
||||
|
||||
<p>The following extensions <b>are</b> known to be supported:</p>
|
||||
<li><p>llvm-gcc supports the vast majority of GCC extensions, including:</p>
|
||||
|
||||
<ol>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html#Pragmas">Pragmas</a>: Pragmas accepted by GCC.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Local-Labels.html#Local%20Labels">Local Labels</a>: Labels local to a block.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other%20Builtins">Other Builtins</a>:
|
||||
Other built-in functions.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html#Variable%20Attributes">Variable Attributes</a>:
|
||||
Specifying attributes of variables.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html#Type%20Attributes">Type Attributes</a>: Specifying attributes of types.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Thread_002dLocal.html">Thread-Local</a>: Per-thread variables.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html#Variable%20Length">Variable Length</a>:
|
||||
Arrays whose length is computed at run time.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html#Labels%20as%20Values">Labels as Values</a>: Getting pointers to labels and computed gotos.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement%20Exprs">Statement Exprs</a>: Putting statements and declarations inside expressions.</li>
|
||||
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Typeof.html#Typeof">Typeof</a>: <code>typeof</code>: referring to the type of an expression.</li>
|
||||
@@ -609,20 +788,15 @@ lists, please let us know (also including whether or not they work).</p>
|
||||
|
||||
<div class="doc_text">
|
||||
|
||||
<p>For this release, the C++ front-end is considered to be fully
|
||||
<p>The C++ front-end is considered to be fully
|
||||
tested and works for a number of non-trivial programs, including LLVM
|
||||
itself.</p>
|
||||
itself, Qt, Mozilla, etc.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<div class="doc_subsubsection">
|
||||
Notes
|
||||
</div>
|
||||
|
||||
<div class="doc_text">
|
||||
<ul>
|
||||
<li>llvm-gcc4 does not support C++ exception handling at all yet.</li>
|
||||
<li>llvm-gcc4 only has partial support for <a href="http://llvm.org/PR870">C++
|
||||
Exception Handling</a>, and it is not enabled by default.</li>
|
||||
|
||||
<!-- NO EH Support!
|
||||
|
||||
<li>Destructors for local objects are not always run when a <tt>longjmp</tt> is
|
||||
performed. In particular, destructors for objects in the <tt>longjmp</tt>ing
|
||||
@@ -640,7 +814,7 @@ itself.</p>
|
||||
<i>However</i>, the exception handling mechanism used by llvm-gcc3 is very
|
||||
different from the model used in the Itanium ABI, so <b>exceptions will not
|
||||
interact correctly</b>. </li>
|
||||
|
||||
-->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -656,11 +830,10 @@ itself.</p>
|
||||
<div class="doc_text">
|
||||
|
||||
<p>A wide variety of additional information is available on the <a
|
||||
href="http://llvm.org">LLVM web page</a>, including <a
|
||||
href="http://llvm.org/docs/">documentation</a> and <a
|
||||
href="http://llvm.org/pubs/">publications describing algorithms and
|
||||
components implemented in LLVM</a>. The web page also contains versions of the
|
||||
API documentation which is up-to-date with the CVS version of the source code.
|
||||
href="http://llvm.org">LLVM web page</a>, in particular in the <a
|
||||
href="http://llvm.org/docs/">documentation</a> section. The web page also
|
||||
contains versions of the API documentation which is up-to-date with the CVS
|
||||
version of the source code.
|
||||
You can access versions of these documents specific to this release by going
|
||||
into the "<tt>llvm/doc/</tt>" directory in the LLVM tree.</p>
|
||||
|
||||
@@ -679,7 +852,7 @@ lists</a>.</p>
|
||||
<a href="http://validator.w3.org/check/referer"><img
|
||||
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
|
||||
|
||||
<a href="http://llvm.org/">The LLVM Compiler Infrastructure</a><br>
|
||||
<a href="http://llvm.org/">LLVM Compiler Infrastructure</a><br>
|
||||
Last modified: $Date$
|
||||
</address>
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ time.</p>
|
||||
|
||||
<div class="doc_code"><pre>
|
||||
static char ID;
|
||||
Hello() : FunctionPass((intptr_t)&ID) {}
|
||||
Hello() : FunctionPass((intptr_t)&ID) {}
|
||||
</pre></div><p>
|
||||
|
||||
<p> This declares pass identifier used by LLVM to identify pass. This allows LLVM to
|
||||
@@ -312,7 +312,7 @@ argument "<tt>hello</tt>", and a name "<tt>Hello World Pass</tt>".</p>
|
||||
<b>struct Hello</b> : <b>public</b> <a href="#FunctionPass">FunctionPass</a> {
|
||||
|
||||
static char ID;
|
||||
Hello() : FunctionPass((intptr_t)&ID) {}
|
||||
Hello() : FunctionPass((intptr_t)&ID) {}
|
||||
|
||||
<b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &F) {
|
||||
llvm::cerr << "<i>Hello: </i>" << F.getName() << "\n";
|
||||
@@ -485,7 +485,7 @@ refering to function bodies in no predictable order, or adding and removing
|
||||
functions. Because nothing is known about the behavior of <tt>ModulePass</tt>
|
||||
subclasses, no optimization can be done for their execution. A module pass
|
||||
can use function level passes (e.g. dominators) using getAnalysis interface
|
||||
<tt> getAnalysis<DominatorTree>(Function)</tt>. </p>
|
||||
<tt> getAnalysis<DominatorTree>(Function)</tt>. </p>
|
||||
|
||||
<p>To write a correct <tt>ModulePass</tt> subclass, derive from
|
||||
<tt>ModulePass</tt> and overload the <tt>runOnModule</tt> method with the
|
||||
@@ -746,7 +746,7 @@ program, or false if they didn't. </p>
|
||||
<b>virtual bool</b> doInitialization(Loop *, LPPassManager &LPM);
|
||||
</pre></div>
|
||||
|
||||
The <tt>doInitialization</tt> method is designed to do simple initialization
|
||||
<p>The <tt>doInitialization</tt> method is designed to do simple initialization
|
||||
type of stuff that does not depend on the functions being processed. The
|
||||
<tt>doInitialization</tt> method call is not scheduled to overlap with any
|
||||
other pass executions (thus it should be very fast). LPPassManager
|
||||
@@ -1159,7 +1159,7 @@ For example:</p>
|
||||
}
|
||||
</pre></div>
|
||||
|
||||
In above example, runOnFunction for DominatorTree is called by pass manager
|
||||
<p>In above example, runOnFunction for DominatorTree is called by pass manager
|
||||
before returning a reference to the desired pass.</p>
|
||||
|
||||
<p>
|
||||
@@ -1797,6 +1797,8 @@ places (for global resources). Although this is a simple extension, we simply
|
||||
haven't had time (or multiprocessor machines, thus a reason) to implement this.
|
||||
Despite that, we have kept the LLVM passes SMP ready, and you should too.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
<hr>
|
||||
<address>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "llvm/Instruction.h"
|
||||
#include "llvm/SymbolTableListTraits.h"
|
||||
#include "llvm/ADT/ilist"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
|
||||
@@ -702,6 +702,10 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
|
||||
|
||||
// Misc.
|
||||
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
|
||||
def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
|
||||
Intrinsic<[llvm_void_ty, llvm_v8i8_ty, llvm_v8i8_ty, llvm_ptr_ty],
|
||||
[IntrWriteMem]>;
|
||||
|
||||
def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
|
||||
Intrinsic<[llvm_i32_ty, llvm_v8i8_ty], [IntrNoMem]>;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "llvm/Value.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
namespace llvm {
|
||||
template<typename ValueSubClass, typename ItemParentClass>
|
||||
|
||||
@@ -24,8 +24,15 @@
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
using namespace llvm;
|
||||
|
||||
BitcodeReader::~BitcodeReader() {
|
||||
void BitcodeReader::FreeState() {
|
||||
delete Buffer;
|
||||
Buffer = 0;
|
||||
std::vector<PATypeHolder>().swap(TypeList);
|
||||
ValueList.clear();
|
||||
std::vector<const ParamAttrsList*>().swap(ParamAttrs);
|
||||
std::vector<BasicBlock*>().swap(FunctionBBs);
|
||||
std::vector<Function*>().swap(FunctionsWithBodies);
|
||||
DeferredFunctionInfo.clear();
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -985,10 +992,10 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) {
|
||||
GlobalInits.push_back(std::make_pair(NewGV, InitID-1));
|
||||
break;
|
||||
}
|
||||
// FUNCTION: [type, callingconv, isproto, linkage, alignment, section,
|
||||
// visibility]
|
||||
// FUNCTION: [type, callingconv, isproto, linkage, paramattr,
|
||||
// alignment, section, visibility]
|
||||
case bitc::MODULE_CODE_FUNCTION: {
|
||||
if (Record.size() < 7)
|
||||
if (Record.size() < 8)
|
||||
return Error("Invalid MODULE_CODE_FUNCTION record");
|
||||
const Type *Ty = getTypeByID(Record[0]);
|
||||
if (!isa<PointerType>(Ty))
|
||||
@@ -1004,13 +1011,17 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) {
|
||||
Func->setCallingConv(Record[1]);
|
||||
bool isProto = Record[2];
|
||||
Func->setLinkage(GetDecodedLinkage(Record[3]));
|
||||
Func->setAlignment((1 << Record[4]) >> 1);
|
||||
if (Record[5]) {
|
||||
if (Record[5]-1 >= SectionTable.size())
|
||||
|
||||
assert(Func->getFunctionType()->getParamAttrs() ==
|
||||
getParamAttrs(Record[4]));
|
||||
|
||||
Func->setAlignment((1 << Record[5]) >> 1);
|
||||
if (Record[6]) {
|
||||
if (Record[6]-1 >= SectionTable.size())
|
||||
return Error("Invalid section ID");
|
||||
Func->setSection(SectionTable[Record[5]-1]);
|
||||
Func->setSection(SectionTable[Record[6]-1]);
|
||||
}
|
||||
Func->setVisibility(GetDecodedVisibility(Record[6]));
|
||||
Func->setVisibility(GetDecodedVisibility(Record[7]));
|
||||
|
||||
ValueList.push_back(Func);
|
||||
|
||||
@@ -1098,42 +1109,6 @@ bool BitcodeReader::ParseBitcode() {
|
||||
}
|
||||
|
||||
|
||||
bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
|
||||
// If it already is material, ignore the request.
|
||||
if (!F->hasNotBeenReadFromBytecode()) return false;
|
||||
|
||||
DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator DFII =
|
||||
DeferredFunctionInfo.find(F);
|
||||
assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
|
||||
|
||||
// Move the bit stream to the saved position of the deferred function body and
|
||||
// restore the real linkage type for the function.
|
||||
Stream.JumpToBit(DFII->second.first);
|
||||
F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
|
||||
DeferredFunctionInfo.erase(DFII);
|
||||
|
||||
if (ParseFunctionBody(F)) {
|
||||
if (ErrInfo) *ErrInfo = ErrorString;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
|
||||
DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator I =
|
||||
DeferredFunctionInfo.begin();
|
||||
while (!DeferredFunctionInfo.empty()) {
|
||||
Function *F = (*I++).first;
|
||||
assert(F->hasNotBeenReadFromBytecode() &&
|
||||
"Deserialized function found in map!");
|
||||
if (materializeFunction(F, ErrInfo))
|
||||
return 0;
|
||||
}
|
||||
return TheModule;
|
||||
}
|
||||
|
||||
|
||||
/// ParseFunctionBody - Lazily parse the specified function body block.
|
||||
bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
if (Stream.EnterSubBlock(bitc::FUNCTION_BLOCK_ID))
|
||||
@@ -1364,12 +1339,12 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
}
|
||||
|
||||
case bitc::FUNC_CODE_INST_INVOKE: { // INVOKE: [cc,fnty, op0,op1,op2, ...]
|
||||
if (Record.size() < 3) return Error("Invalid INVOKE record");
|
||||
unsigned CCInfo = Record[0];
|
||||
BasicBlock *NormalBB = getBasicBlock(Record[1]);
|
||||
BasicBlock *UnwindBB = getBasicBlock(Record[2]);
|
||||
if (Record.size() < 4) return Error("Invalid INVOKE record");
|
||||
unsigned CCInfo = Record[1];
|
||||
BasicBlock *NormalBB = getBasicBlock(Record[2]);
|
||||
BasicBlock *UnwindBB = getBasicBlock(Record[3]);
|
||||
|
||||
unsigned OpNum = 3;
|
||||
unsigned OpNum = 4;
|
||||
Value *Callee;
|
||||
if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
|
||||
return Error("Invalid INVOKE record");
|
||||
@@ -1383,6 +1358,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
Record.size() < OpNum+FTy->getNumParams())
|
||||
return Error("Invalid INVOKE record");
|
||||
|
||||
assert(FTy->getParamAttrs() == getParamAttrs(Record[0]));
|
||||
|
||||
SmallVector<Value*, 16> Ops;
|
||||
for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++OpNum) {
|
||||
Ops.push_back(getFnValueByID(Record[OpNum], FTy->getParamType(i)));
|
||||
@@ -1484,11 +1461,12 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
break;
|
||||
}
|
||||
case bitc::FUNC_CODE_INST_CALL: { // CALL: [cc, fnty, fnid, arg0, arg1...]
|
||||
if (Record.size() < 1)
|
||||
if (Record.size() < 2)
|
||||
return Error("Invalid CALL record");
|
||||
unsigned CCInfo = Record[0];
|
||||
|
||||
unsigned OpNum = 1;
|
||||
unsigned CCInfo = Record[1];
|
||||
|
||||
unsigned OpNum = 2;
|
||||
Value *Callee;
|
||||
if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
|
||||
return Error("Invalid CALL record");
|
||||
@@ -1499,6 +1477,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
if (!FTy || Record.size() < FTy->getNumParams()+OpNum)
|
||||
return Error("Invalid CALL record");
|
||||
|
||||
assert(FTy->getParamAttrs() == getParamAttrs(Record[0]));
|
||||
|
||||
SmallVector<Value*, 16> Args;
|
||||
// Read the fixed params.
|
||||
for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++OpNum) {
|
||||
@@ -1577,6 +1557,69 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ModuleProvider implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
|
||||
// If it already is material, ignore the request.
|
||||
if (!F->hasNotBeenReadFromBytecode()) return false;
|
||||
|
||||
DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator DFII =
|
||||
DeferredFunctionInfo.find(F);
|
||||
assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
|
||||
|
||||
// Move the bit stream to the saved position of the deferred function body and
|
||||
// restore the real linkage type for the function.
|
||||
Stream.JumpToBit(DFII->second.first);
|
||||
F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
|
||||
|
||||
if (ParseFunctionBody(F)) {
|
||||
if (ErrInfo) *ErrInfo = ErrorString;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void BitcodeReader::dematerializeFunction(Function *F) {
|
||||
// If this function isn't materialized, or if it is a proto, this is a noop.
|
||||
if (F->hasNotBeenReadFromBytecode() || F->isDeclaration())
|
||||
return;
|
||||
|
||||
assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
|
||||
|
||||
// Just forget the function body, we can remat it later.
|
||||
F->deleteBody();
|
||||
F->setLinkage(GlobalValue::GhostLinkage);
|
||||
}
|
||||
|
||||
|
||||
Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
|
||||
for (DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator I =
|
||||
DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E;
|
||||
++I) {
|
||||
Function *F = I->first;
|
||||
if (F->hasNotBeenReadFromBytecode() &&
|
||||
materializeFunction(F, ErrInfo))
|
||||
return 0;
|
||||
}
|
||||
return TheModule;
|
||||
}
|
||||
|
||||
|
||||
/// This method is provided by the parent ModuleProvde class and overriden
|
||||
/// here. It simply releases the module from its provided and frees up our
|
||||
/// state.
|
||||
/// @brief Release our hold on the generated module
|
||||
Module *BitcodeReader::releaseModule(std::string *ErrInfo) {
|
||||
// Since we're losing control of this Module, we must hand it back complete
|
||||
Module *M = ModuleProvider::releaseModule(ErrInfo);
|
||||
FreeState();
|
||||
return M;
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// External interface
|
||||
@@ -1606,12 +1649,18 @@ Module *llvm::ParseBitcodeFile(MemoryBuffer *Buffer, std::string *ErrMsg){
|
||||
R = static_cast<BitcodeReader*>(getBitcodeModuleProvider(Buffer, ErrMsg));
|
||||
if (!R) return 0;
|
||||
|
||||
// Read the whole module, get a pointer to it, tell ModuleProvider not to
|
||||
// delete it when its dtor is run.
|
||||
Module *M = R->releaseModule(ErrMsg);
|
||||
|
||||
// Don't let the BitcodeReader dtor delete 'Buffer'.
|
||||
// Read in the entire module.
|
||||
Module *M = R->materializeModule(ErrMsg);
|
||||
|
||||
// Don't let the BitcodeReader dtor delete 'Buffer', regardless of whether
|
||||
// there was an error.
|
||||
R->releaseMemoryBuffer();
|
||||
|
||||
// If there was no error, tell ModuleProvider not to delete it when its dtor
|
||||
// is run.
|
||||
if (M)
|
||||
M = R->releaseModule(ErrMsg);
|
||||
|
||||
delete R;
|
||||
return M;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,10 @@ public:
|
||||
++NumOperands;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
std::vector<Use>().swap(Uses);
|
||||
}
|
||||
|
||||
Value *operator[](unsigned i) const { return getOperand(i); }
|
||||
|
||||
Value *back() const { return Uses.back(); }
|
||||
@@ -111,8 +115,11 @@ public:
|
||||
BitcodeReader(MemoryBuffer *buffer) : Buffer(buffer), ErrorString(0) {
|
||||
HasReversedFunctionsWithBodies = false;
|
||||
}
|
||||
~BitcodeReader();
|
||||
~BitcodeReader() {
|
||||
FreeState();
|
||||
}
|
||||
|
||||
void FreeState();
|
||||
|
||||
/// releaseMemoryBuffer - This causes the reader to completely forget about
|
||||
/// the memory buffer it contains, which prevents the buffer from being
|
||||
@@ -123,7 +130,9 @@ public:
|
||||
|
||||
virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0);
|
||||
virtual Module *materializeModule(std::string *ErrInfo = 0);
|
||||
|
||||
virtual void dematerializeFunction(Function *F);
|
||||
virtual Module *releaseModule(std::string *ErrInfo = 0);
|
||||
|
||||
bool Error(const char *Str) {
|
||||
ErrorString = Str;
|
||||
return true;
|
||||
|
||||
@@ -386,6 +386,12 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
|
||||
Vals.push_back(F->getCallingConv());
|
||||
Vals.push_back(F->isDeclaration());
|
||||
Vals.push_back(getEncodedLinkage(F));
|
||||
|
||||
// Note: we emit the param attr ID number for the function type of this
|
||||
// function. In the future, we intend for attrs to be properties of
|
||||
// functions, instead of on the type. This is to support this future work.
|
||||
Vals.push_back(VE.getParamAttrID(F->getFunctionType()->getParamAttrs()));
|
||||
|
||||
Vals.push_back(Log2_32(F->getAlignment())+1);
|
||||
Vals.push_back(F->hasSection() ? SectionMap[F->getSection()] : 0);
|
||||
Vals.push_back(getEncodedVisibility(F));
|
||||
@@ -736,15 +742,21 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
|
||||
Vals.push_back(VE.getValueID(I.getOperand(i)));
|
||||
break;
|
||||
case Instruction::Invoke: {
|
||||
const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType());
|
||||
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
|
||||
Code = bitc::FUNC_CODE_INST_INVOKE;
|
||||
|
||||
// Note: we emit the param attr ID number for the function type of this
|
||||
// function. In the future, we intend for attrs to be properties of
|
||||
// functions, instead of on the type. This is to support this future work.
|
||||
Vals.push_back(VE.getParamAttrID(FTy->getParamAttrs()));
|
||||
|
||||
Vals.push_back(cast<InvokeInst>(I).getCallingConv());
|
||||
Vals.push_back(VE.getValueID(I.getOperand(1))); // normal dest
|
||||
Vals.push_back(VE.getValueID(I.getOperand(2))); // unwind dest
|
||||
PushValueAndType(I.getOperand(0), InstID, Vals, VE); // callee
|
||||
|
||||
// Emit value #'s for the fixed parameters.
|
||||
const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType());
|
||||
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
|
||||
for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
|
||||
Vals.push_back(VE.getValueID(I.getOperand(i+3))); // fixed param.
|
||||
|
||||
@@ -806,14 +818,21 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
|
||||
Vals.push_back(cast<StoreInst>(I).isVolatile());
|
||||
break;
|
||||
case Instruction::Call: {
|
||||
const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType());
|
||||
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
|
||||
|
||||
Code = bitc::FUNC_CODE_INST_CALL;
|
||||
|
||||
// Note: we emit the param attr ID number for the function type of this
|
||||
// function. In the future, we intend for attrs to be properties of
|
||||
// functions, instead of on the type. This is to support this future work.
|
||||
Vals.push_back(VE.getParamAttrID(FTy->getParamAttrs()));
|
||||
|
||||
Vals.push_back((cast<CallInst>(I).getCallingConv() << 1) |
|
||||
unsigned(cast<CallInst>(I).isTailCall()));
|
||||
PushValueAndType(I.getOperand(0), InstID, Vals, VE); // Callee
|
||||
|
||||
// Emit value #'s for the fixed parameters.
|
||||
const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType());
|
||||
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
|
||||
for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
|
||||
Vals.push_back(VE.getValueID(I.getOperand(i+1))); // fixed param.
|
||||
|
||||
|
||||
@@ -3422,8 +3422,8 @@ SDOperand DAGCombiner::visitSTORE(SDNode *N) {
|
||||
SDOperand Ptr = ST->getBasePtr();
|
||||
|
||||
// If this is a store of a bit convert, store the input value if the
|
||||
// resultant store does not need a higher alignment than the original.
|
||||
if (Value.getOpcode() == ISD::BIT_CONVERT) {
|
||||
// resultant store does not need a higher alignment than the original.
|
||||
if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore()) {
|
||||
unsigned Align = ST->getAlignment();
|
||||
MVT::ValueType SVT = Value.getOperand(0).getValueType();
|
||||
unsigned OrigAlign = TLI.getTargetMachine().getTargetData()->
|
||||
|
||||
@@ -1462,6 +1462,11 @@ bool SelectionDAGLowering::handleSmallSwitchRange(CaseRec& CR,
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool areJTsAllowed(const TargetLowering &TLI) {
|
||||
return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
|
||||
TLI.isOperationLegal(ISD::BRIND, MVT::Other));
|
||||
}
|
||||
|
||||
/// handleJTSwitchCase - Emit jumptable for current switch case range
|
||||
bool SelectionDAGLowering::handleJTSwitchCase(CaseRec& CR,
|
||||
CaseRecVector& WorkList,
|
||||
@@ -1478,9 +1483,7 @@ bool SelectionDAGLowering::handleJTSwitchCase(CaseRec& CR,
|
||||
I!=E; ++I)
|
||||
TSize += I->size();
|
||||
|
||||
if ((!TLI.isOperationLegal(ISD::BR_JT, MVT::Other) &&
|
||||
!TLI.isOperationLegal(ISD::BRIND, MVT::Other)) ||
|
||||
TSize <= 3)
|
||||
if (!areJTsAllowed(TLI) || TSize <= 3)
|
||||
return false;
|
||||
|
||||
double Density = (double)TSize / (double)((Last - First) + 1ULL);
|
||||
@@ -1622,8 +1625,12 @@ bool SelectionDAGLowering::handleBTSplitSwitchCase(CaseRec& CR,
|
||||
LSize += J->size();
|
||||
RSize -= J->size();
|
||||
}
|
||||
// If our case is dense we *really* should handle it earlier!
|
||||
assert((FMetric > 0) && "Should handle dense range earlier!");
|
||||
if (areJTsAllowed(TLI)) {
|
||||
// If our case is dense we *really* should handle it earlier!
|
||||
assert((FMetric > 0) && "Should handle dense range earlier!");
|
||||
} else {
|
||||
Pivot = CR.Range.first + Size/2;
|
||||
}
|
||||
|
||||
CaseRange LHSR(CR.Range.first, Pivot);
|
||||
CaseRange RHSR(Pivot, CR.Range.second);
|
||||
@@ -3441,7 +3448,8 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) {
|
||||
|
||||
// Add information to the INLINEASM node to know about this output.
|
||||
unsigned ResOpType = 4/*MEM*/ | (1 << 3);
|
||||
AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32));
|
||||
AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
|
||||
TLI.getPointerTy()));
|
||||
AsmNodeOperands.push_back(OpInfo.CallOperand);
|
||||
break;
|
||||
}
|
||||
@@ -3533,7 +3541,8 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) {
|
||||
|
||||
// Add information to the INLINEASM node to know about this input.
|
||||
unsigned ResOpType = 3 /*IMM*/ | (1 << 3);
|
||||
AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32));
|
||||
AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
|
||||
TLI.getPointerTy()));
|
||||
AsmNodeOperands.push_back(InOperandVal);
|
||||
break;
|
||||
} else if (OpInfo.ConstraintType == TargetLowering::C_Memory) {
|
||||
@@ -3543,7 +3552,8 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) {
|
||||
|
||||
// Add information to the INLINEASM node to know about this input.
|
||||
unsigned ResOpType = 4/*MEM*/ | (1 << 3);
|
||||
AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32));
|
||||
AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
|
||||
TLI.getPointerTy()));
|
||||
AsmNodeOperands.push_back(InOperandVal);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1199,6 +1199,12 @@ APInt APInt::shl(uint32_t shiftAmt) const {
|
||||
if (shiftAmt == BitWidth)
|
||||
return APInt(BitWidth, 0);
|
||||
|
||||
// If none of the bits are shifted out, the result is *this. This avoids a
|
||||
// lshr by the words size in the loop below which can produce incorrect
|
||||
// results. It also avoids the expensive computation below for a common case.
|
||||
if (shiftAmt == 0)
|
||||
return *this;
|
||||
|
||||
// Create some space for the result.
|
||||
uint64_t * val = new uint64_t[getNumWords()];
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ void MappedFile::unmap() {
|
||||
if (options_ & WRITE_ACCESS)
|
||||
::msync(base_, info_->Size, MS_SYNC);
|
||||
::munmap(base_, info_->Size);
|
||||
base_ = 0; // Mark this as non-mapped.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1398,6 +1398,11 @@ static void generateCompilerSpecificCode(std::ostream& Out) {
|
||||
<< "#define __ATTRIBUTE_DTOR__\n"
|
||||
<< "#define LLVM_ASM(X)\n"
|
||||
<< "#endif\n\n";
|
||||
|
||||
Out << "#if __GNUC__ < 4 /* Old GCC's, or compilers not GCC */ \n"
|
||||
<< "#define __builtin_stack_save() 0 /* not implemented */\n"
|
||||
<< "#define __builtin_stack_restore(X) /* noop */\n"
|
||||
<< "#endif\n\n";
|
||||
|
||||
// Output target-specific code that should be inserted into main.
|
||||
Out << "#define CODE_FOR_MAIN() /* Any target-specific code for main()*/\n";
|
||||
|
||||
@@ -3326,31 +3326,39 @@ isOperandValidForConstraint(SDOperand Op, char Letter, SelectionDAG &DAG) {
|
||||
case 'N':
|
||||
case 'O':
|
||||
case 'P': {
|
||||
if (!isa<ConstantSDNode>(Op)) return SDOperand(0,0);// Must be an immediate.
|
||||
unsigned Value = cast<ConstantSDNode>(Op)->getValue();
|
||||
ConstantSDNode *CST = dyn_cast<ConstantSDNode>(Op);
|
||||
if (!CST) return SDOperand(0, 0); // Must be an immediate to match.
|
||||
unsigned Value = CST->getValue();
|
||||
switch (Letter) {
|
||||
default: assert(0 && "Unknown constraint letter!");
|
||||
case 'I': // "I" is a signed 16-bit constant.
|
||||
if ((short)Value == (int)Value) return Op;
|
||||
if ((short)Value == (int)Value)
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
case 'J': // "J" is a constant with only the high-order 16 bits nonzero.
|
||||
case 'L': // "L" is a signed 16-bit constant shifted left 16 bits.
|
||||
if ((short)Value == 0) return Op;
|
||||
if ((short)Value == 0)
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
case 'K': // "K" is a constant with only the low-order 16 bits nonzero.
|
||||
if ((Value >> 16) == 0) return Op;
|
||||
if ((Value >> 16) == 0)
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
case 'M': // "M" is a constant that is greater than 31.
|
||||
if (Value > 31) return Op;
|
||||
if (Value > 31)
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
case 'N': // "N" is a positive constant that is an exact power of two.
|
||||
if ((int)Value > 0 && isPowerOf2_32(Value)) return Op;
|
||||
if ((int)Value > 0 && isPowerOf2_32(Value))
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
case 'O': // "O" is the constant zero.
|
||||
if (Value == 0) return Op;
|
||||
if (Value == 0)
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
case 'P': // "P" is a constant whose negation is a signed 16-bit constant.
|
||||
if ((short)-Value == (int)-Value) return Op;
|
||||
if ((short)-Value == (int)-Value)
|
||||
return DAG.getTargetConstant(Value, Op.getValueType());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -22,9 +22,9 @@ class GPR<bits<5> num, string n> : PPCReg<n> {
|
||||
}
|
||||
|
||||
// GP8 - One of the 32 64-bit general-purpose registers
|
||||
class GP8<GPR Alias> : PPCReg<Alias.Name> {
|
||||
field bits<5> Num = Alias.Num;
|
||||
let Aliases = [Alias];
|
||||
class GP8<GPR SubReg> : PPCReg<SubReg.Name> {
|
||||
field bits<5> Num = SubReg.Num;
|
||||
let SubRegs = [SubReg];
|
||||
}
|
||||
|
||||
// SPR - One of the 32-bit special-purpose registers
|
||||
|
||||
@@ -2675,7 +2675,8 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) {
|
||||
return Op;
|
||||
}
|
||||
|
||||
if (X86::isSHUFPMask(PermMask.Val))
|
||||
if (X86::isSHUFPMask(PermMask.Val) &&
|
||||
MVT::getSizeInBits(VT) != 64) // Don't do this for MMX.
|
||||
return Op;
|
||||
|
||||
// Handle v8i16 shuffle high / low shuffle node pair.
|
||||
@@ -2712,7 +2713,9 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) {
|
||||
}
|
||||
}
|
||||
|
||||
if (NumElems == 4) {
|
||||
if (NumElems == 4 &&
|
||||
// Don't do this for MMX.
|
||||
MVT::getSizeInBits(VT) != 64) {
|
||||
MVT::ValueType MaskVT = PermMask.getValueType();
|
||||
MVT::ValueType MaskEVT = MVT::getVectorBaseType(MaskVT);
|
||||
SmallVector<std::pair<int, int>, 8> Locs;
|
||||
@@ -4725,18 +4728,19 @@ isOperandValidForConstraint(SDOperand Op, char Constraint, SelectionDAG &DAG) {
|
||||
case 'I':
|
||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||
if (C->getValue() <= 31)
|
||||
return Op;
|
||||
return DAG.getTargetConstant(C->getValue(), Op.getValueType());
|
||||
}
|
||||
return SDOperand(0,0);
|
||||
case 'N':
|
||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||
if (C->getValue() <= 255)
|
||||
return Op;
|
||||
return DAG.getTargetConstant(C->getValue(), Op.getValueType());
|
||||
}
|
||||
return SDOperand(0,0);
|
||||
case 'i': {
|
||||
// Literal immediates are always ok.
|
||||
if (isa<ConstantSDNode>(Op)) return Op;
|
||||
if (ConstantSDNode *CST = dyn_cast<ConstantSDNode>(Op))
|
||||
return DAG.getTargetConstant(CST->getValue(), Op.getValueType());
|
||||
|
||||
// If we are in non-pic codegen mode, we allow the address of a global (with
|
||||
// an optional displacement) to be used with 'i'.
|
||||
|
||||
@@ -493,7 +493,9 @@ def MMX_PMOVMSKBrr : MMXI<0xD7, MRMSrcReg, (ops GR32:$dst, VR64:$src),
|
||||
|
||||
// Misc.
|
||||
def MMX_MASKMOVQ : MMXI<0xF7, MRMDestMem, (ops VR64:$src, VR64:$mask),
|
||||
"maskmovq {$mask, $src|$src, $mask}", []>;
|
||||
"maskmovq {$mask, $src|$src, $mask}",
|
||||
[(int_x86_mmx_maskmovq VR64:$src, VR64:$mask, EDI)]>,
|
||||
Imp<[EDI],[]>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Alias Instructions
|
||||
|
||||
@@ -623,7 +623,11 @@ static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV) {
|
||||
Loads.push_back(LI);
|
||||
Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV);
|
||||
} else {
|
||||
assert(isa<StoreInst>(*GUI) && "Only expect load and stores!");
|
||||
// If we get here we could have stores, selects, or phi nodes whose values
|
||||
// are loaded.
|
||||
assert((isa<StoreInst>(*GUI) || isa<PHINode>(*GUI) ||
|
||||
isa<SelectInst>(*GUI)) &&
|
||||
"Only expect load and stores!");
|
||||
}
|
||||
|
||||
if (Changed) {
|
||||
|
||||
@@ -389,8 +389,7 @@ static const Type *getPromotedType(const Type *Ty) {
|
||||
if (const IntegerType* ITy = dyn_cast<IntegerType>(Ty)) {
|
||||
if (ITy->getBitWidth() < 32)
|
||||
return Type::Int32Ty;
|
||||
} else if (Ty == Type::FloatTy)
|
||||
return Type::DoubleTy;
|
||||
}
|
||||
return Ty;
|
||||
}
|
||||
|
||||
@@ -6449,16 +6448,25 @@ Instruction *InstCombiner::commonPointerCastTransforms(CastInst &CI) {
|
||||
while (Offset) {
|
||||
if (const StructType *STy = dyn_cast<StructType>(GEPIdxTy)) {
|
||||
const StructLayout *SL = TD->getStructLayout(STy);
|
||||
unsigned Elt = SL->getElementContainingOffset(Offset);
|
||||
NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt));
|
||||
if (Offset < (int64_t)SL->getSizeInBytes()) {
|
||||
unsigned Elt = SL->getElementContainingOffset(Offset);
|
||||
NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt));
|
||||
|
||||
Offset -= SL->getElementOffset(Elt);
|
||||
GEPIdxTy = STy->getElementType(Elt);
|
||||
Offset -= SL->getElementOffset(Elt);
|
||||
GEPIdxTy = STy->getElementType(Elt);
|
||||
} else {
|
||||
// Otherwise, we can't index into this, bail out.
|
||||
Offset = 0;
|
||||
OrigBase = 0;
|
||||
}
|
||||
} else if (isa<ArrayType>(GEPIdxTy) || isa<VectorType>(GEPIdxTy)) {
|
||||
const SequentialType *STy = cast<SequentialType>(GEPIdxTy);
|
||||
uint64_t EltSize = TD->getTypeSize(STy->getElementType());
|
||||
NewIndices.push_back(ConstantInt::get(IntPtrTy, Offset/EltSize));
|
||||
Offset %= EltSize;
|
||||
if (uint64_t EltSize = TD->getTypeSize(STy->getElementType())) {
|
||||
NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
|
||||
Offset %= EltSize;
|
||||
} else {
|
||||
NewIndices.push_back(ConstantInt::get(IntPtrTy, 0));
|
||||
}
|
||||
GEPIdxTy = STy->getElementType();
|
||||
} else {
|
||||
// Otherwise, we can't index into this, bail out.
|
||||
@@ -7759,6 +7767,14 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
const FunctionType *FT = Callee->getFunctionType();
|
||||
const Type *OldRetTy = Caller->getType();
|
||||
|
||||
const FunctionType *ActualFT =
|
||||
cast<FunctionType>(cast<PointerType>(CE->getType())->getElementType());
|
||||
|
||||
// If the parameter attributes don't match up, don't do the xform. We don't
|
||||
// want to lose an sret attribute or something.
|
||||
if (FT->getParamAttrs() != ActualFT->getParamAttrs())
|
||||
return false;
|
||||
|
||||
// Check to see if we are changing the return type...
|
||||
if (OldRetTy != FT->getReturnType()) {
|
||||
if (Callee->isDeclaration() && !Caller->use_empty() &&
|
||||
|
||||
30
llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll
Normal file
30
llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll
Normal file
@@ -0,0 +1,30 @@
|
||||
; RUN: llvm-as < %s | llc -march=sparc
|
||||
|
||||
; We cannot emit jump tables on Sparc, but we should correctly handle this case.
|
||||
|
||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
|
||||
|
||||
define i32 @foo(i32 %f) {
|
||||
entry:
|
||||
switch i32 %f, label %bb14 [
|
||||
i32 0, label %UnifiedReturnBlock
|
||||
i32 1, label %bb4
|
||||
i32 2, label %bb7
|
||||
i32 3, label %bb10
|
||||
]
|
||||
|
||||
bb4: ; preds = %entry
|
||||
ret i32 2
|
||||
|
||||
bb7: ; preds = %entry
|
||||
ret i32 5
|
||||
|
||||
bb10: ; preds = %entry
|
||||
ret i32 9
|
||||
|
||||
bb14: ; preds = %entry
|
||||
ret i32 0
|
||||
|
||||
UnifiedReturnBlock: ; preds = %entry
|
||||
ret i32 1
|
||||
}
|
||||
@@ -1,795 +0,0 @@
|
||||
; RUN: llvm-as < %s | llvm-dis > %t1.ll
|
||||
; RUN: llvm-as < %s | llvm2cpp -gen-program -o %t2.cpp - -f
|
||||
; RUN: %link -o %t2.exe %t2.cpp -lLLVMCore -lLLVMSupport -lLLVMSystem -lstdc++
|
||||
; RUN: %t2.exe > %t2.ll
|
||||
; RUN: diff %t1.ll %t2.ll
|
||||
|
||||
@X = global i32 4, align 16 ; <i32*> [#uses=0]
|
||||
|
||||
define i32* @test1012() align 32 {
|
||||
%X = alloca i32, align 4 ; <i32*> [#uses=1]
|
||||
%Y = alloca i32, i32 42, align 16 ; <i32*> [#uses=0]
|
||||
%Z = alloca i32 ; <i32*> [#uses=0]
|
||||
ret i32* %X
|
||||
}
|
||||
|
||||
define i32* @test1013() {
|
||||
%X = malloc i32, align 4 ; <i32*> [#uses=1]
|
||||
%Y = malloc i32, i32 42, align 16 ; <i32*> [#uses=0]
|
||||
%Z = malloc i32 ; <i32*> [#uses=0]
|
||||
ret i32* %X
|
||||
}
|
||||
|
||||
define void @void(i32, i32) {
|
||||
add i32 0, 0 ; <i32>:3 [#uses=2]
|
||||
sub i32 0, 4 ; <i32>:4 [#uses=2]
|
||||
br label %5
|
||||
|
||||
; <label>:5 ; preds = %5, %2
|
||||
add i32 %0, %1 ; <i32>:6 [#uses=2]
|
||||
sub i32 %6, %4 ; <i32>:7 [#uses=1]
|
||||
icmp sle i32 %7, %3 ; <i1>:8 [#uses=1]
|
||||
br i1 %8, label %9, label %5
|
||||
|
||||
; <label>:9 ; preds = %5
|
||||
add i32 %0, %1 ; <i32>:10 [#uses=0]
|
||||
sub i32 %6, %4 ; <i32>:11 [#uses=1]
|
||||
icmp sle i32 %11, %3 ; <i1>:12 [#uses=0]
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @zarro() {
|
||||
Startup:
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define fastcc void @foo() {
|
||||
ret void
|
||||
}
|
||||
|
||||
define coldcc void @bar() {
|
||||
call fastcc void @foo( )
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @structret({ i8 }* sret %P) {
|
||||
call void @structret( { i8 }* %P sret )
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @foo4() {
|
||||
ret void
|
||||
}
|
||||
|
||||
define coldcc void @bar2() {
|
||||
call fastcc void @foo( )
|
||||
ret void
|
||||
}
|
||||
|
||||
define cc42 void @bar3() {
|
||||
invoke fastcc void @foo( )
|
||||
to label %Ok unwind label %U
|
||||
|
||||
Ok: ; preds = %0
|
||||
ret void
|
||||
|
||||
U: ; preds = %0
|
||||
unwind
|
||||
}
|
||||
|
||||
define void @bar4() {
|
||||
call cc42 void @bar( )
|
||||
invoke cc42 void @bar3( )
|
||||
to label %Ok unwind label %U
|
||||
|
||||
Ok: ; preds = %0
|
||||
ret void
|
||||
|
||||
U: ; preds = %0
|
||||
unwind
|
||||
}
|
||||
; ModuleID = 'calltest.ll'
|
||||
%FunTy = type i32 (i32)
|
||||
|
||||
define i32 @test1000(i32 %i0) {
|
||||
ret i32 %i0
|
||||
}
|
||||
|
||||
define void @invoke(%FunTy* %x) {
|
||||
%foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
|
||||
%foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0]
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %argc) {
|
||||
%retval = call i32 @test1000( i32 %argc ) ; <i32> [#uses=2]
|
||||
%two = add i32 %retval, %retval ; <i32> [#uses=1]
|
||||
%retval2 = invoke i32 @test1000( i32 %argc )
|
||||
to label %Next unwind label %Error ; <i32> [#uses=1]
|
||||
|
||||
Next: ; preds = %0
|
||||
%two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
|
||||
call void @invoke( %FunTy* @test1000 )
|
||||
ret i32 %two2
|
||||
|
||||
Error: ; preds = %0
|
||||
ret i32 -1
|
||||
}
|
||||
; ModuleID = 'casttest.ll'
|
||||
|
||||
define i16 @FunFunc(i64 %x, i8 %z) {
|
||||
bb0:
|
||||
%cast110 = sext i8 %z to i16 ; <i16> [#uses=1]
|
||||
%cast10 = trunc i64 %x to i16 ; <i16> [#uses=1]
|
||||
%reg109 = add i16 %cast110, %cast10 ; <i16> [#uses=1]
|
||||
ret i16 %reg109
|
||||
}
|
||||
; ModuleID = 'cfgstructures.ll'
|
||||
|
||||
define void @irreducible(i1 %cond) {
|
||||
br i1 %cond, label %X, label %Y
|
||||
|
||||
X: ; preds = %Y, %0
|
||||
br label %Y
|
||||
|
||||
Y: ; preds = %X, %0
|
||||
br label %X
|
||||
}
|
||||
|
||||
define void @sharedheader(i1 %cond) {
|
||||
br label %A
|
||||
|
||||
A: ; preds = %Y, %X, %0
|
||||
br i1 %cond, label %X, label %Y
|
||||
|
||||
X: ; preds = %A
|
||||
br label %A
|
||||
|
||||
Y: ; preds = %A
|
||||
br label %A
|
||||
}
|
||||
|
||||
define void @nested(i1 %cond1, i1 %cond2, i1 %cond3) {
|
||||
br label %Loop1
|
||||
|
||||
Loop1: ; preds = %L2Exit, %0
|
||||
br label %Loop2
|
||||
|
||||
Loop2: ; preds = %L3Exit, %Loop1
|
||||
br label %Loop3
|
||||
|
||||
Loop3: ; preds = %Loop3, %Loop2
|
||||
br i1 %cond3, label %Loop3, label %L3Exit
|
||||
|
||||
L3Exit: ; preds = %Loop3
|
||||
br i1 %cond2, label %Loop2, label %L2Exit
|
||||
|
||||
L2Exit: ; preds = %L3Exit
|
||||
br i1 %cond1, label %Loop1, label %L1Exit
|
||||
|
||||
L1Exit: ; preds = %L2Exit
|
||||
ret void
|
||||
}
|
||||
; ModuleID = 'constexpr.ll'
|
||||
%SAType = type { i32, { [2 x float], i64 } }
|
||||
%SType = type { i32, { float, { i8 } }, i64 }
|
||||
global i64 1 ; <i64*>:0 [#uses=0]
|
||||
global i64 74514 ; <i64*>:1 [#uses=0]
|
||||
@t2 = global i32* @t1 ; <i32**> [#uses=0]
|
||||
@t3 = global i32* @t1 ; <i32**> [#uses=2]
|
||||
@t1 = global i32 4 ; <i32*> [#uses=2]
|
||||
@t4 = global i32** @t3 ; <i32***> [#uses=1]
|
||||
@t5 = global i32** @t3 ; <i32***> [#uses=0]
|
||||
@t6 = global i32*** @t4 ; <i32****> [#uses=0]
|
||||
@t7 = global float* inttoptr (i32 12345678 to float*) ; <float**> [#uses=0]
|
||||
@t9 = global i32 8 ; <i32*> [#uses=0]
|
||||
global i32* bitcast (float* @4 to i32*) ; <i32**>:2 [#uses=0]
|
||||
global float* @4 ; <float**>:3 [#uses=0]
|
||||
global float 0.000000e+00 ; <float*>:4 [#uses=2]
|
||||
@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
|
||||
@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; <i32**> [#uses=1]
|
||||
@arrayPtr5 = global i32** getelementptr (i32** @arrayPtr, i64 5) ; <i32***> [#uses=0]
|
||||
@somestr = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=2]
|
||||
@char5 = global i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 5) ; <i8**> [#uses=0]
|
||||
@char8a = global i32* bitcast (i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 8) to i32*) ; <i32**> [#uses=0]
|
||||
@char8b = global i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 8) ; <i8**> [#uses=0]
|
||||
@S1 = global %SType* null ; <%SType**> [#uses=1]
|
||||
@S2c = constant %SType {
|
||||
i32 1,
|
||||
{ float, { i8 } } { float 2.000000e+00, { i8 } { i8 3 } },
|
||||
i64 4 } ; <%SType*> [#uses=3]
|
||||
@S3c = constant %SAType { i32 1, { [2 x float], i64 } { [2 x float] [ float 2.000000e+00, float 3.000000e+00 ], i64 4 } } ; <%SAType*> [#uses=1]
|
||||
@S1ptr = global %SType** @S1 ; <%SType***> [#uses=0]
|
||||
@S2 = global %SType* @S2c ; <%SType**> [#uses=0]
|
||||
@S3 = global %SAType* @S3c ; <%SAType**> [#uses=0]
|
||||
@S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ; <float**> [#uses=0]
|
||||
@S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ; <float**> [#uses=1]
|
||||
@S1fld1bptr = global float** @S1fld1b ; <float***> [#uses=0]
|
||||
@S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0) ; <i8**> [#uses=0]
|
||||
|
||||
; ModuleID = 'constpointer.ll'
|
||||
@cpt3 = global i32* @cpt1 ; <i32**> [#uses=1]
|
||||
@cpt1 = global i32 4 ; <i32*> [#uses=2]
|
||||
@cpt4 = global i32** @cpt3 ; <i32***> [#uses=0]
|
||||
@cpt2 = global i32* @cpt1 ; <i32**> [#uses=0]
|
||||
global float* @7 ; <float**>:0 [#uses=0]
|
||||
global float* @7 ; <float**>:1 [#uses=0]
|
||||
global float 0.000000e+00 ; <float*>:2 [#uses=3]
|
||||
global float* @7 ; <float**>:3 [#uses=0]
|
||||
@fptr = global void ()* @f ; <void ()**> [#uses=0]
|
||||
@sptr1 = global [11 x i8]* @somestr ; <[11 x i8]**> [#uses=0]
|
||||
@somestr2 = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=2]
|
||||
@sptr2 = global [11 x i8]* @somestr2 ; <[11 x i8]**> [#uses=0]
|
||||
|
||||
declare void @f()
|
||||
; ModuleID = 'escaped_label.ll'
|
||||
|
||||
define i32 @foo3() {
|
||||
br label "foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?"
|
||||
|
||||
"foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?": ; preds = %0
|
||||
ret i32 17
|
||||
}
|
||||
; ModuleID = 'float.ll'
|
||||
@F1 = global float 4.000000e+00 ; <float*> [#uses=0]
|
||||
@D1 = global double 4.000000e+00 ; <double*> [#uses=0]
|
||||
; ModuleID = 'fold-fpcast.ll'
|
||||
|
||||
define i32 @test1() {
|
||||
ret i32 1080872141
|
||||
}
|
||||
|
||||
define float @test1002() {
|
||||
ret float 0x36E1000000000000
|
||||
}
|
||||
|
||||
define i64 @test3() {
|
||||
ret i64 4614256656431372362
|
||||
}
|
||||
|
||||
define double @test4() {
|
||||
ret double 2.075076e-322
|
||||
}
|
||||
; ModuleID = 'forwardreftest.ll'
|
||||
%myfn = type float (i32, double, i32, i16)
|
||||
%myty = type i32
|
||||
%thisfuncty = type i32 (i32)*
|
||||
|
||||
declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
|
||||
|
||||
define i32 @zarro2(i32 %Func) {
|
||||
Startup:
|
||||
add i32 0, 10 ; <i32>:0 [#uses=0]
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @test1004(i32) {
|
||||
call void @F( %thisfuncty @zarro2, %thisfuncty @test1004, %thisfuncty @foozball )
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @foozball(i32) {
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
; ModuleID = 'globalredefinition.ll'
|
||||
@A = global i32* @B ; <i32**> [#uses=0]
|
||||
@B = global i32 7 ; <i32*> [#uses=1]
|
||||
|
||||
define void @X() {
|
||||
ret void
|
||||
}
|
||||
; ModuleID = 'global_section.ll'
|
||||
@GlobSec = global i32 4, section "foo", align 16
|
||||
|
||||
define void @test1005() section "bar" {
|
||||
ret void
|
||||
}
|
||||
|
||||
; ModuleID = 'globalvars.ll'
|
||||
@MyVar = external global i32 ; <i32*> [#uses=1]
|
||||
@MyIntList = external global { \2*, i32 } ; <{ \2*, i32 }*> [#uses=1]
|
||||
external global i32 ; <i32*>:0 [#uses=0]
|
||||
@AConst = constant i32 123 ; <i32*> [#uses=0]
|
||||
@AString = constant [4 x i8] c"test" ; <[4 x i8]*> [#uses=0]
|
||||
@ZeroInit = global { [100 x i32], [40 x float] } zeroinitializer ; <{ [100 x i32], [40 x float] }*> [#uses=0]
|
||||
|
||||
define i32 @foo10015(i32 %blah) {
|
||||
store i32 5, i32* @MyVar
|
||||
%idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=1]
|
||||
store i32 12, i32* %idx
|
||||
ret i32 %blah
|
||||
}
|
||||
; ModuleID = 'indirectcall2.ll'
|
||||
|
||||
define i64 @test1006(i64 %X) {
|
||||
ret i64 %X
|
||||
}
|
||||
|
||||
define i64 @fib(i64 %n) {
|
||||
; <label>:0
|
||||
%T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
|
||||
br i1 %T, label %BaseCase, label %RecurseCase
|
||||
|
||||
RecurseCase: ; preds = %0
|
||||
%result = call i64 @test1006( i64 %n ) ; <i64> [#uses=0]
|
||||
br label %BaseCase
|
||||
|
||||
BaseCase: ; preds = %RecurseCase, %0
|
||||
%X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
|
||||
ret i64 %X
|
||||
}
|
||||
; ModuleID = 'indirectcall.ll'
|
||||
|
||||
declare i32 @atoi(i8*)
|
||||
|
||||
define i64 @fibonacc(i64 %n) {
|
||||
icmp ult i64 %n, 2 ; <i1>:1 [#uses=1]
|
||||
br i1 %1, label %BaseCase, label %RecurseCase
|
||||
|
||||
BaseCase: ; preds = %0
|
||||
ret i64 1
|
||||
|
||||
RecurseCase: ; preds = %0
|
||||
%n2 = sub i64 %n, 2 ; <i64> [#uses=1]
|
||||
%n1 = sub i64 %n, 1 ; <i64> [#uses=1]
|
||||
%f2 = call i64 @fibonacc( i64 %n2 ) ; <i64> [#uses=1]
|
||||
%f1 = call i64 @fibonacc( i64 %n1 ) ; <i64> [#uses=1]
|
||||
%result = add i64 %f2, %f1 ; <i64> [#uses=1]
|
||||
ret i64 %result
|
||||
}
|
||||
|
||||
define i64 @realmain(i32 %argc, i8** %argv) {
|
||||
; <label>:0
|
||||
icmp eq i32 %argc, 2 ; <i1>:1 [#uses=1]
|
||||
br i1 %1, label %HasArg, label %Continue
|
||||
|
||||
HasArg: ; preds = %0
|
||||
%n1 = add i32 1, 1 ; <i32> [#uses=1]
|
||||
br label %Continue
|
||||
|
||||
Continue: ; preds = %HasArg, %0
|
||||
%n = phi i32 [ %n1, %HasArg ], [ 1, %0 ] ; <i32> [#uses=1]
|
||||
%N = sext i32 %n to i64 ; <i64> [#uses=1]
|
||||
%F = call i64 @fib( i64 %N ) ; <i64> [#uses=1]
|
||||
ret i64 %F
|
||||
}
|
||||
|
||||
define i64 @trampoline(i64 %n, i64 (i64)* %fibfunc) {
|
||||
%F = call i64 %fibfunc( i64 %n ) ; <i64> [#uses=1]
|
||||
ret i64 %F
|
||||
}
|
||||
|
||||
define i32 @main2() {
|
||||
%Result = call i64 @trampoline( i64 10, i64 (i64)* @fib ) ; <i64> [#uses=1]
|
||||
%Result.upgrd.1 = trunc i64 %Result to i32 ; <i32> [#uses=1]
|
||||
ret i32 %Result.upgrd.1
|
||||
}
|
||||
; ModuleID = 'inlineasm.ll'
|
||||
module asm "this is an inline asm block"
|
||||
module asm "this is another inline asm block"
|
||||
|
||||
define i32 @test1007() {
|
||||
%X = call i32 asm "tricky here $0, $1", "=r,r"( i32 4 ) ; <i32> [#uses=1]
|
||||
call void asm sideeffect "eieio", ""( )
|
||||
ret i32 %X
|
||||
}
|
||||
; ModuleID = 'instructions.ll'
|
||||
|
||||
define i32 @test_extractelement(<4 x i32> %V) {
|
||||
%R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1]
|
||||
ret i32 %R
|
||||
}
|
||||
|
||||
define <4 x i32> @test_insertelement(<4 x i32> %V) {
|
||||
%R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1]
|
||||
ret <4 x i32> %R
|
||||
}
|
||||
|
||||
define <4 x i32> @test_shufflevector_u(<4 x i32> %V) {
|
||||
%R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1]
|
||||
ret <4 x i32> %R
|
||||
}
|
||||
|
||||
define <4 x float> @test_shufflevector_f(<4 x float> %V) {
|
||||
%R = shufflevector <4 x float> %V, <4 x float> undef, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x float>> [#uses=1]
|
||||
ret <4 x float> %R
|
||||
}
|
||||
; ModuleID = 'intrinsics.ll'
|
||||
|
||||
declare i1 @llvm.isunordered.f32(float, float)
|
||||
|
||||
declare i1 @llvm.isunordered.f64(double, double)
|
||||
|
||||
declare void @llvm.prefetch(i8*, i32, i32)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctpop.i8(i8)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctpop.i16(i16)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctpop.i32(i32)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctpop.i64(i64)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.cttz.i8(i8)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.cttz.i16(i16)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.cttz.i32(i32)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.cttz.i64(i64)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctlz.i8(i8)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctlz.i16(i16)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctlz.i32(i32)
|
||||
|
||||
declare i32 @upgrd.rm.llvm.ctlz.i64(i64)
|
||||
|
||||
declare float @llvm.sqrt.f32(float)
|
||||
|
||||
declare double @llvm.sqrt.f64(double)
|
||||
|
||||
define void @libm() {
|
||||
fcmp uno float 1.000000e+00, 2.000000e+00 ; <i1>:1 [#uses=0]
|
||||
fcmp uno double 3.000000e+00, 4.000000e+00 ; <i1>:2 [#uses=0]
|
||||
call void @llvm.prefetch( i8* null, i32 1, i32 3 )
|
||||
call float @llvm.sqrt.f32( float 5.000000e+00 ) ; <float>:3 [#uses=0]
|
||||
call double @llvm.sqrt.f64( double 6.000000e+00 ) ; <double>:4 [#uses=0]
|
||||
call i32 @llvm.ctpop.i8( i8 10 ) ; <i32>:5 [#uses=1]
|
||||
bitcast i32 %5 to i32 ; <i32>:6 [#uses=0]
|
||||
call i32 @llvm.ctpop.i16( i16 11 ) ; <i32>:7 [#uses=1]
|
||||
bitcast i32 %7 to i32 ; <i32>:8 [#uses=0]
|
||||
call i32 @llvm.ctpop.i32( i32 12 ) ; <i32>:9 [#uses=1]
|
||||
bitcast i32 %9 to i32 ; <i32>:10 [#uses=0]
|
||||
call i32 @llvm.ctpop.i64( i64 13 ) ; <i32>:11 [#uses=1]
|
||||
bitcast i32 %11 to i32 ; <i32>:12 [#uses=0]
|
||||
call i32 @llvm.ctlz.i8( i8 14 ) ; <i32>:13 [#uses=1]
|
||||
bitcast i32 %13 to i32 ; <i32>:14 [#uses=0]
|
||||
call i32 @llvm.ctlz.i16( i16 15 ) ; <i32>:15 [#uses=1]
|
||||
bitcast i32 %15 to i32 ; <i32>:16 [#uses=0]
|
||||
call i32 @llvm.ctlz.i32( i32 16 ) ; <i32>:17 [#uses=1]
|
||||
bitcast i32 %17 to i32 ; <i32>:18 [#uses=0]
|
||||
call i32 @llvm.ctlz.i64( i64 17 ) ; <i32>:19 [#uses=1]
|
||||
bitcast i32 %19 to i32 ; <i32>:20 [#uses=0]
|
||||
call i32 @llvm.cttz.i8( i8 18 ) ; <i32>:21 [#uses=1]
|
||||
bitcast i32 %21 to i32 ; <i32>:22 [#uses=0]
|
||||
call i32 @llvm.cttz.i16( i16 19 ) ; <i32>:23 [#uses=1]
|
||||
bitcast i32 %23 to i32 ; <i32>:24 [#uses=0]
|
||||
call i32 @llvm.cttz.i32( i32 20 ) ; <i32>:25 [#uses=1]
|
||||
bitcast i32 %25 to i32 ; <i32>:26 [#uses=0]
|
||||
call i32 @llvm.cttz.i64( i64 21 ) ; <i32>:27 [#uses=1]
|
||||
bitcast i32 %27 to i32 ; <i32>:28 [#uses=0]
|
||||
ret void
|
||||
}
|
||||
|
||||
declare i32 @llvm.ctpop.i8(i8)
|
||||
|
||||
declare i32 @llvm.ctpop.i16(i16)
|
||||
|
||||
declare i32 @llvm.ctpop.i32(i32)
|
||||
|
||||
declare i32 @llvm.ctpop.i64(i64)
|
||||
|
||||
declare i32 @llvm.ctlz.i8(i8)
|
||||
|
||||
declare i32 @llvm.ctlz.i16(i16)
|
||||
|
||||
declare i32 @llvm.ctlz.i32(i32)
|
||||
|
||||
declare i32 @llvm.ctlz.i64(i64)
|
||||
|
||||
declare i32 @llvm.cttz.i8(i8)
|
||||
|
||||
declare i32 @llvm.cttz.i16(i16)
|
||||
|
||||
declare i32 @llvm.cttz.i32(i32)
|
||||
|
||||
declare i32 @llvm.cttz.i64(i64)
|
||||
|
||||
; ModuleID = 'packed.ll'
|
||||
@foo1 = external global <4 x float> ; <<4 x float>*> [#uses=2]
|
||||
@foo102 = external global <2 x i32> ; <<2 x i32>*> [#uses=2]
|
||||
|
||||
define void @main3() {
|
||||
store <4 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >, <4 x float>* @foo1
|
||||
store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo102
|
||||
%l1 = load <4 x float>* @foo1 ; <<4 x float>> [#uses=0]
|
||||
%l2 = load <2 x i32>* @foo102 ; <<2 x i32>> [#uses=0]
|
||||
ret void
|
||||
}
|
||||
|
||||
; ModuleID = 'properties.ll'
|
||||
target datalayout = "e-p:32:32"
|
||||
target triple = "proc-vend-sys"
|
||||
deplibs = [ "m", "c" ]
|
||||
; ModuleID = 'prototype.ll'
|
||||
|
||||
declare i32 @bar1017(i32 %in)
|
||||
|
||||
define i32 @foo1016(i32 %blah) {
|
||||
%xx = call i32 @bar1017( i32 %blah ) ; <i32> [#uses=1]
|
||||
ret i32 %xx
|
||||
}
|
||||
|
||||
; ModuleID = 'recursivetype.ll'
|
||||
%list = type { %list*, i32 }
|
||||
|
||||
declare i8* @malloc(i32)
|
||||
|
||||
define void @InsertIntoListTail(%list** %L, i32 %Data) {
|
||||
bb1:
|
||||
%reg116 = load %list** %L ; <%list*> [#uses=1]
|
||||
%cast1004 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
|
||||
%cond1000 = icmp eq %list* %reg116, %cast1004 ; <i1> [#uses=1]
|
||||
br i1 %cond1000, label %bb3, label %bb2
|
||||
|
||||
bb2: ; preds = %bb2, %bb1
|
||||
%reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
|
||||
%cast1010 = bitcast %list** %reg117 to %list*** ; <%list***> [#uses=1]
|
||||
%reg118 = load %list*** %cast1010 ; <%list**> [#uses=3]
|
||||
%reg109 = load %list** %reg118 ; <%list*> [#uses=1]
|
||||
%cast1005 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
|
||||
%cond1001 = icmp ne %list* %reg109, %cast1005 ; <i1> [#uses=1]
|
||||
br i1 %cond1001, label %bb2, label %bb3
|
||||
|
||||
bb3: ; preds = %bb2, %bb1
|
||||
%reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
|
||||
%cast1006 = bitcast %list** %reg119 to i8** ; <i8**> [#uses=1]
|
||||
%reg111 = call i8* @malloc( i32 16 ) ; <i8*> [#uses=3]
|
||||
store i8* %reg111, i8** %cast1006
|
||||
%reg111.upgrd.1 = ptrtoint i8* %reg111 to i64 ; <i64> [#uses=1]
|
||||
%reg1002 = add i64 %reg111.upgrd.1, 8 ; <i64> [#uses=1]
|
||||
%reg1002.upgrd.2 = inttoptr i64 %reg1002 to i8* ; <i8*> [#uses=1]
|
||||
%cast1008 = bitcast i8* %reg1002.upgrd.2 to i32* ; <i32*> [#uses=1]
|
||||
store i32 %Data, i32* %cast1008
|
||||
%cast1003 = inttoptr i64 0 to i64* ; <i64*> [#uses=1]
|
||||
%cast1009 = bitcast i8* %reg111 to i64** ; <i64**> [#uses=1]
|
||||
store i64* %cast1003, i64** %cast1009
|
||||
ret void
|
||||
}
|
||||
|
||||
define %list* @FindData(%list* %L, i32 %Data) {
|
||||
bb1:
|
||||
br label %bb2
|
||||
|
||||
bb2: ; preds = %bb6, %bb1
|
||||
%reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ; <%list*> [#uses=4]
|
||||
%cast1014 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
|
||||
%cond1011 = icmp ne %list* %reg115, %cast1014 ; <i1> [#uses=1]
|
||||
br i1 %cond1011, label %bb4, label %bb3
|
||||
|
||||
bb3: ; preds = %bb2
|
||||
ret %list* null
|
||||
|
||||
bb4: ; preds = %bb2
|
||||
%idx = getelementptr %list* %reg115, i64 0, i32 1 ; <i32*> [#uses=1]
|
||||
%reg111 = load i32* %idx ; <i32> [#uses=1]
|
||||
%cond1013 = icmp ne i32 %reg111, %Data ; <i1> [#uses=1]
|
||||
br i1 %cond1013, label %bb6, label %bb5
|
||||
|
||||
bb5: ; preds = %bb4
|
||||
ret %list* %reg115
|
||||
|
||||
bb6: ; preds = %bb4
|
||||
%idx2 = getelementptr %list* %reg115, i64 0, i32 0 ; <%list**> [#uses=1]
|
||||
%reg116 = load %list** %idx2 ; <%list*> [#uses=1]
|
||||
br label %bb2
|
||||
}
|
||||
; ModuleID = 'simplecalltest.ll'
|
||||
%FunTy = type i32 (i32)
|
||||
|
||||
define void @invoke1019(%FunTy* %x) {
|
||||
%foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main4(i32 %argc, i8** %argv, i8** %envp) {
|
||||
%retval = call i32 @test1008( i32 %argc ) ; <i32> [#uses=2]
|
||||
%two = add i32 %retval, %retval ; <i32> [#uses=1]
|
||||
%retval2 = call i32 @test1008( i32 %argc ) ; <i32> [#uses=1]
|
||||
%two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
|
||||
call void @invoke1019( %FunTy* @test1008 )
|
||||
ret i32 %two2
|
||||
}
|
||||
|
||||
define i32 @test1008(i32 %i0) {
|
||||
ret i32 %i0
|
||||
}
|
||||
; ModuleID = 'smallest.ll'
|
||||
; ModuleID = 'small.ll'
|
||||
%x = type i32
|
||||
|
||||
define i32 @foo1020(i32 %in) {
|
||||
label:
|
||||
ret i32 2
|
||||
}
|
||||
; ModuleID = 'testalloca.ll'
|
||||
%inners = type { float, { i8 } }
|
||||
%struct = type { i32, %inners, i64 }
|
||||
|
||||
define i32 @testfunction(i32 %i0, i32 %j0) {
|
||||
alloca i8, i32 5 ; <i8*>:1 [#uses=0]
|
||||
%ptr = alloca i32 ; <i32*> [#uses=2]
|
||||
store i32 3, i32* %ptr
|
||||
%val = load i32* %ptr ; <i32> [#uses=0]
|
||||
%sptr = alloca %struct ; <%struct*> [#uses=2]
|
||||
%nsptr = getelementptr %struct* %sptr, i64 0, i32 1 ; <%inners*> [#uses=1]
|
||||
%ubsptr = getelementptr %inners* %nsptr, i64 0, i32 1 ; <{ i8 }*> [#uses=1]
|
||||
%idx = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
|
||||
store i8 4, i8* %idx
|
||||
%fptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 0 ; <float*> [#uses=1]
|
||||
store float 4.000000e+00, float* %fptr
|
||||
ret i32 3
|
||||
}
|
||||
; ModuleID = 'testconstants.ll'
|
||||
@somestr3 = constant [11 x i8] c"hello world"
|
||||
@array99 = constant [2 x i32] [ i32 12, i32 52 ]
|
||||
constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0]
|
||||
|
||||
define [2 x i32]* @testfunction99(i32 %i0, i32 %j0) {
|
||||
ret [2 x i32]* @array
|
||||
}
|
||||
|
||||
define i8* @otherfunc(i32, double) {
|
||||
%somestr = getelementptr [11 x i8]* @somestr3, i64 0, i64 0 ; <i8*> [#uses=1]
|
||||
ret i8* %somestr
|
||||
}
|
||||
|
||||
define i8* @yetanotherfunc(i32, double) {
|
||||
ret i8* null
|
||||
}
|
||||
|
||||
define i32 @negativeUnsigned() {
|
||||
ret i32 -1
|
||||
}
|
||||
|
||||
define i32 @largeSigned() {
|
||||
ret i32 -394967296
|
||||
}
|
||||
; ModuleID = 'testlogical.ll'
|
||||
|
||||
define i32 @simpleAdd(i32 %i0, i32 %j0) {
|
||||
%t1 = xor i32 %i0, %j0 ; <i32> [#uses=1]
|
||||
%t2 = or i32 %i0, %j0 ; <i32> [#uses=1]
|
||||
%t3 = and i32 %t1, %t2 ; <i32> [#uses=1]
|
||||
ret i32 %t3
|
||||
}
|
||||
; ModuleID = 'testmemory.ll'
|
||||
%complexty = type { i32, { [4 x i8*], float }, double }
|
||||
%struct = type { i32, { float, { i8 } }, i64 }
|
||||
|
||||
define i32 @main6() {
|
||||
call i32 @testfunction98( i64 0, i64 1 )
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @testfunction98(i64 %i0, i64 %j0) {
|
||||
%array0 = malloc [4 x i8] ; <[4 x i8]*> [#uses=2]
|
||||
%size = add i32 2, 2 ; <i32> [#uses=1]
|
||||
%array1 = malloc i8, i32 4 ; <i8*> [#uses=1]
|
||||
%array2 = malloc i8, i32 %size ; <i8*> [#uses=1]
|
||||
%idx = getelementptr [4 x i8]* %array0, i64 0, i64 2 ; <i8*> [#uses=1]
|
||||
store i8 123, i8* %idx
|
||||
free [4 x i8]* %array0
|
||||
free i8* %array1
|
||||
free i8* %array2
|
||||
%aa = alloca %complexty, i32 5 ; <%complexty*> [#uses=1]
|
||||
%idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0 ; <i8**> [#uses=1]
|
||||
store i8* null, i8** %idx2
|
||||
%ptr = alloca i32 ; <i32*> [#uses=2]
|
||||
store i32 3, i32* %ptr
|
||||
%val = load i32* %ptr ; <i32> [#uses=0]
|
||||
%sptr = alloca %struct ; <%struct*> [#uses=1]
|
||||
%ubsptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 1 ; <{ i8 }*> [#uses=1]
|
||||
%idx3 = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
|
||||
store i8 4, i8* %idx3
|
||||
ret i32 3
|
||||
}
|
||||
; ModuleID = 'testswitch.ll'
|
||||
%int = type i32
|
||||
|
||||
define i32 @squared(i32 %i0) {
|
||||
switch i32 %i0, label %Default [
|
||||
i32 1, label %Case1
|
||||
i32 2, label %Case2
|
||||
i32 4, label %Case4
|
||||
]
|
||||
|
||||
Default: ; preds = %0
|
||||
ret i32 -1
|
||||
|
||||
Case1: ; preds = %0
|
||||
ret i32 1
|
||||
|
||||
Case2: ; preds = %0
|
||||
ret i32 4
|
||||
|
||||
Case4: ; preds = %0
|
||||
ret i32 16
|
||||
}
|
||||
; ModuleID = 'testvarargs.ll'
|
||||
|
||||
declare i32 @printf(i8*, ...)
|
||||
|
||||
define i32 @testvarar() {
|
||||
call i32 (i8*, ...)* @printf( i8* null, i32 12, i8 42 ) ; <i32>:1 [#uses=1]
|
||||
ret i32 %1
|
||||
}
|
||||
; ModuleID = 'undefined.ll'
|
||||
@X2 = global i32 undef ; <i32*> [#uses=0]
|
||||
|
||||
declare i32 @atoi(i8*)
|
||||
|
||||
define i32 @test1009() {
|
||||
ret i32 undef
|
||||
}
|
||||
|
||||
define i32 @test1003() {
|
||||
%X = add i32 undef, 1 ; <i32> [#uses=1]
|
||||
ret i32 %X
|
||||
}
|
||||
; ModuleID = 'unreachable.ll'
|
||||
|
||||
declare void @bar()
|
||||
|
||||
define i32 @foo1021() {
|
||||
unreachable
|
||||
}
|
||||
|
||||
define double @xyz() {
|
||||
call void @bar( )
|
||||
unreachable
|
||||
}
|
||||
; ModuleID = 'varargs.ll'
|
||||
|
||||
declare void @llvm.va_start(i8* %ap)
|
||||
|
||||
declare void @llvm.va_copy(i8* %aq, i8* %ap)
|
||||
|
||||
declare void @llvm.va_end(i8* %ap)
|
||||
|
||||
define i32 @test1010(i32 %X, ...) {
|
||||
%ap = alloca i8* ; <i8**> [#uses=4]
|
||||
%va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_start( i8* %va.upgrd.1 )
|
||||
%tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
|
||||
%aq = alloca i8* ; <i8**> [#uses=2]
|
||||
%va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
|
||||
%va1.upgrd.3 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
|
||||
%va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_end( i8* %va.upgrd.4 )
|
||||
%va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_end( i8* %va.upgrd.5 )
|
||||
ret i32 %tmp
|
||||
}
|
||||
; ModuleID = 'varargs_new.ll'
|
||||
|
||||
declare void @llvm.va_start(i8*)
|
||||
|
||||
declare void @llvm.va_copy(i8*, i8*)
|
||||
|
||||
declare void @llvm.va_end(i8*)
|
||||
|
||||
define i32 @test1011(i32 %X, ...) {
|
||||
%ap = alloca i8* ; <i8**> [#uses=4]
|
||||
%aq = alloca i8* ; <i8**> [#uses=2]
|
||||
%va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_start( i8* %va.upgrd.1 )
|
||||
%tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
|
||||
%apv = load i8** %ap ; <i8*> [#uses=1]
|
||||
%va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
|
||||
%va1.upgrd.3 = bitcast i8* %apv to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
|
||||
%va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_end( i8* %va.upgrd.4 )
|
||||
%va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
|
||||
call void @llvm.va_end( i8* %va.upgrd.5 )
|
||||
ret i32 %tmp
|
||||
}
|
||||
; ModuleID = 'weirdnames.ll'
|
||||
"&^ " = type { i32 }
|
||||
@"%.*+ foo" = global "&^ " { i32 5 } ; <"&^ "*> [#uses=0]
|
||||
@"0" = global float 0.000000e+00 ; <float*> [#uses=0]
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -335,7 +335,7 @@
|
||||
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
#line 1771 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
|
||||
#line 1775 "/proj/llvm/llvm-20/tools/llvm-upgrade/UpgradeParser.y"
|
||||
typedef union YYSTYPE {
|
||||
llvm::Module *ModuleVal;
|
||||
llvm::Function *FunctionVal;
|
||||
|
||||
@@ -62,6 +62,7 @@ static bool ObsoleteVarArgs;
|
||||
static bool NewVarArgs;
|
||||
static BasicBlock *CurBB;
|
||||
static GlobalVariable *CurGV;
|
||||
static unsigned lastCallingConv;
|
||||
|
||||
// This contains info used when building the body of a function. It is
|
||||
// destroyed when the function is completed.
|
||||
@@ -380,19 +381,18 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1,
|
||||
if (F1->getReturnType() != F2->getReturnType() ||
|
||||
F1->getNumParams() != F2->getNumParams())
|
||||
return false;
|
||||
ParamAttrsList PAL1;
|
||||
if (F1->getParamAttrs())
|
||||
PAL1 = *F1->getParamAttrs();
|
||||
ParamAttrsList PAL2;
|
||||
if (F2->getParamAttrs())
|
||||
PAL2 = *F2->getParamAttrs();
|
||||
if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0))
|
||||
const ParamAttrsList *PAL1 = F1->getParamAttrs();
|
||||
const ParamAttrsList *PAL2 = F2->getParamAttrs();
|
||||
if (PAL1 && !PAL2 || PAL2 && !PAL1)
|
||||
return false;
|
||||
if (PAL1 && PAL2 && ((PAL1->size() != PAL2->size()) ||
|
||||
(PAL1->getParamAttrs(0) != PAL2->getParamAttrs(0))))
|
||||
return false;
|
||||
unsigned SRetMask = ~unsigned(ParamAttr::StructRet);
|
||||
for (unsigned i = 0; i < F1->getNumParams(); ++i) {
|
||||
if (F1->getParamType(i) != F2->getParamType(i) ||
|
||||
unsigned(PAL1.getParamAttrs(i+1)) & SRetMask !=
|
||||
unsigned(PAL2.getParamAttrs(i+1)) & SRetMask)
|
||||
if (F1->getParamType(i) != F2->getParamType(i) || (PAL1 && PAL2 &&
|
||||
(unsigned(PAL1->getParamAttrs(i+1)) & SRetMask !=
|
||||
unsigned(PAL2->getParamAttrs(i+1)) & SRetMask)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1460,6 +1460,10 @@ upgradeIntrinsicCall(const Type* RetTy, const ValID &ID,
|
||||
std::vector<Value*>& Args) {
|
||||
|
||||
std::string Name = ID.Type == ValID::NameVal ? ID.Name : "";
|
||||
if (Name.length() <= 5 || Name[0] != 'l' || Name[1] != 'l' ||
|
||||
Name[2] != 'v' || Name[3] != 'm' || Name[4] != '.')
|
||||
return 0;
|
||||
|
||||
switch (Name[5]) {
|
||||
case 'i':
|
||||
if (Name == "llvm.isunordered.f32" || Name == "llvm.isunordered.f64") {
|
||||
@@ -2006,17 +2010,17 @@ OptLinkage
|
||||
;
|
||||
|
||||
OptCallingConv
|
||||
: /*empty*/ { $$ = OldCallingConv::C; }
|
||||
| CCC_TOK { $$ = OldCallingConv::C; }
|
||||
| CSRETCC_TOK { $$ = OldCallingConv::CSRet; }
|
||||
| FASTCC_TOK { $$ = OldCallingConv::Fast; }
|
||||
| COLDCC_TOK { $$ = OldCallingConv::Cold; }
|
||||
| X86_STDCALLCC_TOK { $$ = OldCallingConv::X86_StdCall; }
|
||||
| X86_FASTCALLCC_TOK { $$ = OldCallingConv::X86_FastCall; }
|
||||
: /*empty*/ { $$ = lastCallingConv = OldCallingConv::C; }
|
||||
| CCC_TOK { $$ = lastCallingConv = OldCallingConv::C; }
|
||||
| CSRETCC_TOK { $$ = lastCallingConv = OldCallingConv::CSRet; }
|
||||
| FASTCC_TOK { $$ = lastCallingConv = OldCallingConv::Fast; }
|
||||
| COLDCC_TOK { $$ = lastCallingConv = OldCallingConv::Cold; }
|
||||
| X86_STDCALLCC_TOK { $$ = lastCallingConv = OldCallingConv::X86_StdCall; }
|
||||
| X86_FASTCALLCC_TOK { $$ = lastCallingConv = OldCallingConv::X86_FastCall; }
|
||||
| CC_TOK EUINT64VAL {
|
||||
if ((unsigned)$2 != $2)
|
||||
error("Calling conv too large");
|
||||
$$ = $2;
|
||||
$$ = lastCallingConv = $2;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -2146,8 +2150,17 @@ UpRTypes
|
||||
bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
|
||||
if (isVarArg) Params.pop_back();
|
||||
|
||||
ParamAttrsList *PAL = 0;
|
||||
if (lastCallingConv == OldCallingConv::CSRet) {
|
||||
ParamAttrsVector Attrs;
|
||||
ParamAttrsWithIndex PAWI;
|
||||
PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
|
||||
Attrs.push_back(PAWI);
|
||||
PAL = ParamAttrsList::get(Attrs);
|
||||
}
|
||||
|
||||
const FunctionType *FTy =
|
||||
FunctionType::get($1.PAT->get(), Params, isVarArg, 0);
|
||||
FunctionType::get($1.PAT->get(), Params, isVarArg, PAL);
|
||||
|
||||
$$.PAT = new PATypeHolder( HandleUpRefs(FTy, $$.S) );
|
||||
delete $1.PAT; // Delete the return type handle
|
||||
@@ -2930,15 +2943,17 @@ FunctionHeaderH
|
||||
|
||||
// Convert the CSRet calling convention into the corresponding parameter
|
||||
// attribute.
|
||||
ParamAttrsList *ParamAttrs = 0;
|
||||
ParamAttrsList *PAL = 0;
|
||||
if ($1 == OldCallingConv::CSRet) {
|
||||
ParamAttrs = new ParamAttrsList();
|
||||
ParamAttrs->addAttributes(0, ParamAttr::None); // result
|
||||
ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg
|
||||
ParamAttrsVector Attrs;
|
||||
ParamAttrsWithIndex PAWI;
|
||||
PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
|
||||
Attrs.push_back(PAWI);
|
||||
PAL = ParamAttrsList::get(Attrs);
|
||||
}
|
||||
|
||||
const FunctionType *FT =
|
||||
FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs);
|
||||
FunctionType::get(RetTy, ParamTyList, isVarArg, PAL);
|
||||
const PointerType *PFT = PointerType::get(FT);
|
||||
delete $2.PAT;
|
||||
|
||||
@@ -3076,6 +3091,7 @@ FunctionHeaderH
|
||||
}
|
||||
delete $5; // We're now done with the argument list
|
||||
}
|
||||
lastCallingConv = OldCallingConv::C;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -3324,15 +3340,17 @@ BBTerminatorInst
|
||||
FTySign.add(I->S);
|
||||
}
|
||||
}
|
||||
ParamAttrsList *ParamAttrs = 0;
|
||||
ParamAttrsList *PAL = 0;
|
||||
if ($2 == OldCallingConv::CSRet) {
|
||||
ParamAttrs = new ParamAttrsList();
|
||||
ParamAttrs->addAttributes(0, ParamAttr::None); // Function result
|
||||
ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param
|
||||
ParamAttrsVector Attrs;
|
||||
ParamAttrsWithIndex PAWI;
|
||||
PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
|
||||
Attrs.push_back(PAWI);
|
||||
PAL = ParamAttrsList::get(Attrs);
|
||||
}
|
||||
bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
|
||||
if (isVarArg) ParamTypes.pop_back();
|
||||
Ty = FunctionType::get($3.PAT->get(), ParamTypes, isVarArg, ParamAttrs);
|
||||
Ty = FunctionType::get($3.PAT->get(), ParamTypes, isVarArg, PAL);
|
||||
PFTy = PointerType::get(Ty);
|
||||
$$.S.copy($3.S);
|
||||
} else {
|
||||
@@ -3375,6 +3393,7 @@ BBTerminatorInst
|
||||
cast<InvokeInst>($$.TI)->setCallingConv(upgradeCallingConv($2));
|
||||
delete $3.PAT;
|
||||
delete $6;
|
||||
lastCallingConv = OldCallingConv::C;
|
||||
}
|
||||
| Unwind {
|
||||
$$.TI = new UnwindInst();
|
||||
@@ -3729,14 +3748,16 @@ InstVal
|
||||
error("Functions cannot return aggregate types");
|
||||
|
||||
// Deal with CSRetCC
|
||||
ParamAttrsList *ParamAttrs = 0;
|
||||
ParamAttrsList *PAL = 0;
|
||||
if ($2 == OldCallingConv::CSRet) {
|
||||
ParamAttrs = new ParamAttrsList();
|
||||
ParamAttrs->addAttributes(0, ParamAttr::None); // function result
|
||||
ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter
|
||||
ParamAttrsVector Attrs;
|
||||
ParamAttrsWithIndex PAWI;
|
||||
PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
|
||||
Attrs.push_back(PAWI);
|
||||
PAL = ParamAttrsList::get(Attrs);
|
||||
}
|
||||
|
||||
FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs);
|
||||
FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, PAL);
|
||||
PFTy = PointerType::get(FTy);
|
||||
$$.S.copy($3.S);
|
||||
} else {
|
||||
@@ -3792,6 +3813,7 @@ InstVal
|
||||
}
|
||||
delete $3.PAT;
|
||||
delete $6;
|
||||
lastCallingConv = OldCallingConv::C;
|
||||
}
|
||||
| MemoryInst {
|
||||
$$ = $1;
|
||||
|
||||
@@ -3678,11 +3678,12 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
||||
// Emit boilerplate.
|
||||
OS << "SDNode *Select_INLINEASM(SDOperand N) {\n"
|
||||
<< " std::vector<SDOperand> Ops(N.Val->op_begin(), N.Val->op_end());\n"
|
||||
<< " AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n"
|
||||
<< " // Select the flag operand.\n"
|
||||
<< " if (Ops.back().getValueType() == MVT::Flag)\n"
|
||||
<< " AddToISelQueue(Ops.back());\n"
|
||||
<< " SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n"
|
||||
<< " SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n\n"
|
||||
|
||||
<< " // Ensure that the asm operands are themselves selected.\n"
|
||||
<< " for (unsigned j = 0, e = Ops.size(); j != e; ++j)\n"
|
||||
<< " AddToISelQueue(Ops[j]);\n\n"
|
||||
|
||||
<< " std::vector<MVT::ValueType> VTs;\n"
|
||||
<< " VTs.push_back(MVT::Other);\n"
|
||||
<< " VTs.push_back(MVT::Flag);\n"
|
||||
@@ -3718,6 +3719,7 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
||||
<< " case ISD::TargetConstant:\n"
|
||||
<< " case ISD::TargetConstantPool:\n"
|
||||
<< " case ISD::TargetFrameIndex:\n"
|
||||
<< " case ISD::TargetExternalSymbol:\n"
|
||||
<< " case ISD::TargetJumpTable:\n"
|
||||
<< " case ISD::TargetGlobalTLSAddress:\n"
|
||||
<< " case ISD::TargetGlobalAddress: {\n"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
Makefile.common
|
||||
config.log
|
||||
config.status
|
||||
mklib
|
||||
@@ -1,18 +0,0 @@
|
||||
#===-- projects/llvm-stacker/Makefile -----------------------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
#
|
||||
# This is the Stacker top-level Makefile
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
LEVEL = .
|
||||
DIRS = lib tools
|
||||
EXTRA_DIST = test samples
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
@@ -1,29 +0,0 @@
|
||||
#===-- projects/llvm-stacker/Makefile.common.in -------------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
# Set the name of the project here
|
||||
PROJECT_NAME := Stacker
|
||||
|
||||
# Set this variable to the top of the LLVM source tree.
|
||||
LLVM_SRC_ROOT = @LLVM_SRC@
|
||||
|
||||
# Set this variable to the top level directory where LLVM was built
|
||||
# (this is *not* the same as OBJ_ROOT as defined in LLVM's Makefile.config).
|
||||
LLVM_OBJ_ROOT = @LLVM_OBJ@
|
||||
|
||||
# Set the directory root of this project's source files
|
||||
PROJ_SRC_ROOT := $(subst //,/,@abs_top_srcdir@)
|
||||
|
||||
# Set the root directory of this project's object files
|
||||
PROJ_OBJ_ROOT := $(subst //,/,@abs_top_objdir@)
|
||||
|
||||
# Set the root directory of this project's install prefix
|
||||
PROJ_INSTALL_ROOT := @prefix@
|
||||
|
||||
# Include LLVM's Master Makefile.
|
||||
include $(LLVM_OBJ_ROOT)/Makefile.common
|
||||
@@ -1,2 +0,0 @@
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
die () {
|
||||
echo "$@" 1>&2
|
||||
exit 1
|
||||
}
|
||||
test -d autoconf && test -f autoconf/configure.ac && cd autoconf
|
||||
[ -f configure.ac ] || die "Can't find 'autoconf' dir; please cd into it first"
|
||||
echo "Regenerating aclocal.m4 with aclocal"
|
||||
aclocal || die "aclocal failed"
|
||||
autoconf --version | egrep '2\.5[0-9]' > /dev/null
|
||||
if test $? -ne 0
|
||||
then
|
||||
die "Your autoconf was not detected as being 2.5x"
|
||||
fi
|
||||
echo "Regenerating configure with autoconf 2.5x"
|
||||
autoconf -o ../configure configure.ac || die "autoconf failed"
|
||||
cd ..
|
||||
exit 0
|
||||
@@ -1,24 +0,0 @@
|
||||
------------------------------------------------------------------------------
|
||||
Autoconf Files
|
||||
------------------------------------------------------------------------------
|
||||
All autoconf files are licensed under the LLVM license with the following
|
||||
additions:
|
||||
|
||||
llvm/autoconf/install-sh:
|
||||
This script is licensed under the LLVM license, with the following
|
||||
additional copyrights and restrictions:
|
||||
|
||||
Copyright 1991 by the Massachusetts Institute of Technology
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation, and that the name of M.I.T. not be used in advertising or
|
||||
publicity pertaining to distribution of the software without specific,
|
||||
written prior permission. M.I.T. makes no representations about the
|
||||
suitability of this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.
|
||||
|
||||
Please see the source files for additional copyrights.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1388
stacker/autoconf/config.guess
vendored
1388
stacker/autoconf/config.guess
vendored
File diff suppressed because it is too large
Load Diff
1489
stacker/autoconf/config.sub
vendored
1489
stacker/autoconf/config.sub
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,79 +0,0 @@
|
||||
dnl **************************************************************************
|
||||
dnl * Initialize
|
||||
dnl **************************************************************************
|
||||
AC_INIT([[[Stacker]]],[[[1.0]]],[rspencer@x10sys.com])
|
||||
|
||||
dnl Place all of the extra autoconf files into the config subdirectory
|
||||
AC_CONFIG_AUX_DIR([autoconf])
|
||||
|
||||
dnl Verify that the source directory is valid
|
||||
AC_CONFIG_SRCDIR([lib/compiler/StackerParser.y])
|
||||
|
||||
AC_CONFIG_FILES([Makefile.common])
|
||||
|
||||
dnl Configure Makefiles
|
||||
dnl List every Makefile that exists within your source tree
|
||||
|
||||
AC_CONFIG_MAKEFILE(Makefile)
|
||||
AC_CONFIG_MAKEFILE(lib/Makefile)
|
||||
AC_CONFIG_MAKEFILE(lib/compiler/Makefile)
|
||||
AC_CONFIG_MAKEFILE(lib/runtime/Makefile)
|
||||
AC_CONFIG_MAKEFILE(test/Makefile)
|
||||
AC_CONFIG_MAKEFILE(tools/Makefile)
|
||||
AC_CONFIG_MAKEFILE(tools/stkrc/Makefile)
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Determine which system we are building on
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Check for programs.
|
||||
dnl **************************************************************************
|
||||
AC_PROG_LIBTOOL
|
||||
dnl Get libtool's idea of what the shared library suffix is.
|
||||
dnl (This is a hack; it relies on undocumented behavior.)
|
||||
AC_MSG_CHECKING([for shared library suffix])
|
||||
eval "SHLIBEXT=$shrext"
|
||||
AC_MSG_RESULT($SHLIBEXT)
|
||||
dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
|
||||
AC_SUBST(SHLIBEXT,$SHLIBEXT)
|
||||
AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
|
||||
[Extension that shared libraries have,
|
||||
e.g., ".so".])
|
||||
|
||||
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Check for libraries.
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Checks for header files.
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Checks for library functions.
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Enable various compile-time options
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Set the location of various third-party software packages
|
||||
dnl **************************************************************************
|
||||
|
||||
dnl Location of LLVM source code
|
||||
AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`]))
|
||||
|
||||
dnl Location of LLVM object code
|
||||
AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`]))
|
||||
|
||||
dnl **************************************************************************
|
||||
dnl * Create the output files
|
||||
dnl **************************************************************************
|
||||
AC_OUTPUT
|
||||
@@ -1,251 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
:
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,101 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id$
|
||||
|
||||
errstatus=0
|
||||
dirmode=""
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
-h | --help | --h* ) # -h for help
|
||||
echo "${usage}" 1>&2; exit 0 ;;
|
||||
-m ) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
|
||||
dirmode="${1}"
|
||||
shift ;;
|
||||
-- ) shift; break ;; # stop option processing
|
||||
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
|
||||
* ) break ;; # first non-opt arg
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p -- . 2>/dev/null; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
fi ;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
|
||||
lasterr=""
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 3
|
||||
# End:
|
||||
# mkinstalldirs ends here
|
||||
19278
stacker/configure
vendored
19278
stacker/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
#===-- projects/llvm-stacker/lib/Makefile -------------------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
#
|
||||
# Compile Stacker libraries
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
LEVEL = ..
|
||||
DIRS = compiler runtime
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
# Don't generate the runtime if we don't have LLVMGCC
|
||||
ifeq ($(strip $(LLVMGCC)),)
|
||||
DIRS := $(filter-out runtime, $(DIRS))
|
||||
endif
|
||||
@@ -1,4 +0,0 @@
|
||||
Lexer.cpp
|
||||
StackerParser.cpp
|
||||
StackerParser.h
|
||||
StackerParser.output
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,234 +0,0 @@
|
||||
/*===-- Lexer.l - Scanner for Stacker language -----------------*- C++ -*--===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by Reid Spencer and donated to the LLVM research
|
||||
// group and is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the flex scanner for Stacker languages files.
|
||||
//
|
||||
//===----------------------------------------------------------------------===*/
|
||||
|
||||
%option prefix="Stacker"
|
||||
%option yylineno
|
||||
%option nostdinit
|
||||
%option never-interactive
|
||||
%option batch
|
||||
%option noyywrap
|
||||
%option nodefault
|
||||
%option 8bit
|
||||
%option outfile="Lexer.cpp"
|
||||
%option ecs
|
||||
%option noreject
|
||||
%option noyymore
|
||||
|
||||
%{
|
||||
|
||||
#include "StackerCompiler.h"
|
||||
#include "StackerParser.h"
|
||||
|
||||
/* Conversion of text ints to binary */
|
||||
static int64_t IntToVal(const char *Buffer) {
|
||||
int64_t Result = 0;
|
||||
for (; *Buffer; Buffer++) {
|
||||
int64_t OldRes = Result;
|
||||
Result *= 10;
|
||||
Result += *Buffer-'0';
|
||||
if (Result < OldRes) // Uh, oh, overflow detected!!!
|
||||
StackerCompiler::ThrowException("constant bigger than 64 bits detected!");
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
/* Conversion of text hexadecimal ints to binary */
|
||||
static int64_t HexIntToVal(const char *Buffer) {
|
||||
int64_t Result = 0;
|
||||
for (; *Buffer; ++Buffer) {
|
||||
int64_t OldRes = Result;
|
||||
Result *= 16;
|
||||
char C = *Buffer;
|
||||
if (C >= '0' && C <= '9')
|
||||
Result += C-'0';
|
||||
else if (C >= 'A' && C <= 'F')
|
||||
Result += C-'A'+10;
|
||||
else if (C >= 'a' && C <= 'f')
|
||||
Result += C-'a'+10;
|
||||
|
||||
if (Result < OldRes) // Uh, oh, overflow detected!!!
|
||||
StackerCompiler::ThrowException("constant bigger than 64 bits detected!");
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
%}
|
||||
|
||||
/* Comments start with a ; and go till end of line */
|
||||
Comment1 [#].*$
|
||||
/* You can also embed them in ( ... ) */
|
||||
Comment2 \(.*\)
|
||||
/* We ignore white space */
|
||||
White [ \t\r\n]
|
||||
|
||||
/* jdentifiers start with a % sign */
|
||||
Identifier [A-Za-z][-A-Za-z0-9_]*
|
||||
|
||||
/* Strings can contain any character except " and \ */
|
||||
String \"[^\"]*\"
|
||||
|
||||
/* Positive and negative integer constants*/
|
||||
PInteger [+]?[0-9]+
|
||||
NInteger -[0-9]+
|
||||
HexInteger 0x[0-9A-Fa-f]+
|
||||
|
||||
/* Special Characters - name them to avoid flex confusion */
|
||||
Semi [;]
|
||||
Colon [:]
|
||||
Less \<
|
||||
More \>
|
||||
LessEq \<\=
|
||||
MoreEq \>\=
|
||||
NotEq \<\>
|
||||
Equal \=
|
||||
Plus \+
|
||||
Minus \-
|
||||
Incr \+\+
|
||||
Decr \-\-
|
||||
Mult \*
|
||||
Div \/
|
||||
StarSlash \*\/
|
||||
LShift \<\<
|
||||
RShift \>\>
|
||||
InStr \<s
|
||||
InNum \<d
|
||||
InChar \<c
|
||||
OutStr \>s
|
||||
OutNum \>d
|
||||
OutChar \>c
|
||||
|
||||
%%
|
||||
|
||||
{Comment1} { /* Ignore comments */ }
|
||||
{Comment2} { /* Ignore comments */ }
|
||||
|
||||
{Colon} { return COLON; }
|
||||
{Semi} { return SEMI; }
|
||||
|
||||
TRUE { return TRUETOK; }
|
||||
FALSE { return FALSETOK; }
|
||||
ON { return TRUETOK; }
|
||||
OFF { return FALSETOK; }
|
||||
{Less} { return LESS; }
|
||||
LT { return LESS; }
|
||||
{More} { return MORE; }
|
||||
GT { return MORE; }
|
||||
{LessEq} { return LESS_EQUAL; }
|
||||
LE { return LESS_EQUAL; }
|
||||
{MoreEq} { return MORE_EQUAL; }
|
||||
GE { return MORE_EQUAL; }
|
||||
{NotEq} { return NOT_EQUAL; }
|
||||
NE { return NOT_EQUAL; }
|
||||
{Equal} { return EQUAL; }
|
||||
EQ { return EQUAL; }
|
||||
|
||||
{Plus} { return PLUS; }
|
||||
{Minus} { return MINUS; }
|
||||
{Incr} { return INCR; }
|
||||
{Decr} { return DECR; }
|
||||
{Mult} { return MULT; }
|
||||
{Div} { return DIV; }
|
||||
MOD { return MODULUS; }
|
||||
NEG { return NEGATE; }
|
||||
ABS { return ABS; }
|
||||
MIN { return MIN; }
|
||||
MAX { return MAX; }
|
||||
{StarSlash} { return STAR_SLASH; }
|
||||
|
||||
AND { return AND; }
|
||||
OR { return OR; }
|
||||
XOR { return XOR; }
|
||||
{LShift} { return LSHIFT; }
|
||||
{RShift} { return RSHIFT; }
|
||||
|
||||
DROP { return DROP; }
|
||||
NIP { return NIP; }
|
||||
DUP { return DUP; }
|
||||
SWAP { return SWAP; }
|
||||
OVER { return OVER; }
|
||||
PICK { return PICK; }
|
||||
SELECT { return SELECT; }
|
||||
ROT { return ROT; }
|
||||
RROT { return RROT; }
|
||||
ROLL { return ROLL; }
|
||||
TUCK { return TUCK; }
|
||||
DROP2 { return DROP2; }
|
||||
NIP2 { return NIP2; }
|
||||
DUP2 { return DUP2; }
|
||||
SWAP2 { return SWAP2; }
|
||||
OVER2 { return OVER2; }
|
||||
TUCK2 { return TUCK2; }
|
||||
ROT2 { return ROT2; }
|
||||
RROT2 { return RROT2; }
|
||||
|
||||
MALLOC { return MALLOC; }
|
||||
FREE { return FREE; }
|
||||
GET { return GET; }
|
||||
PUT { return PUT; }
|
||||
|
||||
IF { return IF; }
|
||||
ELSE { return ELSE; }
|
||||
ENDIF { return ENDIF; }
|
||||
WHILE { return WHILE; }
|
||||
END { return END; }
|
||||
|
||||
RECURSE { return RECURSE; }
|
||||
RETURN { return RETURN; }
|
||||
EXIT { return EXIT; }
|
||||
FORWARD { return FORWARD; }
|
||||
TAB { return TAB; }
|
||||
SPACE { return SPACE; }
|
||||
CR { return CR; }
|
||||
|
||||
{InStr} { return IN_STR; }
|
||||
{InNum} { return IN_NUM; }
|
||||
{InChar} { return IN_CHAR; }
|
||||
|
||||
{OutStr} { return OUT_STR; }
|
||||
{OutNum} { return OUT_NUM; }
|
||||
{OutChar} { return OUT_CHAR; }
|
||||
|
||||
MAIN { return MAIN; }
|
||||
|
||||
DUMP { return DUMP; }
|
||||
|
||||
!= { StackerCompiler::ThrowException(
|
||||
"You probably meant to use a <> instead of !=" ); }
|
||||
|
||||
== { StackerCompiler::ThrowException(
|
||||
"You probably meant to use a single = .. this isn't C"); }
|
||||
|
||||
{PInteger} { Stackerlval.IntegerVal = IntToVal(yytext); return INTEGER; }
|
||||
{NInteger} { uint64_t Val = IntToVal(yytext+1);
|
||||
// +1: we have bigger negative range
|
||||
if (Val > (uint64_t)INT64_MAX+1)
|
||||
StackerCompiler::ThrowException(
|
||||
"Constant too large for signed 64 bits!");
|
||||
Stackerlval.IntegerVal = -Val;
|
||||
return INTEGER;
|
||||
}
|
||||
{HexInteger} { Stackerlval.IntegerVal = HexIntToVal(yytext+3);
|
||||
return INTEGER;
|
||||
}
|
||||
|
||||
{String} { yytext[strlen(yytext)-1] = 0; // nuke end quote
|
||||
Stackerlval.StringVal = strdup(yytext+1); // Nuke start quote
|
||||
return STRING;
|
||||
}
|
||||
|
||||
{Identifier} { Stackerlval.StringVal = strdup(yytext); return IDENTIFIER; }
|
||||
|
||||
{White} { /* Ignore whitespace */ }
|
||||
%%
|
||||
@@ -1,234 +0,0 @@
|
||||
/*===-- Lexer.l - Scanner for Stacker language -----------------*- C++ -*--===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by Reid Spencer and donated to the LLVM research
|
||||
// group and is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the flex scanner for Stacker languages files.
|
||||
//
|
||||
//===----------------------------------------------------------------------===*/
|
||||
|
||||
%option prefix="Stacker"
|
||||
%option yylineno
|
||||
%option nostdinit
|
||||
%option never-interactive
|
||||
%option batch
|
||||
%option noyywrap
|
||||
%option nodefault
|
||||
%option 8bit
|
||||
%option outfile="Lexer.cpp"
|
||||
%option ecs
|
||||
%option noreject
|
||||
%option noyymore
|
||||
|
||||
%{
|
||||
|
||||
#include "StackerCompiler.h"
|
||||
#include "StackerParser.h"
|
||||
|
||||
/* Conversion of text ints to binary */
|
||||
static int64_t IntToVal(const char *Buffer) {
|
||||
int64_t Result = 0;
|
||||
for (; *Buffer; Buffer++) {
|
||||
int64_t OldRes = Result;
|
||||
Result *= 10;
|
||||
Result += *Buffer-'0';
|
||||
if (Result < OldRes) // Uh, oh, overflow detected!!!
|
||||
StackerCompiler::ThrowException("constant bigger than 64 bits detected!");
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
/* Conversion of text hexadecimal ints to binary */
|
||||
static int64_t HexIntToVal(const char *Buffer) {
|
||||
int64_t Result = 0;
|
||||
for (; *Buffer; ++Buffer) {
|
||||
int64_t OldRes = Result;
|
||||
Result *= 16;
|
||||
char C = *Buffer;
|
||||
if (C >= '0' && C <= '9')
|
||||
Result += C-'0';
|
||||
else if (C >= 'A' && C <= 'F')
|
||||
Result += C-'A'+10;
|
||||
else if (C >= 'a' && C <= 'f')
|
||||
Result += C-'a'+10;
|
||||
|
||||
if (Result < OldRes) // Uh, oh, overflow detected!!!
|
||||
StackerCompiler::ThrowException("constant bigger than 64 bits detected!");
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
%}
|
||||
|
||||
/* Comments start with a ; and go till end of line */
|
||||
Comment1 [#].*$
|
||||
/* You can also embed them in ( ... ) */
|
||||
Comment2 \(.*\)
|
||||
/* We ignore white space */
|
||||
White [ \t\r\n]
|
||||
|
||||
/* jdentifiers start with a % sign */
|
||||
Identifier [A-Za-z][-A-Za-z0-9_]*
|
||||
|
||||
/* Strings can contain any character except " and \ */
|
||||
String \"[^\"]*\"
|
||||
|
||||
/* Positive and negative integer constants*/
|
||||
PInteger [+]?[0-9]+
|
||||
NInteger -[0-9]+
|
||||
HexInteger 0x[0-9A-Fa-f]+
|
||||
|
||||
/* Special Characters - name them to avoid flex confusion */
|
||||
Semi [;]
|
||||
Colon [:]
|
||||
Less \<
|
||||
More \>
|
||||
LessEq \<\=
|
||||
MoreEq \>\=
|
||||
NotEq \<\>
|
||||
Equal \=
|
||||
Plus \+
|
||||
Minus \-
|
||||
Incr \+\+
|
||||
Decr \-\-
|
||||
Mult \*
|
||||
Div \/
|
||||
StarSlash \*\/
|
||||
LShift \<\<
|
||||
RShift \>\>
|
||||
InStr \<s
|
||||
InNum \<d
|
||||
InChar \<c
|
||||
OutStr \>s
|
||||
OutNum \>d
|
||||
OutChar \>c
|
||||
|
||||
%%
|
||||
|
||||
{Comment1} { /* Ignore comments */ }
|
||||
{Comment2} { /* Ignore comments */ }
|
||||
|
||||
{Colon} { return COLON; }
|
||||
{Semi} { return SEMI; }
|
||||
|
||||
TRUE { return TRUETOK; }
|
||||
FALSE { return FALSETOK; }
|
||||
ON { return TRUETOK; }
|
||||
OFF { return FALSETOK; }
|
||||
{Less} { return LESS; }
|
||||
LT { return LESS; }
|
||||
{More} { return MORE; }
|
||||
GT { return MORE; }
|
||||
{LessEq} { return LESS_EQUAL; }
|
||||
LE { return LESS_EQUAL; }
|
||||
{MoreEq} { return MORE_EQUAL; }
|
||||
GE { return MORE_EQUAL; }
|
||||
{NotEq} { return NOT_EQUAL; }
|
||||
NE { return NOT_EQUAL; }
|
||||
{Equal} { return EQUAL; }
|
||||
EQ { return EQUAL; }
|
||||
|
||||
{Plus} { return PLUS; }
|
||||
{Minus} { return MINUS; }
|
||||
{Incr} { return INCR; }
|
||||
{Decr} { return DECR; }
|
||||
{Mult} { return MULT; }
|
||||
{Div} { return DIV; }
|
||||
MOD { return MODULUS; }
|
||||
NEG { return NEGATE; }
|
||||
ABS { return ABS; }
|
||||
MIN { return MIN; }
|
||||
MAX { return MAX; }
|
||||
{StarSlash} { return STAR_SLASH; }
|
||||
|
||||
AND { return AND; }
|
||||
OR { return OR; }
|
||||
XOR { return XOR; }
|
||||
{LShift} { return LSHIFT; }
|
||||
{RShift} { return RSHIFT; }
|
||||
|
||||
DROP { return DROP; }
|
||||
NIP { return NIP; }
|
||||
DUP { return DUP; }
|
||||
SWAP { return SWAP; }
|
||||
OVER { return OVER; }
|
||||
PICK { return PICK; }
|
||||
SELECT { return SELECT; }
|
||||
ROT { return ROT; }
|
||||
RROT { return RROT; }
|
||||
ROLL { return ROLL; }
|
||||
TUCK { return TUCK; }
|
||||
DROP2 { return DROP2; }
|
||||
NIP2 { return NIP2; }
|
||||
DUP2 { return DUP2; }
|
||||
SWAP2 { return SWAP2; }
|
||||
OVER2 { return OVER2; }
|
||||
TUCK2 { return TUCK2; }
|
||||
ROT2 { return ROT2; }
|
||||
RROT2 { return RROT2; }
|
||||
|
||||
MALLOC { return MALLOC; }
|
||||
FREE { return FREE; }
|
||||
GET { return GET; }
|
||||
PUT { return PUT; }
|
||||
|
||||
IF { return IF; }
|
||||
ELSE { return ELSE; }
|
||||
ENDIF { return ENDIF; }
|
||||
WHILE { return WHILE; }
|
||||
END { return END; }
|
||||
|
||||
RECURSE { return RECURSE; }
|
||||
RETURN { return RETURN; }
|
||||
EXIT { return EXIT; }
|
||||
FORWARD { return FORWARD; }
|
||||
TAB { return TAB; }
|
||||
SPACE { return SPACE; }
|
||||
CR { return CR; }
|
||||
|
||||
{InStr} { return IN_STR; }
|
||||
{InNum} { return IN_NUM; }
|
||||
{InChar} { return IN_CHAR; }
|
||||
|
||||
{OutStr} { return OUT_STR; }
|
||||
{OutNum} { return OUT_NUM; }
|
||||
{OutChar} { return OUT_CHAR; }
|
||||
|
||||
MAIN { return MAIN; }
|
||||
|
||||
DUMP { return DUMP; }
|
||||
|
||||
!= { StackerCompiler::ThrowException(
|
||||
"You probably meant to use a <> instead of !=" ); }
|
||||
|
||||
== { StackerCompiler::ThrowException(
|
||||
"You probably meant to use a single = .. this isn't C"); }
|
||||
|
||||
{PInteger} { Stackerlval.IntegerVal = IntToVal(yytext); return INTEGER; }
|
||||
{NInteger} { uint64_t Val = IntToVal(yytext+1);
|
||||
// +1: we have bigger negative range
|
||||
if (Val > (uint64_t)INT64_MAX+1)
|
||||
StackerCompiler::ThrowException(
|
||||
"Constant too large for signed 64 bits!");
|
||||
Stackerlval.IntegerVal = -Val;
|
||||
return INTEGER;
|
||||
}
|
||||
{HexInteger} { Stackerlval.IntegerVal = HexIntToVal(yytext+3);
|
||||
return INTEGER;
|
||||
}
|
||||
|
||||
{String} { yytext[strlen(yytext)-1] = 0; // nuke end quote
|
||||
Stackerlval.StringVal = strdup(yytext+1); // Nuke start quote
|
||||
return STRING;
|
||||
}
|
||||
|
||||
{Identifier} { Stackerlval.StringVal = strdup(yytext); return IDENTIFIER; }
|
||||
|
||||
{White} { /* Ignore whitespace */ }
|
||||
%%
|
||||
@@ -1,28 +0,0 @@
|
||||
#===-- projects/llvm-stacker/lib/compiler/Makefile ----------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
LEVEL := ../..
|
||||
LIBRARYNAME := stkr_compiler
|
||||
EXTRA_DIST := Lexer.cpp.cvs Lexer.l.cvs \
|
||||
StackerParser.cpp.cvs StackerParser.h.cvs StackerParser.y.cvs
|
||||
REQUIRES_EH := 1
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
ifdef PARSE_DEBUG
|
||||
INCLUDES += -DPARSE_DEBUG
|
||||
endif
|
||||
|
||||
# Disable -pedantic for this library, as bison output isn't necessarily
|
||||
# -pedantic clean.
|
||||
CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
|
||||
CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
|
||||
|
||||
$(ObjDir)/Lexer.o : $(PROJ_SRC_DIR)/StackerParser.h
|
||||
$(ObjDir)/StackerCompiler.o : $(PROJ_SRC_DIR)/StackerParser.h
|
||||
@@ -1,20 +0,0 @@
|
||||
This directory contains a sample language front end for LLVM.
|
||||
|
||||
It is a *very* simple/crude implementation of FORTH. It has many
|
||||
deficiencies but provides enough basics to give you an idea of
|
||||
what programming a new language front end for LLVM looks like.
|
||||
|
||||
To keep things simple, Stacker has the following limitations:
|
||||
1. Only a single, global stack is manipulated.
|
||||
2. There is no interpretation, everything is compiled.
|
||||
3. There's no type/bounds checking .. you're on your own.
|
||||
4. There's no floating point support.
|
||||
5. Only stdin can be read. Only stdout can be written. No other
|
||||
file I/O is supported.
|
||||
|
||||
As such, this isn't a very useful language for anything other than
|
||||
the most trivial of programs. It is, however, a good learning tool
|
||||
(for both the author and the student).
|
||||
|
||||
Reid Spencer
|
||||
16 November 2003
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,224 +0,0 @@
|
||||
//===-- StackerCompiler.h - Interface to the Stacker Compiler ---*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by Reid Spencer and donated to the LLVM research
|
||||
// group and is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This header file defines the various variables that are shared among the
|
||||
// different components of the parser...
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_STACKERCOMPILER_H
|
||||
#define LLVM_STACKERCOMPILER_H
|
||||
|
||||
#include <llvm/Constants.h>
|
||||
#include <llvm/DerivedTypes.h>
|
||||
#include <llvm/Function.h>
|
||||
#include <llvm/Instruction.h>
|
||||
#include <llvm/Module.h>
|
||||
#include <llvm/Assembly/Parser.h>
|
||||
#include <llvm/ADT/StringExtras.h>
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
// Global variables exported from the lexer...
|
||||
extern std::FILE *Stackerin;
|
||||
extern int Stackerlineno;
|
||||
extern char* Stackertext;
|
||||
extern int Stackerleng;
|
||||
|
||||
/// @brief This class provides the Compiler for the Stacker language.
|
||||
///
|
||||
/// The main method to call is \c compile. The other methods are
|
||||
/// all internal to the compiler and protected. In general the
|
||||
/// handle_* methods are called by the BISON generated parser
|
||||
/// (see StackerParser.y). The methods returning Instruction* all
|
||||
/// produce some snippet of code to manipulate the stack in some
|
||||
/// way. These functions are just conveniences as they are used
|
||||
/// often by the compiler.
|
||||
class StackerCompiler
|
||||
{
|
||||
/// @name Constructors and Operators
|
||||
/// @{
|
||||
public:
|
||||
/// Default Constructor
|
||||
StackerCompiler();
|
||||
|
||||
/// Destructor
|
||||
~StackerCompiler();
|
||||
private:
|
||||
/// Do not copy StackerCompilers
|
||||
StackerCompiler(const StackerCompiler&);
|
||||
|
||||
/// Do not copy StackerCompilers.
|
||||
StackerCompiler& operator=(const StackerCompiler& );
|
||||
|
||||
/// @}
|
||||
/// @name High Level Interface
|
||||
/// @{
|
||||
public:
|
||||
/// @brief Compile a single file to LLVM bytecode.
|
||||
///
|
||||
/// To use the StackerCompiler, just create one on
|
||||
/// the stack and call this method.
|
||||
Module* compile(
|
||||
const std::string& filename, ///< File to compile
|
||||
bool echo, ///< Causes compiler to echo output
|
||||
unsigned optLevel, ///< Level of optimization
|
||||
size_t stack_size ); ///< Size of generated stack
|
||||
/// @}
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
public:
|
||||
/// @brief Returns the name of the file being compiled.
|
||||
std::string& filename() { return CurFilename; }
|
||||
|
||||
/// @}
|
||||
/// @name Parse Handling Methods
|
||||
/// @{
|
||||
private:
|
||||
/// Allow only the parser to access these methods. No
|
||||
/// one else should call them.
|
||||
friend int Stackerparse();
|
||||
|
||||
/// @brief Handle the start of a module
|
||||
Module* handle_module_start();
|
||||
|
||||
/// @brief Handle the end of a module
|
||||
/// @param mod The module we're defining.
|
||||
Module* handle_module_end( Module* mod );
|
||||
|
||||
/// @brief Handle the start of a list of definitions
|
||||
Module* handle_definition_list_start( );
|
||||
|
||||
/// @brief Handle the end of a list of definitions
|
||||
/// @param mod The module we're constructing
|
||||
/// @param definition A definition (function) to add to the module
|
||||
Module* handle_definition_list_end( Module* mod, Function* definition );
|
||||
|
||||
/// @brief Handle creation of the MAIN definition
|
||||
/// @param func The function to be used as the MAIN definition
|
||||
Function* handle_main_definition( Function* func );
|
||||
|
||||
/// @brief Handle a forward definition
|
||||
/// @param name The name of the definition being declared
|
||||
Function* handle_forward( char* name );
|
||||
|
||||
/// @brief Handle a general definition
|
||||
/// @param name The name of the definition being defined
|
||||
/// @param func The Function definition.
|
||||
Function* handle_definition( char* name, Function* func );
|
||||
|
||||
/// @brief Handle the start of a definition's word list
|
||||
Function* handle_word_list_start();
|
||||
|
||||
/// @brief Handle the end of a definition's word list
|
||||
/// @param func The function to which the basic block is added
|
||||
/// @param next The block to add to the function
|
||||
Function* handle_word_list_end( Function* func, BasicBlock* next );
|
||||
|
||||
/// @brief Handle an if statement, possibly without an else
|
||||
/// @brief ifTrue The block to execute if true
|
||||
/// @brief ifFalse The optional block to execute if false
|
||||
BasicBlock* handle_if( char* ifTrue, char* ifFalse = 0 );
|
||||
|
||||
/// @brief Handle a while statement
|
||||
/// @brief todo The block to repeatedly execute
|
||||
BasicBlock* handle_while( char* todo );
|
||||
|
||||
/// @brief Handle an identifier to call the identified definition
|
||||
/// @param name The name of the identifier to be called.
|
||||
BasicBlock* handle_identifier( char * name );
|
||||
|
||||
/// @brief Handle the push of a string onto the stack
|
||||
/// @param value The string to be pushed.
|
||||
BasicBlock* handle_string( char * value );
|
||||
|
||||
/// @brief Handle the push of an integer onto the stack.
|
||||
/// @param value The integer value to be pushed.
|
||||
BasicBlock* handle_integer( const int64_t value );
|
||||
|
||||
/// @brief Handle one of the reserved words (given as a token)
|
||||
BasicBlock* handle_word( int tkn );
|
||||
|
||||
/// @}
|
||||
/// @name Utility functions
|
||||
/// @{
|
||||
public:
|
||||
/// @brief Throws an exception to indicate an error
|
||||
/// @param message The message to be output
|
||||
/// @param line Override for the current line no
|
||||
static inline void ThrowException( const std::string &message,
|
||||
int line = -1)
|
||||
{
|
||||
if (line == -1) line = Stackerlineno;
|
||||
// TODO: column number in exception
|
||||
ParseError Err;
|
||||
Err.setError(TheInstance->CurFilename, message, line);
|
||||
throw Err;
|
||||
}
|
||||
private:
|
||||
/// @brief Generate code to increment the stack index
|
||||
Instruction* incr_stack_index( BasicBlock* bb, Value* );
|
||||
/// @brief Generate code to decrement the stack index.
|
||||
Instruction* decr_stack_index( BasicBlock* bb, Value* );
|
||||
/// @brief Generate code to dereference the top of stack.
|
||||
Instruction* get_stack_pointer( BasicBlock* bb, Value* );
|
||||
/// @brief Generate code to push any value onto the stack.
|
||||
Instruction* push_value( BasicBlock* bb, Value* value );
|
||||
/// @brief Generate code to push a constant integer onto the stack.
|
||||
Instruction* push_integer( BasicBlock* bb, int64_t value );
|
||||
/// @brief Generate code to pop an integer off the stack.
|
||||
Instruction* pop_integer( BasicBlock* bb );
|
||||
/// @brief Generate code to push a string pointer onto the stack.
|
||||
Instruction* push_string( BasicBlock* bb, const char* value );
|
||||
/// @brief Generate code to pop a string pointer off the stack.
|
||||
Instruction* pop_string( BasicBlock* bb );
|
||||
/// @brief Generate code to get the top stack element.
|
||||
Instruction* stack_top( BasicBlock* bb, Value* index );
|
||||
/// @brief Generate code to get the top stack element as a string.
|
||||
Instruction* stack_top_string( BasicBlock* bb, Value* index );
|
||||
/// @brief Generate code to replace the top element of the stack.
|
||||
Instruction* replace_top( BasicBlock* bb, Value* new_top, Value* index);
|
||||
|
||||
/// @}
|
||||
/// @name Data Members (used during parsing)
|
||||
/// @{
|
||||
public:
|
||||
static StackerCompiler* TheInstance; ///< The instance for the parser
|
||||
|
||||
private:
|
||||
std::string CurFilename; ///< Current file name
|
||||
Module* TheModule; ///< Module instance we'll build
|
||||
Function* TheFunction; ///< Function we're building
|
||||
FunctionType* DefinitionType; ///< FT for Definitions
|
||||
GlobalVariable* TheStack; ///< For referencing _stack_
|
||||
GlobalVariable* TheIndex; ///< For referencing _index_
|
||||
Function* TheScanf; ///< External input function
|
||||
Function* ThePrintf; ///< External output function
|
||||
Function* TheExit; ///< External exit function
|
||||
GlobalVariable* StrFormat; ///< Format for strings
|
||||
GlobalVariable* NumFormat; ///< Format for numbers
|
||||
GlobalVariable* ChrFormat; ///< Format for chars
|
||||
GlobalVariable* InStrFormat; ///< Format for input strings
|
||||
GlobalVariable* InNumFormat; ///< Format for input numbers
|
||||
GlobalVariable* InChrFormat; ///< Format for input chars
|
||||
ConstantInt* Zero; ///< long constant 0
|
||||
ConstantInt* One; ///< long constant 1
|
||||
ConstantInt* Two; ///< long constant 2
|
||||
ConstantInt* Three; ///< long constant 3
|
||||
ConstantInt* Four; ///< long constant 4
|
||||
ConstantInt* Five; ///< long constant 5
|
||||
std::vector<Value*> no_arguments; ///< no arguments for Stacker
|
||||
bool echo; ///< Echo flag
|
||||
size_t stack_size; ///< Size of stack to gen.
|
||||
ArrayType* stack_type; ///< The type of the stack
|
||||
/// @}
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,204 +0,0 @@
|
||||
/* A Bison parser, made by GNU Bison 2.1. */
|
||||
|
||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
INTEGER = 258,
|
||||
STRING = 259,
|
||||
IDENTIFIER = 260,
|
||||
SEMI = 261,
|
||||
COLON = 262,
|
||||
FORWARD = 263,
|
||||
MAIN = 264,
|
||||
DUMP = 265,
|
||||
TRUETOK = 266,
|
||||
FALSETOK = 267,
|
||||
LESS = 268,
|
||||
MORE = 269,
|
||||
LESS_EQUAL = 270,
|
||||
MORE_EQUAL = 271,
|
||||
NOT_EQUAL = 272,
|
||||
EQUAL = 273,
|
||||
PLUS = 274,
|
||||
MINUS = 275,
|
||||
INCR = 276,
|
||||
DECR = 277,
|
||||
MULT = 278,
|
||||
DIV = 279,
|
||||
MODULUS = 280,
|
||||
NEGATE = 281,
|
||||
ABS = 282,
|
||||
MIN = 283,
|
||||
MAX = 284,
|
||||
STAR_SLASH = 285,
|
||||
AND = 286,
|
||||
OR = 287,
|
||||
XOR = 288,
|
||||
LSHIFT = 289,
|
||||
RSHIFT = 290,
|
||||
DROP = 291,
|
||||
DROP2 = 292,
|
||||
NIP = 293,
|
||||
NIP2 = 294,
|
||||
DUP = 295,
|
||||
DUP2 = 296,
|
||||
SWAP = 297,
|
||||
SWAP2 = 298,
|
||||
OVER = 299,
|
||||
OVER2 = 300,
|
||||
ROT = 301,
|
||||
ROT2 = 302,
|
||||
RROT = 303,
|
||||
RROT2 = 304,
|
||||
TUCK = 305,
|
||||
TUCK2 = 306,
|
||||
ROLL = 307,
|
||||
PICK = 308,
|
||||
SELECT = 309,
|
||||
MALLOC = 310,
|
||||
FREE = 311,
|
||||
GET = 312,
|
||||
PUT = 313,
|
||||
IF = 314,
|
||||
ELSE = 315,
|
||||
ENDIF = 316,
|
||||
WHILE = 317,
|
||||
END = 318,
|
||||
RECURSE = 319,
|
||||
RETURN = 320,
|
||||
EXIT = 321,
|
||||
TAB = 322,
|
||||
SPACE = 323,
|
||||
CR = 324,
|
||||
IN_STR = 325,
|
||||
IN_NUM = 326,
|
||||
IN_CHAR = 327,
|
||||
OUT_STR = 328,
|
||||
OUT_NUM = 329,
|
||||
OUT_CHAR = 330
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
#define INTEGER 258
|
||||
#define STRING 259
|
||||
#define IDENTIFIER 260
|
||||
#define SEMI 261
|
||||
#define COLON 262
|
||||
#define FORWARD 263
|
||||
#define MAIN 264
|
||||
#define DUMP 265
|
||||
#define TRUETOK 266
|
||||
#define FALSETOK 267
|
||||
#define LESS 268
|
||||
#define MORE 269
|
||||
#define LESS_EQUAL 270
|
||||
#define MORE_EQUAL 271
|
||||
#define NOT_EQUAL 272
|
||||
#define EQUAL 273
|
||||
#define PLUS 274
|
||||
#define MINUS 275
|
||||
#define INCR 276
|
||||
#define DECR 277
|
||||
#define MULT 278
|
||||
#define DIV 279
|
||||
#define MODULUS 280
|
||||
#define NEGATE 281
|
||||
#define ABS 282
|
||||
#define MIN 283
|
||||
#define MAX 284
|
||||
#define STAR_SLASH 285
|
||||
#define AND 286
|
||||
#define OR 287
|
||||
#define XOR 288
|
||||
#define LSHIFT 289
|
||||
#define RSHIFT 290
|
||||
#define DROP 291
|
||||
#define DROP2 292
|
||||
#define NIP 293
|
||||
#define NIP2 294
|
||||
#define DUP 295
|
||||
#define DUP2 296
|
||||
#define SWAP 297
|
||||
#define SWAP2 298
|
||||
#define OVER 299
|
||||
#define OVER2 300
|
||||
#define ROT 301
|
||||
#define ROT2 302
|
||||
#define RROT 303
|
||||
#define RROT2 304
|
||||
#define TUCK 305
|
||||
#define TUCK2 306
|
||||
#define ROLL 307
|
||||
#define PICK 308
|
||||
#define SELECT 309
|
||||
#define MALLOC 310
|
||||
#define FREE 311
|
||||
#define GET 312
|
||||
#define PUT 313
|
||||
#define IF 314
|
||||
#define ELSE 315
|
||||
#define ENDIF 316
|
||||
#define WHILE 317
|
||||
#define END 318
|
||||
#define RECURSE 319
|
||||
#define RETURN 320
|
||||
#define EXIT 321
|
||||
#define TAB 322
|
||||
#define SPACE 323
|
||||
#define CR 324
|
||||
#define IN_STR 325
|
||||
#define IN_NUM 326
|
||||
#define IN_CHAR 327
|
||||
#define OUT_STR 328
|
||||
#define OUT_NUM 329
|
||||
#define OUT_CHAR 330
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
#line 34 "/proj/llvm/llvm-3/projects/llvm-stacker/lib/compiler/StackerParser.y"
|
||||
typedef union YYSTYPE {
|
||||
llvm::Module* ModuleVal;
|
||||
llvm::Function* FunctionVal;
|
||||
llvm::BasicBlock* BasicBlockVal;
|
||||
int64_t IntegerVal;
|
||||
char* StringVal;
|
||||
} YYSTYPE;
|
||||
/* Line 1447 of yacc.c. */
|
||||
#line 196 "StackerParser.tab.h"
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
extern YYSTYPE Stackerlval;
|
||||
|
||||
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
//===-- StackerParser.y - Parser for Stacker programs -----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by the LLVM research group and is distributed under
|
||||
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the bison parser for Stacker programs.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
%{
|
||||
#include "StackerCompiler.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/DepthFirstIterator.h"
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
|
||||
#define YYERROR_VERBOSE 1
|
||||
#define SCI StackerCompiler::TheInstance
|
||||
|
||||
int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
|
||||
int yylex(); // declaration" of xxx warnings.
|
||||
int yyparse();
|
||||
|
||||
%}
|
||||
|
||||
%union
|
||||
{
|
||||
llvm::Module* ModuleVal;
|
||||
llvm::Function* FunctionVal;
|
||||
llvm::BasicBlock* BasicBlockVal;
|
||||
int64_t IntegerVal;
|
||||
char* StringVal;
|
||||
}
|
||||
|
||||
/* Typed Productions */
|
||||
%type <ModuleVal> Module DefinitionList
|
||||
%type <FunctionVal> Definition ForwardDef ColonDef MainDef
|
||||
%type <FunctionVal> WordList
|
||||
%type <BasicBlockVal> Word
|
||||
|
||||
/* Typed Tokens */
|
||||
%token <IntegerVal> INTEGER
|
||||
%token <StringVal> STRING IDENTIFIER
|
||||
|
||||
/* Terminal Tokens */
|
||||
%token SEMI COLON FORWARD MAIN DUMP
|
||||
%token TRUETOK FALSETOK LESS MORE LESS_EQUAL MORE_EQUAL NOT_EQUAL EQUAL
|
||||
%token PLUS MINUS INCR DECR MULT DIV MODULUS NEGATE ABS MIN MAX STAR_SLASH
|
||||
%token AND OR XOR LSHIFT RSHIFT
|
||||
%token DROP DROP2 NIP NIP2 DUP DUP2 SWAP SWAP2 OVER OVER2 ROT ROT2
|
||||
%token RROT RROT2 TUCK TUCK2 ROLL PICK SELECT
|
||||
%token MALLOC FREE GET PUT
|
||||
%token IF ELSE ENDIF WHILE END RECURSE RETURN EXIT
|
||||
%token TAB SPACE CR IN_STR IN_NUM IN_CHAR OUT_STR OUT_NUM OUT_CHAR
|
||||
|
||||
/* Start Token */
|
||||
%start Module
|
||||
|
||||
%%
|
||||
|
||||
/* A module is just a DefinitionList */
|
||||
Module : { SCI->handle_module_start( ); }
|
||||
DefinitionList { $$ = SCI->handle_module_end( $2 ); } ;
|
||||
|
||||
/* A Definitionlist is just a sequence of definitions */
|
||||
DefinitionList : DefinitionList Definition { $$ = SCI->handle_definition_list_end( $1, $2 ); }
|
||||
| /* empty */ { $$ = SCI->handle_definition_list_start(); } ;
|
||||
|
||||
/* A definition can be one of three flavors */
|
||||
Definition : ForwardDef { $$ = $1; }
|
||||
| ColonDef { $$ = $1; }
|
||||
| MainDef { $$ = $1; } ;
|
||||
|
||||
/* Forward definitions just introduce a name */
|
||||
ForwardDef : FORWARD IDENTIFIER SEMI { $$ = SCI->handle_forward( $2 ); } ;
|
||||
|
||||
/* The main definition has to generate additional code so we treat it specially */
|
||||
MainDef : COLON MAIN WordList SEMI { $$ = SCI->handle_main_definition($3); } ;
|
||||
|
||||
/* Regular definitions have a name and a WordList */
|
||||
ColonDef : COLON IDENTIFIER WordList SEMI { $$ = SCI->handle_definition( $2, $3 ); } ;
|
||||
|
||||
/* A WordList is just a sequence of words */
|
||||
WordList : WordList Word { $$ = SCI->handle_word_list_end( $1, $2 ); }
|
||||
| /* empty */ { $$ = SCI->handle_word_list_start(); } ;
|
||||
|
||||
/* A few "words" have a funky syntax */
|
||||
/* FIXME: The body of compound words can currently only be function calls */
|
||||
/* This is not acceptable, it should be a WordList, but that produces a Function */
|
||||
/* Which is hard to merge into the function the compound statement is working on */
|
||||
Word : IF IDENTIFIER ELSE IDENTIFIER ENDIF { $$ = SCI->handle_if( $2, $4 ); }
|
||||
| IF IDENTIFIER ENDIF { $$ = SCI->handle_if( $2 ); }
|
||||
| WHILE IDENTIFIER END { $$ = SCI->handle_while( $2 ); } ;
|
||||
|
||||
/* A few words are handled specially */
|
||||
Word : IDENTIFIER { $$ = SCI->handle_identifier( $1 ); } ;
|
||||
Word : STRING { $$ = SCI->handle_string( $1 ); } ;
|
||||
Word : INTEGER { $$ = SCI->handle_integer( $1 ); } ;
|
||||
|
||||
/* Everything else is a terminal symbol and goes to handle_word */
|
||||
Word : TRUETOK { $$ = SCI->handle_word( TRUETOK ); } ;
|
||||
Word : FALSETOK { $$ = SCI->handle_word( FALSETOK ); } ;
|
||||
Word : LESS { $$ = SCI->handle_word( LESS ); } ;
|
||||
Word : MORE { $$ = SCI->handle_word( MORE ); } ;
|
||||
Word : LESS_EQUAL { $$ = SCI->handle_word( LESS_EQUAL ); } ;
|
||||
Word : MORE_EQUAL { $$ = SCI->handle_word( MORE_EQUAL ); } ;
|
||||
Word : NOT_EQUAL { $$ = SCI->handle_word( NOT_EQUAL ); } ;
|
||||
Word : EQUAL { $$ = SCI->handle_word( EQUAL ); } ;
|
||||
Word : PLUS { $$ = SCI->handle_word( PLUS ); } ;
|
||||
Word : MINUS { $$ = SCI->handle_word( MINUS ); } ;
|
||||
Word : INCR { $$ = SCI->handle_word( INCR ); } ;
|
||||
Word : DECR { $$ = SCI->handle_word( DECR ); } ;
|
||||
Word : MULT { $$ = SCI->handle_word( MULT ); } ;
|
||||
Word : DIV { $$ = SCI->handle_word( DIV ); } ;
|
||||
Word : MODULUS { $$ = SCI->handle_word( MODULUS ); } ;
|
||||
Word : NEGATE { $$ = SCI->handle_word( NEGATE ); } ;
|
||||
Word : ABS { $$ = SCI->handle_word( ABS ); } ;
|
||||
Word : MIN { $$ = SCI->handle_word( MIN ); } ;
|
||||
Word : MAX { $$ = SCI->handle_word( MAX ); } ;
|
||||
Word : STAR_SLASH { $$ = SCI->handle_word( STAR_SLASH ); } ;
|
||||
Word : AND { $$ = SCI->handle_word( AND ); } ;
|
||||
Word : OR { $$ = SCI->handle_word( OR ); } ;
|
||||
Word : XOR { $$ = SCI->handle_word( XOR ); } ;
|
||||
Word : LSHIFT { $$ = SCI->handle_word( LSHIFT ); } ;
|
||||
Word : RSHIFT { $$ = SCI->handle_word( RSHIFT ); } ;
|
||||
Word : DROP { $$ = SCI->handle_word( DROP ); } ;
|
||||
Word : DROP2 { $$ = SCI->handle_word( DROP2 ); } ;
|
||||
Word : NIP { $$ = SCI->handle_word( NIP ); } ;
|
||||
Word : NIP2 { $$ = SCI->handle_word( NIP2 ); } ;
|
||||
Word : DUP { $$ = SCI->handle_word( DUP ); } ;
|
||||
Word : DUP2 { $$ = SCI->handle_word( DUP2 ); } ;
|
||||
Word : SWAP { $$ = SCI->handle_word( SWAP ); } ;
|
||||
Word : SWAP2 { $$ = SCI->handle_word( SWAP2 ); } ;
|
||||
Word : OVER { $$ = SCI->handle_word( OVER ); } ;
|
||||
Word : OVER2 { $$ = SCI->handle_word( OVER2 ); } ;
|
||||
Word : ROT { $$ = SCI->handle_word( ROT ); } ;
|
||||
Word : ROT2 { $$ = SCI->handle_word( ROT2 ); } ;
|
||||
Word : RROT { $$ = SCI->handle_word( RROT ); } ;
|
||||
Word : RROT2 { $$ = SCI->handle_word( RROT2 ); } ;
|
||||
Word : TUCK { $$ = SCI->handle_word( TUCK ); } ;
|
||||
Word : TUCK2 { $$ = SCI->handle_word( TUCK2 ); } ;
|
||||
Word : ROLL { $$ = SCI->handle_word( ROLL ); } ;
|
||||
Word : PICK { $$ = SCI->handle_word( PICK ); } ;
|
||||
Word : SELECT { $$ = SCI->handle_word( SELECT ); } ;
|
||||
Word : MALLOC { $$ = SCI->handle_word( MALLOC ); } ;
|
||||
Word : FREE { $$ = SCI->handle_word( FREE ); } ;
|
||||
Word : GET { $$ = SCI->handle_word( GET ); } ;
|
||||
Word : PUT { $$ = SCI->handle_word( PUT ); } ;
|
||||
Word : RECURSE { $$ = SCI->handle_word( RECURSE ); } ;
|
||||
Word : RETURN { $$ = SCI->handle_word( RETURN ); } ;
|
||||
Word : EXIT { $$ = SCI->handle_word( EXIT ); } ;
|
||||
Word : TAB { $$ = SCI->handle_word( TAB ); };
|
||||
Word : SPACE { $$ = SCI->handle_word( SPACE ); } ;
|
||||
Word : CR { $$ = SCI->handle_word( CR ); } ;
|
||||
Word : IN_STR { $$ = SCI->handle_word( IN_STR ); } ;
|
||||
Word : IN_NUM { $$ = SCI->handle_word( IN_NUM ); } ;
|
||||
Word : IN_CHAR { $$ = SCI->handle_word( IN_CHAR ); } ;
|
||||
Word : OUT_STR { $$ = SCI->handle_word( OUT_STR ); } ;
|
||||
Word : OUT_NUM { $$ = SCI->handle_word( OUT_NUM ); } ;
|
||||
Word : OUT_CHAR { $$ = SCI->handle_word( OUT_CHAR ); } ;
|
||||
Word : DUMP { $$ = SCI->handle_word( DUMP ); } ;
|
||||
|
||||
%%
|
||||
|
||||
/* Handle messages a little more nicely than the default yyerror */
|
||||
int yyerror(const char *ErrorMsg) {
|
||||
std::string where
|
||||
= std::string((SCI->filename() == "-") ? std::string("<stdin>") : SCI->filename())
|
||||
+ ":" + utostr((unsigned) Stackerlineno ) + ": ";
|
||||
std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
|
||||
if (yychar == YYEMPTY)
|
||||
errMsg += "end-of-file.";
|
||||
else
|
||||
errMsg += "token: '" + std::string(Stackertext, Stackerleng) + "'";
|
||||
StackerCompiler::ThrowException(errMsg);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
//===-- StackerParser.y - Parser for Stacker programs -----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by the LLVM research group and is distributed under
|
||||
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the bison parser for Stacker programs.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
%{
|
||||
#include "StackerCompiler.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/DepthFirstIterator.h"
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
|
||||
#define YYERROR_VERBOSE 1
|
||||
#define SCI StackerCompiler::TheInstance
|
||||
|
||||
int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
|
||||
int yylex(); // declaration" of xxx warnings.
|
||||
int yyparse();
|
||||
|
||||
%}
|
||||
|
||||
%union
|
||||
{
|
||||
llvm::Module* ModuleVal;
|
||||
llvm::Function* FunctionVal;
|
||||
llvm::BasicBlock* BasicBlockVal;
|
||||
int64_t IntegerVal;
|
||||
char* StringVal;
|
||||
}
|
||||
|
||||
/* Typed Productions */
|
||||
%type <ModuleVal> Module DefinitionList
|
||||
%type <FunctionVal> Definition ForwardDef ColonDef MainDef
|
||||
%type <FunctionVal> WordList
|
||||
%type <BasicBlockVal> Word
|
||||
|
||||
/* Typed Tokens */
|
||||
%token <IntegerVal> INTEGER
|
||||
%token <StringVal> STRING IDENTIFIER
|
||||
|
||||
/* Terminal Tokens */
|
||||
%token SEMI COLON FORWARD MAIN DUMP
|
||||
%token TRUETOK FALSETOK LESS MORE LESS_EQUAL MORE_EQUAL NOT_EQUAL EQUAL
|
||||
%token PLUS MINUS INCR DECR MULT DIV MODULUS NEGATE ABS MIN MAX STAR_SLASH
|
||||
%token AND OR XOR LSHIFT RSHIFT
|
||||
%token DROP DROP2 NIP NIP2 DUP DUP2 SWAP SWAP2 OVER OVER2 ROT ROT2
|
||||
%token RROT RROT2 TUCK TUCK2 ROLL PICK SELECT
|
||||
%token MALLOC FREE GET PUT
|
||||
%token IF ELSE ENDIF WHILE END RECURSE RETURN EXIT
|
||||
%token TAB SPACE CR IN_STR IN_NUM IN_CHAR OUT_STR OUT_NUM OUT_CHAR
|
||||
|
||||
/* Start Token */
|
||||
%start Module
|
||||
|
||||
%%
|
||||
|
||||
/* A module is just a DefinitionList */
|
||||
Module : { SCI->handle_module_start( ); }
|
||||
DefinitionList { $$ = SCI->handle_module_end( $2 ); } ;
|
||||
|
||||
/* A Definitionlist is just a sequence of definitions */
|
||||
DefinitionList : DefinitionList Definition { $$ = SCI->handle_definition_list_end( $1, $2 ); }
|
||||
| /* empty */ { $$ = SCI->handle_definition_list_start(); } ;
|
||||
|
||||
/* A definition can be one of three flavors */
|
||||
Definition : ForwardDef { $$ = $1; }
|
||||
| ColonDef { $$ = $1; }
|
||||
| MainDef { $$ = $1; } ;
|
||||
|
||||
/* Forward definitions just introduce a name */
|
||||
ForwardDef : FORWARD IDENTIFIER SEMI { $$ = SCI->handle_forward( $2 ); } ;
|
||||
|
||||
/* The main definition has to generate additional code so we treat it specially */
|
||||
MainDef : COLON MAIN WordList SEMI { $$ = SCI->handle_main_definition($3); } ;
|
||||
|
||||
/* Regular definitions have a name and a WordList */
|
||||
ColonDef : COLON IDENTIFIER WordList SEMI { $$ = SCI->handle_definition( $2, $3 ); } ;
|
||||
|
||||
/* A WordList is just a sequence of words */
|
||||
WordList : WordList Word { $$ = SCI->handle_word_list_end( $1, $2 ); }
|
||||
| /* empty */ { $$ = SCI->handle_word_list_start(); } ;
|
||||
|
||||
/* A few "words" have a funky syntax */
|
||||
/* FIXME: The body of compound words can currently only be function calls */
|
||||
/* This is not acceptable, it should be a WordList, but that produces a Function */
|
||||
/* Which is hard to merge into the function the compound statement is working on */
|
||||
Word : IF IDENTIFIER ELSE IDENTIFIER ENDIF { $$ = SCI->handle_if( $2, $4 ); }
|
||||
| IF IDENTIFIER ENDIF { $$ = SCI->handle_if( $2 ); }
|
||||
| WHILE IDENTIFIER END { $$ = SCI->handle_while( $2 ); } ;
|
||||
|
||||
/* A few words are handled specially */
|
||||
Word : IDENTIFIER { $$ = SCI->handle_identifier( $1 ); } ;
|
||||
Word : STRING { $$ = SCI->handle_string( $1 ); } ;
|
||||
Word : INTEGER { $$ = SCI->handle_integer( $1 ); } ;
|
||||
|
||||
/* Everything else is a terminal symbol and goes to handle_word */
|
||||
Word : TRUETOK { $$ = SCI->handle_word( TRUETOK ); } ;
|
||||
Word : FALSETOK { $$ = SCI->handle_word( FALSETOK ); } ;
|
||||
Word : LESS { $$ = SCI->handle_word( LESS ); } ;
|
||||
Word : MORE { $$ = SCI->handle_word( MORE ); } ;
|
||||
Word : LESS_EQUAL { $$ = SCI->handle_word( LESS_EQUAL ); } ;
|
||||
Word : MORE_EQUAL { $$ = SCI->handle_word( MORE_EQUAL ); } ;
|
||||
Word : NOT_EQUAL { $$ = SCI->handle_word( NOT_EQUAL ); } ;
|
||||
Word : EQUAL { $$ = SCI->handle_word( EQUAL ); } ;
|
||||
Word : PLUS { $$ = SCI->handle_word( PLUS ); } ;
|
||||
Word : MINUS { $$ = SCI->handle_word( MINUS ); } ;
|
||||
Word : INCR { $$ = SCI->handle_word( INCR ); } ;
|
||||
Word : DECR { $$ = SCI->handle_word( DECR ); } ;
|
||||
Word : MULT { $$ = SCI->handle_word( MULT ); } ;
|
||||
Word : DIV { $$ = SCI->handle_word( DIV ); } ;
|
||||
Word : MODULUS { $$ = SCI->handle_word( MODULUS ); } ;
|
||||
Word : NEGATE { $$ = SCI->handle_word( NEGATE ); } ;
|
||||
Word : ABS { $$ = SCI->handle_word( ABS ); } ;
|
||||
Word : MIN { $$ = SCI->handle_word( MIN ); } ;
|
||||
Word : MAX { $$ = SCI->handle_word( MAX ); } ;
|
||||
Word : STAR_SLASH { $$ = SCI->handle_word( STAR_SLASH ); } ;
|
||||
Word : AND { $$ = SCI->handle_word( AND ); } ;
|
||||
Word : OR { $$ = SCI->handle_word( OR ); } ;
|
||||
Word : XOR { $$ = SCI->handle_word( XOR ); } ;
|
||||
Word : LSHIFT { $$ = SCI->handle_word( LSHIFT ); } ;
|
||||
Word : RSHIFT { $$ = SCI->handle_word( RSHIFT ); } ;
|
||||
Word : DROP { $$ = SCI->handle_word( DROP ); } ;
|
||||
Word : DROP2 { $$ = SCI->handle_word( DROP2 ); } ;
|
||||
Word : NIP { $$ = SCI->handle_word( NIP ); } ;
|
||||
Word : NIP2 { $$ = SCI->handle_word( NIP2 ); } ;
|
||||
Word : DUP { $$ = SCI->handle_word( DUP ); } ;
|
||||
Word : DUP2 { $$ = SCI->handle_word( DUP2 ); } ;
|
||||
Word : SWAP { $$ = SCI->handle_word( SWAP ); } ;
|
||||
Word : SWAP2 { $$ = SCI->handle_word( SWAP2 ); } ;
|
||||
Word : OVER { $$ = SCI->handle_word( OVER ); } ;
|
||||
Word : OVER2 { $$ = SCI->handle_word( OVER2 ); } ;
|
||||
Word : ROT { $$ = SCI->handle_word( ROT ); } ;
|
||||
Word : ROT2 { $$ = SCI->handle_word( ROT2 ); } ;
|
||||
Word : RROT { $$ = SCI->handle_word( RROT ); } ;
|
||||
Word : RROT2 { $$ = SCI->handle_word( RROT2 ); } ;
|
||||
Word : TUCK { $$ = SCI->handle_word( TUCK ); } ;
|
||||
Word : TUCK2 { $$ = SCI->handle_word( TUCK2 ); } ;
|
||||
Word : ROLL { $$ = SCI->handle_word( ROLL ); } ;
|
||||
Word : PICK { $$ = SCI->handle_word( PICK ); } ;
|
||||
Word : SELECT { $$ = SCI->handle_word( SELECT ); } ;
|
||||
Word : MALLOC { $$ = SCI->handle_word( MALLOC ); } ;
|
||||
Word : FREE { $$ = SCI->handle_word( FREE ); } ;
|
||||
Word : GET { $$ = SCI->handle_word( GET ); } ;
|
||||
Word : PUT { $$ = SCI->handle_word( PUT ); } ;
|
||||
Word : RECURSE { $$ = SCI->handle_word( RECURSE ); } ;
|
||||
Word : RETURN { $$ = SCI->handle_word( RETURN ); } ;
|
||||
Word : EXIT { $$ = SCI->handle_word( EXIT ); } ;
|
||||
Word : TAB { $$ = SCI->handle_word( TAB ); };
|
||||
Word : SPACE { $$ = SCI->handle_word( SPACE ); } ;
|
||||
Word : CR { $$ = SCI->handle_word( CR ); } ;
|
||||
Word : IN_STR { $$ = SCI->handle_word( IN_STR ); } ;
|
||||
Word : IN_NUM { $$ = SCI->handle_word( IN_NUM ); } ;
|
||||
Word : IN_CHAR { $$ = SCI->handle_word( IN_CHAR ); } ;
|
||||
Word : OUT_STR { $$ = SCI->handle_word( OUT_STR ); } ;
|
||||
Word : OUT_NUM { $$ = SCI->handle_word( OUT_NUM ); } ;
|
||||
Word : OUT_CHAR { $$ = SCI->handle_word( OUT_CHAR ); } ;
|
||||
Word : DUMP { $$ = SCI->handle_word( DUMP ); } ;
|
||||
|
||||
%%
|
||||
|
||||
/* Handle messages a little more nicely than the default yyerror */
|
||||
int yyerror(const char *ErrorMsg) {
|
||||
std::string where
|
||||
= std::string((SCI->filename() == "-") ? std::string("<stdin>") : SCI->filename())
|
||||
+ ":" + utostr((unsigned) Stackerlineno ) + ": ";
|
||||
std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
|
||||
if (yychar == YYEMPTY)
|
||||
errMsg += "end-of-file.";
|
||||
else
|
||||
errMsg += "token: '" + std::string(Stackertext, Stackerleng) + "'";
|
||||
StackerCompiler::ThrowException(errMsg);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#===-- projects/llvm-stacker/lib/runtime/Makefile -----------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
LEVEL = ../..
|
||||
DONT_BUILD_RELINKED = 1
|
||||
MODULE_NAME = stkr_runtime
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
@@ -1,74 +0,0 @@
|
||||
/*===-- stacker_rt.c - Runtime Support For Stacker Compiler -----*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by Reid Spencer and donated to the LLVM research
|
||||
// group and is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines a stack dumping function that can be used for debugging.
|
||||
// It is called whenever the DUMP built-in word is used in the Stacker source.
|
||||
// It has no effect on the stack (other than to print it).
|
||||
//
|
||||
// The real reason this is here is to test LLVM's ability to link with
|
||||
// separately compiled software.
|
||||
//
|
||||
//===----------------------------------------------------------------------===*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
extern int64_t _index_;
|
||||
extern int64_t _stack_[];
|
||||
extern void _MAIN_();
|
||||
|
||||
void
|
||||
_stacker_dump_stack_()
|
||||
{
|
||||
int64_t i;
|
||||
printf("Stack Dump:\n");
|
||||
for (i = _index_; i > 0; i-- )
|
||||
{
|
||||
printf("#%03lld: %lld\n", (long long int) i, (long long int) _stack_[i] );
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main ( int argc, char** argv )
|
||||
{
|
||||
/* Avoid modifying argc */
|
||||
int a = argc;
|
||||
|
||||
/* Make sure we're starting with the right index */
|
||||
_index_ = 0;
|
||||
|
||||
/* Copy the arguments to the stack in reverse order
|
||||
* so that they get popped in the order presented
|
||||
*/
|
||||
while ( a > 0 )
|
||||
{
|
||||
if ( isdigit( (int) argv[--a][0] ) )
|
||||
{
|
||||
_stack_[_index_++] = atoll( argv[a] );
|
||||
}
|
||||
else
|
||||
{
|
||||
_stack_[_index_++] = (int64_t) (intptr_t) argv[a];
|
||||
}
|
||||
}
|
||||
|
||||
/* Put the argument count on the stack */
|
||||
_stack_[_index_] = argc;
|
||||
|
||||
/* Invoke the user's main program */
|
||||
_MAIN_();
|
||||
|
||||
/* Return last item on the stack */
|
||||
if ( _index_ >= 0 )
|
||||
return _stack_[_index_];
|
||||
return -1;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#===-- projects/llvm-stacker/samples/Makefile ---------------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
#
|
||||
# This makefile builds some sample stacker programs.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
# Indicates our relative path to the top of the project's root directory.
|
||||
LEVEL = ../../..
|
||||
DIRS =
|
||||
|
||||
EXTRA_DIST = fibonacci.st hello.st prime.st goof.st
|
||||
|
||||
SAMPLES = fibonacci hello prime goof
|
||||
|
||||
LLVMC_EXEC = LLVM_CONFIG_DIR=$(BUILD_SRC_ROOT)/tools/llvmc $(TOOLDIR)/llvmc
|
||||
|
||||
all :: $(SAMPLES)
|
||||
|
||||
ifdef OPTIMIZE
|
||||
% : %.st
|
||||
$(Echo) "Compiling and Optimizing $(<F)"
|
||||
$(Verb)$(LLVMC_EXEC) -O3 $< -o $@
|
||||
else
|
||||
% : %.st
|
||||
$(Echo) "Compiling $(<F)"
|
||||
$(Verb)$(LLVMC_EXEC) $< -o $@
|
||||
endif
|
||||
|
||||
SAMPLES_LL = $(SAMPLES:%=%.ll)
|
||||
SAMPLES_BC = $(SAMPLES:%=%.bc)
|
||||
SAMPLES_S = $(SAMPLES:%=%.s)
|
||||
|
||||
clean ::
|
||||
$(Verb)rm -f gmon.out $(SAMPLES)
|
||||
#
|
||||
# Include the Master Makefile that knows how to build all.
|
||||
#
|
||||
include $(LEVEL)/Makefile.common
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# Fibonacci Algorithm in Stacker.
|
||||
#
|
||||
: print >d CR;
|
||||
: fibonacci RROT DUP2 + print 3 PICK -- ;
|
||||
: MAIN 0 print 1 print 44 WHILE fibonacci END ;
|
||||
@@ -1,25 +0,0 @@
|
||||
#
|
||||
# goof
|
||||
#
|
||||
: print_one
|
||||
--
|
||||
SWAP
|
||||
>s
|
||||
DROP
|
||||
;
|
||||
: print_it
|
||||
WHILE
|
||||
print_one
|
||||
END
|
||||
;
|
||||
|
||||
: MAIN
|
||||
"MICKEY: I said she was f'in goofy!"
|
||||
"MICKEY: I didn't say she was insane."
|
||||
"JUDGE: Yet you provide no evidence of this and I do not concur."
|
||||
"JUDGE: In your pleadings you claim that Mini Mouse is insane."
|
||||
"MICKEY: Well, what do you mean, your honor?"
|
||||
"JUDGE: Mr. Mouse, I find your grounds for divorce insufficient. "
|
||||
6
|
||||
print_it
|
||||
;
|
||||
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# Traditional "Hello World" program in Stacker
|
||||
#
|
||||
: say_hello "Hello, World!" >s CR ;
|
||||
: MAIN say_hello ;
|
||||
@@ -1,235 +0,0 @@
|
||||
################################################################################
|
||||
#
|
||||
# Brute force prime number generator
|
||||
#
|
||||
# This program is written in classic Stacker style, that being the style of a
|
||||
# stack. Start at the bottom and read your way up !
|
||||
#
|
||||
# Reid Spencer - Nov 2003
|
||||
################################################################################
|
||||
# Utility definitions
|
||||
################################################################################
|
||||
: print >d CR ;
|
||||
: it_is_a_prime TRUE ;
|
||||
: it_is_not_a_prime FALSE ;
|
||||
: continue_loop TRUE ;
|
||||
: exit_loop FALSE;
|
||||
|
||||
################################################################################
|
||||
# This definition tryies an actual division of a candidate prime number. It
|
||||
# determines whether the division loop on this candidate should continue or
|
||||
# not.
|
||||
# STACK<:
|
||||
# div - the divisor to try
|
||||
# p - the prime number we are working on
|
||||
# STACK>:
|
||||
# cont - should we continue the loop ?
|
||||
# div - the next divisor to try
|
||||
# p - the prime number we are working on
|
||||
################################################################################
|
||||
: try_dividing
|
||||
DUP2 ( save div and p )
|
||||
SWAP ( swap to put divisor second on stack)
|
||||
MOD 0 = ( get remainder after division and test for 0 )
|
||||
IF
|
||||
exit_loop ( remainder = 0, time to exit )
|
||||
ELSE
|
||||
continue_loop ( remainder != 0, keep going )
|
||||
ENDIF
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# This function tries one divisor by calling try_dividing. But, before doing
|
||||
# that it checks to see if the value is 1. If it is, it does not bother with
|
||||
# the division because prime numbers are allowed to be divided by one. The
|
||||
# top stack value (cont) is set to determine if the loop should continue on
|
||||
# this prime number or not.
|
||||
# STACK<:
|
||||
# cont - should we continue the loop (ignored)?
|
||||
# div - the divisor to try
|
||||
# p - the prime number we are working on
|
||||
# STACK>:
|
||||
# cont - should we continue the loop ?
|
||||
# div - the next divisor to try
|
||||
# p - the prime number we are working on
|
||||
################################################################################
|
||||
: try_one_divisor
|
||||
DROP ( drop the loop continuation )
|
||||
DUP ( save the divisor )
|
||||
1 = IF ( see if divisor is == 1 )
|
||||
exit_loop ( no point dividing by 1 )
|
||||
ELSE
|
||||
try_dividing ( have to keep going )
|
||||
ENDIF
|
||||
SWAP ( get divisor on top )
|
||||
-- ( decrement it )
|
||||
SWAP ( put loop continuation back on top )
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# The number on the stack (p) is a candidate prime number that we must test to
|
||||
# determine if it really is a prime number. To do this, we divide it by every
|
||||
# number from one p-1 to 1. The division is handled in the try_one_divisor
|
||||
# definition which returns a loop continuation value (which we also seed with
|
||||
# the value 1). After the loop, we check the divisor. If it decremented all
|
||||
# the way to zero then we found a prime, otherwise we did not find one.
|
||||
# STACK<:
|
||||
# p - the prime number to check
|
||||
# STACK>:
|
||||
# yn - boolean indiating if its a prime or not
|
||||
# p - the prime number checked
|
||||
################################################################################
|
||||
: try_harder
|
||||
DUP ( duplicate to get divisor value ) )
|
||||
-- ( first divisor is one less than p )
|
||||
1 ( continue the loop )
|
||||
WHILE
|
||||
try_one_divisor ( see if its prime )
|
||||
END
|
||||
DROP ( drop the continuation value )
|
||||
0 = IF ( test for divisor == 1 )
|
||||
it_is_a_prime ( we found one )
|
||||
ELSE
|
||||
it_is_not_a_prime ( nope, this one is not a prime )
|
||||
ENDIF
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# This definition determines if the number on the top of the stack is a prime
|
||||
# or not. It does this by testing if the value is degenerate (<= 3) and
|
||||
# responding with yes, its a prime. Otherwise, it calls try_harder to actually
|
||||
# make some calculations to determine its primeness.
|
||||
# STACK<:
|
||||
# p - the prime number to check
|
||||
# STACK>:
|
||||
# yn - boolean indicating if its a prime or not
|
||||
# p - the prime number checked
|
||||
################################################################################
|
||||
: is_prime
|
||||
DUP ( save the prime number )
|
||||
3 >= IF ( see if its <= 3 )
|
||||
it_is_a_prime ( its <= 3 just indicate its prime )
|
||||
ELSE
|
||||
try_harder ( have to do a little more work )
|
||||
ENDIF
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# This definition is called when it is time to exit the program, after we have
|
||||
# found a sufficiently large number of primes.
|
||||
# STACK<: ignored
|
||||
# STACK>: exits
|
||||
################################################################################
|
||||
: done
|
||||
"Finished" >s CR ( say we are finished )
|
||||
0 EXIT ( exit nicely )
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# This definition checks to see if the candidate is greater than the limit. If
|
||||
# it is, it terminates the program by calling done. Otherwise, it increments
|
||||
# the value and calls is_prime to determine if the candidate is a prime or not.
|
||||
# If it is a prime, it prints it. Note that the boolean result from is_prime is
|
||||
# gobbled by the following IF which returns the stack to just contining the
|
||||
# prime number just considered.
|
||||
# STACK<:
|
||||
# p - one less than the prime number to consider
|
||||
# STACK>
|
||||
# p+1 - the prime number considered
|
||||
################################################################################
|
||||
: consider_prime
|
||||
DUP ( save the prime number to consider )
|
||||
1000000 < IF ( check to see if we are done yet )
|
||||
done ( we are done, call "done" )
|
||||
ENDIF
|
||||
++ ( increment to next prime number )
|
||||
is_prime ( see if it is a prime )
|
||||
IF
|
||||
print ( it is, print it )
|
||||
ENDIF
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# This definition starts at one, prints it out and continues into a loop calling
|
||||
# consider_prime on each iteration. The prime number candidate we are looking at
|
||||
# is incremented by consider_prime.
|
||||
# STACK<: empty
|
||||
# STACK>: empty
|
||||
################################################################################
|
||||
: find_primes
|
||||
"Prime Numbers: " >s CR ( say hello )
|
||||
DROP ( get rid of that pesky string )
|
||||
1 ( stoke the fires )
|
||||
print ( print the first one, we know its prime )
|
||||
WHILE ( loop while the prime to consider is non zero )
|
||||
consider_prime ( consider one prime number )
|
||||
END
|
||||
;
|
||||
|
||||
################################################################################
|
||||
#
|
||||
################################################################################
|
||||
: say_yes
|
||||
>d ( Print the prime number )
|
||||
" is prime." ( push string to output )
|
||||
>s ( output it )
|
||||
CR ( print carriage return )
|
||||
DROP ( pop string )
|
||||
;
|
||||
|
||||
: say_no
|
||||
>d ( Print the prime number )
|
||||
" is NOT prime." ( push string to put out )
|
||||
>s ( put out the string )
|
||||
CR ( print carriage return )
|
||||
DROP ( pop string )
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# This definition processes a single command line argument and determines if it
|
||||
# is a prime number or not.
|
||||
# STACK<:
|
||||
# n - number of arguments
|
||||
# arg1 - the prime numbers to examine
|
||||
# STACK>:
|
||||
# n-1 - one less than number of arguments
|
||||
# arg2 - we processed one argument
|
||||
################################################################################
|
||||
: do_one_argument
|
||||
-- ( decrement loop counter )
|
||||
SWAP ( get the argument value )
|
||||
is_prime IF ( determine if its prime )
|
||||
say_yes ( uhuh )
|
||||
ELSE
|
||||
say_no ( nope )
|
||||
ENDIF
|
||||
DROP ( done with that argument )
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# The MAIN program just prints a banner and processes its arguments.
|
||||
# STACK<:
|
||||
# n - number of arguments
|
||||
# ... - the arguments
|
||||
################################################################################
|
||||
: process_arguments
|
||||
WHILE ( while there are more arguments )
|
||||
do_one_argument ( process one argument )
|
||||
END
|
||||
;
|
||||
|
||||
################################################################################
|
||||
# The MAIN program just prints a banner and processes its arguments.
|
||||
# STACK<: arguments
|
||||
################################################################################
|
||||
: MAIN
|
||||
NIP ( get rid of the program name )
|
||||
-- ( reduce number of arguments )
|
||||
DUP ( save the arg counter )
|
||||
1 <= IF ( See if we got an argument )
|
||||
process_arguments ( tell user if they are prime )
|
||||
ELSE
|
||||
find_primes ( see how many we can find )
|
||||
ENDIF
|
||||
0 ( push return code )
|
||||
;
|
||||
@@ -1,62 +0,0 @@
|
||||
#===-- projects/llvm-stacker/test/Makefile ------------------*- Makefile -*-===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file was developed by Reid Spencer and is distributed under the
|
||||
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
#
|
||||
# This is the makefile that tests the various facilities of the Stacker language
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
# Indicates our relative path to the top of the project's root directory.
|
||||
LEVEL = ../
|
||||
|
||||
# Directories that need to be built.
|
||||
DIRS =
|
||||
|
||||
# Include the Master Makefile that knows how to build all.
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
LOGIC_TESTS = eq ne le ge gt lt false true
|
||||
BITWISE_TESTS = shl shr xor or and
|
||||
ARITHMETIC_TESTS = abs neg add sub mul div mod star_slash incr decr min max
|
||||
STACK_TESTS = drop drop2 nip nip2 dup dup2 swap swap2 over over2 rot rot2 \
|
||||
rrot rrot2 tuck tuck2 roll pick select
|
||||
MEMORY_TESTS = memory
|
||||
CONTROL_TESTS = while return
|
||||
IO_TESTS = space tab out_chr out_num out_str
|
||||
|
||||
TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
|
||||
$(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
|
||||
|
||||
LLVMC = $(LLVMToolDir)/llvmc
|
||||
|
||||
all :: test_each
|
||||
|
||||
test_each: $(TESTS)
|
||||
$(Echo) "Running Tests..."
|
||||
$(Verb) LD_LIBRARY_PATH=$(PROJ_OBJ_ROOT)/lib/$(CONFIGURATION) \
|
||||
$(PROJ_SRC_DIR)/runtests $(PROJ_OBJ_DIR) $(TESTS)
|
||||
|
||||
% : %.st Makefile testing.bc
|
||||
$(Echo) "Building $*"
|
||||
$(Verb)$(LLVMC) -O4 -o $@ $< testing.bc -L$(LibDir)
|
||||
|
||||
testing.bc : testing.st Makefile
|
||||
$(Echo) "Compiling $*"
|
||||
$(Verb)$(LLVMC) -O3 -c -o $@ $<
|
||||
|
||||
TESTS_LL = $(TESTS:%=%.ll)
|
||||
TESTS_BC = $(TESTS:%=%.bc)
|
||||
TESTS_S = $(TESTS:%=%.s)
|
||||
|
||||
clean ::
|
||||
$(Verb)rm -f gmon.out $(TESTS_LL) $(TESTS_BC) $(TESTS_S) $(TESTS) \
|
||||
testing.bc testing.s testing.ll
|
||||
|
||||
.SUFFIXES: .st .s .ll .bc
|
||||
.PRECIOUS: %.s %.ll %.bc %.st
|
||||
.PHONY: test_each
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# ABS test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: MAIN -23 ABS 23 = IF success ELSE failure ENDIF ;
|
||||
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# ADD test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: step2 7 93 + 100 = IF success ELSE failure ENDIF ;
|
||||
: MAIN 93 7 + 100 = IF step2 ELSE failure ENDIF ;
|
||||
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# AND test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: step2 7 15 AND 7 = IF success ELSE failure ENDIF ;
|
||||
: MAIN 8 16 AND 0 = IF step2 ELSE failure ENDIF ;
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# DECR test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: MAIN 8 -- 7 = IF success ELSE failure ENDIF ;
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# DIV test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: MAIN 7 49 / 7 = IF success ELSE failure ENDIF ;
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# DROP test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: MAIN 1 2 DROP 1 = IF success ELSE failure ENDIF ;
|
||||
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# DROP2 test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: step2 0 = IF success ELSE failure ENDIF ;
|
||||
: MAIN 0 1 2 3 DROP2 1 = IF step2 ELSE failure ENDIF ;
|
||||
@@ -1,8 +0,0 @@
|
||||
#
|
||||
# DUP test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: phase3 1 = IF success ELSE failure ENDIF ;
|
||||
: phase2 2 = IF phase3 ELSE failure ENDIF ;
|
||||
: MAIN 1 2 DUP 2 = IF phase2 ELSE failure ENDIF ;
|
||||
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# DUP2 test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: phase2 1 = IF success ELSE failure ENDIF ;
|
||||
: MAIN 1 2 DUP2 2 = IF phase2 ELSE failure ENDIF ;
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# EQ test
|
||||
#
|
||||
FORWARD success;
|
||||
FORWARD failure;
|
||||
: MAIN 17 17 = IF success ELSE failure ENDIF ;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user