summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add return type checking for overriding virtual functions. We currently ↵Anders Carlsson2009-05-143-4/+59
| | | | | | don't check covariance but that's next. llvm-svn: 71759
* Implement explicit instantiations of member classes of class templates, e.g.,Douglas Gregor2009-05-148-17/+126
| | | | | | | | | | | | | | | | | | | | | | | | | template<typename T> struct X { struct Inner; }; template struct X<int>::Inner; This change is larger than it looks because it also fixes some a problem with nested-name-specifiers and tags. We weren't requiring the DeclContext associated with the scope specifier of a tag to be complete. Therefore, when looking for something like "struct X<int>::Inner", we weren't instantiating X<int>. This, naturally, uncovered a problem with member pointers, where we were requiring the left-hand side of a member pointer access expression (e.g., x->*) to be a complete type. However, this is wrong: the semantics of this expression does not require a complete type (EDG agrees). Stuart vouched for me. Blame him. llvm-svn: 71756
* Look for and diagnose missing sentinel argument on messageFariborz Jahanian2009-05-132-2/+45
| | | | | | dispatch arguments which have sentinel attribute. llvm-svn: 71737
* Make sure not to include the LLVM asm prefix in function names forDaniel Dunbar2009-05-131-0/+4
| | | | | | debug info. llvm-svn: 71736
* Use an iterator type for found_decls_begin/found_decls_end.Anders Carlsson2009-05-132-4/+5
| | | | llvm-svn: 71721
* Add a new, more advanced CheckDerivedToBaseConversion that takes custom ↵Anders Carlsson2009-05-133-9/+33
| | | | | | diagnostic IDs. llvm-svn: 71720
* Add some basic type checking for attributes ns_returns_retained andTed Kremenek2009-05-131-39/+39
| | | | | | | | | | | | | | cf_returns_retained. Currently this attribute can now be applied to any Objective-C method or C function that returns a pointer or Objective-C object type. Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to expect that the diagnostics infrastructure will add quotes around the attribute name when appropriate. Alonq with this change, I modified the places where this warning is issued to passed the attribute's IdentifierInfo* instead of having a hard-coded C constant string. llvm-svn: 71718
* Explicit instantiations of templates now instantiate the definitionsDouglas Gregor2009-05-134-3/+83
| | | | | | | | of class members (recursively). Only member classes are actually instantiated; the instantiation logic for member functions and variables are just stubs. llvm-svn: 71713
* Disable access control by default. It can be enabled with the ↵Anders Carlsson2009-05-133-0/+6
| | | | | | -faccess-control option. When we have better support for it, we can enable it by default again. llvm-svn: 71706
* Enhance diagnostics value tracking logic for null dereferences and ↵Ted Kremenek2009-05-131-72/+225
| | | | | | uninitialized values. llvm-svn: 71700
* Driver: Emit an unsupported error on -iframework.Daniel Dunbar2009-05-131-1/+2
| | | | llvm-svn: 71698
* ABI handling: Fix invalid assertion, it is possible for a validDaniel Dunbar2009-05-131-6/+16
| | | | | | | | coercion to be specified which truncates padding bits. It would be nice to still have the assert, but we don't have any API call for the unpadding size of a type yet. llvm-svn: 71695
* Improve the semantic checking for explicit instantiations ofDouglas Gregor2009-05-133-32/+114
| | | | | | | | | | | | | | | | templates. In particular: - An explicit instantiation can follow an implicit instantiation (we were improperly diagnosing this as an error, previously). - In C++0x, an explicit instantiation that follows an explicit specialization of the same template specialization is ignored. In C++98, we just emit an extension warning. - In C++0x, an explicit instantiation must be in a namespace enclosing the original template. C++98 has no such requirement. Also, fixed a longstanding FIXME regarding the integral type that is used for the size of a constant array type when it is being instantiated. llvm-svn: 71689
* Fix crasher reported in PR 4209 caused by an invalid summaryTed Kremenek2009-05-131-4/+16
| | | | | | | | generation when EvalObjCMessageExpr() did not resolve the ObjCInterfaceDecl* for a receiver when the receiver's symbolic value wasn't being explicitly tracked. llvm-svn: 71685
* Some early declarations to support sentinel attribute onFariborz Jahanian2009-05-135-0/+27
| | | | | | | message dispatches (and function calls later). No change in functionality. llvm-svn: 71683
* Removed 4-letter :) word in comment.Fariborz Jahanian2009-05-131-8/+8
| | | | | | Used simple array for Selector build. llvm-svn: 71674
* Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < ↵Ted Kremenek2009-05-131-25/+27
| | | | | | | | | NumArgs && "Arg access out of range!"). For format string checking, only check the type of the format specifier for non-vararg functions. llvm-svn: 71672
* Fix crasher in CFRefCount.cpp reported by Nikita Zhuk due to recently added ↵Ted Kremenek2009-05-131-2/+5
| | | | | | autorelease tracking. llvm-svn: 71647
* Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.Chris Lattner2009-05-131-2/+2
| | | | llvm-svn: 71643
* Fix rdar://6880951 by rejecting vectors of vectors.Chris Lattner2009-05-131-2/+3
| | | | | | | | It seems dubious to me that isIntegerType() returns true for vectors of integers, but not complex integers. This should probably be rethought, I'll file a bugzilla. llvm-svn: 71640
* reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.Chris Lattner2009-05-131-1/+4
| | | | | | rdar://6880104 llvm-svn: 71639
* eli correctly points out that this code is dead, just rip it out forChris Lattner2009-05-131-7/+0
| | | | | | now until someone does it right llvm-svn: 71638
* implement __sync_synchronize and __sync_lock_release,Chris Lattner2009-05-131-3/+15
| | | | | | rdar://6880573 llvm-svn: 71637
* add support for __sync_nand_and_fetch and __sync_fetch_and_nand,Chris Lattner2009-05-132-11/+35
| | | | | | rdar://6880573 llvm-svn: 71636
* Fix rdar://6880874 - [sema] crash on array types with different index sizesChris Lattner2009-05-131-1/+6
| | | | llvm-svn: 71634
* Fix rdar://6881069, a crash on a form of vector_size that weChris Lattner2009-05-131-1/+2
| | | | | | | | | don't support. While it would be nice to support this eventually, this form is not common at all (just seen in gcc testsuite) and it might be better to model vector_size as a type attribute anyway. For now just emit a nice error on it. llvm-svn: 71633
* Fix rdar://6880259 - invalid function name in block call ↵Chris Lattner2009-05-131-32/+7
| | | | | | | | (__NSConcreteGlobalBlock2) by using the appropriate CGM interface instead of directly creating a global. llvm-svn: 71617
* When we expect two arguments but have zero, make sure to addChris Lattner2009-05-132-0/+6
| | | | | | | | | two empty arguments. Also, add an assert so that this bug manifests as an assertion failure, not a valgrind problem. This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion llvm-svn: 71616
* Semantic analysis for explicit instantiation of class templates. WeDouglas Gregor2009-05-134-6/+158
| | | | | | | | still aren't instantiating the definitions of class template members, and core issues 275 and 259 will both affect the checking that we do for explicit instantiations (but are not yet implemented). llvm-svn: 71613
* Implement parsing for explicit instantiations of class templates, e.g.,Douglas Gregor2009-05-125-41/+114
| | | | | | | | | template class X<int>; This also cleans up the propagation of template information through declaration parsing, which is used to improve some diagnostics. llvm-svn: 71608
* improve the diagnostic for uses of the GCC "global variable in a register" ↵Chris Lattner2009-05-121-1/+7
| | | | | | | | extension. This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension llvm-svn: 71599
* Parser::ParseDeclarationOrFunctionDefinition no longer needs to acceptDouglas Gregor2009-05-121-4/+2
| | | | | | template parameters. llvm-svn: 71598
* Method attributes may only be specified on methodFariborz Jahanian2009-05-121-0/+4
| | | | | | declarations. llvm-svn: 71597
* Refactor the parsing of declarations so that template declarations canDouglas Gregor2009-05-123-91/+223
| | | | | | | | | | parse just a single declaration and provide a reasonable diagnostic when the "only one declarator per template declaration" rule is violated. This eliminates some ugly, ugly hackery where we used to require thatn the layout of a DeclGroup of a single element be the same as the layout of a single declaration. llvm-svn: 71596
* implement l-value codegen of comma exprChris Lattner2009-05-121-0/+6
| | | | llvm-svn: 71595
* push GlobalDecl through enough of the CodeGenModule interfacesChris Lattner2009-05-126-69/+68
| | | | | | | | | to allow us to support generation of deferred ctors/dtors. It looks like codegen isn't emitting a call to the dtor in member-functions.cpp:test2, but when it does, its body should get emitted. llvm-svn: 71594
* add an initial stab at emitting deferred c++ inline functions. This handles ↵Chris Lattner2009-05-121-0/+9
| | | | | | | | | static functions and methods declared inline, but not ctors/dtors or methods not declared inline (apparently my previous patch wasn't good enough). llvm-svn: 71591
* cleanups, no functionality change.Chris Lattner2009-05-121-3/+5
| | | | llvm-svn: 71590
* Method who have definitions in structs/classes are semantically inline.Chris Lattner2009-05-121-0/+7
| | | | | | | Per the FIXME, it might be interesting to track whether the inline keyword was also used on the method, but for now we don't do this. Testcase pending. llvm-svn: 71589
* static methods don't get this pointers.Chris Lattner2009-05-121-4/+4
| | | | llvm-svn: 71586
* revert my previous patch, I committed the wrong file.Chris Lattner2009-05-121-10/+2
| | | | llvm-svn: 71585
* static methods don't get this pointers.Chris Lattner2009-05-121-2/+10
| | | | llvm-svn: 71583
* Fix: <rdar://problem/6320065> false positive - init method returns an object ↵Ted Kremenek2009-05-121-22/+46
| | | | | | | | | owned by caller Now 'init' methods are treated by the retain/release checker as claiming their receiver and allocating a new object. llvm-svn: 71579
* Fixed typos, used DenseSet for keeping track ofFariborz Jahanian2009-05-121-34/+48
| | | | | | | selectors which need use Nonfrgile API for message dispatch. llvm-svn: 71578
* accept "#pragma clang foo" where we accept "#pragma GCC foo".Chris Lattner2009-05-121-1/+12
| | | | llvm-svn: 71572
* Patch to implement ivar synthesis of properties declared in protocolsFariborz Jahanian2009-05-122-29/+59
| | | | | | only and used in class imllementations (objc2 Nonfragile ABI specific). llvm-svn: 71571
* Darwin x86-32 ABI: Now that structure passing is farther along, weDaniel Dunbar2009-05-121-12/+5
| | | | | | don't need special treatment for unions. llvm-svn: 71559
* x86-64 ABI: clang incorrectly passes union { long double, float } inDaniel Dunbar2009-05-121-1/+2
| | | | | | | register. - Merge algorithm was returning MEMORY as it should. llvm-svn: 71556
* Add logic for invalidating array region to CFRefCount.cpp. When invalidatingZhongxing Xu2009-05-123-14/+58
| | | | | | | | | array region, set its default value to conjured symbol. When retrieving its element, create new region value symbol for the element. Also fix some 80 columns violations. llvm-svn: 71548
* Fix <rdar://problem/6877235> Classes typedef-ed to CF objects should get the ↵Ted Kremenek2009-05-121-3/+11
| | | | | | | | same treatment as CF objects This was accomplished by having 'isTypeRef' recursively walk the typedef stack. llvm-svn: 71538
OpenPOWER on IntegriCloud