Commit Graph

1403 Commits

Author SHA1 Message Date
Nick Lewycky 0702adc65e Escape "$#".
llvm-svn: 51998
2008-06-05 12:54:44 +00:00
Chris Lattner 6449690da4 Add #includes required by GCC 4.3, thanks for Zhongxing Xu
for reporting this.

llvm-svn: 51926
2008-06-04 04:46:14 +00:00
Dan Gohman 9494a03df8 Update the polygen grammer for the new insertvalue and extractvalue syntax.
llvm-svn: 51879
2008-06-02 19:47:09 +00:00
Dan Gohman 92d62b43c2 Fix the position of MemOperands in nodes that use variadic_ops
in DAGISelEmitter output. This bug was recently uncovered by the
addition of patterns for CALL32m and CALL64m, which are nodes
that now have both MemOperands and variadic_ops.

This bug was especially visible with PIC in various configurations,
because the new patterns are matching the indirect call code used
in many PIC configurations.

llvm-svn: 51877
2008-06-02 17:40:38 +00:00
Anton Korobeynikov 10d2f50826 Initialize members properly during construction
llvm-svn: 51841
2008-06-01 16:22:49 +00:00
Mikhail Glushenkov f970edf9b7 Callback was not executed on OS X when it was a function.
llvm-svn: 51814
2008-05-31 13:43:21 +00:00
Dan Gohman bd3390c73a Teach the DAGISelEmitter to not compute the variable_ops operand
index for the input pattern in terms of the output pattern. Instead
keep track of how many fixed operands the input pattern actually
has, and have the input matching code pass the output-emitting
function that index value. This simplifies the code, disentangles
variables_ops from the support for predication operations, and
makes variable_ops more robust.

llvm-svn: 51808
2008-05-31 02:11:25 +00:00
Evan Cheng 215c528565 Revert 51775.
llvm-svn: 51795
2008-05-30 22:47:19 +00:00
Evan Cheng a50833b695 Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
llvm-svn: 51775
2008-05-30 17:16:20 +00:00
Mikhail Glushenkov 401f3d6eab Add a check for side effect-free options (specified only in the OptionList).
llvm-svn: 51759
2008-05-30 06:28:37 +00:00
Mikhail Glushenkov c03ce6071c Refactoring: remove code duplication introduced in the previous patch.
llvm-svn: 51757
2008-05-30 06:27:29 +00:00
Mikhail Glushenkov e8cee23f67 Refactoring: split CollectProperties into two separate function objects.
llvm-svn: 51756
2008-05-30 06:27:02 +00:00
Mikhail Glushenkov b9b010eb09 New feature: OptionList.
It can be handy to have all information about options gathered in a single place
to provide an overview of all supported options. This patch allows the following:

def Options : OptionList<[
(switch_option "E", (help "Help string")),
(alias_option "quiet", "q")
...
]>;

Tool-specific option properties (like 'append_cmd') have (obviously) no meaning in
this context, so the only properties that are allowed are 'help' and 'required'.

See usage example in examples/Clang.td.

llvm-svn: 51754
2008-05-30 06:26:08 +00:00
Mikhail Glushenkov c8bd3517d5 A small optimization: use static char* array instead of StrVector.
llvm-svn: 51752
2008-05-30 06:24:49 +00:00
Mikhail Glushenkov bf14dd7dc3 Make it possible to test if the '-o' option is provided.
The following is now allowed:

    (case (not_empty "o"), do_something, ...)

This didn't work previously because "-o" is built-in.

llvm-svn: 51751
2008-05-30 06:24:07 +00:00
Mikhail Glushenkov f83f33e8d3 Fix: 'sink' handling was broken.
llvm-svn: 51750
2008-05-30 06:23:29 +00:00
Mikhail Glushenkov b043663cf9 Add support for option aliases.
llvm-svn: 51749
2008-05-30 06:22:52 +00:00
Mikhail Glushenkov bf1552d866 Allow nesting of case expressions.
The following is now legal:

    (case (in_language "c"),
          (case (switch_on "E"), "gcc -x c -E $INFILE", (default), "gcc -x c $INFILE"),
          (default),
          "gcc $INFILE $OUTFILE")

llvm-svn: 51748
2008-05-30 06:22:15 +00:00
Mikhail Glushenkov d1a6a34cc5 Small error message improvement.
llvm-svn: 51747
2008-05-30 06:21:48 +00:00
Mikhail Glushenkov 763cc577b3 Remove RequireDefault parameter from EmitCaseConstructHandler.
There are now no situations when 'default' is required.

llvm-svn: 51746
2008-05-30 06:21:21 +00:00
Mikhail Glushenkov 5916ade717 Fix some headers.
llvm-svn: 51745
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov 2f51489a62 New tests for the 'case' expression: not_empty, in_language.
llvm-svn: 51744
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov 1f7a028929 Make it possible to have multiple input languages for a single tool.
llvm-svn: 51742
2008-05-30 06:18:16 +00:00
Mikhail Glushenkov 326d508303 Better error reporting for the 'case' construct.
llvm-svn: 51738
2008-05-30 06:15:47 +00:00
Mikhail Glushenkov 9e58d5958f Do not generate empty 'if's for the output_suffix property.
llvm-svn: 51737
2008-05-30 06:15:20 +00:00
Mikhail Glushenkov 6db24d96cd Make it possible to use hooks like this: '$CALL(MyHook)/path/to/file'.
llvm-svn: 51734
2008-05-30 06:13:29 +00:00
Mikhail Glushenkov 73edde26f0 Make it possible to change the output file suffix based on command-line options.
For instance, the following command:

    llvmc2 -E hello.c

now generates a file with the correct suffix (hello.i).

