A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete

As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46897 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/undef-protocol-methods-1.m b/test/Sema/undef-protocol-methods-1.m
index 748b151..9ad3593 100644
--- a/test/Sema/undef-protocol-methods-1.m
+++ b/test/Sema/undef-protocol-methods-1.m
@@ -1,31 +1,40 @@
 // RUN: clang -fsyntax-only -verify %s
 
 @protocol P1
-- (void) P1proto; // expected-warning {{method definition for 'P1proto' not found}}
-+ (void) ClsP1Proto; // expected-warning {{method definition for 'ClsP1Proto' not found}}
+- (void) P1proto;
++ (void) ClsP1Proto;  
 - (void) DefP1proto;
 @end
 @protocol P2
-- (void) P2proto;  // expected-warning {{method definition for 'P2proto' not found}}
-+ (void) ClsP2Proto; // expected-warning {{method definition for 'ClsP2Proto' not found}}
+- (void) P2proto;  
++ (void) ClsP2Proto; 
 @end
 
 @protocol P3<P2>
-- (void) P3proto; // expected-warning {{method definition for 'P3proto' not found}}
-+ (void) ClsP3Proto; // expected-warning {{method definition for 'ClsP3Proto' not found}}
+- (void) P3proto; 
++ (void) ClsP3Proto; 
 + (void) DefClsP3Proto;
 @end
 
 @protocol PROTO<P1, P3>
-- (void) meth;			// expected-warning {{method definition for 'meth' not found}}
-- (void) meth : (int) arg1;	// expected-warning {{method definition for 'meth:' not found}}
-+ (void) cls_meth : (int) arg1; // expected-warning {{method definition for 'cls_meth:' not found}}
+- (void) meth;		
+- (void) meth : (int) arg1; 
++ (void) cls_meth : (int) arg1; 
 @end
 
 @interface INTF <PROTO>
 @end
 
-@implementation INTF   // expected-warning {{incomplete implementation of class 'INTF'}}
+@implementation INTF   // expected-warning {{incomplete implementation}} \
+                          expected-warning {{method definition for 'meth' not found}} \
+                          expected-warning {{method definition for 'meth:' not found}} \
+                          expected-warning {{method definition for 'cls_meth:' not found}} \
+                          expected-warning {{method definition for 'P3proto' not found}} \
+                          expected-warning {{method definition for 'ClsP3Proto' not found}} \
+                          expected-warning {{method definition for 'P2proto' not found}} \
+                          expected-warning {{method definition for 'ClsP2Proto' not found}} \
+                          expected-warning {{method definition for 'ClsP1Proto' not found}} \
+                          expected-warning {{method definition for 'P1proto' not found}}
 - (void) DefP1proto{}
 
 + (void) DefClsP3Proto{}