summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Clear LV cache when dropping availability attributes.Rafael Espindola2013-01-081-0/+6
| | | | llvm-svn: 171906
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-082-12/+8
| | | | llvm-svn: 171902
* Don't crash when trying to apply the availability attribute to a block.Rafael Espindola2013-01-081-1/+6
| | | | llvm-svn: 171899
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-082-6/+6
| | | | llvm-svn: 171894
* Move loop variable update.Rafael Espindola2013-01-081-2/+1
| | | | | | Thanks to Dmitri Gribenko for the suggestion. llvm-svn: 171889
* Mark all subsequent decls used.Rafael Espindola2013-01-082-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | In the source static void f(); static void f(); template<typename T> static void g() { f(); } static void f() { } void h() { g<int>(); } the call to f refers to the second decl, but it is only marked used at the end of the translation unit during instantiation, after the third f decl has been linked in. With this patch we mark all subsequent decls used, so that it is easy to check if a symbol is used or not. llvm-svn: 171888
* Use Decl::getAvailability() rather than checking for the "unavailable"Douglas Gregor2013-01-081-1/+2
| | | | | | | attribute when determining whether we need to see an implementation of a property. Fixes <rdar://problem/12958191>. llvm-svn: 171877
* Clear the LV cache when merging the availability attribute.Rafael Espindola2013-01-081-2/+6
| | | | | | | The availability implies default visibility, so it can change the computed visibility. llvm-svn: 171840
* Don't warn about undefined varargs argument behavior in unreachable code.Ted Kremenek2013-01-081-5/+5
| | | | | | Fixes <rdar://problem/12322000>. llvm-svn: 171831
* PR14838: When a member reference is bound to a temporary, don't forget toRichard Smith2013-01-081-2/+2
| | | | | | | perform the semantic checks associated with the destruction of that temporary. It'll be destroyed at the end of the constructor. llvm-svn: 171818
* Back out my no-op change from r171783.Douglas Gregor2013-01-081-8/+2
| | | | llvm-svn: 171817
* Use the C++11 POD definition in C++11 mode to determine whether oneDouglas Gregor2013-01-071-2/+8
| | | | | | can create a VLA of class type. Fixes <rdar://problem/12151822>. llvm-svn: 171783
* Use getter. Fixes the build from a bad merge.Rafael Espindola2013-01-071-1/+1
| | | | llvm-svn: 171782
* Add support for attribute((mode(unwind_word))).Rafael Espindola2013-01-071-0/+4
| | | | | | Patch by Nick Lewycky. Fixes pr8703. llvm-svn: 171781
* objective-C: when searching for declarations in protocolFariborz Jahanian2013-01-071-0/+5
| | | | | | | list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-071-0/+5
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* Fixes a breakage in dejagnu++ test suite where it includedFariborz Jahanian2013-01-051-0/+1
| | | | | | | | <objc/Protocol.h>. Caused by my recent changes for various builtin declarations of objc_msgSendSuper variety. // rdar://12489098 llvm-svn: 171638
* Fix up various builtin declaration of objc_msgSend familiesFariborz Jahanian2013-01-041-0/+20
| | | | | | | to match those foung in objc.h an avoid spurious warnings. // rdar://12489098 llvm-svn: 171492
* Warn on unused auto variables.Rafael Espindola2013-01-031-2/+3
| | | | | | | | To do so we have to wait until we know that the type of a variable has been deduced. Sema::FinalizeDeclaration is the first callback that is used for decl with or without initializers. llvm-svn: 171458
* Use early returns to reduce indentation.Rafael Espindola2013-01-031-31/+34
| | | | llvm-svn: 171457
* Remove the anonymous namespace from lib/Sema/TreeTransform.hArgyrios Kyrtzidis2013-01-021-2/+0
| | | | llvm-svn: 171402
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-022-2/+2
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-0224-156/+156
| | | | llvm-svn: 171367
* Don't warn on unused member functions that are extern because of a typedef.Rafael Espindola2012-12-301-0/+3
| | | | llvm-svn: 171267
* Use hasCLanguageLinkage when warning about non C return types.Rafael Espindola2012-12-301-1/+1
| | | | llvm-svn: 171263
* Don't warn for undefined but used decls that are external because of a typedef.Rafael Espindola2012-12-291-0/+3
| | | | | | | | This fixes pr14736. It is fairly ugly, but I don't think we can do much better as we have to wait at least until the end of the typedef to know if the function will have external linkage or not. llvm-svn: 171240
* ArrayRefize CXXTryStmt.Nico Weber2012-12-291-1/+1
| | | | llvm-svn: 171239
* ArrayRefize a CompoundStmt constructor.Nico Weber2012-12-293-6/+7
| | | | llvm-svn: 171238
* Reject overloading of two static extern C functions.Rafael Espindola2012-12-282-29/+11
| | | | | | | | This patch moves hasCLanguageLinkage to be VarDecl and FunctionDecl methods so that they can be used from SemaOverload.cpp and then fixes the logic in Sema::IsOverload. llvm-svn: 171193
* Improve diagnostic wording for when an implicitly-deleted special memberRichard Smith2012-12-282-15/+6
| | | | | | function is selected by overload resolution. llvm-svn: 171190
* Implement dcl.link paragraph 5.Rafael Espindola2012-12-271-0/+40
| | | | | | | The language linkage of redeclarations must match. GCC was already reporting an error for this. llvm-svn: 171139
* Fix a regression from the previous commit.Rafael Espindola2012-12-261-1/+5
| | | | | | | Template instantiation can set the canonical decl to used after subsequent decls have been chained, so we have to check that too. llvm-svn: 171088
* Use the most recent redecl to decide if it is needed.Rafael Espindola2012-12-261-1/+1
| | | | | | This fixes pr14691, which I think is a regression from r168519. llvm-svn: 171077
* Fix for PR12222.Erik Verbruggen2012-12-252-7/+13
| | | | | | | | Changed getLocStart() and getLocEnd() to be required for Stmts, and make getSourceRange() optional. The default implementation for getSourceRange() is build the range by calling getLocStart() and getLocEnd(). llvm-svn: 171067
* Add intel_ocl_bicc calling convention as a function attribute to clang. The ↵Guy Benyei2012-12-252-1/+9
| | | | | | calling convention is already implemented in LLVM. llvm-svn: 171056
* Add 171048 back but invalidate the cache of all redeclarations when settingRafael Espindola2012-12-253-6/+20
| | | | | | | | | | | | | | | | | | the body of a functions. The problem was that hasBody looks at the entire chain and causes problems to -fvisibility-inlines-hidden if the cache was not invalidated. Original message: Cache visibility of decls. This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171053
* Revert r171048, "Cache visibility of decls."NAKAMURA Takumi2012-12-253-20/+6
| | | | | | It broke stage2. llvm-svn: 171050
* Cache visibility of decls.Rafael Espindola2012-12-253-6/+20
| | | | | | | | | | | This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171048
* Move a declaration closer to its use. No functionality change.Nico Weber2012-12-231-2/+2
| | | | llvm-svn: 170992
* PR14695: Fix assert from bad cast<>. Not every namespace is a NamespaceDecl; ↵Richard Smith2012-12-221-5/+12
| | | | | | it might instead be a TranslationUnitDecl. llvm-svn: 170976
* Add back -Wduplicate-enum which I mistakenly removed.Ted Kremenek2012-12-221-0/+178
| | | | | | | | | | | | This was removed with -Wunique-enum, which is still removed. The corresponding thread on cfe-comments for that warning is here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024224.html If we get specific user feedback for -Wduplicate-enum we can evaluate whether or not to keep it. llvm-svn: 170974
* Tweak Sema::CheckLiteralKind() to also include block literalsTed Kremenek2012-12-212-11/+9
| | | | | | | This simplifies some diagnostic logic in checkUnsafeAssignLiteral(), hopefully making it less error prone. llvm-svn: 170945
* Add comments back that were accidentally removed in r170933.Chad Rosier2012-12-211-0/+2
| | | | llvm-svn: 170938
* Remove unused arguments and rename to conform to coding standards.Chad Rosier2012-12-211-8/+3
| | | | llvm-svn: 170933
* Change checkUnsafeAssignLiteral() to use the new Sema::CheckLiteralKind().Ted Kremenek2012-12-212-25/+16
| | | | | | | | | | Along the way, fix a bug in CheckLiteralKind(), previously in diagnoseObjCLiteralComparison, where we didn't ignore parentheses in boxed expressions for purpose of classification. In other words, both @42 and @(42) should be classified as numeric literals. llvm-svn: 170931
* Hoist logic for classifying Objective-C literals into Sema (proper) for use ↵Ted Kremenek2012-12-211-52/+45
| | | | | | | | with other diagnostics. No immediate (intended) functionality change. llvm-svn: 170930
* Use descriptive enum instead of raw integers for checkUnsafeAssignLiteral().Ted Kremenek2012-12-211-7/+9
| | | | llvm-svn: 170920
* Sink call to checkUnsafeAssignLiteral() into checkUnsafeAssignObject().Ted Kremenek2012-12-211-23/+22
| | | | llvm-svn: 170919
* Remove duplicate includes.Roman Divacky2012-12-213-4/+0
| | | | llvm-svn: 170903
* Fix regression in r170489: when instantiating a direct initializer which is aRichard Smith2012-12-212-7/+22
| | | | | | | | CXXScalarValueInitExpr (or an ImplicitValueInitExpr), strip it back down to an empty pair of parentheses so that the initialization code can tell that we're performing value-initialization. llvm-svn: 170867
OpenPOWER on IntegriCloud