aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
AgeCommit message (Collapse)Author
2012-08-21[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl. In general,Chad Rosier
this is the index of the operand that failed to match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162296 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21[ms-inline asm] Append identifier for better debugging.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21[ms-inline asm] Remove this test case and the associated special case code.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21Screw around with ObjCRuntime some more, changing theJohn McCall
diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21Better diagnostics for range-based for loops with bad range types.Sam Panzer
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162248 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20Fix a pair of bugs relating to properties in ARC.John McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20Code-complete 'weak' for properties under ARC-with-weak-references (or GC)Jordan Rose
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162220 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20[ms-inline asm] Remove old cruft now that MS-style asms their own code path.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162210 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20Better wording for reference self-initialization warning.Hans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162198 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-18PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers andRichard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162159 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17When code completion is enabled, don't do any work inDouglas Gregor
Sema::ActOnEndOfTranslationUnit(). This is a (minor) optimization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162144 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17c: privide deprecated warning when __private_extern__ storageFariborz Jahanian
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17[ms-inline asm] Update comment.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162134 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17[ms-inline asm] Extract AsmStmt handling into a separate file, so as to notChad Rosier
pollute SemaStmt with extraneous asm handling logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162132 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17c: implement gcc's -Wbad-function-cast which warnsFariborz Jahanian
on unsafe cast of a c-function call. This is a C-only option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162109 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17[ms-inline asm] Instantiate the MCStreamer as a NullStream. We're parsingChad Rosier
instruction, not emitting them, so a NullStream is fine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17Warn about self-initialization of references.Hans Wennborg
Initializing a reference with itself, e.g. "int &a = a;" seems like a very bad idea. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17Make the spacing of the code completion result for NSDictionaryDouglas Gregor
literals match the spacing introduced by the ObjC modernizer. Fixes the rest of <rdar://problem/11889572>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162084 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17Don't do jump-scope checking when code completion is enabled. It'sDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17Don't forget to apply #pragma pack to partial and explicit specializations ofRichard Smith
class templates. This fixes misalignment issues in llvm/Support/Endian.h when built by Clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17Don't form a null reference when checking for validity of an anonymousRichard Smith
elaborated type specifier in template instantiation: such a specifier is always valid because it must be specified within the definition of the type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162068 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17Add support for "type safety" attributes that allow checking that 'void *'Dmitri Gribenko
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(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162067 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Random string removal.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Comment.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162055 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Extract a helper function, getSpelling(). Also use this onChad Rosier
tokens we don't know how to handle; this should aid when debugging. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16objective-C++: issue diagnostic when ivar type isFariborz Jahanian
an abstract c++ class. // rdar://12095239 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] If we don't know how to handle a token then assume this is not aChad Rosier
simple asm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162051 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Add a helper function, isMSAsmKeyword().Chad Rosier
These require special handling, which we don't currently handle. This is being put in place to ensure we don't do invalid symbol table lookups or try to parse invalid assembly. The test cases just makes sure the latter isn't happening. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Removed unused LParenLoc parameter to ActOnCXXForRangeStmtSam Panzer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162048 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Perform symbol table lookup on variables. The idea is to useChad Rosier
this information to determine valid MC operands. This will also be used for semantic analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16objective-C: deprecate casts of ObjC's SELFariborz Jahanian
expressions except to void, void * and their qualified versions. // rdar://12107381 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162036 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Start tracking which tokens are registers and which areChad Rosier
variables, function or label references. The former is a potential clobber. The latter is either an input or an output. Unfortunately, it's difficult to test this patch at the moment, but the added test case will eventually do so. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Store SourceManager pointer on PrintingPolicy in the case where we're dumping,Richard Smith
and remove ASTContext reference (which was frequently bound to a dereferenced null pointer) from the recursive lump of printPretty functions. In so doing, fix (at least) one case where we intended to use the 'dump' mode, but that failed because a null ASTContext reference had been passed in. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Test commit: deleted whitespace on blank lineSam Panzer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Add inputs and outputs to AST. No functional change.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Use a set container to remove redundant clobbers.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161991 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Address a FIXME by computing the number of asm statements whenChad Rosier
building the AsmString. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161988 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] MSVC parses multiple __asm statements on a single line as oneChad Rosier
statement. For example, if (x) __asm out dx, ax __asm out dx, ax results in a single inline asm statement (i.e., both "out dx, ax" statements are predicated on if(x)). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Allow 'static' and type qualifiers in K&R parameter type lists.Matt Beaumont-Gay
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Don't emit newlines as these are ignored by the AsmParserChad Rosier
anyways. Also, simplify some conditional logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Patch to warn about __private_extern__ on tentative definitionsFariborz Jahanian
as it does something unexpected (but gcc compatible). Suggest use of __attribute__((visibility("hidden"))) on declaration instead. // rdar://7703982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161972 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Capturing loop-scoped (std::string)Reg with a StringRef is bad.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161966 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Add the left brace source location and improve the prettyChad Rosier
printer. Patch by Enea Zaffanella <zaffanella@cs.unipr.it>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161958 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Check for improper use of 'static' and type qualifiers in arrayHans Wennborg
declarators. They are only allowed for function parameters, and then only on the outermost array type derivation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161934 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15clang/lib/Sema/SemaStmt.cpp: Include MCAsmLexer.h to appease msvc to define ↵NAKAMURA Takumi
llvm::AsmToken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Have MC start parsing the asms.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14Check local static variables for self reference on initialization.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14[ms-inline asm] Remove the last bits of LineEnds.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161904 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14Remove trailing return flag from FunctionTypeLoc, since we now carry thatRichard Smith
information on FunctionProtoType. (This also fixes one of *many* misalignment problems in the TypeLoc hierarchy...) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161901 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14[ms-inline asm] Simplify more logic by using the Token::hasLeadingSpace() andChad Rosier
Token::isAtStartOfLine() APIs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161898 91177308-0d34-0410-b5e6-96231b3b80d8