summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Ignore a more comprehensive set of gcc-special format attributes.Duncan Sands2010-03-231-1/+2
| | | | llvm-svn: 99277
* For forward-declared static inline functions, delay CFG-based warnings until weTed Kremenek2010-03-232-8/+23
| | | | | | encounter a definition. llvm-svn: 99243
* Only perform CFG-based warnings on 'static inline' functions thatTed Kremenek2010-03-236-41/+113
| | | | | | | are called (transitively) by regular functions/blocks within a translation untion. llvm-svn: 99233
* Set the relevent attributes declared in class extensionFariborz Jahanian2010-03-221-0/+5
| | | | | | | and fix a missing diagnostics on assigning to a read-only property. Fixes radar 7766184. llvm-svn: 99230
* A fixed version of r99174 which also includes a test that we emit vtables whenRafael Espindola2010-03-222-2/+11
| | | | | | we see an specialization definition ever if we then see a extern template declaration. llvm-svn: 99226
* (re)implement PR6542, accepting and discarding the __gcc_tdiag__Chris Lattner2010-03-221-0/+8
| | | | | | format attribute specifier. llvm-svn: 99213
* Diagnose miuse of property dot-syntax instead of crashing.Fariborz Jahanian2010-03-221-1/+4
| | | | | | (radar 7634653). llvm-svn: 99210
* Fixes access rues for ivars declared in classFariborz Jahanian2010-03-221-2/+0
| | | | | | implementations (radar 7547942). llvm-svn: 99198
* revert r99174. It caused PR6677. Will try to debug why tonight.Rafael Espindola2010-03-222-6/+2
| | | | llvm-svn: 99188
* When handling a TSK_ExplicitInstantiationDefinition after aRafael Espindola2010-03-222-2/+6
| | | | | | | | | TSK_ExplicitInstantiationDeclaration make sure we call MaybeMarkVirtualMembersReferenced with a method attached to the definition. Remove the hack that forced vtable emition with declarations. llvm-svn: 99174
* -Wshadow should only warn about parameter declarations when we'reJohn McCall2010-03-223-14/+33
| | | | | | | | | entering a function or block definition, not on every single declaration. Unfortunately we don't have previous-lookup results around when it's time to make this decision, so we have to redo the lookup. The alternative is to use delayed diagnostics. llvm-svn: 99172
* Fix PR6618.Rafael Espindola2010-03-212-7/+15
| | | | | | | If a struct has an invalid field, mark it as invalid. Also avoid producing errors about incomplete types that are invalid. llvm-svn: 99150
* Don't bother running the analysis for CFG-based warnings if theTed Kremenek2010-03-201-0/+7
| | | | | | declaration is in a system header. llvm-svn: 99087
* Refactor CFG-based warnings in Sema to be run by a worked object called ↵Ted Kremenek2010-03-207-302/+425
| | | | | | | | | | | | | | | AnalysisBasedWarnings. This object controls when the warnings are executed, allowing the client code in Sema to selectively disable warnings as needed. Centralizing the logic for analysis-based warnings allows us to optimize when and how they are run. Along the way, remove the redundant logic for the 'check fall-through' warning for blocks; now the same logic is used for both blocks and functions. llvm-svn: 99085
* Implement -Wshadow for parameter declarations as well.John McCall2010-03-202-19/+37
| | | | llvm-svn: 99037
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-192-7/+0
| | | | | | | | ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
* Promote enum types during -Wsign-compare. Fixes some spurious warnings,John McCall2010-03-191-0/+5
| | | | | | mostly during conditional expressions. llvm-svn: 98975
* Diagnose conversion of 'Class' to/from objective-c Fariborz Jahanian2010-03-191-1/+11
| | | | | | | object pointer types. Fixes radar 7634850. llvm-svn: 98970
* Remember the "found declaration" for an overload candidate, which is theJohn McCall2010-03-199-201/+224
| | | | | | | | | | | | | | | | entity (if applicable) which was actually looked up. If a candidate was found via a using declaration, this is the UsingShadowDecl; otherwise, if the candidate is template specialization, this is the template; otherwise, this is the function. The point of this exercise is that "found declarations" are the entities we do access control for, not their underlying declarations. Broadly speaking, this patch fixes access control for using declarations. There is a *lot* of redundant code calling into the overload-resolution APIs; we really ought to clean that up. llvm-svn: 98945
* When elevating access along an inheritance path, initialize the computedJohn McCall2010-03-182-14/+31
| | | | | | | | | | | | | | | | access to the (elevated) access of the accessed declaration, if applicable, rather than plunking that access onto the end after we've calculated the inheritance access. Also, being a friend of a derived class gives you public access to its members (subject to later modification by further inheritance); it does not simply ignore a single location of restricted inheritance. Also, when computing the best unprivileged path to a subobject, preserve the information that the worst path might be AS_none (forbidden) rather than a minimum of AS_private. llvm-svn: 98899
* Some cleanup, change diagnostic when assigning toFariborz Jahanian2010-03-181-3/+0
| | | | | | a property which is not lvalue. llvm-svn: 98848
* from code inspection, we were treating placement news with one argument asJohn McCall2010-03-183-7/+39
| | | | | | | | non-placement news when selecting the corresponding operator delete; this is fixed. Access and ambiguity control for calls to operator new and delete. Also AFAICT llvm-svn: 98818
* Redeclaration lookups for parameter names should be flagged as redeclaration ↵John McCall2010-03-181-1/+5
| | | | | | | | lookups so they don't trigger diagnostics like (say) access control. llvm-svn: 98806
* Simplify code (and remove 'dyn_cast') by using ↵Ted Kremenek2010-03-181-11/+3
| | | | | | ObjCProperyDecl::findPropertyDecl(). llvm-svn: 98794
* Implement non-dependent friend functions and classes.John McCall2010-03-171-18/+94
| | | | llvm-svn: 98764
* ActOnTagDefinitionError is supposed to 'unwind' ActOnTagStartDefinition, notJohn McCall2010-03-172-4/+7
| | | | | | | | ActOnStartCXXMemberDeclaration. We haven't started the field collector on this class yet, so don't stop it. Fixes a crash in the VS buildbot and a memory error on all the others. llvm-svn: 98760
* Remove warning about shadowing a built-in; built-ins aren't actuallyDouglas Gregor2010-03-171-9/+1
| | | | | | | considered to be a part of the translation unit unless they're named in a way that brings them into existence. llvm-svn: 98729
* Entering the main source file in the preprocessor can fail if theDouglas Gregor2010-03-171-1/+2
| | | | | | source file has been changed. Handle that failure more gracefully. llvm-svn: 98727
* Grant nested classes the access privileges of their enclosing classes.John McCall2010-03-171-48/+51
| | | | llvm-svn: 98710
* Clean up after ourselves when there's an error parsing the base clause.John McCall2010-03-172-0/+16
| | | | | | Fixes the crash-on-invalid in PR6629. llvm-svn: 98698
* objective-c patch to provide type safty when blocks are passing orFariborz Jahanian2010-03-171-1/+5
| | | | | | | returning objc objects. There will be a corresponding objective-c++ patch soon. llvm-svn: 98696
* Issue error when a byref array is accessed in a blockFariborz Jahanian2010-03-161-1/+1
| | | | | | literal. Fixes radar 7760213. llvm-svn: 98693
* Audit all Preprocessor::getSpelling() callers, improving failureDouglas Gregor2010-03-161-2/+8
| | | | | | recovery for those that need it. llvm-svn: 98689
* Implement -Wshadow. Based on a patch by Mike M.!John McCall2010-03-162-0/+63
| | | | llvm-svn: 98684
* Perform access control for the implicit calls to base and member destructorsJohn McCall2010-03-163-38/+22
| | | | | | that occur in constructors (on the unwind path). llvm-svn: 98681
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-161-5/+4
| | | | | | const char*. llvm-svn: 98630
* Access control for implicit calls to copy assignment operators and copyJohn McCall2010-03-163-4/+48
| | | | | | constructors from implicitly-defined members. llvm-svn: 98614
* Perform access control even for the implicit destructor calls from implicitJohn McCall2010-03-161-38/+1
| | | | | | destructor definitions. Remove some code duplication. llvm-svn: 98611
* Perform access control for the implicit base and member destructor callsJohn McCall2010-03-168-173/+228
| | | | | | required when emitting a destructor definition. llvm-svn: 98609
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-161-2/+3
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-151-1/+4
| | | | | | | | | | | | | | SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface. Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()). llvm-svn: 98585
* Make 'findPropertyDecl()' a static method of ObjCPropertyDecl.Ted Kremenek2010-03-151-14/+4
| | | | llvm-svn: 98570
* Correctly determine if the @property has been previously declared. IfTed Kremenek2010-03-151-7/+17
| | | | | | | a property has the same name as the ivar it wraps then the old logic wouldn't find the previous property declaration. llvm-svn: 98559
* objective-c++ must take into account qualifiers when Fariborz Jahanian2010-03-151-0/+6
| | | | | | considering valid objc pointer converions. llvm-svn: 98557
* During C++ name lookup, use DeclContext::Equals() rather thanDouglas Gregor2010-03-151-5/+3
| | | | | | | comparing DeclContext pointers, to avoid having to remember to call getPrimaryContext() everywhere. This is the last part PR6594. llvm-svn: 98546
* Implement C++ [temp.local]p8, which specifies that a templateDouglas Gregor2010-03-151-10/+93
| | | | | | | | | | | parameter hides a namespace-scope declararion with the same name in an out-of-line definition of a template. The lookup requires a strange interleaving of lexical and semantic scopes (go C++), which I have not yet handled in the typo correction/code completion path. Fixes PR6594. llvm-svn: 98544
* Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.John McCall2010-03-152-2/+2
| | | | llvm-svn: 98541
* Remember declaration scope qualifiers in the AST. Imposes no memory overheadJohn McCall2010-03-154-0/+100
| | | | | | | | | | | on unqualified declarations. Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes with the ASTContext and delete them during Destroy(). I audited a bunch of Destroy methods at the same time, to ensure that the correct teardown was being done. llvm-svn: 98540
* Fix PR6562. If a type is dependent, we don't know if it will have implicitRafael Espindola2010-03-131-0/+5
| | | | | | destructors. llvm-svn: 98440
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-131-173/+173
| | | | llvm-svn: 98436
OpenPOWER on IntegriCloud