Commit Graph

44204 Commits

Author SHA1 Message Date
Gabor Greif 5df4326d78 rewrite operand loops to use iterators
llvm-svn: 51789
2008-05-30 21:24:22 +00:00
Mikhail Glushenkov 7640cca259 Make all help strings start in upper case.
llvm-svn: 51788
2008-05-30 21:14:10 +00:00
Eli Friedman 6859a1b961 PR1893: Fix up the type of tentative definitions of incomplete array
types so that they end up the correct size.

llvm-svn: 51787
2008-05-30 20:39:54 +00:00
Owen Anderson 8269c9b1c9 Forgot to commit this file.
llvm-svn: 51786
2008-05-30 20:14:04 +00:00
Eli Friedman 34994cbcbf Fix and enable generating general union initializers. Essentially, what
this does is reconstruct the type for structs and arrays if the type 
wouldn't be compatible otherwise.

The assertion about packing in the struct type reconstruction code 
sucks, but I don't see any obvious way to fix it.  Maybe we need a general
utility method to take a list of types and alignments and try to construct an
unpacked type if possible?

llvm-svn: 51785
2008-05-30 19:58:50 +00:00
Mikhail Glushenkov b6725054b8 Fix the -opt switch and add a test case for it.
llvm-svn: 51784
2008-05-30 19:56:27 +00:00
Eli Friedman c18d9d53bb Allow the type of a global to be different from the type of its
associated declaration. This is a prerequisite to handling
general union initializations; for example, an array of unions involving 
pointers has to be turned into a struct because the elements can have 
incompatible types.

I refactored the code a bit to make it more readable; now, the logic for 
definitions is all in EmitGlobalVarInit.

The second parameter for GetAddrOfGlobalVar is now dead; I'll remove it 
separately.

By itself, this patch should not cause any visible changes.

llvm-svn: 51783
2008-05-30 19:50:47 +00:00
Mikhail Glushenkov 48b9f4be9d Fix indentation.
llvm-svn: 51782
2008-05-30 18:53:09 +00:00
Mikhail Glushenkov 241042b700 Add a --dry-run option to llvmc2. Patch by Holger Schurig.
llvm-svn: 51781
2008-05-30 18:48:52 +00:00
Owen Anderson e785fb639c Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.
llvm-svn: 51780
2008-05-30 18:38:26 +00:00
Eli Friedman 66572afde4 Allow a pointer implicitly cast to a bool as a constant expression, as
required by the standard (the standard doesn't know anything about 
implicit casts).

Disallow pointers cast to non-integral arithmetic types as constant 
expressions.  This was previously allowed by accident. 

llvm-svn: 51779
2008-05-30 18:14:48 +00:00
Eli Friedman 3360d898ec Make sure to allow assigning a pointer to a bool.
llvm-svn: 51778
2008-05-30 18:07:22 +00:00
Owen Anderson 1f59d9937f Since LCSSA switched over to DenseMap, we have to be more careful to avoid iterator invalidation. Fixes PR2385.
llvm-svn: 51777
2008-05-30 17:31:01 +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
Ted Kremenek 6bb6d9f197 Use llvm:🆑:desc for description of the -Wimplicit-function-declaration option.
Patch by Holger Schurig!

llvm-svn: 51774
2008-05-30 16:42:02 +00:00
Ted Kremenek 8595668eca Fix some strict-aliasing warnings by using Stmt* instead of Expr* in VariableArrayType, EnumConstantDecl, and VarDecl.
llvm-svn: 51772
2008-05-30 16:14:41 +00:00
Matthijs Kooijman c9c67157d1 Give a proper error message when a command line option is defined more than
once (ie, at two different places in the source, not two times on the
commandline).

llvm-svn: 51771
2008-05-30 13:26:11 +00:00
Matthijs Kooijman 57da7d2308 Use eraseFromParent() instead of doing that manually in two places.
llvm-svn: 51770
2008-05-30 12:35:46 +00:00
Eli Friedman f7fe41656c Fix constant vector init for initializer lists with an incomplete list
of elements.

llvm-svn: 51769
2008-05-30 12:02:14 +00:00
Eli Friedman 35c01c6f2d Fix crash with -serialize (reported to cfe-dev). The issue was
essentially that we were destroying the declarations twice.

(Note that we don't use -serialize directly in the testsuite, only 
SerializeTest.)

llvm-svn: 51768
2008-05-30 11:28:30 +00:00
Eli Friedman 617ba48fd5 Always check that the definition of a function has the correct type.
This fixes a crash on the included testcase (found in NetHack).

llvm-svn: 51767
2008-05-30 11:13:18 +00:00
Matthijs Kooijman bf8d6cefde Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.

llvm-svn: 51766
2008-05-30 10:31:54 +00:00
Sanjiv Gupta 18de624ca0 Emit parameter and local variable debug information with -g.
llvm-svn: 51765
2008-05-30 10:30:31 +00:00
Eli Friedman 711665c309 Add FIXME to CodeGen struct layout.
llvm-svn: 51764
2008-05-30 10:29:32 +00:00
Eli Friedman a2eaffc747 Some additions to constant initializer generation code. Adds
bit-field initialization; ugly code, X86-only, but it works, at least 
for basic stuff.  Separates/adds union initialization; currently disabled,
though, because the struct/array code needs modifications to support 
elements of the wrong type.

Fixes PR2381 and PR2309 with the bit-field initialization.  And NetHack 
compiles and appears to work with a few tweaks (to work around the lack 
of transparent_union support, and clang being a bit strict about
conflicting declarations).

llvm-svn: 51763
2008-05-30 10:24:46 +00:00
Eli Friedman 3df5efe83e Cleanup/refactoring of Sema struct layout. This patch unifies the struct
and union codepaths and fixes some minor bugs.

I'm reasonably confident this is accurate, at least for X86.  I'll 
correct any bugs as I find them; I haven't found any for a while, 
though.

llvm-svn: 51762
2008-05-30 09:31:38 +00:00
Bill Wendling b0aa651259 Add the "AsCheapAsAMove" flag to some 64-bit xor instructions.
llvm-svn: 51761
2008-05-30 06:47:04 +00:00
Mikhail Glushenkov 394620bbd8 Add a --save-temps option.
llvm-svn: 51760
2008-05-30 06:29:17 +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 47817cd1a4 Documentation update.
llvm-svn: 51758
2008-05-30 06:28:00 +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 1c64538a5e Show argv[0] in error messages (like gcc).
llvm-svn: 51755
2008-05-30 06:26:35 +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 ae551a012d Documentation update.
llvm-svn: 51753
2008-05-30 06:25:24 +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 90777a5b82 -E should print to stdout.
llvm-svn: 51743
2008-05-30 06:18:50 +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 73d708b82c Rename StringVector to StrVector (to be consistent with LLVMCConfigurationEmitter.cpp).
llvm-svn: 51741
2008-05-30 06:17:29 +00:00
Mikhail Glushenkov b2ec0b425b Minor error message fixes.
llvm-svn: 51740
2008-05-30 06:16:59 +00:00
Mikhail Glushenkov dc45f58905 Documentation and examples improvements
llvm-svn: 51739
2008-05-30 06:16:32 +00:00
Mikhail Glushenkov 326d508303 Better error reporting for the 'case' construct.
llvm-svn: 51738
2008-05-30 06:15:47 +00:00