Eli Friedman
aee9e54dca
Don't swap function decls, and add them to the scope as they are
...
encountered. Mixing up the decls is unintuitive, and confuses the AST
destruction code. Fixes PR2360.
Note that there is a need to look up the characteristics and
declarations of a function associated with a particular name or decl,
but the original swapping code doesn't solve it properly.
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one
suggestion for how to fix that.
llvm-svn: 51584
2008-05-27 05:07:37 +00:00
Eli Friedman
078c963a31
Add a more reliable check for whether a static declaration has already
...
been used. In preparation for the fix to PR2360, but also a minor bug
in its own right.
llvm-svn: 51583
2008-05-27 04:58:01 +00:00
Eli Friedman
bdef5df44e
Generalize the float type generation code, and specifically fix the
...
codegen of X86 long double.
llvm-svn: 51578
2008-05-27 04:20:05 +00:00
Eli Friedman
3e113409cb
Implementation of gcc mode attribute; this is significant because
...
it fixes PR2204. Not too much to say about the implementation; it works
in a similar way to the vector size attribute.
At some point, we need to modify the targets to provide information
about the appropriate types.
llvm-svn: 51577
2008-05-27 03:33:27 +00:00
Eli Friedman
1c2d5f56f8
Change diagnostic per suggestion, to make it a bit clearer what is
...
happening.
llvm-svn: 51574
2008-05-27 02:01:50 +00:00
Eli Friedman
0e56c82e4a
Count the number of initializable members correctly in structs/unions
...
with unnamed members.
llvm-svn: 51557
2008-05-25 14:03:31 +00:00
Eli Friedman
e0f832bd4f
Diagnose implicit init list for empty aggregate, like struct {}. Fixes
...
PR2151 (by not creating the empty implicit init list).
llvm-svn: 51556
2008-05-25 13:49:22 +00:00
Eli Friedman
85f5497c4a
Move the error checking for variable-sized objects so we don't
...
double-report errors; fixes PR2362.
llvm-svn: 51555
2008-05-25 13:22:35 +00:00
Eli Friedman
d042a969c9
Fix this test on non-X86 platforms.
...
llvm-svn: 51552
2008-05-25 04:43:38 +00:00
Chris Lattner
10a7bd6341
fix a nasty off-by-one error.
...
llvm-svn: 51519
2008-05-23 23:29:33 +00:00
Chris Lattner
17c2476d0b
fix an inconsistency computing offsets that caused a crash on rewrite-nest.m
...
llvm-svn: 51514
2008-05-23 23:06:56 +00:00
Ted Kremenek
6849601f69
More test cases for retain/release checker. These cases handle not flagging leaks for static variables.
...
llvm-svn: 51486
2008-05-23 17:25:17 +00:00
Gabor Greif
f61cb42ab5
fix typo
...
llvm-svn: 51479
2008-05-23 11:19:39 +00:00
Ted Kremenek
db622628e8
Additional retain/release checker regression tests.
...
llvm-svn: 51454
2008-05-22 23:46:11 +00:00
Eli Friedman
bb5de96bc8
Patch for PR2350; the issue was tnat we were allowing (with an error)
...
void f(const void) in one place and rejecting it in another.
llvm-svn: 51424
2008-05-22 08:54:03 +00:00
Ted Kremenek
91f035cda7
Improve dead stores diagnostics to include the variable name.
...
llvm-svn: 51395
2008-05-21 22:59:16 +00:00
Ted Kremenek
b120ff1b95
Fixed bug in the transfer function for dereferences: the loaded value from EvalLoad should bind to the UnaryOperator*, not its subexpression.
...
Added test case to exercise this fix when checking for uses of uninitialized values.
Patch by Zhongxing Xu!
llvm-svn: 51377
2008-05-21 15:48:33 +00:00
Eli Friedman
43f6b67135
A small testcase; no patch, since it was a bug in a patch I never
...
committed.
llvm-svn: 51370
2008-05-21 13:21:01 +00:00
Eli Friedman
0ceef458b6
Fix this test so that it's valid; the point is to test for the crash,
...
not the missing diagnostic.
llvm-svn: 51365
2008-05-21 05:37:55 +00:00
Eli Friedman
0883bfb541
PR2347: Fix crash iterating over VLAs; this started triggering because
...
we now iterate over the whole AST when we destroy it.
llvm-svn: 51363
2008-05-21 05:06:46 +00:00
Eli Friedman
86346ede95
Fix a couple of bugs found by Neil Booth in the const-ness checking.
...
llvm-svn: 51361
2008-05-21 03:39:11 +00:00
Eli Friedman
4b44e2ee8c
Test from PR2332; bug already fixed by r51311.
...
llvm-svn: 51316
2008-05-20 12:55:29 +00:00
Eli Friedman
2460b0c941
Fix the scope of K&R-style argument declarations so that they don't
...
extend beyond the end of the function.
I'm not completely sure this is the right way to fix this bug, so
someone familiar with the parser should double-check.
llvm-svn: 51311
2008-05-20 09:10:20 +00:00
Eli Friedman
f77daf5e58
Fix test (it was incorrectly succeeding).
...
llvm-svn: 51310
2008-05-20 09:04:19 +00:00
Eli Friedman
53e38bd6b6
Add codegen support for stack address intrinsics.
...
llvm-svn: 51309
2008-05-20 08:59:34 +00:00
Eli Friedman
503731aa22
Fix typo in test.
...
llvm-svn: 51308
2008-05-20 08:27:04 +00:00
Eli Friedman
f8353034eb
Add __builtin_frame_address and __builtin_return_address gcc builtins to
...
Sema. No codegen yet.
llvm-svn: 51307
2008-05-20 08:23:37 +00:00
Eli Friedman
4b0e2a30e0
Implement codegen for comma operator for structs.
...
llvm-svn: 51304
2008-05-20 07:56:31 +00:00
Eli Friedman
d0e48ea682
Be a bit more defensive in SemaInit.
...
llvm-svn: 51301
2008-05-20 05:25:56 +00:00
Eli Friedman
37a186d765
Add some more checking for compound literals.
...
llvm-svn: 51300
2008-05-20 05:22:08 +00:00
Eli Friedman
a3a4068949
Implement CodeGen for __builtin_memcpy.
...
llvm-svn: 51282
2008-05-19 23:27:48 +00:00
Eli Friedman
ca8da1d89d
Make the unused expression warning a bit less aggressive (found in PHP
...
code).
llvm-svn: 51276
2008-05-19 21:24:43 +00:00
Eli Friedman
a68c3006f4
Switch on SemaInit; this makes some code in SemaDecl dead, but I'll give
...
it a few days to make sure there aren't any significant regressions.
llvm-svn: 51273
2008-05-19 20:29:35 +00:00
Eli Friedman
541268086a
Remove illegal test.
...
llvm-svn: 51267
2008-05-19 20:17:34 +00:00
Eli Friedman
f23b6fa41f
Fix the emission of expressions like char a[10] = "asdf"; previously,
...
they were causing bad code to be emitted. There are two fixes here: one
makes sure we emit a string that is long enough, and one makes sure we
properly handle string initialization in init lists.
llvm-svn: 51259
2008-05-19 17:51:16 +00:00
Eli Friedman
8e12298192
Add proper type-checking for pointer additiion; before, we were accepting
...
addition with a pointer and an integer even when it didn't make sense.
llvm-svn: 51228
2008-05-18 18:08:51 +00:00
Eli Friedman
f2442dcc8d
Fix support for _Bool bitfields. The issue is that the bitfield width
...
used for _Bool is not the same as the primitive width (which for _Bool
is 1 bit). The load and store changes add some casts to make the
types consistent. The EmitLValue changes make sure that the pointer is
of an appropriate type for loading the bitfield.
This isn't perfect, but it's an improvement, and getting everything
right depends on actually laying out structs in an ABI-compliant way.
llvm-svn: 51224
2008-05-17 20:03:47 +00:00
Eli Friedman
cb92a3f03b
Patch for PR2334, and a similar ObjC bug.
...
llvm-svn: 51193
2008-05-16 17:37:11 +00:00
Eli Friedman
a1b4ed8003
Implementation of __builtin_shufflevector, a portable builtin capable of
...
expressing the full flexibility of the LLVM shufflevector instruction.
The expected immediate usage is in *mmintrin.h, so that they don't
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.
llvm-svn: 51113
2008-05-14 19:38:39 +00:00
Eli Friedman
9fd8b68568
Add codegen support for block-level compound literals.
...
llvm-svn: 51081
2008-05-13 23:18:27 +00:00
Eli Friedman
58639e584c
Both operands to && have to be scalars, not just one.
...
llvm-svn: 51065
2008-05-13 20:16:47 +00:00
Steve Naroff
a98fe19c7e
Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.
...
Teach Sema::MergeVarDecl() about __private_extern__.
llvm-svn: 51005
2008-05-12 22:36:43 +00:00
Steve Naroff
bf1516c618
Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats
...
llvm-svn: 51002
2008-05-12 21:44:38 +00:00
Chris Lattner
c9c296d235
testcase for PR2263, fixed by Nate's r50903 patch.
...
llvm-svn: 50983
2008-05-12 18:31:17 +00:00
Eli Friedman
6a7087e455
Emit basic block for switch body; fixes PR2307.
...
llvm-svn: 50968
2008-05-12 16:08:04 +00:00
Eli Friedman
6e31321043
Don't try to take the address of a bitfield; fixes PR2310.
...
llvm-svn: 50966
2008-05-12 15:06:05 +00:00
Argyrios Kyrtzidis
fa8e15bfa5
-Implement proper name lookup for namespaces.
...
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.
llvm-svn: 50923
2008-05-09 23:39:43 +00:00
Mon P Wang
b84407d6ec
Added support to generate some atomic operators (add, sub, and, or etc..)
...
llvm-svn: 50919
2008-05-09 22:40:52 +00:00
Ted Kremenek
712c91f8a9
Add attribute "format" support for typedefs of function pointers.
...
llvm-svn: 50906
2008-05-09 17:36:24 +00:00
Nate Begeman
f322eabbce
Extend vector member references to include {.hi, .lo, .e, .o} which return a
...
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.
Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.
Remove some unnecessary methods/types in the ExtVectorElementExpr class.
llvm-svn: 50892
2008-05-09 06:41:27 +00:00