Commit Graph

10389 Commits

Author SHA1 Message Date
Steve Naroff e29c4dd022 Partial fix <rdar://problem/6301205> [irgen] dot-syntax on super isn't supported.
Tweak Sema::ActOnMemberReferenceExpr() and Sema::ActOnDeclarationNameExpr() to handle "super." notation for Class methods.

llvm-svn: 66185
2009-03-05 20:12:00 +00:00
Fariborz Jahanian 631c5818ab Moved CollectObjCIvars to more commonly available place
for future use.

llvm-svn: 66184
2009-03-05 20:08:48 +00:00
Fariborz Jahanian 01dff426c8 Adds a template for a function for objc2's gc's ivar layout
bitmap.

llvm-svn: 66175
2009-03-05 19:17:31 +00:00
Ted Kremenek a7ec605dbd Update test case: objects stored to self.ivar are not tracked.
llvm-svn: 66168
2009-03-05 18:15:02 +00:00
Ted Kremenek fa3d77bc2c Retrofit some basic tracking of ivars (for the current object) into BasicStore.
llvm-svn: 66166
2009-03-05 18:08:28 +00:00
Ted Kremenek 89f4781703 Minor code compaction. No functionality change.
llvm-svn: 66165
2009-03-05 16:41:21 +00:00
Ted Kremenek 1fe63ac93d Rename VarBindings -> Bindings.
llvm-svn: 66164
2009-03-05 16:32:59 +00:00
Ted Kremenek 2f340d6cb6 BasicStore:
- Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal
  binding. This mirrors some of the idea of RegionStore, but is far simpler and
  not nearly as functional.  This leads to some code simplification and
  some potential for some minor precision hacks.
  
Along the way...
- constify the use of MemRegion* in a few places
- add operator<<(llvm::raw_ostream, const MemRegion*)

llvm-svn: 66163
2009-03-05 16:31:07 +00:00
Steve Naroff 8f4528bc7c Tweak diag for <rdar://problem/5982579> [clang on xcode] (using arch=x86_64): synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar.
llvm-svn: 66162
2009-03-05 15:45:01 +00:00
Steve Naroff 41d09add4f Fix <rdar://problem/6144382> [sema] gcc inconsistency w.r.t. forward protocol declarations.
llvm-svn: 66161
2009-03-05 15:22:01 +00:00
Mike Stump 4446dcf061 prep work for copy/destroy helpers for block literals.
llvm-svn: 66159
2009-03-05 08:32:30 +00:00
Chris Lattner ff9fbcaa8a if we die in IR generation of a compound statement, include
it in the stack trace, giving us stuff like:

Stack dump:
0.	Program arguments: clang t.c -emit-llvm 
1.	<eof> parser at end of file
2.	t.c:1:5: LLVM IR generation of declaration 'a'
3.	t.c:1:9: LLVM IR generation of compound statement ('{}')
4.	t.c:2:3: LLVM IR generation of compound statement ('{}')
Abort

llvm-svn: 66154
2009-03-05 08:04:57 +00:00
Chris Lattner eae6cb6154 rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.
Introduce a new PrettyStackTraceDecl.
Use it to add the top level LLVM IR generation stuff in 
Backend.cpp to stack traces.  We now get crashes like:

Stack dump:
0.	Program arguments: clang t.c -emit-llvm 
1.	<eof> parser at end of file
2.	t.c:1:5: LLVM IR generation of declaration 'a'
Abort

for IR generation crashes.

llvm-svn: 66153
2009-03-05 08:00:35 +00:00
Ted Kremenek 1d09f6a221 Update checker build.
llvm-svn: 66152
2009-03-05 07:55:15 +00:00
Chris Lattner 6acdec9332 remove unneeded forward decl.
llvm-svn: 66151
2009-03-05 07:54:06 +00:00
Chris Lattner f68012072c if we crash while parsing a block literal, include it.
llvm-svn: 66150
2009-03-05 07:32:12 +00:00
Chris Lattner f02db35b05 fix eof check
llvm-svn: 66149
2009-03-05 07:27:50 +00:00
Chris Lattner bcfe4f7b7b When the parser is live, print out the location and spelling of its current token.
For example:

