summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-2315-180/+168
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Fix a bunch of -Wdocumentation warnings.Dmitri Gribenko2012-08-235-9/+7
| | | | llvm-svn: 162452
* [ms-inline asm] Rename a few induction variables to avoid confusion and silenceChad Rosier2012-08-231-7/+7
| | | | | | a gcc warning. llvm-svn: 162444
* Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith2012-08-235-21/+31
| | | | llvm-svn: 162430
* Fix undefined behavior: don't call ObjCInterfaceDecl::isArcWeakrefUnavailableRichard Smith2012-08-231-5/+6
| | | | | | | on a null pointer. (This function happens to work for a null 'this' pointer, so no test.) llvm-svn: 162427
* Don't recycle loop variables (to keep GCC happy).Matt Beaumont-Gay2012-08-231-2/+2
| | | | llvm-svn: 162424
* Fix 80-column violation.Chad Rosier2012-08-231-1/+3
| | | | llvm-svn: 162416
* [ms-inline asm] Compute the inputs and outputs. No test case (yet) as thisChad Rosier2012-08-221-1/+28
| | | | | | requires codegen support. llvm-svn: 162410
* [ms-inline asm] Refactor code so that we can begin computing the Inputs/Outputs.Chad Rosier2012-08-221-11/+19
| | | | | | No functional change intended. llvm-svn: 162403
* [ms-inline asm] Add comments.Chad Rosier2012-08-221-1/+3
| | | | llvm-svn: 162396
* [ms-inline asm] Add comments.Chad Rosier2012-08-221-1/+6
| | | | llvm-svn: 162394
* [ms-inline asm] Add helper function. No functional change intended.Chad Rosier2012-08-221-2/+7
| | | | llvm-svn: 162393
* [ms-inline asm] Simplify logic. No functional change intended.Chad Rosier2012-08-221-7/+2
| | | | llvm-svn: 162392
* [ms-inline asm] Compute the token range for each instruction within the asm.Chad Rosier2012-08-221-4/+9
| | | | | | | Eventually, we'll need a way of mapping tokens (and their IdentifierInfo*) to the operands computed by buildMSAsmPieces(). llvm-svn: 162388
* [ms-inline asm] Simplify logic. No functional change intended.Chad Rosier2012-08-221-5/+11
| | | | llvm-svn: 162385
* [ms-inline asm] Start sending non-simple inline asms to the AsmParser.Chad Rosier2012-08-221-15/+27
| | | | | | | The parser still can't handle all cases, so fall back to emitting a simple MSAsmStmt if we get into trouble. llvm-svn: 162382
* Reduce duplicated hash map lookups.Benjamin Kramer2012-08-221-2/+2
| | | | llvm-svn: 162361
* Merge existing attributes before processing pragmas in friend templateRafael Espindola2012-08-221-2/+3
| | | | | | | declarations. Fixes pr13662. llvm-svn: 162360
* [ms-inline asm] Remove the patchMSAsmStrings function. After some discussionChad Rosier2012-08-211-134/+17
| | | | | | | between Bob, Jim, Eric and I, we've decided to take a slightly different approach. llvm-svn: 162327
* [ms-inline asm] Have buildMSAsmString build a vector of unmodified AsmStrings.Chad Rosier2012-08-211-7/+35
| | | | | | | | | | Add a new static function, buildMSAsmPieces, that will break these strings down into mnemonic and operands. Upon a match failure, the idea is to use the ErrorInfo from MatchInstructionImpl to inspect the mnemonic/operand and decide a course of action. Unfortunately, there's no easy way to test this at the moment. llvm-svn: 162321
* change function name in my last patch.Fariborz Jahanian2012-08-211-3/+3
| | | | | | // rdar://12103400 llvm-svn: 162320
* objective-C: Change rules for overriding properties in Fariborz Jahanian2012-08-211-13/+25
| | | | | | | | | class extensions a little. clang now allows readonly property with no ownership rule (assign, unsafe_unretained, weak, retain, strong, or copy) with a readwrite property with an ownership rule. // rdar://12103400 llvm-svn: 162319
* [ms-inline asm] Do not report a Parser error when matching inline assembly.Chad Rosier2012-08-211-1/+2
| | | | llvm-svn: 162307
* [ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl. In general,Chad Rosier2012-08-211-1/+3
| | | | | | this is the index of the operand that failed to match. llvm-svn: 162296
* [ms-inline asm] Append identifier for better debugging.Chad Rosier2012-08-211-0/+1
| | | | llvm-svn: 162289
* [ms-inline asm] Remove this test case and the associated special case code.Chad Rosier2012-08-211-6/+0
| | | | llvm-svn: 162288
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-213-4/+3
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* Better diagnostics for range-based for loops with bad range types.Sam Panzer2012-08-213-170/+335
| | | | | | | | | | | | | The old error message stating that 'begin' was an undeclared identifier is replaced with a new message explaining that the error is in the range expression, along with which of the begin() and end() functions was problematic if relevant. Additionally, if the range was a pointer type or defines operator*, attempt to dereference the range, and offer a FixIt if the modified range works. llvm-svn: 162248
* Fix a pair of bugs relating to properties in ARC.John McCall2012-08-201-1/+18
| | | | | | | | | | | | | | | | | | | | First, when synthesizing an explicitly strong/retain/copy property of Class type, don't pretend during compatibility checking that the property is actually assign. Instead, resolve incompatibilities by secretly changing the type of *implicitly* __unsafe_unretained Class ivars to be strong. This is moderately evil but better than what we were doing. Second, when synthesizing the setter for a strong property of non-retainable type, be sure to use objc_setProperty. This is possible when the property is decorated with the NSObject attribute. This is an ugly, ugly corner of the language, and we probably ought to deprecate it. The first is rdar://problem/12039404; the second was noticed by inspection while fixing the first. llvm-svn: 162244
* Code-complete 'weak' for properties under ARC-with-weak-references (or GC)Jordan Rose2012-08-201-10/+14
| | | | | | | | | | Also, suggest 'readonly' even if the property has been given an ownership attribute ('strong', 'weak', etc). This is used when properties are declared readonly in the public interface but readwrite in a class extension. <rdar://problem/11500004&11932285> llvm-svn: 162220
* [ms-inline asm] Remove old cruft now that MS-style asms their own code path.Chad Rosier2012-08-203-16/+7
| | | | llvm-svn: 162210
* Better wording for reference self-initialization warning.Hans Wennborg2012-08-202-2/+8
| | | | llvm-svn: 162198
* PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers andRichard Smith2012-08-181-24/+36
| | | | | | | | | | | | | | | | | nested names as id-expressions, using the annot_primary_expr annotation, where possible. This removes some redundant lookups, and also allows us to typo-correct within tentative parsing, and to carry on disambiguating past an identifier which we can determine will fail lookup as both a type and as a non-type, allowing us to disambiguate more declarations (and thus offer improved error recovery for such cases). This also introduces to the parser the notion of a tentatively-declared name, which is an identifier which we *might* have seen a declaration for in a tentative parse (but only if we end up disambiguating the tokens as a declaration). This is necessary to correctly disambiguate cases where a variable is used within its own initializer. llvm-svn: 162159
* When code completion is enabled, don't do any work inDouglas Gregor2012-08-171-0/+5
| | | | | | Sema::ActOnEndOfTranslationUnit(). This is a (minor) optimization. llvm-svn: 162144
* c: privide deprecated warning when __private_extern__ storageFariborz Jahanian2012-08-171-1/+3
| | | | | | | | specifier is unsed in a declaration; as it may not make the symbol local to linkage unit as intended. Suggest using "hidden" visibility attribute instead. // rdar://7703982 llvm-svn: 162138
* [ms-inline asm] Update comment.Chad Rosier2012-08-171-1/+1
| | | | llvm-svn: 162134
* [ms-inline asm] Extract AsmStmt handling into a separate file, so as to notChad Rosier2012-08-173-611/+636
| | | | | | pollute SemaStmt with extraneous asm handling logic. llvm-svn: 162132
* c: implement gcc's -Wbad-function-cast which warnsFariborz Jahanian2012-08-171-1/+38
| | | | | | | on unsafe cast of a c-function call. This is a C-only option. llvm-svn: 162109
* [ms-inline asm] Instantiate the MCStreamer as a NullStream. We're parsingChad Rosier2012-08-171-1/+1
| | | | | | instruction, not emitting them, so a NullStream is fine. llvm-svn: 162105
* Warn about self-initialization of references.Hans Wennborg2012-08-171-6/+9
| | | | | | | Initializing a reference with itself, e.g. "int &a = a;" seems like a very bad idea. llvm-svn: 162093
* Make the spacing of the code completion result for NSDictionaryDouglas Gregor2012-08-171-1/+0
| | | | | | | literals match the spacing introduced by the ObjC modernizer. Fixes the rest of <rdar://problem/11889572>. llvm-svn: 162084
* Don't do jump-scope checking when code completion is enabled. It'sDouglas Gregor2012-08-172-2/+4
| | | | | | | | both a waste of time, and prone to crash due to the use of the error-recovery path in parser. Fixes <rdar://problem/12103608>, which has been driving me nuts. llvm-svn: 162081
* Don't forget to apply #pragma pack to partial and explicit specializations ofRichard Smith2012-08-171-0/+7
| | | | | | | class templates. This fixes misalignment issues in llvm/Support/Endian.h when built by Clang. llvm-svn: 162074
* Don't form a null reference when checking for validity of an anonymousRichard Smith2012-08-171-2/+1
| | | | | | | elaborated type specifier in template instantiation: such a specifier is always valid because it must be specified within the definition of the type. llvm-svn: 162068
* Add support for "type safety" attributes that allow checking that 'void *'Dmitri Gribenko2012-08-174-0/+580
| | | | | | | | | | | | | | function arguments and arguments for variadic functions are of a particular type which is determined by some other argument to the same function call. Usecases include: * MPI library implementations, where these attributes enable checking that buffer type matches the passed MPI_Datatype; * for HDF5 library there is a similar usecase as MPI; * checking types of variadic functions' arguments for functions like fcntl() and ioctl(). llvm-svn: 162067
* Random string removal.Eric Christopher2012-08-161-1/+1
| | | | llvm-svn: 162063
* [ms-inline asm] Comment.Chad Rosier2012-08-161-1/+2
| | | | llvm-svn: 162055
* [ms-inline asm] Extract a helper function, getSpelling(). Also use this onChad Rosier2012-08-161-14/+16
| | | | | | tokens we don't know how to handle; this should aid when debugging. llvm-svn: 162053
* objective-C++: issue diagnostic when ivar type isFariborz Jahanian2012-08-161-2/+8
| | | | | | an abstract c++ class. // rdar://12095239 llvm-svn: 162052
* [ms-inline asm] If we don't know how to handle a token then assume this is not aChad Rosier2012-08-161-1/+1
| | | | | | simple asm. llvm-svn: 162051
OpenPOWER on IntegriCloud