Commit Graph

65 Commits

Author SHA1 Message Date
Chris Lattner df59f5aa3c Pull protocol resolution of out ActOnStartClassInterface, this is also the
last client of the old ParseObjCProtocolReferences, so it also removes it.

llvm-svn: 54094
2008-07-26 04:13:19 +00:00
Chris Lattner b1f3c948ee refactor protocol resolution out of ActOnStartCategoryInterface
llvm-svn: 54093
2008-07-26 04:07:02 +00:00
Chris Lattner 3bbae00f50 pull protocol resolution out into ActOnStartProtocolInterface.
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.

llvm-svn: 54092
2008-07-26 04:03:38 +00:00
Chris Lattner 9c1842b612 simplify some code.
llvm-svn: 54091
2008-07-26 03:47:43 +00:00
Chris Lattner 3f375d055e make sizeof/alignof diagnostics highlight their operand with a sourcerange.
llvm-svn: 54066
2008-07-25 21:45:37 +00:00
Ted Kremenek 77c51b2aa3 Move isObjCObjectPointerType() from Sema to ASTContext.
llvm-svn: 53998
2008-07-24 23:58:27 +00:00
Daniel Dunbar b725726c29 Implement nans, prefetch, and trap builtins.
This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.

llvm-svn: 53885
2008-07-21 22:59:13 +00:00
Chris Lattner d7352d6801 minor cleanup to the actions interface to pass around SmallVectorImpl instead
of a specific smallvector size.

Fix protocol lists to pass down proper location info, so we get diagnostics
like this:

t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
                                  ^

instead of this:

t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
                                           ^


Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>

llvm-svn: 53883
2008-07-21 22:17:28 +00:00
Chris Lattner 530315fe89 improve comments yet again, now I know what this does :)
llvm-svn: 53821
2008-07-21 04:16:33 +00:00
Nate Begeman 191a6b1f1b http://llvm.org/bugs/show_bug.cgi?id=2523
Add some code to handle vector comparisons, which is the language side
of the llvm vicmp/vfcmp instructions.  Also make the vector-vector and
vector-scalar asign checks a bit more sane under the presence of lax vector
conversions.

llvm-svn: 53565
2008-07-14 18:02:46 +00:00
Argyrios Kyrtzidis ed9834272f Add Sema support for C++ classes.
llvm-svn: 52956
2008-07-01 10:37:29 +00:00
Chris Lattner a7e619c17b make type attribute processing static instead of methods on Sema.
llvm-svn: 52881
2008-06-29 00:50:08 +00:00
Chris Lattner b632a6e534 make the rest of the decl attribute processing methods be
static functions instead of methods on sema.

llvm-svn: 52880
2008-06-29 00:43:07 +00:00
Chris Lattner a663a0a1b6 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.

llvm-svn: 52879
2008-06-29 00:28:59 +00:00
Chris Lattner 58418ffa32 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;
                     ^

because you can't make a pointer be HImode.

llvm-svn: 52876
2008-06-29 00:16:31 +00:00
Chris Lattner 2727d1b221 move some code from all callers of ProcessDeclAttributes into
the implementation of ProcessDeclAttributes.

llvm-svn: 52875
2008-06-29 00:02:00 +00:00
Chris Lattner a574154106 more attribute refactoring/renaming, no functionality change.
llvm-svn: 52874
2008-06-28 23:58:55 +00:00
Chris Lattner ed9cbbc4f0 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.

llvm-svn: 52872
2008-06-28 23:48:25 +00:00
Chris Lattner 4a927cba2e 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.

llvm-svn: 52871
2008-06-28 23:36:30 +00:00
Argyrios Kyrtzidis 853fbea313 Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
llvm-svn: 52852
2008-06-28 06:07:14 +00:00
Chris Lattner acbc2d200d the 'mode' attribute is a decl attribute, not a type attribute. Move it to
SemaDeclAttr, and do some cleanups.

llvm-svn: 52844
2008-06-27 22:18:37 +00:00
Chris Lattner cf31de3760 Make Declarator::getDeclSpec() return a const reference to avoid
cases where mutation can introduce bugs.  Propagate around 'const'.

llvm-svn: 52772
2008-06-26 06:49:43 +00:00
Chris Lattner 4b413ea3bf 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.

This fixes rdar://6032532.

llvm-svn: 52769
2008-06-26 06:27:57 +00:00
Argyrios Kyrtzidis 7bbb20e338 Add parsing support for C++ classes.
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.

llvm-svn: 52694
2008-06-24 22:12:16 +00:00
Chris Lattner 535b830449 add parser and sema support for the funny ObjC '@defs' thing.
Patch by David Chisnall!

llvm-svn: 52586
2008-06-21 19:39:06 +00:00
Chris Lattner 5696e7badf Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!

llvm-svn: 52422
2008-06-17 18:05:57 +00:00
Ted Kremenek 34f664d443 Introduce preliminary support for NSString format-string checking.
Patch by Nikita Zhuk!

