Commit Graph

5179 Commits

Author SHA1 Message Date
Matthijs Kooijman 9c995757a9 Sprinkle some "-o -" clang options to make the examples work.
llvm-svn: 52145
2008-06-09 14:09:10 +00:00
Ted Kremenek 420f7e76c7 Add redirection page.
llvm-svn: 52143
2008-06-09 13:38:32 +00:00
Sanjiv Gupta 224e8ea2bb Generate debug descriptors for array types while generating the debug info.
llvm-svn: 52140
2008-06-09 10:47:41 +00:00
Eli Friedman e6e0f23a29 Add code to make test/CodeGen/struct-init.c work correctly without the
pointer cast hack currently in isIntegerConstantExpr 
(in lib/AST/Expr.cpp).  Also removes an odd test that even gcc doesn't accept.

The reason the pointer cast hack is relevant here is that it makes Sema 
end up misinterpreting the relevant expression as a null pointer constant.

The reason for this patch is that I plan to remove the pointer cast hack 
sometime soon because it causes strange issues, especially in its 
current form; see my recent email to cfe-dev
"[PATCH] add constant expression evaluation to the AST and fix PR2413".

llvm-svn: 52120
2008-06-09 05:05:07 +00:00
Eli Friedman 7567573926 For struct initialization, check compatibility with the unqualified
type; this isn't explicitly stated in the standard, but it doesn't 
really make sense for them to have an effect here.  Fixes the included 
testcase, sent to me by Steve Naroff.

llvm-svn: 52113
2008-06-09 03:52:40 +00:00
Chris Lattner e642fcd689 Since this isn't linked from anywhere yet, I'm taking the opportunity
to move it to a more stable URL.  If the S-A work grows, this will be
the entrypoint for the pages related to it.

llvm-svn: 52101
2008-06-08 21:55:32 +00:00
Nuno Lopes b6f7953818 implement the alias attirbute (in both Sema and Codegen)
llvm-svn: 52092
2008-06-08 15:45:52 +00:00
Nuno Lopes cc041ea68e fix compiler warnings
llvm-svn: 52089
2008-06-08 10:16:34 +00:00
Eli Friedman c98a7add43 Don't crash emitting an initializer for a static local with union type.
This fix just makes sure to construct the global with the appropriate 
type, and fixes up the one user this affects to compensate.

llvm-svn: 52084
2008-06-08 01:23:18 +00:00
Eli Friedman 69d721e071 Enable the rewriter tests on all platforms; there don't appear to
be any regressions from this on my machine, but please let me know if 
you run into issues.  (The idea here is that it's better to run all 
tests on all platforms if at all possible.)

llvm-svn: 52083
2008-06-07 23:20:33 +00:00
Eli Friedman 7e4f41ef3f Don't include objc.h, so the rewriter tests work on machines without it.
llvm-svn: 52082
2008-06-07 23:15:03 +00:00
Chris Lattner a5678ccd4a capture whether a CharacterLiteral was wide or not in the AST.
Patch by Mike Stump!

llvm-svn: 52081
2008-06-07 22:35:38 +00:00
Chris Lattner a0173131fa Fix ast dumping to work with long double literals, e.g. we dump:
long double X() { return 1.0L; }

as:

long double X()
(CompoundStmt 0xb06a00 <t.c:2:17, col:32>
  (ReturnStmt 0xb068d0 <col:19, col:26>
    (FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000)))

llvm-svn: 52080
2008-06-07 22:13:43 +00:00
Chris Lattner 82333ccf39 Mark the right ctor explicit, patch by Cédric Venet
llvm-svn: 52078
2008-06-07 19:56:57 +00:00
Eli Friedman 3ce7b20590 Fix crash with conversion to an address-space-qualified pointer. Bug
reported on cfe-dev by Cédric Venet.

Note that I seriously doubt that this perticular construct is useful, 
though: it's a pointer in an alternate address space pointing into 
unqualified address space.

llvm-svn: 52076
2008-06-07 17:27:51 +00:00
Eli Friedman 7dbab8a6a1 Fix the line endings in the newly added DeclBase.cpp.
llvm-svn: 52075
2008-06-07 16:52:53 +00:00
Eli Friedman 445c73d19f Fix Visual Studio project files; patch by Cédric Venet.
llvm-svn: 52074
2008-06-07 16:34:27 +00:00
Sanjiv Gupta 1929242a94 Create debug type descriptors for aggregate/enum types.
llvm-svn: 52070
2008-06-07 04:46:53 +00:00
Ted Kremenek 92611db88f Use a common SourceManager when processing multiple files. This allows us to cache the contents of source files already loaded from disk.
llvm-svn: 52066
2008-06-06 22:42:39 +00:00
Ted Kremenek af44b83296 Updated Xcode project.
llvm-svn: 52065
2008-06-06 21:48:51 +00:00
Ted Kremenek ef17049bac Reclaim memory owned by ObjCForwardProtocolDecls.
llvm-svn: 52063
2008-06-06 21:05:33 +00:00
Eli Friedman fd1e32b1f3 Reorganize this loop a bit so it doesn't crash for empty unions. Fixes
PR2419.