llvm-svn: 51733
2008-05-30 06:13:02 +00:00
Mikhail Glushenkov fc4ed7ad83 Add support for user-provided hooks and environment variable reads to the cmd_line tool property.
Used like this: (cmd_line "$CALL(MyHook) --option -o $ENV(VARIABLE) $CALL(AnotherHook)")
Also works with case expressions.

Hook declarations are auto-generated, the definitions should be provided by the user
(just drop a .cpp file in the tools/llvmc2 directory).

Hooks should live in the "hooks" namespace and have type std::string hooks::Hook(void).

llvm-svn: 51732
2008-05-30 06:12:24 +00:00
Mikhail Glushenkov f1c87ff378 Some small tweaks to make the generated code prettier.
llvm-svn: 51729
2008-05-30 06:10:47 +00:00
Mikhail Glushenkov e57a403338 Make it possible to use the generalised 'case' construct in the cmd_line property.
llvm-svn: 51728
2008-05-30 06:10:19 +00:00
Mikhail Glushenkov 8fedbb7b02 Add a generalised 'case' construct.
Besides assigning edge weights, it will also be used by the cmd_line tool property.

llvm-svn: 51727
2008-05-30 06:08:50 +00:00
Dan Gohman 96af4ddb62 Add patterns for CALL32m and CALL64m. They aren't matched in most
cases due to an isel deficiency already noted in
lib/Target/X86/README.txt, but they can be matched in this fold-call.ll
testcase, for example.

This is interesting mainly because it exposes a tricky tblgen bug;
tblgen was incorrectly computing the starting index for variable_ops
in the case of a complex pattern.

llvm-svn: 51706
2008-05-29 21:50:34 +00:00
Dan Gohman 6e582c449f Fix a tblgen problem handling variable_ops in tblgen instruction
definitions. This adds a new construct, "discard", for indicating
that a named node in the input matching pattern is to be discarded,
instead of corresponding to a node in the output pattern. This
allows tblgen to know where the arguments for the varaible_ops are
supposed to begin.

This fixes "rdar://5791600", whatever that is ;-).

llvm-svn: 51699
2008-05-29 19:57:41 +00:00
Bill Wendling 3f6bb2713e Add a flag to indicate that an instruction is as cheap (or cheaper) than a move
instruction to execute. This can be used for transformations (like two-address
conversion) to remat an instruction instead of generating a "move"
instruction. The idea is to decrease the live ranges and register pressure and
all that jazz.

llvm-svn: 51660
2008-05-28 22:54:52 +00:00
Dan Gohman 14552f83bb Fix the spelling of the va_arg keyword.
llvm-svn: 51484
2008-05-23 17:11:55 +00:00
Dan Gohman 30499844ea Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.

llvm-svn: 51468
2008-05-23 01:55:30 +00:00
Dan Gohman 5477a1583a Add a polygen grammar definition for LLVM assembly language.
llvm-svn: 51449
2008-05-22 22:45:03 +00:00
Roman Levenstein 52a005ac13 Do not generate by TableGen the hard-coded standard, target-independent part of
DAG instruction selectors. Introudce a dedicated header file for this part:
include/llvm/CodeGen/DAGISelHeader.h

TableGen now only generates the include preprocessor directive to include this
new header.

This is a preparation for supporting multiple implementations of instruction
selectors in the future.

Reviewed and approved by Evan and Dan.

llvm-svn: 51102
2008-05-14 10:17:11 +00:00
Mikhail Glushenkov c79304461a Filter option names to escape symbols not allowed as C++ identifiers.
Makes it possible to use options with names like "Wa,".
Also fixes the -Wall option handling as a side-effect.

llvm-svn: 50973
2008-05-12 16:33:06 +00:00
Mikhail Glushenkov 22ce861ffe Reapply 50867: A small refactoring (extract method) + some comment fixes.
Fixed the build breakage, sorry for that.

llvm-svn: 50895
2008-05-09 08:27:26 +00:00
Tanya Lattner 93cea9fd18 Revertin 50867 since it was breaking the build.
llvm-svn: 50871
2008-05-08 21:54:20 +00:00
Mikhail Glushenkov d7e151f868 A small refactoring (extract method) + some comment fixes.
llvm-svn: 50867
2008-05-08 20:02:03 +00:00
Mikhail Glushenkov 41318a15d0 Use Doxygen-style comments.
llvm-svn: 50833
2008-05-07 21:50:19 +00:00
Mikhail Glushenkov eeac27e38c Change from llvm::SmallSet<std::string> to llvm::StringMap<char>.
llvm-svn: 50766
2008-05-06 18:18:58 +00:00
Mikhail Glushenkov 5e9d6a3dd8 Add new edge property combinator: weight.
llvm-svn: 50765
2008-05-06 18:18:20 +00:00
Mikhail Glushenkov a02084cff7 Use edge weights to choose the right linker based on input language names.
llvm-svn: 50759
2008-05-06 18:15:12 +00:00
Mikhail Glushenkov 1b056e9e5a Add weights to graph edges. Choose between edges based on their weight.
llvm-svn: 50757
2008-05-06 18:14:24 +00:00
Mikhail Glushenkov 3a2f5c423e Remove the UnpackValues() function.
llvm-svn: 50756
2008-05-06 18:13:45 +00:00
Mikhail Glushenkov 7f6ed20009 Add a --linker command-line option, make all tests pass.
llvm-svn: 50755
2008-05-06 18:13:00 +00:00
Mikhail Glushenkov 20c18c344b Naming fix: LLVMCCConfigurationEmitter -> LLVMCConfigurationEmitter.
llvm-svn: 50754
2008-05-06 18:12:03 +00:00