Stack dump:
0.	Program arguments: clang t.cpp 
1.	t.cpp:4:8: current parser token: ';'
2.	t.cpp:3:1: parsing struct/union/class body 'x'
Abort

It is weird that the parser is always "underneath" any parse context 
actions, but the parser is created first.

llvm-svn: 66148
2009-03-05 07:24:28 +00:00
Chris Lattner a2a1f27bd5 finish comment.
llvm-svn: 66146
2009-03-05 07:16:05 +00:00
Daniel Dunbar d02cb1dc2b Driver: Basic argument parsing.
- Add Driver::ParseArgStrings.
 - Store values directly in CommaJoinedArg to support simple access.
 - Add FlagArg class.

llvm-svn: 66142
2009-03-05 06:38:47 +00:00
Ted Kremenek 2b24f306df Test case: When using RegionStore with the retain/release checker, stop tracking objects assigned to self's ivar.
llvm-svn: 66139
2009-03-05 05:14:55 +00:00
Ted Kremenek 77a3cb2dfa Add test case for RegionStore's tracking of the ivars of 'self'.
llvm-svn: 66136
2009-03-05 04:55:08 +00:00
Ted Kremenek d3c82768e4 Add initial support for tracking ivars, with special handling for ivars of 'self'.
llvm-svn: 66133
2009-03-05 04:50:08 +00:00
Eli Friedman cecc21d2f6 Make IRGen compatible with declaring a function with incomplete
return/argument types.  (The generated IR isn't ideal, but we can't 
really do better in general.)

llvm-svn: 66132
2009-03-05 04:18:07 +00:00
Ted Kremenek 9ce427b21f Add 'cast<>' to remove an extra function call and dynamic cast.
llvm-svn: 66131
2009-03-05 03:44:53 +00:00
Ted Kremenek d982bd83ba More fixes in cast logic.
llvm-svn: 66130
2009-03-05 03:42:31 +00:00
Eli Friedman 22fcc24b30 Initial implementation of CodeGen for incomplete function types; fixes
PR3688.  (The FIXME is a rather big performance issue, but it only 
affects code using this feature, which is relatively rare.)

llvm-svn: 66128
2009-03-05 03:16:41 +00:00
Ted Kremenek eba836a457 GRExprEngine: Polish up handling of casting integer constants to pointers and back.
llvm-svn: 66127
2009-03-05 02:42:32 +00:00
Mike Stump cd1280b405 Avoid dispose calls when only doing gc.
llvm-svn: 66126
2009-03-05 02:34:38 +00:00
Ted Kremenek 6c29a91c05 Fix regression in transparent translation of nonloc::ConcreteInto to loc::ConcreteInt.
llvm-svn: 66125
2009-03-05 02:33:55 +00:00
Chris Lattner 477f990ac5 Include struct context info for parser/sema crashes. This
gives us:

Stack dump:
0.	using-directive.cpp:26:16: in compound statement ('{}')
1.	using-directive.cpp:26:16: parsing function body 'A::K1::foo'
2.	using-directive.cpp:25:3: parsing struct/union/class body 'A::K1'
3.	using-directive.cpp:5:1: parsing namespace 'A'
4.	clang using-directive.cpp 
Abort

for code like:

