summaryrefslogtreecommitdiffstats
path: root/clang/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Sema::ActOnMemberReferenceExpr() needs to perform the default conversions.Steve Naroff2007-12-161-0/+3
| | | | | | Bug and test case provided by Carl Lewis. llvm-svn: 45078
* - Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ↵Steve Naroff2007-12-141-23/+25
| | | | | | | | | | ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class. - Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage. - Various changes to convert all clients to the above API's... llvm-svn: 45046
* Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceTypeFariborz Jahanian2007-12-131-5/+2
| | | | llvm-svn: 45014
* Sema::ActOnFinishFunctionBody(): Since we no longer synthesize a ↵Steve Naroff2007-12-131-4/+2
| | | | | | FunctionDecl for each method, remove the unconditional initialization to 0 and corresponding comment. llvm-svn: 45008
* Don't do integer promotions of LHS for compound shift assignment. The LHS ↵Chris Lattner2007-12-131-1/+2
| | | | | | has to be a modifiable lvalue. llvm-svn: 44993
* Concatenation of objc strings.Fariborz Jahanian2007-12-121-3/+22
| | | | llvm-svn: 44964
* TargetInfo no longer includes a reference to SourceManager.Ted Kremenek2007-12-123-23/+33
| | | | | | | | | | | | | | | Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. llvm-svn: 44957
* make it a bit more clear in what way the ivar is consistent.Chris Lattner2007-12-121-2/+2
| | | | llvm-svn: 44945
* simplify some code, bump j. This fixes the remaining test failures.Chris Lattner2007-12-121-8/+7
| | | | llvm-svn: 44941
* unbreak the build. I'm still working on test failures.Chris Lattner2007-12-121-31/+32
| | | | llvm-svn: 44938
* split objc pieces of SemaDecl.cpp out into SemaDeclObjC.cppChris Lattner2007-12-122-896/+915
| | | | llvm-svn: 44925
* implement correct semantic analysis for shifts. For:Chris Lattner2007-12-122-26/+21
| | | | | | | | | | | | int test(int x, long long y) { return x << y; } we now realize the type of the shift is int, not long long. This fixes a fixme from june. llvm-svn: 44912
* Add ObjC parser support for concatenated ObjC strings. Note thatChris Lattner2007-12-122-5/+11
| | | | | | | | this is passed to sema and ignored there, so the second part of the string will not make it into the AST. Passing to Fariborz to finish Sema + AST construction. llvm-svn: 44898
* simplify code now that isConstantExpr really does alwaysChris Lattner2007-12-111-11/+13
| | | | | | return a loc. llvm-svn: 44890
* Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek2007-12-111-9/+13
| | | | | | | | | | | | | | | | | | SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. llvm-svn: 44878
* For @optional unimplemented methods do not issue the warning.Fariborz Jahanian2007-12-111-2/+4
| | | | llvm-svn: 44872
* Avoid the first person in a recently added comment. Steve Naroff2007-12-111-2/+2
| | | | llvm-svn: 44843
* Change err_undef_protocolref to warn_undef_protocolref (this is consistent ↵Steve Naroff2007-12-111-3/+3
| | | | | | with GCC). llvm-svn: 44840
* Explicitly set the string literal type from "char *" to "constant array of ↵Steve Naroff2007-12-111-0/+4
| | | | | | | | | | | | char". At this point, I am fairly certain the front-end is correct. Unfortunately, the back-end is still unhappy. That said, I've commented out the two lines in globalinit.c that are causing problems. Chris, please have a look...thanks! llvm-svn: 44823
* Add support for initializing char arrays from string literals.Steve Naroff2007-12-103-31/+116
| | | | | | Adapted from a patch by Anders Carlsson. llvm-svn: 44816
* Implement correct semantic analysis of subtractions, implementingChris Lattner2007-12-091-5/+51
| | | | | | C99 6.5.6. llvm-svn: 44746
* Implemented when static typing is combined with protocols and use as receiverFariborz Jahanian2007-12-071-8/+26
| | | | | | type. llvm-svn: 44685
* Have Sema::CheckConstantInitList skip semantic analysis when the element ↵Steve Naroff2007-12-071-0/+3
| | | | | | | | | | | | | | | | | | | | type is a record (until we implement the FIXME). This removes a bogus error for the following code... snarofflocal% cat bug.m #import <Foundation/NSGeometry.h> #define NUMHELICOPTERRECTS 5 static NSRect helicopterRects[NUMHELICOPTERRECTS] = { {{27, 0}, {18, 11}}, // Bottom {{0, 8}, {4, 11}}, // Tail {{0, 16}, {50, 1}}, {{22, 5}, {18, 12}}, // Body {{0, 10}, {42, 3}} }; llvm-svn: 44684
* Lookup methods in the global pool even when a statically typed object's ↵Steve Naroff2007-12-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | class interface isn't in scope! As the comment in the code indicates, I'm not fond of this. Nevertheless, gcc compat is a goal. Here is the case I'm talking about... #import <Foundation/Foundation.h> @interface AnyClass : NSObject - (NSRect)rect; @end @class Helicopter; static void func(Helicopter *obj) { NSRect r = [obj rect]; } ...before this patch, we would warn/error. With this patch, everything "just works". llvm-svn: 44682
* Rewrite 'super' within a class method. This required some minor tweaks to ↵Steve Naroff2007-12-072-9/+10
| | | | | | the front-end. llvm-svn: 44673
* Patch to implement "Protocol" as a built-in type declared asFariborz Jahanian2007-12-073-25/+15
| | | | | | "@class Protocol;" llvm-svn: 44670
* Add workaround to get test/Parser/compound_literal.c working again.Anders Carlsson2007-12-061-3/+9
| | | | llvm-svn: 44666
* On Steve's suggestion, moved handling of use of undeclared method in a messageFariborz Jahanian2007-12-061-4/+0
| | | | | | to rewriter (my previous patch). llvm-svn: 44665
* A missing method in a messaging expression issues a warning, clients must not Fariborz Jahanian2007-12-061-0/+4
| | | | | | crash because of this. llvm-svn: 44648
* Patch to prevent crash on use of objc2 syntax.Fariborz Jahanian2007-12-051-0/+2
| | | | llvm-svn: 44617
* Add sema checking for compound literal expressions.Anders Carlsson2007-12-051-2/+5
| | | | llvm-svn: 44605
* Revert DidWarn change - It won't catch all cases anyway and GCC warns for ↵Anders Carlsson2007-12-051-5/+1
| | | | | | every excess element. Maybe later we can add back the limit and make it smarter. llvm-svn: 44603
* Recognize CompoundLiteralExpr's as valid lvalue's.Steve Naroff2007-12-051-1/+2
| | | | | | Also updated a FIXME in Sema::CheckInitializer()... llvm-svn: 44602
* Simplified setting up Method's scope before generating AST for its nody.Fariborz Jahanian2007-12-045-38/+22
| | | | llvm-svn: 44576
* Handle initializing vector elements correctly. Emit just one warning if ↵Anders Carlsson2007-12-031-4/+18
| | | | | | there are excess initializers, instead of one per initializer. llvm-svn: 44525
* restore these lines, which fixes some regtest failures.Chris Lattner2007-12-021-4/+4
| | | | llvm-svn: 44516
* improve VC++ compatibility, patch by Cédric Venet.Chris Lattner2007-12-021-4/+4
| | | | llvm-svn: 44496
* Initialize CurMethodDecl to 0.Anders Carlsson2007-11-301-1/+1
| | | | llvm-svn: 44463
* GCC has an extension where the left hand side of the ? : operator can be ↵Anders Carlsson2007-11-301-8/+12
| | | | | | omitted. Handle this in a few more places. llvm-svn: 44462
* Support lax vector conversions.Anders Carlsson2007-11-301-2/+15
| | | | llvm-svn: 44449
* Yesterday, I simplified how we stream top-level decls.Steve Naroff2007-11-294-52/+6
| | | | | | | After a discussion with Ted, we both came to the conclusion that adding a "HandleTopLevelDeclaration" hook to ASConsumer is far more elegant. The default implementation of HandleTopLevelDeclaration will be responsible for iterating over the ScopedDecl (which has a chain of the decls:-). TODO: Once Ted adds HandleTopLevelDeclaration, make sure TagDecls are chainged appropriately... llvm-svn: 44445
* Update the initializer's type, in addition to the decl, if we've changed the ↵Christopher Lamb2007-11-291-1/+3
| | | | | | type of the decl based on it. llvm-svn: 44440
* Enhanced implementation of -Wfloat-equal to check for comparisons againstTed Kremenek2007-11-291-0/+18
| | | | | | | | | | floating-point literals that are represented exactly by the APFloat in FloatingLiteral. For such literals, we do not emit a warning since such checks are often performed in real code to see if a variable has changed from its original value. This heuristic clearly can lead to false negatives, but the hope is it will significantly reduce false positives to help make the compiler flag more useful. llvm-svn: 44424
* Added "isExact" field to FloatingLiteral. This flag indicates whether or notTed Kremenek2007-11-291-2/+6
| | | | | | | | the APFloat representing the parsed literal can represent the literal value exactly. This is useful when performing various semantic checks on the code, and issuing appropriate warnings to users. llvm-svn: 44423
* Several fixes/simplifications surrounding how we stream top-level decl AST's.Steve Naroff2007-11-284-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following code... typedef struct cssm_data {} CSSM_DATA, *CSSM_DATA_PTR; struct Y { int A; }; struct X { int A; } D; struct X E, F; ...now produces the following output... > ../../Debug/bin/clang xx.c -ast-print Read top-level tag decl: 'cssm_data' typedef struct cssm_data CSSM_DATA; typedef struct cssm_data *CSSM_DATA_PTR; Read top-level tag decl: 'Y' Read top-level tag decl: 'X' Read top-level variable decl: 'D' Read top-level variable decl: 'E' Read top-level variable decl: 'F' ...which is much more accurate than the previous -ast-print output... typedef struct cssm_data CSSM_DATA; typedef struct cssm_data CSSM_DATA; Read top-level variable decl: 'D' Read top-level variable decl: 'E' Read top-level variable decl: 'E' llvm-svn: 44421
* Fix a bug checking for 'int foo(void)' that didn't look through typedefs of ↵Chris Lattner2007-11-281-1/+2
| | | | | | | | void. Bug pointed out by Michael Zolda, thanks! llvm-svn: 44408
* Set loc earlier in CheckSingleInitializer to avoid emitting a Chris Lattner2007-11-271-2/+1
| | | | | | | | | | | | | diagnostic without a location. This produces: simpleTest.c:2:18: error: initializer element is not constant int *myPointer = &(myArray[2]); ^~~~~~~~~~~~~ instead of: error: initializer element is not constant llvm-svn: 44375
* Move the null pointer constant check from ↵Steve Naroff2007-11-273-31/+21
| | | | | | | | Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible. Thanks to Seo Sanghyeon for the bug, follow-through, and patch! llvm-svn: 44366
* handle __vector_size__ like vector_sizeChris Lattner2007-11-271-2/+4
| | | | llvm-svn: 44358
* Add comment to CheckVectorCast.hAnders Carlsson2007-11-271-0/+3
| | | | llvm-svn: 44356
OpenPOWER on IntegriCloud