summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-093-7/+6
| | | | llvm-svn: 159925
* PR13136:Richard Smith2012-07-092-5/+21
| | | | | | | | | | | | | | | * When substituting a reference to a non-type template parameter pack where the corresponding argument is a pack expansion, transform into an expression which contains an unexpanded parameter pack rather than into an expression which contains a pack expansion. This causes the SubstNonTypeTemplateParmExpr to be inside the PackExpansionExpr, rather than outside, so the expression still looks like a pack expansion and can be deduced. * Teach MarkUsedTemplateParameters that we can deduce a reference to a template parameter if it's wrapped in a SubstNonTypeTemplateParmExpr (such nodes are added during alias template substitution). llvm-svn: 159922
* MIPS: Range check __builtin_mips_wrdsp / __builtin_mips_rddsp arguments ↵Simon Atanasyan2012-07-081-0/+34
| | | | | | against the upper/lower values. llvm-svn: 159911
* PR13243: When deducing a non-type template parameter which is specified as anRichard Smith2012-07-081-2/+11
| | | | | | | | expression, skip over any SubstNonTypeTemplateParmExprs which alias templates may have inserted before checking for a DeclRefExpr referring to a non-type template parameter declaration. llvm-svn: 159909
* PR13293: Defer deduction of an auto type with a dependent declarator, such ↵Richard Smith2012-07-083-9/+48
| | | | | | as "auto (*f)(T t)". llvm-svn: 159908
* PR9793: Treat substitution as an instantiation step for the purpose of theRichard Smith2012-07-084-50/+58
| | | | | | | | -ftemplate-depth limit. There are various ways to get an infinite (or merely huge) stack of substitutions with no intervening instantiations. This is also consistent with gcc's behavior. llvm-svn: 159907
* Reject 'int a[1][];' in Sema rather than crashing in IR generation. Found by aRichard Smith2012-07-071-1/+6
| | | | | | misreduction of PR13290. llvm-svn: 159905
* PR12670: Support for initializing an array of non-aggregate class type from anRichard Smith2012-07-071-41/+34
| | | | | | | initializer list. Patch by Olivier Goffart, with extra testcases by Meador Inge and Daniel Lunow. llvm-svn: 159896
* When marking virtual functions as used for a class' vtable, mark all functionsRichard Smith2012-07-071-8/+17
| | | | | | | | | | which will appear in the vtable as used, not just those ones which were declared within the class itself. Fixes an issue reported as comment#3 in PR12763 -- we sometimes assert in codegen if we try to emit a reference to a function declaration which we've not marked as referenced. This also matches gcc's observed behavior. llvm-svn: 159895
* objc-arc: warn when assigning retained object toFariborz Jahanian2012-07-061-1/+11
| | | | | | | a 'weak' property just as we do the same for 'weak' variables. // rdar://11814185 llvm-svn: 159859
* objective-c++11: extend c++11 range-based loop to iterateFariborz Jahanian2012-07-061-0/+12
| | | | | | over objective-c container collection. // rdar://9293227 llvm-svn: 159847
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-061-0/+1
| | | | | | | | | | | | | | very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. llvm-svn: 159790
* objective-c: don't involve properties when checkingFariborz Jahanian2012-07-051-1/+2
| | | | | | | | under -Wsuper-class-method-mismatch for method mismatches in current and suprt class. // rdar://11793793 llvm-svn: 159784
* PR13273: When performing list-initialization with an empty initializer list,Richard Smith2012-07-051-109/+102
| | | | | | | | | | | actually perform value initialization rather than trying to fake it with a call to the default constructor. Fixes various bugs related to the previously-missing zero-initialization in this case. I've also moved this and the other list initialization 'special case' from TryConstructorInitialization into TryListInitialization where they belong. llvm-svn: 159733
* Drop the ASTContext.h include from Stmt.h and fix up transitive users.Benjamin Kramer2012-07-043-2/+6
| | | | | | | | | | | | | | This required moving the ctors for IntegerLiteral and FloatingLiteral out of line which shouldn't change anything as they are usually called through Create methods that are already out of line. ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector and make it independent from ASTContext.h Pass the StorageAllocator directly to AccessedEntity so it doesn't need to have a definition of ASTContext around. llvm-svn: 159718
* Split out the "empty" case for compound statement into a separate ctor.Benjamin Kramer2012-07-042-7/+4
| | | | | | Move the ASTContext-dependent version out of line. llvm-svn: 159717
* Renamed RawComment kinds to avoid name clash.Abramo Bagnara2012-07-041-2/+2
| | | | llvm-svn: 159706
* objective-c: Refactor parse/sema portion ofFariborz Jahanian2012-07-032-27/+36
| | | | | | | objective-c's fast enumeration statement, for more work to come. llvm-svn: 159689
* Rename -Wself-assign-memvar to -Wself-assign-field to improve local ↵Nico Weber2012-07-031-8/+8
| | | | | | | | consistency a bit. (cf -Wunused-private-field and several other existing -field diagnostics.) llvm-svn: 159633
* Remove a redundant assignment to the FDecl variable from *inside* it'sChandler Carruth2012-07-031-1/+1
| | | | | | | | | | | initializer. I really feel like Clang should warn about this, but I can't describe a good reason. GCC will warn on this in some cases under -Wsequence-point, but it actually seems like a false positive for that warning.... llvm-svn: 159631
* objective-c: just as we have done for method definitions,Fariborz Jahanian2012-07-021-5/+29
| | | | | | | | c-functions declared in implementation should have their parsing delayed until the end so, they can access forward declared private methods. // rdar://10387088 llvm-svn: 159626
* Thread safety analysis: fixed incorrect error message at the end of a ↵DeLesley Hutchins2012-07-021-0/+3
| | | | | | locks_required function. llvm-svn: 159607
* In blocks, only pretend that enum constants have enum type if necessary.Jordan Rose2012-07-024-47/+174
| | | | | | | | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) Thus, when a block's return type is inferred from an enum constant, it is incompatible with expressions that return the enum type. In r158899, I told block returns to pretend that enum constants have enum type, like in C++. Doug Gregor pointed out that this can break existing code. Now, we don't check the types of return statements until the end of the block. This lets us go back and add implicit casts in blocks with mixed enum constants and enum-typed expressions. <rdar://problem/11662489> (again) llvm-svn: 159591
* Be more eager about setting the 'Invalid' bit on an invalid classDouglas Gregor2012-07-022-13/+12
| | | | | | | | | template instantiation. I wasn't able to reproduce this down to anything small enough to put in our test suite, but it's "obviously" okay to set the invalid bit earlier and precludes a known-broken-but-not-marked-broken class from being used elsewhere. llvm-svn: 159584
* Add a new libclang completion API to get brief documentation comment that isDmitri Gribenko2012-07-022-9/+28
| | | | | | | | | | | | | | | | attached to a declaration in the completion string. Since extracting comments isn't free, a new code completion option is introduced. A new code completion option that enables including brief comments into CodeCompletionString should be a, err, code completion option. But because ASTUnit caches global declarations during parsing before even completion consumer is created, the option is duplicated as a translation unit option (in both libclang and ASTUnit, like the option to cache code completion results). llvm-svn: 159539
* Add support for the C11 _Alignof keyword.Jordan Rose2012-06-302-0/+19
| | | | | | | This behaves like the existing GNU __alignof and C++11 alignof keywords; most of the patch is simply adding the third token spelling to various places. llvm-svn: 159494
* In Sema::ClassifyName, try to avoid nonsensical corrections toKaelyn Uhrain2012-06-291-0/+13
| | | | | | keywords when doing type correction. llvm-svn: 159464
* Add a fix-it hint note to -Wunique-enum to suggest that the last element getsRichard Trieu2012-06-291-0/+7
| | | | | | initialized with the next to last element to silence the warning. llvm-svn: 159458
* fix a typo in my last commit. I thought I recompiled,Fariborz Jahanian2012-06-291-1/+1
| | | | | | but apparently I did not. llvm-svn: 159452
* objc diagnostic: pass IdentifierInfo* to the diagnostic systemFariborz Jahanian2012-06-291-2/+2
| | | | | | to produce quotes instead of adding qoute to the test. llvm-svn: 159450
* Avoid redundant error when redefining a function as deleted.David Blaikie2012-06-291-2/+2
| | | | | | Reviewed by Doug Gregor. llvm-svn: 159442
* Change condition to be the same as in SemaTemplateInstantiate.Nico Weber2012-06-291-1/+1
| | | | | | No functionality change. llvm-svn: 159436
* When a builtin that requires a constant is given a type- orDouglas Gregor2012-06-291-2/+16
| | | | | | | value-dependent expression, don't complain that it wasn't the constant we wanted. Fixes <rdar://problem/11688587> and PR11074. llvm-svn: 159404
* Teach the __is_trivially_assignable and __is_trivially_constructibleDouglas Gregor2012-06-291-2/+33
| | | | | | | type traits that assignment to/construction of a lifetime-qualified object under ARC is *not* trivial. Fixes <rdar://problem/11738725>. llvm-svn: 159401
* Warn on self-assignment to member variables. PR13104.Nico Weber2012-06-281-1/+24
| | | | llvm-svn: 159394
* Warn on weak properties declared in protocols as well.Jordan Rose2012-06-281-2/+4
| | | | | | Previously this caused a crash, since protocols are not interfaces. llvm-svn: 159357
* objective-c mrc: Issue warning for mrc, as is done for arc, whenFariborz Jahanian2012-06-271-2/+1
| | | | | | | property retains a block object as it could be on the stack. // rdar://11761511 llvm-svn: 159293
* Refactoring after r159290: don't hold onto and check a misleading QualType.Richard Smith2012-06-271-4/+3
| | | | llvm-svn: 159292
* Check for non-POD vararg argument type after default argument promotion, notRichard Smith2012-06-271-1/+1
| | | | | | before, so we don't incorrectly think arguments of function type are non-POD. llvm-svn: 159290
* patch to suggest 'static' function should be 'static inline' Fariborz Jahanian2012-06-271-3/+11
| | | | | | | when it appears to be unused and occurs in a header. // rdar://11202617 llvm-svn: 159282
* Implement John McCall's review of r159212 other than the this pointer notRafael Espindola2012-06-271-2/+3
| | | | | | being updated. Will fix that in a second. llvm-svn: 159280
* Fix a crash I introduced in r159212.Rafael Espindola2012-06-271-0/+2
| | | | llvm-svn: 159279
* Whitespace.Chad Rosier2012-06-261-107/+107
| | | | llvm-svn: 159229
* During codegen of a virtual call we would extract any casts in the expressionRafael Espindola2012-06-261-0/+16
| | | | | | | | to see if we had an underlying final class or method, but we would then use the cast type to do the call, resulting in a direct call to the wrong method. llvm-svn: 159212
* Give L__FUNCTION__ the right type in templates. PR13206.Nico Weber2012-06-251-1/+5
| | | | llvm-svn: 159171
* PR12937: Explicitly deleting an explicit template specialization.David Blaikie2012-06-251-2/+7
| | | | | | | | | | | | | | | This works around a quirk in the way that explicit template specializations are handled in Clang. We generate an implicit declaration from the original template which the explicit specialization is considered to redeclare. This trips up the explicit delete logic. This change only works around that strange representation. At some point it'd be nice to remove those extra declarations to make the AST more accurately reflect the C++ semantics. Review by Doug Gregor. llvm-svn: 159167
* Unrevert r158887, reverted in r158949, along with a fix for the bug whichRichard Smith2012-06-254-205/+378
| | | | | | | | | | | | | | | | | | | | resulted in it being reverted. A test for that bug was added in r158950. Original comment: If an object (such as a std::string) with an appropriate c_str() member function is passed to a variadic function in a position where a format string indicates that c_str()'s return type is desired, provide a note suggesting that the user may have intended to call the c_str() member. Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and move it to SemaChecking in order to facilitate this. Factor the call checking out of function call checking and block call checking, and extend it to cover constructor calls too. Patch by Sam Panzer! llvm-svn: 159159
* Make explicit specializations at class scope workNico Weber2012-06-252-6/+18
| | | | | | | for non-type template parameters in microsoft mode. PR12709. llvm-svn: 159147
* objective-c: issue deprecation/unavailability warnings for methods called on Fariborz Jahanian2012-06-231-0/+3
| | | | | | id <Protocol>. // rdar://11618852 llvm-svn: 159084
* Support the tls_model attribute (PR9788)Hans Wennborg2012-06-231-1/+39
| | | | | | | | | | | | | | This adds support for the tls_model attribute. This allows the user to choose a TLS model that is better than what LLVM would select by default. For example, a variable might be declared as: __thread int x __attribute__((tls_model("initial-exec"))); if it will not be used in a shared library that is dlopen'ed. This depends on LLVM r159077. llvm-svn: 159078
OpenPOWER on IntegriCloud