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
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
490692c1d1
Update documentation, add examples.
...
llvm-svn: 51736
2008-05-30 06:14:42 +00:00
Mikhail Glushenkov
0ec82aff72
Rename LLVMC-Tutorial.rst to LLVMC-Reference.rst
...
llvm-svn: 51735
2008-05-30 06:14:01 +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
550052d0e5
Enable the response file ('llvmc @file') support.
...
llvm-svn: 51731
2008-05-30 06:11:45 +00:00
Mikhail Glushenkov
a06c516cad
Update the code to the fact that StringSet now lives in llvm/ADT.
...
llvm-svn: 51730
2008-05-30 06:11:18 +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