llvm-svn: 52336
2008-06-16 18:00:42 +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
Eli Friedman 01321c3b8c Clean up dead code from SemaInit landing.
llvm-svn: 52054
2008-06-06 19:40:52 +00:00
Eli Friedman 149614bfe7 Re-fix r51907 in a way which doesn't affect valid code. This essentially
moves the check for the invalid construct to a point where it doesn't 
affect other uses of isIntegerConstantExpr, and we can warn properly 
when the extension is used.  This makes it a bit more complicated, but 
it's a lot cleaner.

Steve, please tell me if this check is sufficient to handle the 
relevant system header.  I know it's enough to handle the testcase, but 
I don't know what exactly the original looks like.

llvm-svn: 51918
2008-06-03 21:01:11 +00:00
Eli Friedman 3e113409cb Implementation of gcc mode attribute; this is significant because
it fixes PR2204.  Not too much to say about the implementation; it works 
in a similar way to the vector size attribute.

At some point, we need to modify the targets to provide information 
about the appropriate types.

llvm-svn: 51577
2008-05-27 03:33:27 +00:00
Eli Friedman d5a55bd466 Perform stricter/more accurate checking for C99 constant expressions
in Sema, per discussion on mailing list.  This doesn't cause any changes 
in the test results.  I'll probably add some more tests at some point, 
but it's an open question what we need to accept to be compatible with 
real code.

This doesn't touch the existing isConstantExpr method on Expr; that 
should be addressed somehow eventually (either removed or refined to 
whatever is appropriate).

llvm-svn: 51318
2008-05-20 13:48:25 +00:00
Eli Friedman f8353034eb Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.

llvm-svn: 51307
2008-05-20 08:23:37 +00:00
Eli Friedman 23a9e3176c Various fixes; solves (almost) all of the test regressions that would be
caused by enabling SemaInit.

llvm-svn: 51261
2008-05-19 19:16:24 +00:00
Eli Friedman a1b4ed8003 Implementation of __builtin_shufflevector, a portable builtin capable of
expressing the full flexibility of the LLVM shufflevector instruction.  
The expected immediate usage is in *mmintrin.h, so that they don't 
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.

llvm-svn: 51113
2008-05-14 19:38:39 +00:00
Douglas Gregor caa8acebe7 Diagnose attempts to use C++ default arguments outside of a function declaration
llvm-svn: 50799
2008-05-07 04:49:29 +00:00
Fariborz Jahanian 09367d68ff Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.

llvm-svn: 50747
2008-05-06 18:09:04 +00:00
Steve Naroff 125d73dc84 Several fixes to SemaInit.cpp. It's still not enabled (since it fails a few tests). Expect to enable it very soon.
llvm-svn: 50688
2008-05-06 00:23:44 +00:00
Fariborz Jahanian 8d91686b0d percolate @optional/@required protocols down to ASTs for
properties declared in the protocol.

llvm-svn: 50662
2008-05-05 18:51:55 +00:00
Fariborz Jahanian 98a6c4fa77 This patch is about merging ObjC2's properties declared in class
protocols into class's property list and performing semantics
on them for while doing so.

llvm-svn: 50587
2008-05-02 19:17:30 +00:00
Steve Naroff f8ecff2a94 Replace Sema::CheckInitializerListTypes() with a helper class (InitListChecker) that synthesizes implicit InitListExpr's when appropriate (see InitListExpr comments in Expr.h for more details). I also moved the code to SemaInit.cpp, to help reduce clutter in SemaDecl.cpp.
NOTE: This work is incomplete and still fails many tests (as a result, it isn't enabled yet). Nevertheless, I wanted to check it in so I can work on it from home.
llvm-svn: 50544
2008-05-01 22:18:59 +00:00
Fariborz Jahanian 7cf18862c2 More ObjC2 property semantics work. Work in progress.
llvm-svn: 50508
2008-05-01 00:03:38 +00:00
Argyrios Kyrtzidis 081148986a Parsing of namespaces:
-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.

llvm-svn: 50321
2008-04-27 13:50:30 +00:00
Nuno Lopes 0276933b4b initial support for recognizing __transparent_union__ attributes
comments on the ML will follow

llvm-svn: 50262
2008-04-25 09:32:00 +00:00
Fariborz Jahanian 0a070ff570 Patch to diagnose inconsistancies between properties declared in current and
its super class. This patch is incomplete.

llvm-svn: 50228
2008-04-24 19:58:34 +00:00
Chris Lattner bec41348e2 "This patch renames
DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC

It makes the code more consistent."

Patch by Zhongxing Xu!

llvm-svn: 50105
2008-04-22 18:39:57 +00:00
Douglas Gregor 89f238cbe1 Clean up handling of function redeclarations
llvm-svn: 50021
2008-04-21 02:02:58 +00:00
Nate Begeman ce4d7fce6b OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.
llvm-svn: 49942
2008-04-18 23:10:10 +00:00
Fariborz Jahanian ffe97a3925 Initial work for property implementation declarations.
Mostly semantic checking in this patch. This is on going
and incomplete.

llvm-svn: 49882
2008-04-18 00:19:30 +00:00
Fariborz Jahanian 0152a1a5db New AST representation for each objc2's property declaration.
llvm-svn: 49699
2008-04-14 23:36:35 +00:00