llvm-svn: 52060
2008-06-06 20:12:37 +00:00
Ted Kremenek 71fff8b4de Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim its memory and the memory of the Decls it owns.
llvm-svn: 52059
2008-06-06 20:11:53 +00:00
Ted Kremenek 2e34af659a Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to reclaim its memory and the memory of the Decls it owns.
llvm-svn: 52055
2008-06-06 19:48:57 +00:00
Eli Friedman 01321c3b8c Clean up dead code from SemaInit landing.
llvm-svn: 52054
2008-06-06 19:40:52 +00:00
Ted Kremenek 5144fe2287 Because of a lack of a clear ownership role between ObjCInterfaceDecls and
ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a
horrible hack, and must be removed eventually.

llvm-svn: 52051
2008-06-06 17:21:42 +00:00
Ted Kremenek 09a0d04ea0 Initial work on additional memory collection for ObjC AST objects. We now
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively
destroy their owned Decls and Stmts.  There are a few cases where it is not
clear what to do (FIXMEs included in the patch).

llvm-svn: 52050
2008-06-06 16:45:15 +00:00
Nuno Lopes 9b07b7b099 implement constant expr. sub ptr ptr
llvm-svn: 52049
2008-06-06 16:41:08 +00:00
Devang Patel 8f5645cd51 During interface layout, don't forget super class.
llvm-svn: 52035
2008-06-06 02:14:01 +00:00
Devang Patel e1f10511ba Undo previous check-in.
llvm-svn: 52034
2008-06-06 02:00:35 +00:00
Devang Patel 1216b05d3d During interface layout, don't forget super class.
llvm-svn: 52033
2008-06-06 01:50:12 +00:00
Ted Kremenek 3ad519441f Fix crash when running with multiple source files. This can be improved.
llvm-svn: 52032
2008-06-06 01:47:30 +00:00
Steve Naroff d32ae8edf2 Oops...remove weird printf:-)
llvm-svn: 52025
2008-06-05 22:58:33 +00:00
Steve Naroff 946166f4e9 Second half of "fix" for <rdar://problem/5986085> clang on xcode: error: redefinition of 'XCElementToggler' as different kind of symbol
llvm-svn: 52024
2008-06-05 22:57:10 +00:00
Ted Kremenek dfa8c8aef5 Ignore a few more linker arguments.
llvm-svn: 52023
2008-06-05 22:46:24 +00:00
Steve Naroff a44099f022 super fix submitted by David Chisnall.
llvm-svn: 52014
2008-06-05 18:14:25 +00:00
Steve Naroff 31e1d41338 Fixed a recent test regression from last night (r51976).
llvm-svn: 52006
2008-06-05 15:03:27 +00:00
Steve Naroff 25449a5221 Fix <rdar://problem/5986833> clang on xcode: incompatible type returning 'void', expected 'int'.
- Changed Sema::ObjCActOnStartOfMethodDef() to more accurately type "self" in factory methods.
- Changed Sema::ActOnInstanceMessage() to use the new type to restrict the lookup.

llvm-svn: 52005
2008-06-05 14:49:39 +00:00
Steve Naroff f9c65246dd Fix <rdar://problem/5987482> clang on xcode: null dereference in Sema::ActOnMemberReferenceExpr.
In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>").

llvm-svn: 52001
2008-06-05 13:55:23 +00:00
Sanjiv Gupta 158143ad54 Emit debug information for global and static variables when -g is specified.
llvm-svn: 51993
2008-06-05 08:59:10 +00:00
Steve Naroff d1c3d1130b Fix trivial crasher and downgrade an error to warning (to match GCC).
llvm-svn: 51976
2008-06-05 04:33:44 +00:00
Steve Naroff cfdf6166fc Support "<p>" as a short-hand for "id<p>". Here's a comment from GCC (the only documentation I could find on it).
/* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>" - nisse@lysator.liu.se.  */

This commit adds the parser magic. The type associated with <p> is still incorrect. Will discuss with Chris.

llvm-svn: 51972
2008-06-05 00:02:44 +00:00
Steve Naroff d5bf26fa26 Fix crash identified by <rdar://problem/5986085>.
llvm-svn: 51969
2008-06-04 23:08:38 +00:00
Devang Patel dbb7263fd9 Add ObjCInterface layout support.
Reuse RecordLayout.

llvm-svn: 51968
2008-06-04 21:54:36 +00:00
Steve Naroff 524fbe8687 Update a test and add a FIXME.
llvm-svn: 51967
2008-06-04 21:38:52 +00:00
Devang Patel 21979193bb Refactoring.
Move field layout code in a ASTRecordLayout member fn.

llvm-svn: 51966
2008-06-04 21:22:16 +00:00
Ted Kremenek 6da61be501 ccc-analyzer now properly eats the -install_name, -exported_symbols_list, -current_version, -compatibility_version, and -sectorder command line arguments.
llvm-svn: 51965
2008-06-04 20:49:03 +00:00
Ted Kremenek 46267c839d Added fixmes.
llvm-svn: 51964
2008-06-04 20:48:08 +00:00
Steve Naroff d9c2607014 Parser::ParseObjCSynchronizedStmt() needs to Enter/Exit a decl scope.
llvm-svn: 51963
2008-06-04 20:36:13 +00:00
Eli Friedman 3e1852fa7e Make sure the types are consistent for a void conditional. No visible
difference, but it's better to be consistent.

llvm-svn: 51961
2008-06-04 19:47:51 +00:00