Added AnalysisConsumer, a meta-level ASTConsumer class to drive various
analyses. This potentially is the primordial origins of a Clang-equivalent
"PassManager".
The new AnalysisConsumer interface allows multiple analyses to be run from a
single invocation of Clang.
Migrated the logic of "-warn-dead-stores" and "-warn-uninit-values" to use the
new AnalysisConsumer interface. The new interface results in a significant code
reduction to incorporate an analysis into the Driver.
Updated a test case to (correctly) acknowledge that it contains a dead store
(this check wasn't being performed because it was previously masked by
-warn-uninit-values).
Chris Lattner [Mon, 30 Jun 2008 18:32:54 +0000 (18:32 +0000)]
Make a few related changes:
1) add a new ASTContext::getFloatTypeSemantics method.
2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places.
3) Change the TargetInfo.h get*Format methods to return their
fltSemantics byref instead of by pointer.
4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which
sometimes expand specially and othertimes fall back to libm.
5) Add support for __builtin_nan("") to codegen, cases that don't pass
in an empty string are currently lowered to libm calls.
6) Fix codegen of __builtin_infl.
Ted Kremenek [Mon, 30 Jun 2008 16:57:41 +0000 (16:57 +0000)]
Added "Autorelease" ArgEffect to better simulate "autorelease" messages. Right
now this does the same thing as "MayEscape", but more functionality will go in
here shortly.
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.