llvm-project/clang
David Chisnall b62d15c24e Only warn for mismatched types in Objective-C methods when they are incompatible, not when they are simply different. Now we test whether the difference in types breaks the principle of substitutability, rather than whether they are different.
A common idiom in Objective-C is to provide a definition of a method in a subclass that returns a more-specified version of an object than the superclass.  This does not violate the principle of substitutability, because you can always use the object returned by the subclass anywhere that you could use the type returned by the superclass.  It was, however, generating warnings with clang, leading people to believe that semantically correct code was incorrect and requiring less accurate type specification and explicit down-casts (neither of which is a good thing to encourage).

This change ensures that any method definition has parameter and return types that make it accept anything that something conforming to the declaration may pass and return something that the caller will expect, but allows stricter definitions.  

llvm-svn: 117271
2010-10-25 17:23:52 +00:00
..
INPUTS
bindings/python Rename 'CIndex' to 'libclang', since it has basically become our stable public 2010-04-30 21:51:10 +00:00
clang.xcodeproj Move the "used but marked unused" warning behind a special warning flag for now. 2010-10-24 04:28:00 +00:00
docs Reorganize predefined macros for all Windows targets. 2010-10-21 05:21:48 +00:00
examples Rename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect that we aborted analysis may not necessarily be due to a loop. 2010-09-14 21:35:27 +00:00
include Improve the tracking of source locations for parentheses in constructor calls. 2010-10-25 08:47:36 +00:00
lib Only warn for mismatched types in Objective-C methods when they are incompatible, not when they are simply different. Now we test whether the difference in types breaks the principle of substitutability, rather than whether they are different. 2010-10-25 17:23:52 +00:00
runtime Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386 2010-09-22 00:03:52 +00:00
test Only warn for mismatched types in Objective-C methods when they are incompatible, not when they are simply different. Now we test whether the difference in types breaks the principle of substitutability, rather than whether they are different. 2010-10-25 17:23:52 +00:00
tools Teach clang_getCursorReferenced() and friends about BlockDeclRefExprs. 2010-10-22 22:24:08 +00:00
utils utils/ABITest: Factor out type naming code slightly. 2010-09-27 20:13:24 +00:00
www Update compatibility page for objective-c. 2010-10-22 22:35:51 +00:00
CMakeLists.txt Copied some flags from the Makefile build to the list of GCC flags. 2010-10-15 00:16:22 +00:00
INSTALL.txt
LICENSE.TXT 2010 is here. 2010-01-09 18:40:42 +00:00
Makefile Move lib/Runtime to runtime/, and build after everything else. 2010-06-30 22:10:38 +00:00
ModuleInfo.txt
NOTES.txt A Release-Asserts build is now called a Release build. 2010-07-07 07:49:17 +00:00
README.txt Fix typo (test commit) 2010-06-17 12:39:05 +00:00
TODO.txt

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:              http://clang.llvm.org/
Building and using Clang:          http://clang.llvm.org/get_started.html
Clang Static Analyzer:             http://clang-analyzer.llvm.org/
Information on the LLVM project:   http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/