Граф коммитов

701 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek ca65b0241d More test cases for retain/release checker. These cases handle not flagging leaks for static variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 17:25:17 +00:00
Gabor Greif 1b76779233 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 11:19:39 +00:00
Ted Kremenek bd2a69411d Additional retain/release checker regression tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 23:46:11 +00:00
Eli Friedman 6d1e4b5e7e 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 08:54:03 +00:00
Ted Kremenek 3eb817e509 Improve dead stores diagnostics to include the variable name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51395 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 22:59:16 +00:00
Ted Kremenek 5c96c27e7f 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!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 15:48:33 +00:00
Eli Friedman 0ac5957479 A small testcase; no patch, since it was a bug in a patch I never
committed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 13:21:01 +00:00
Eli Friedman 6b2564c5d9 Fix this test so that it's valid; the point is to test for the crash,
not the missing diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51365 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 05:37:55 +00:00
Eli Friedman b0c0554bd6 PR2347: Fix crash iterating over VLAs; this started triggering because
we now iterate over the whole AST when we destroy it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51363 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 05:06:46 +00:00
Eli Friedman 97c0a39113 Fix a couple of bugs found by Neil Booth in the const-ness checking.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 03:39:11 +00:00
Eli Friedman 33701a6167 Test from PR2332; bug already fixed by r51311.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 12:55:29 +00:00
Eli Friedman 6e33dd5b5c 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 09:10:20 +00:00
Eli Friedman a8ea76a45a Fix test (it was incorrectly succeeding).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 09:04:19 +00:00
Eli Friedman 256f77e431 Add codegen support for stack address intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 08:59:34 +00:00
Eli Friedman e590a84c6e Fix typo in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51308 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 08:27:04 +00:00
Eli Friedman 6cfda23b37 Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51307 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 08:23:37 +00:00
Eli Friedman 07fa52ab33 Implement codegen for comma operator for structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 07:56:31 +00:00
Eli Friedman d8dc210048 Be a bit more defensive in SemaInit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 05:25:56 +00:00
Eli Friedman 6223c22370 Add some more checking for compound literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 05:22:08 +00:00
Eli Friedman d4b32e4651 Implement CodeGen for __builtin_memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 23:27:48 +00:00
Eli Friedman 4be1f47de2 Make the unused expression warning a bit less aggressive (found in PHP
code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 21:24:43 +00:00
Eli Friedman c56c977f44 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:29:35 +00:00
Eli Friedman 19119a819d Remove illegal test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:17:34 +00:00
Eli Friedman 922696f03e 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51259 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 17:51:16 +00:00
Eli Friedman d72d16e6f1 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-18 18:08:51 +00:00
Eli Friedman 316bb1b9eb 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 20:03:47 +00:00
Eli Friedman 145c08360a Patch for PR2334, and a similar ObjC bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 17:37:11 +00:00
Eli Friedman d38617c8a5 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51113 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 19:38:39 +00:00
Eli Friedman 06e863f290 Add codegen support for block-level compound literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51081 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 23:18:27 +00:00
Eli Friedman 5773a6c4ab Both operands to && have to be scalars, not just one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51065 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 20:16:47 +00:00
Steve Naroff 235549c7bd Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.
Teach Sema::MergeVarDecl() about __private_extern__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51005 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 22:36:43 +00:00
Steve Naroff e701c0a953 Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 21:44:38 +00:00
Chris Lattner a989def422 testcase for PR2263, fixed by Nate's r50903 patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 18:31:17 +00:00
Eli Friedman d28a80d646 Emit basic block for switch body; fixes PR2307.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50968 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:08:04 +00:00
Eli Friedman c8ba9614ca Don't try to take the address of a bitfield; fixes PR2310.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50966 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 15:06:05 +00:00
Argyrios Kyrtzidis 00bc645d15 -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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 23:39:43 +00:00
Mon P Wang 1ffe281890 Added support to generate some atomic operators (add, sub, and, or etc..)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 22:40:52 +00:00
Ted Kremenek 72786e009b Add attribute "format" support for typedefs of function pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50906 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 17:36:24 +00:00
Nate Begeman 8a99764f9b 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 06:41:27 +00:00
Chris Lattner abb5758660 Fix rdar://5921025 a crash on the included testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 05:34:49 +00:00
Chris Lattner 63bc035870 The awesome GNU "comma elision extension" works with both the standard
__VA_ARGS__ syntax as well as with the amazingly awesome GNU "named 
variadic macro" extension.  Allow it with the GNU syntax as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 05:10:33 +00:00
Devang Patel 5cada6bd7f Begin handling union bitfields.
Note, this is just beginning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 22:28:29 +00:00
Ted Kremenek 0fcbf8ef89 Expand the CF retain checker to allow the Create/Get rule to apply to any
function that returns a CFxxxRef, not just functions whose name begins with
CF.  This implements <rdar://problem/5917879>.

Added test case for this feature.

Updated calls to CStrInCStrNoCase to swap their arguments, per compatibility
with strcasestr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 20:06:41 +00:00
Douglas Gregor 6d6eb57225 Diagnose attempts to use C++ default arguments outside of a function declaration
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50799 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 04:49:29 +00:00
Ted Kremenek a22cc2f6a6 Don't report leaks for autoreleased objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 23:07:13 +00:00
Devang Patel d8ecd3c8f7 Fix PR2101 - Codegen crash during bitfield initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50769 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 19:57:59 +00:00
Fariborz Jahanian daa03115d6 Test was accidently nullified in previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:14:26 +00:00
Fariborz Jahanian 5251e130a2 Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:09:04 +00:00
Ted Kremenek 70f9d8652b String comparison cleanups.
Added test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50711 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 04:28:05 +00:00
Ted Kremenek b309525445 Use EvalSummary to process message expressions, thereby unifying the checker
logic for function calls and message expressions.

Use the following heuristic to infer "allocating" instance methods:

  [ClassName classWithXXX]  allocates an object
  
Update testcase to reflect this heuristic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50708 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 04:20:12 +00:00