namespace A {
...
  class K1 {
    void foo() { <<crash>>

llvm-svn: 66124
2009-03-05 02:25:03 +00:00
Chris Lattner e332b82320 Include namespace contexts in the virtual stack trace, so we get stuff
like this:

Stack dump:
0.	using-directive.cpp:9:14: in compound statement ('{}')
1.	using-directive.cpp:9:14: parsing function body 'A::B::f'
2.	using-directive.cpp:7:3: parsing namespace 'A::B'
3.	using-directive.cpp:5:1: parsing namespace 'A'
4.	clang using-directive.cpp 
Abort

for testcase like like:

namespace A {
  short i;
  namespace B {
    long i;
    void f() { <<crash>>

llvm-svn: 66123
2009-03-05 02:09:07 +00:00
Chris Lattner e268b406ba include objc method decl contexts in stack trace of crash, e.g.:
Stack dump:
0.	message.m:53:13: in compound statement ('{}')
1.	message.m:53:13: parsing Objective-C method 'xx'
2.	clang message.m 

llvm-svn: 66121
2009-03-05 02:03:49 +00:00
Devang Patel eed256da90 Set isMain bit for MainFile.
llvm-svn: 66120
2009-03-05 01:55:07 +00:00
Chris Lattner 03b5394da7 When parsing a function body, add it to the crash stack, giving us something
like:

Stack dump:
0.	t.c:5:10: in compound statement ('{}')
1.	t.c:3:12: in compound statement ('{}')
2.	t.c:3:12: parsing function body 'foo'
3.	clang t.c 
Abort

llvm-svn: 66118
2009-03-05 01:25:28 +00:00
Mike Stump 626aecc4be Add codegen support for __block variables to call _Block_object_dispose as necessary.
llvm-svn: 66117
2009-03-05 01:23:13 +00:00
Chris Lattner f5d8ba86cc fix some 80 col violations.
llvm-svn: 66114
2009-03-05 00:56:34 +00:00
Chris Lattner 12f2ea5015 Simplify the interface to ParseFunctionStatementBody to not take
locations that are the current tok loc.  Note that inline C++ methods
have a big fixme that could cause a crash.

llvm-svn: 66113
2009-03-05 00:49:17 +00:00
Eli Friedman 85dfd74439 Use LLVM type header rather than using stdint.h directly.
llvm-svn: 66111
2009-03-05 00:37:49 +00:00
Ted Kremenek 8d9af4cb48 Fix message title
llvm-svn: 66110
2009-03-05 00:12:45 +00:00
Chris Lattner 735012c466 update xcode proj
llvm-svn: 66109
2009-03-05 00:03:30 +00:00
Chris Lattner bd61a95481 Include information about compound statements when crashing in sema or the
parser.  For example, we now print out:

0.	t.c:5:10: in compound statement {}
1.	t.c:3:12: in compound statement {}
2.	clang t.c -fsyntax-only

llvm-svn: 66108
2009-03-05 00:00:31 +00:00
Ted Kremenek 00dfe30409 For now, do not track NSWindow objects and it's subclasses.
llvm-svn: 66107
2009-03-04 23:30:42 +00:00
Daniel Dunbar 458b6982d4 Driver: Implement Option::accept methods.
llvm-svn: 66106
2009-03-04 23:22:02 +00:00
Daniel Dunbar b7396f10b9 Driver: Fix off by one in ParseOneArg; this code is ugly but will be
replaced anyway.

llvm-svn: 66101
2009-03-04 23:03:35 +00:00
Daniel Dunbar 135837e046 Driver: Add Arg::dump and SeparateArg stubs.
llvm-svn: 66100
2009-03-04 23:02:50 +00:00
Fariborz Jahanian 5e55d41cd7 Removed an unfortunate cut and paste left-over.
llvm-svn: 66099
2009-03-04 23:00:40 +00:00
Ted Kremenek 33129a26f7 Add prototype support for invalidating fields for structures passed-by-reference
to unknown functions. Most of this logic should be eventually moved to
RegionStore and be made lazy.

llvm-svn: 66094
2009-03-04 22:56:43 +00:00
Ted Kremenek 9a92b95092 MemRegion:
- Have 'TypedRegion::getRValueType()' return a null QualType for 'id<...>'
  instead of aborting.
- Change 'TypedRegion::isBoundable()' to return true for all objects with a
  non-null RValueType (this may not be the final behavior).

llvm-svn: 66093
2009-03-04 22:55:18 +00:00
Ted Kremenek 6ee8f8bcb5 Add an optional "tag" to conjured symbols that allows us to distinguish between
multiple symbols conjured at the same location. All that is required of the tag
is that it is a fixed void* value that points to an memory address that remains
valid throughout the remainder of the lifetime of the SymbolManager.

llvm-svn: 66092
2009-03-04 22:53:46 +00:00