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

8904 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 0bdf17888d Add test case for <rdar://problem/6562655>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 00:10:09 +00:00
Ted Kremenek c3cf7b27df Fix crash from <rdar://problem/6562655>: 'init' method only return a receiver alias if the return type is a location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 00:05:35 +00:00
Chris Lattner 92dd386e3f replace a dirty hack with a clean solution. Too bad we can't
use Blocks for our callbacks ;-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:53:20 +00:00
Ted Kremenek 33b6f6352d retain/release checker: Generate an intermediate simulation node for "leak"
transitions and then generate a subsequent node that removes the dead symbol
bindings. This should drastically improve caching in the simulation graph when
retain-counted objects are being tracked.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:47:02 +00:00
Chris Lattner d0344a4a61 Fix a long standard problem with clang retaining "too much" sugar
information about types.  We often print diagnostics where we say 
"foo_t" is bad, but the user doesn't know how foo_t is declared 
(because it is a typedef).  Fix this by expanding sugar when present
in a diagnostic (and not one of a few special cases, like vectors).

Before:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:45:49 +00:00
Ted Kremenek 58e899b336 Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:45:28 +00:00
Ted Kremenek 2680b5f926 ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data) so that clients don't need a unique address for the pair itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:43:16 +00:00
Chris Lattner 08eddd9466 pretty printing vector types should print the element type, not just the attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:42:29 +00:00
Fariborz Jahanian a223cca775 More objc's gc ir-gen stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:36:06 +00:00
Chris Lattner 83aa61f600 GetTypeForDeclarator can return null on error now, handle this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:13:55 +00:00
Daniel Dunbar eeb44ce483 ccc: Give nicer error when spawning a subprocess fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:59:57 +00:00
Daniel Dunbar dd2116462a Extend Evaluate() to fold (int) <pointer type>.
- PR3463, PR3398, <rdar://problem/6553401> crash on relocatable
   symbol addresses as constants in static locals.

 - There are many more scenarious we could handle (like arithmetic on
   such an int) but this is the main use case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65074 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:24:01 +00:00
Daniel Dunbar b92dac8bc2 Simplify, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:16:29 +00:00
Ted Kremenek 640f552ace Fix another PTH warning that should not be a note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:14:49 +00:00
Ted Kremenek 395c59c690 Make PTH warnings actual warnings instead of 'notes'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:13:40 +00:00
Mike Stump b83d287bc7 Add enough checking to ensure that non-constant block literals don't
appear to be constant.  I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:01:56 +00:00
Daniel Dunbar f084663ed0 ccc: Also look for .gch files when seeing if we should auto load a
token-cache for clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:01:23 +00:00
Daniel Dunbar e20de512d8 Remove IRgen constant emission assumption that LValue APValue results
only occur for pointer types; they are also possible for integer types
now.
 - No intended functionality change, IntExprEvaluate doesn't return
   LValue results yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:44:24 +00:00
