Chris Lattner [Sun, 29 Jun 2008 00:28:59 +0000 (00:28 +0000)]
make most of Sema public. Sema is a class private to the Sema library
anyway, so there is no real loss here. Start making attribute processing
methods static functions instead of methods on Sema.
Chris Lattner [Sun, 29 Jun 2008 00:16:31 +0000 (00:16 +0000)]
Make ProcessDeclAttributes walk the declarator structure pulling
decl attributes out of the various places they can hide. This makes
us correctly reject things like this:
t.c:2:22: error: mode attribute only supported for integer and floating-point types
int **__attribute((mode(HI)))* i32;
^
Chris Lattner [Sat, 28 Jun 2008 23:48:25 +0000 (23:48 +0000)]
more cleanups, refactor HandleVectorTypeAttribute
to work list the rest of the attr handlers. Also, rename
it to HandleVectorSizeAttribute to match its attr name.
No functionality change.
Chris Lattner [Sat, 28 Jun 2008 23:36:30 +0000 (23:36 +0000)]
adjust the prototypes of a bunch of decl processing methods to take
the single attribute they look at by reference instead of by pointer.
This is a subtle indicator that they take the specified attribute, not
a whole list of them.
This also make HandleExtVectorTypeAttribute work the same way as the rest
of the attributes, adds some comments etc. No functionality change.
Eli Friedman [Sat, 28 Jun 2008 06:23:08 +0000 (06:23 +0000)]
Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work
correctly. (The testcase in PR2501 uses a comparison between long and
unsigned int).
Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
Cedric Venet [Fri, 27 Jun 2008 17:53:02 +0000 (17:53 +0000)]
Add missing include file (due to a file splitting in llvm).
Add new file to Sema Project for VS.
this unbreak the build for VS2005 (with the associated patch on llvm).
Chris Lattner [Thu, 26 Jun 2008 06:27:57 +0000 (06:27 +0000)]
fix a bug handling type attributes in the declspec. declspec processing
used to mutate the attribute list for declspecs when the type was
converted, breaking the case where one declspec was shared by multiple
declarators.
Chris Lattner [Thu, 26 Jun 2008 04:19:03 +0000 (04:19 +0000)]
give CreateObjCRuntime a full CGM so it can get whatever state it needs,
instead of passing in just a couple random things it currently
happens to use.
Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place.
Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass.
Chris Lattner [Tue, 24 Jun 2008 17:04:18 +0000 (17:04 +0000)]
"Support for Objective-C message sends which return structures. Also includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)."
Chris Lattner [Tue, 24 Jun 2008 17:01:28 +0000 (17:01 +0000)]
"This is a small fix for a bug where static object instances were being incorrectly generated. The bug was caused by my inability to read the GNU libobjc source and is only apparent when JITing code (static compilation does not expose the bug due to the data layout of other globals)."
Ted Kremenek [Tue, 24 Jun 2008 15:50:53 +0000 (15:50 +0000)]
ObjCMessageExpr objects that represent messages to class methods now can contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class.
Ted Kremenek [Tue, 24 Jun 2008 03:33:47 +0000 (03:33 +0000)]
Patch by Anders Bergh:
'There's not much to say about this patch, it just adds the Arch Linux
gcc 4.3.1 header paths for i686 and amd64. The patch was generated
using "svn diff" with clang at revision 52660. The paths aren't
distribution-specific, so they should work for all Linux distributions
using the default(?) names like "i686-pc-linux-gnu".'
Ted Kremenek [Mon, 23 Jun 2008 23:30:29 +0000 (23:30 +0000)]
Added ObjCSummaryCache, a new summary cache object to cache summaries for Objective-C methods. Instead of mapping from Selectors -> Summaries, we will now map from (ObjCInterfaceDecl*,Selectors) -> Summaries. This will allow more nuanced summary generation. This patch just swaps in the new data structure; the rest of the code works as before by allowing the ObjCInterfaceDecl* to be null.
Ted Kremenek [Mon, 23 Jun 2008 18:02:52 +0000 (18:02 +0000)]
The CF retain/release checker now assumes that allocations do not fail. Eventually we will add a flag to the driver to enable allocation failures (documented as a FIXME).
Chris Lattner [Sat, 21 Jun 2008 21:44:18 +0000 (21:44 +0000)]
"this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet."
Chris Lattner [Sat, 21 Jun 2008 18:04:54 +0000 (18:04 +0000)]
Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.
Chris Lattner [Sat, 21 Jun 2008 17:46:11 +0000 (17:46 +0000)]
"This maps the -pthread option to -lpthread - this isn't 100% correct,
since handling this correctly is quite complex, and on some platforms
requires additional -D options and on some implies linking against a
different libc, but this works better than just ignoring the option.
The other change passes the -x option across to clang, which allows
compiling .c files as Objective-C and so on. For some reason a lot of
configure scripts seem to be under the misguided impression that this
is a sensible thing to do."
Ted Kremenek [Fri, 20 Jun 2008 21:45:25 +0000 (21:45 +0000)]
Modified the dead stores checker to...
1) Check if a dead store appears as a subexpression. For such cases, we emit
a verbose diagnostic so that users aren't confused. This addresses:
<rdar://problem/5968508> checker gives misleading report for dead store in loop
2) Don't emit a dead store warning when assigning a null value to a pointer.
This is a common form of defensive programming. We may wish to make
this an option to the the checker one day.
This addresses the feature request in the following email:
Ted Kremenek [Fri, 20 Jun 2008 21:39:47 +0000 (21:39 +0000)]
Added "Decl::getCodyBody()", a virtual method that returns the root AST node (Stmt*) that the Decl wraps (if any). Currently this only returns a non-null value for FunctionDecl and ObjCMethodDecl.