Daniel Dunbar 30c37f4d2e Change IntExprEvaluator to operate on an APValue not an APSInt.
- Prep for handling lvalues, no intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 20:17:33 +00:00
Daniel Dunbar 403bc2bd9e Arguments to unordered comparison builtins may need implicit casts.
- <rdar://problem/6094103> sema fails to promote type arguments to __builtin_isgreater (and friends)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:28:43 +00:00
Anders Carlsson 81ebbde0fb Add irgen support for the noinline attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:22:11 +00:00
Anders Carlsson 5bab788d40 Add sema support for the noinline attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:16:48 +00:00
Ted Kremenek 0527f0d0f3 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:08:21 +00:00
Daniel Dunbar 3f7d995390 Add another IntExprEvaluator::Success overload to suck up remained of
manual setting of the Result.

 - Idiom now enforces that result will always have correct width and
   type; this exposed three new bugs:

    o Enum constant decl value can have different width than type
      (PR3173).

    o EvaluateInteger should not run an IntExprEvaluator over
      non-integral expressions.

    o FloatExprEvaluate was not handling casts correctly (it was
      evaluating the cast in the IntExprEvaluator!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 18:37:50 +00:00
Chris Lattner b66158c299 fix PR3609, emit:
t.c:1:10: error: missing terminating '>' character
#include <stdio.h
         ^

instead of:

t.c:1:10: error: missing terminating " character
#include <stdio.h
         ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 18:29:56 +00:00
Fariborz Jahanian 167fdc137e Generate the conservative objc gc's API for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 18:29:24 +00:00
Ted Kremenek 79f7f8ab9a Update test case to include a leak that occurs at the place of allocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 18:20:28 +00:00
Ted Kremenek b1dbf158db retain/release checker: Fix crasher when the leak site is the same expression that allocates an object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 18:18:48 +00:00
Chris Lattner 0be2ef2321 Fix PR3619 by properly considering size modifiers and type quals when
uniquing array types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 17:31:02 +00:00
Zhongxing Xu d8895f64c4 only track integer and pointer values for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 09:56:08 +00:00
Gabor Greif 4b5d486a0a fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 09:27:40 +00:00
Daniel Dunbar 131eb438d8 Add IntExprEvaluator::Success method.
- Handles assignment to Result with appropriate type.

 - Simplifies & encapsulates most direct handling of the Result value;
   prep for allowing IntExprEvaluator to deal with LValue APValues.

 - No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 09:06:44 +00:00
Zhongxing Xu 6beb16578e fix test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 08:45:23 +00:00
Zhongxing Xu 3450a55f40 add test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 08:42:43 +00:00
Zhongxing Xu 5ea2ffcb6c Convert the offset to signed before making an ElementRegion with it. It seems
that this problem arises from time to time. We should find a fundamental 
solution for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 08:37:16 +00:00
Ted Kremenek 73a1aa016b Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:22:21 +00:00
Daniel Dunbar d5d31801fc Don't emit K&R unprototyped function definitions as varargs.
- <rdar://problem/6584606> clang/x86-64 - too many reg saves


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:15:39 +00:00
Daniel Dunbar afa74448a0 Add Type::getAsFunctionNoProto
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:11:26 +00:00
Chris Lattner f82328852c only do one DenseMap lookup instead of two (one to find out if there is
already an entry and one to insert).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:05:16 +00:00
Chris Lattner ba1bd5c54d minor simplification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:02:09 +00:00
Chris Lattner bd6c800376 use early exit to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:00:44 +00:00
Chris Lattner d000c9ec6e standardise on bastardised american spelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:49:30 +00:00
Chris Lattner 6858dd3fcc fix a bug introduced in my previous patch: moving clang headers to the
"after" group instead of the system group makes it so #include <limits.h>
picks up the *system* limits.h file before clang's.  This causes a failure
on linux and is definitely not what we want.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:48:28 +00:00
Chris Lattner 60b2837ba2 disable copying and assignment of AttributeList
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:41:35 +00:00
Chris Lattner 8a778d6c95 fix warning in no-assert mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:41:13 +00:00
Anders Carlsson 1c17689a67 Emit the correct diagnostics when we constant fold an array size to a negative value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:30:50 +00:00
Chris Lattner 005b235fbc don't new[] an empty array when an AttributeList has
zero expression arguments.  This eliminates 2579 1-byte
mallocs when parsing Cocoa.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:25:12 +00:00
Anders Carlsson e2f0e96e9b Make sure to check the value of the constant expression, as suggested by Daniel.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:19:15 +00:00
Daniel Dunbar 232350d4fa Emission of global variable initialializer was broken in rare
situation where a tentative decl was emitted *after* the actual
initialization. This occurs in some rare situations with static decls.
 - PR3613.

 - I'm not particularly happy with this fix, but I don't see a simpler
   or more elegant solution yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 05:36:41 +00:00
Ted Kremenek d3794b8cc3 scan-build now searches for the clang binary in the subdirectory 'cbin'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 04:58:30 +00:00