[llvm-branch-commits] [cfe-branch] r146654 - in /cfe/branches/tooling: ./ include/clang-c/ include/clang/AST/ include/clang/Analysis/Analyses/ include/clang/Basic/ include/clang/Sema/ include/clang/Serialization/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Frontend/ lib/Index/ lib/Rewrite/ lib/Sema/ lib/Serialization/ lib/StaticAnalyzer/Core/ test/ARCMT/ test/Analysis/ test/CXX/basic/basic.lookup/basic.lookup.argdep/ test/CXX/basic/basic.lookup/basic.lookup.classref/ test/CXX/basic/basic.start/basic.start.m...

Chandler Carruth chandlerc at gmail.com
Thu Dec 15 03:54:04 PST 2011


Author: chandlerc
Date: Thu Dec 15 05:54:03 2011
New Revision: 146654

URL: http://llvm.org/viewvc/llvm-project?rev=146654&view=rev
Log:
Sync the branch with the latest Clang trunk.

Added:
    cfe/branches/tooling/test/Misc/diag-verify.cpp
      - copied unchanged from r146653, cfe/trunk/test/Misc/diag-verify.cpp
    cfe/branches/tooling/test/Sema/format-strings-c90.c
      - copied unchanged from r146653, cfe/trunk/test/Sema/format-strings-c90.c
Modified:
    cfe/branches/tooling/   (props changed)
    cfe/branches/tooling/include/clang-c/Index.h
    cfe/branches/tooling/include/clang/AST/DeclBase.h
    cfe/branches/tooling/include/clang/AST/DeclObjC.h
    cfe/branches/tooling/include/clang/Analysis/Analyses/FormatString.h
    cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/branches/tooling/include/clang/Sema/Sema.h
    cfe/branches/tooling/include/clang/Serialization/ASTReader.h
    cfe/branches/tooling/lib/AST/ASTContext.cpp
    cfe/branches/tooling/lib/AST/ASTImporter.cpp
    cfe/branches/tooling/lib/AST/DeclObjC.cpp
    cfe/branches/tooling/lib/AST/DeclPrinter.cpp
    cfe/branches/tooling/lib/Analysis/FormatString.cpp
    cfe/branches/tooling/lib/Analysis/FormatStringParsing.h
    cfe/branches/tooling/lib/Analysis/PrintfFormatString.cpp
    cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp
    cfe/branches/tooling/lib/Basic/Targets.cpp
    cfe/branches/tooling/lib/CodeGen/CGObjCRuntime.cpp
    cfe/branches/tooling/lib/Driver/Tools.cpp
    cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp
    cfe/branches/tooling/lib/Index/Analyzer.cpp
    cfe/branches/tooling/lib/Rewrite/RewriteObjC.cpp
    cfe/branches/tooling/lib/Sema/SemaAccess.cpp
    cfe/branches/tooling/lib/Sema/SemaChecking.cpp
    cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp
    cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
    cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp
    cfe/branches/tooling/lib/Sema/SemaExpr.cpp
    cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
    cfe/branches/tooling/lib/Sema/SemaExprMember.cpp
    cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp
    cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp
    cfe/branches/tooling/lib/Sema/SemaOverload.cpp
    cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp
    cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerRegistry.cpp
    cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m
    cfe/branches/tooling/test/Analysis/CFDateGC.m
    cfe/branches/tooling/test/Analysis/NSString.m
    cfe/branches/tooling/test/Analysis/method-arg-decay.m
    cfe/branches/tooling/test/Analysis/retain-release-path-notes-gc.m
    cfe/branches/tooling/test/Analysis/retain-release-path-notes.m
    cfe/branches/tooling/test/Analysis/retain-release-region-store.m
    cfe/branches/tooling/test/Analysis/taint-tester.c
    cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp
    cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
    cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp
    cfe/branches/tooling/test/CXX/basic/basic.start/basic.start.main/p2f.cpp
    cfe/branches/tooling/test/CXX/class.access/p6.cpp
    cfe/branches/tooling/test/CXX/class.derived/class.member.lookup/p6.cpp
    cfe/branches/tooling/test/CXX/class/class.friend/p1.cpp
    cfe/branches/tooling/test/CXX/class/class.mem/p13.cpp
    cfe/branches/tooling/test/CXX/class/class.nest/p1-cxx0x.cpp
    cfe/branches/tooling/test/CXX/class/class.nest/p1.cpp
    cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
    cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
    cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp
    cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp
    cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp
    cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp
    cfe/branches/tooling/test/CXX/over/over.over/p2-resolve-single-template-id.cpp
    cfe/branches/tooling/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
    cfe/branches/tooling/test/FixIt/typo.c
    cfe/branches/tooling/test/Index/index-suppress-refs.h
    cfe/branches/tooling/test/Index/index-suppress-refs.m
    cfe/branches/tooling/test/Lexer/rdr-6096838-2.c
    cfe/branches/tooling/test/Lexer/string-literal-encoding.c
    cfe/branches/tooling/test/Lexer/string_concat.cpp
    cfe/branches/tooling/test/Misc/diag-aka-types.cpp
    cfe/branches/tooling/test/Modules/macros.c
    cfe/branches/tooling/test/Modules/normal-module-map.cpp
    cfe/branches/tooling/test/PCH/typo.cpp
    cfe/branches/tooling/test/Parser/attr-availability.c
    cfe/branches/tooling/test/Parser/check-syntax-1.m
    cfe/branches/tooling/test/Parser/cxx-altivec.cpp
    cfe/branches/tooling/test/Parser/cxx-typeid.cpp
    cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp
    cfe/branches/tooling/test/Parser/objc-category-neg-1.m
    cfe/branches/tooling/test/Parser/objc-forcollection-neg-2.m
    cfe/branches/tooling/test/Parser/objc-init.m
    cfe/branches/tooling/test/Parser/recovery.c
    cfe/branches/tooling/test/Sema/attr-unavailable-message.c
    cfe/branches/tooling/test/Sema/block-misc.c
    cfe/branches/tooling/test/Sema/builtins.c
    cfe/branches/tooling/test/Sema/compare.c
    cfe/branches/tooling/test/Sema/format-strings-scanf.c
    cfe/branches/tooling/test/Sema/format-strings-size_t.c
    cfe/branches/tooling/test/Sema/implicit-builtin-redecl.c
    cfe/branches/tooling/test/Sema/overloadable-complex.c
    cfe/branches/tooling/test/Sema/overloadable.c
    cfe/branches/tooling/test/Sema/thread-specifier.c
    cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp
    cfe/branches/tooling/test/SemaCXX/access.cpp
    cfe/branches/tooling/test/SemaCXX/addr-of-overloaded-function.cpp
    cfe/branches/tooling/test/SemaCXX/class.cpp
    cfe/branches/tooling/test/SemaCXX/complex-overload.cpp
    cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
    cfe/branches/tooling/test/SemaCXX/dcl_init_aggr.cpp
    cfe/branches/tooling/test/SemaCXX/exceptions.cpp
    cfe/branches/tooling/test/SemaCXX/explicit.cpp
    cfe/branches/tooling/test/SemaCXX/incomplete-call.cpp
    cfe/branches/tooling/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
    cfe/branches/tooling/test/SemaCXX/overload-call.cpp
    cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp
    cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp
    cfe/branches/tooling/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp
    cfe/branches/tooling/test/SemaCXX/scope-check.cpp
    cfe/branches/tooling/test/SemaCXX/statements.cpp
    cfe/branches/tooling/test/SemaCXX/static-assert.cpp
    cfe/branches/tooling/test/SemaCXX/this.cpp
    cfe/branches/tooling/test/SemaCXX/typeid.cpp
    cfe/branches/tooling/test/SemaCXX/uninit-variables.cpp
    cfe/branches/tooling/test/SemaCXX/warn-bool-conversion.cpp
    cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp
    cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp
    cfe/branches/tooling/test/SemaObjC/arc.m
    cfe/branches/tooling/test/SemaObjC/attr-deprecated.m
    cfe/branches/tooling/test/SemaObjC/blocks.m
    cfe/branches/tooling/test/SemaObjC/call-super-2.m
    cfe/branches/tooling/test/SemaObjC/category-1.m
    cfe/branches/tooling/test/SemaObjC/class-extension-dup-methods.m
    cfe/branches/tooling/test/SemaObjC/compare-qualified-id.m
    cfe/branches/tooling/test/SemaObjC/comptypes-1.m
    cfe/branches/tooling/test/SemaObjC/comptypes-7.m
    cfe/branches/tooling/test/SemaObjC/conditional-expr-3.m
    cfe/branches/tooling/test/SemaObjC/conditional-expr.m
    cfe/branches/tooling/test/SemaObjC/default-synthesize.m
    cfe/branches/tooling/test/SemaObjC/gcc-cast-ext.m
    cfe/branches/tooling/test/SemaObjC/invalid-objc-decls-1.m
    cfe/branches/tooling/test/SemaObjC/ivar-lookup.m
    cfe/branches/tooling/test/SemaObjC/method-bad-param.m
    cfe/branches/tooling/test/SemaObjC/method-not-defined.m
    cfe/branches/tooling/test/SemaObjC/method-undef-category-warn-1.m
    cfe/branches/tooling/test/SemaObjC/method-undef-extension-warn-1.m
    cfe/branches/tooling/test/SemaObjC/missing-method-return-type.m
    cfe/branches/tooling/test/SemaObjC/no-protocol-option-tests.m
    cfe/branches/tooling/test/SemaObjC/property-9.m
    cfe/branches/tooling/test/SemaObjC/property-lookup-in-id.m
    cfe/branches/tooling/test/SemaObjC/scope-check.m
    cfe/branches/tooling/test/SemaObjC/special-dep-unavail-warning.m
    cfe/branches/tooling/test/SemaObjC/super.m
    cfe/branches/tooling/test/SemaObjC/try-catch.m
    cfe/branches/tooling/test/SemaObjC/undef-protocol-methods-1.m
    cfe/branches/tooling/test/SemaObjC/unknown-anytype.m
    cfe/branches/tooling/test/SemaObjC/warn-implicit-atomic-property.m
    cfe/branches/tooling/test/SemaObjC/warn-strict-selector-match.m
    cfe/branches/tooling/test/SemaObjCXX/unknown-anytype.mm
    cfe/branches/tooling/test/SemaObjCXX/warn-strict-selector-match.mm
    cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp
    cfe/branches/tooling/test/SemaTemplate/friend.cpp
    cfe/branches/tooling/test/SemaTemplate/instantiate-expr-5.cpp
    cfe/branches/tooling/tools/c-index-test/c-index-test.c
    cfe/branches/tooling/tools/libclang/CIndex.cpp
    cfe/branches/tooling/tools/libclang/IndexingContext.cpp
    cfe/branches/tooling/tools/libclang/IndexingContext.h

Propchange: cfe/branches/tooling/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 15 05:54:03 2011
@@ -1,3 +1,3 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:146581-146591
+/cfe/trunk:146581-146653
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/tooling/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang-c/Index.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang-c/Index.h (original)
+++ cfe/branches/tooling/include/clang-c/Index.h Thu Dec 15 05:54:03 2011
@@ -4171,19 +4171,6 @@
   CXIdxEntity_TemplateSpecialization = 3
 } CXIdxEntityCXXTemplateKind;
 
-typedef struct {
-  CXIdxEntityKind kind;
-  CXIdxEntityCXXTemplateKind templateKind;
-  CXIdxEntityLanguage lang;
-  const char *name;
-  const char *USR;
-  CXCursor cursor;
-} CXIdxEntityInfo;
-
-typedef struct {
-  CXCursor cursor;
-} CXIdxContainerInfo;
-
 typedef enum {
   CXIdxAttr_Unexposed     = 0,
   CXIdxAttr_IBAction      = 1,
@@ -4198,6 +4185,21 @@
 } CXIdxAttrInfo;
 
 typedef struct {
+  CXIdxEntityKind kind;
+  CXIdxEntityCXXTemplateKind templateKind;
+  CXIdxEntityLanguage lang;
+  const char *name;
+  const char *USR;
+  CXCursor cursor;
+  const CXIdxAttrInfo *const *attributes;
+  unsigned numAttributes;
+} CXIdxEntityInfo;
+
+typedef struct {
+  CXCursor cursor;
+} CXIdxContainerInfo;
+
+typedef struct {
   const CXIdxAttrInfo *attrInfo;
   const CXIdxEntityInfo *objcClass;
   CXCursor classCursor;

Modified: cfe/branches/tooling/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/DeclBase.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/DeclBase.h (original)
+++ cfe/branches/tooling/include/clang/AST/DeclBase.h Thu Dec 15 05:54:03 2011
@@ -589,12 +589,6 @@
 
   /// \brief Whether this particular Decl is a canonical one.
   bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
-
-  /// \brief Determine whether this declaration declares the same entity as
-  /// the other declaration.
-  bool isSameEntityAs(const Decl *Other) const {
-    return getCanonicalDecl() == Other->getCanonicalDecl();
-  }
   
 protected:
   /// \brief Returns the next redeclaration or itself if this is the only decl.
@@ -766,6 +760,17 @@
   ASTMutationListener *getASTMutationListener() const;
 };
 
+/// \brief Determine whether two declarations declare the same entity.
+inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
+  if (D1 == D2)
+    return true;
+  
+  if (!D1 || !D2)
+    return false;
+  
+  return D1->getCanonicalDecl() == D2->getCanonicalDecl();
+}
+  
 /// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when
 /// doing something to a specific decl.
 class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry {

Modified: cfe/branches/tooling/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/DeclObjC.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/DeclObjC.h (original)
+++ cfe/branches/tooling/include/clang/AST/DeclObjC.h Thu Dec 15 05:54:03 2011
@@ -545,45 +545,63 @@
   /// TypeDecl.  It is a cache maintained by ASTContext::getObjCInterfaceType
   mutable const Type *TypeForDecl;
   friend class ASTContext;
+  
+  struct DefinitionData {
+    /// Class's super class.
+    ObjCInterfaceDecl *SuperClass;
+
+    /// Protocols referenced in the @interface  declaration
+    ObjCProtocolList ReferencedProtocols;
+
+    /// Protocols reference in both the @interface and class extensions.
+    ObjCList<ObjCProtocolDecl> AllReferencedProtocols;
+
+    /// \brief List of categories and class extensions defined for this class.
+    ///
+    /// Categories are stored as a linked list in the AST, since the categories
+    /// and class extensions come long after the initial interface declaration,
+    /// and we avoid dynamically-resized arrays in the AST wherever possible.
+    ObjCCategoryDecl *CategoryList;
+
+    /// IvarList - List of all ivars defined by this class; including class
+    /// extensions and implementation. This list is built lazily.
+    ObjCIvarDecl *IvarList;
+
+    /// \brief Indicates that the contents of this Objective-C class will be
+    /// completed by the external AST source when required.
+    mutable bool ExternallyCompleted : 1;
 
-  /// Class's super class.
-  ObjCInterfaceDecl *SuperClass;
+    SourceLocation SuperClassLoc; // location of the super class identifier.
+  };
 
-  /// Protocols referenced in the @interface  declaration
-  ObjCProtocolList ReferencedProtocols;
+  ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id,
+                    SourceLocation CLoc, bool FD, bool isInternal);
 
-  /// Protocols reference in both the @interface and class extensions.
-  ObjCList<ObjCProtocolDecl> AllReferencedProtocols;
+  void LoadExternalDefinition() const;
 
-  /// \brief List of categories and class extensions defined for this class.
-  ///
-  /// Categories are stored as a linked list in the AST, since the categories
-  /// and class extensions come long after the initial interface declaration,
-  /// and we avoid dynamically-resized arrays in the AST wherever possible.
-  ObjCCategoryDecl *CategoryList;
-
-  /// IvarList - List of all ivars defined by this class; including class
-  /// extensions and implementation. This list is built lazily.
-  ObjCIvarDecl *IvarList;
+  /// \brief Contains a pointer to the data associated with this class,
+  /// which will be NULL if this class has not yet been defined.
+  DefinitionData *Definition;
+
+  /// \brief The location of the last location in this declaration, e.g.,
+  /// the '>', '}', or identifier.
+  /// FIXME: This seems like the wrong location to care about.
+  SourceLocation EndLoc; 
 
   /// \brief True if it was initially declared with @class.
   /// Differs with \see ForwardDecl in that \see ForwardDecl will change to
   /// false when we see the @interface, but InitiallyForwardDecl will remain
   /// true.
   bool InitiallyForwardDecl : 1;
-  bool ForwardDecl:1; // declared with @class.
-
-  /// \brief Indicates that the contents of this Objective-C class will be
-  /// completed by the external AST source when required.
-  mutable bool ExternallyCompleted : 1;
 
-  SourceLocation SuperClassLoc; // location of the super class identifier.
-  SourceLocation EndLoc; // marks the '>', '}', or identifier.
-
-  ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id,
-                    SourceLocation CLoc, bool FD, bool isInternal);
+  DefinitionData &data() const {
+    assert(Definition != 0 && "Declaration is not a definition!");
+    return *Definition;
+  }
 
-  void LoadExternalDefinition() const;
+  /// \brief Allocate the definition data for this class.
+  void allocateDefinitionData();
+  
 public:
   static ObjCInterfaceDecl *Create(ASTContext &C, DeclContext *DC,
                                    SourceLocation atLoc,
@@ -604,10 +622,10 @@
   void setExternallyCompleted();
 
   const ObjCProtocolList &getReferencedProtocols() const {
-    if (ExternallyCompleted)
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return ReferencedProtocols;
+    return data().ReferencedProtocols;
   }
 
   ObjCImplementationDecl *getImplementation() const;
@@ -626,55 +644,93 @@
   typedef ObjCProtocolList::iterator protocol_iterator;
 
   protocol_iterator protocol_begin() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return protocol_iterator();
+    
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return ReferencedProtocols.begin();
+    return data().ReferencedProtocols.begin();
   }
   protocol_iterator protocol_end() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return protocol_iterator();
+
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return ReferencedProtocols.end();
+    return data().ReferencedProtocols.end();
   }
 
   typedef ObjCProtocolList::loc_iterator protocol_loc_iterator;
 
   protocol_loc_iterator protocol_loc_begin() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return protocol_loc_iterator();
+
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return ReferencedProtocols.loc_begin();
+    return data().ReferencedProtocols.loc_begin();
   }
 
   protocol_loc_iterator protocol_loc_end() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return protocol_loc_iterator();
+
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return ReferencedProtocols.loc_end();
+    return data().ReferencedProtocols.loc_end();
   }
 
   typedef ObjCList<ObjCProtocolDecl>::iterator all_protocol_iterator;
 
   all_protocol_iterator all_referenced_protocol_begin() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return all_protocol_iterator();
+
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return AllReferencedProtocols.empty() ? protocol_begin()
-      : AllReferencedProtocols.begin();
+    return data().AllReferencedProtocols.empty()  
+             ? protocol_begin()
+             : data().AllReferencedProtocols.begin();
   }
   all_protocol_iterator all_referenced_protocol_end() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return all_protocol_iterator();
+    
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return AllReferencedProtocols.empty() ? protocol_end()
-      : AllReferencedProtocols.end();
+    return data().AllReferencedProtocols.empty() 
+             ? protocol_end()
+             : data().AllReferencedProtocols.end();
   }
 
   typedef specific_decl_iterator<ObjCIvarDecl> ivar_iterator;
 
-  ivar_iterator ivar_begin() const { return ivar_iterator(decls_begin()); }
-  ivar_iterator ivar_end() const { return ivar_iterator(decls_end()); }
+  ivar_iterator ivar_begin() const { 
+    if (const ObjCInterfaceDecl *Def = getDefinition())
+      return ivar_iterator(Def->decls_begin()); 
+    
+    // FIXME: Should make sure no callers ever do this.
+    return ivar_iterator();
+  }
+  ivar_iterator ivar_end() const { 
+    if (const ObjCInterfaceDecl *Def = getDefinition())
+      return ivar_iterator(Def->decls_end()); 
+
+    // FIXME: Should make sure no callers ever do this.
+    return ivar_iterator();
+  }
 
   unsigned ivar_size() const {
     return std::distance(ivar_begin(), ivar_end());
@@ -688,13 +744,13 @@
     // the ivar chain is essentially a cached property of ObjCInterfaceDecl.
     return const_cast<ObjCInterfaceDecl *>(this)->all_declared_ivar_begin();
   }
-  void setIvarList(ObjCIvarDecl *ivar) { IvarList = ivar; }
+  void setIvarList(ObjCIvarDecl *ivar) { data().IvarList = ivar; }
 
   /// setProtocolList - Set the list of protocols that this interface
   /// implements.
   void setProtocolList(ObjCProtocolDecl *const* List, unsigned Num,
                        const SourceLocation *Locs, ASTContext &C) {
-    ReferencedProtocols.set(List, Num, Locs, C);
+    data().ReferencedProtocols.set(List, Num, Locs, C);
   }
 
   /// mergeClassExtensionProtocolList - Merge class extension's protocol list
@@ -706,30 +762,63 @@
   /// \brief True if it was initially declared with @class.
   /// Differs with \see isForwardDecl in that \see isForwardDecl will change to
   /// false when we see the @interface, but this will remain true.
-  bool isInitiallyForwardDecl() const { return InitiallyForwardDecl; }
-
-  bool isForwardDecl() const { return ForwardDecl; }
+  bool isInitiallyForwardDecl() const { 
+    return InitiallyForwardDecl; 
+  }
 
-  void completedForwardDecl();
+  /// \brief Determine whether this declaration is a forward declaration of
+  /// the class.
+  bool isForwardDecl() const { return Definition == 0; }
 
+  /// \brief Determine whether this class has been defined.
+  bool hasDefinition() const { return Definition != 0; }
+  
+  /// \brief Retrieve the definition of this class, or NULL if this class 
+  /// has been forward-declared (with @class) but not yet defined (with 
+  /// @interface).
+  ObjCInterfaceDecl *getDefinition() {
+    return hasDefinition()? this : 0;
+  }
+
+  /// \brief Retrieve the definition of this class, or NULL if this class 
+  /// has been forward-declared (with @class) but not yet defined (with 
+  /// @interface).
+  const ObjCInterfaceDecl *getDefinition() const {
+    return hasDefinition()? this : 0;
+  }
+
+  /// \brief Starts the definition of this Objective-C class, taking it from
+  /// a forward declaration (@class) to a definition (@interface).
+  void startDefinition();
+  
   ObjCInterfaceDecl *getSuperClass() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return 0;
+    
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return SuperClass;
+    return data().SuperClass;
   }
 
-  void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }
+  void setSuperClass(ObjCInterfaceDecl * superCls) { 
+    data().SuperClass = superCls; 
+  }
 
   ObjCCategoryDecl* getCategoryList() const {
-    if (ExternallyCompleted)
+    // FIXME: Should make sure no callers ever do this.
+    if (!hasDefinition())
+      return 0;
+    
+    if (data().ExternallyCompleted)
       LoadExternalDefinition();
 
-    return CategoryList;
+    return data().CategoryList;
   }
 
   void setCategoryList(ObjCCategoryDecl *category) {
-    CategoryList = category;
+    data().CategoryList = category;
   }
 
   ObjCCategoryDecl* getFirstClassExtension() const;
@@ -742,8 +831,9 @@
   bool isSuperClassOf(const ObjCInterfaceDecl *I) const {
     // If RHS is derived from LHS it is OK; else it is not OK.
     while (I != NULL) {
-      if (this == I)
+      if (declaresSameEntity(this, I))
         return true;
+      
       I = I->getSuperClass();
     }
     return false;
@@ -787,8 +877,8 @@
   SourceLocation getLocEnd() const { return EndLoc; }
   void setLocEnd(SourceLocation LE) { EndLoc = LE; }
 
-  void setSuperClassLoc(SourceLocation Loc) { SuperClassLoc = Loc; }
-  SourceLocation getSuperClassLoc() const { return SuperClassLoc; }
+  void setSuperClassLoc(SourceLocation Loc) { data().SuperClassLoc = Loc; }
+  SourceLocation getSuperClassLoc() const { return data().SuperClassLoc; }
 
   /// isImplicitInterfaceDecl - check that this is an implicitly declared
   /// ObjCInterfaceDecl node. This is for legacy objective-c @implementation

Modified: cfe/branches/tooling/include/clang/Analysis/Analyses/FormatString.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Analysis/Analyses/FormatString.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Analysis/Analyses/FormatString.h (original)
+++ cfe/branches/tooling/include/clang/Analysis/Analyses/FormatString.h Thu Dec 15 05:54:03 2011
@@ -71,6 +71,7 @@
     AsSizeT,      // 'z'
     AsPtrDiff,    // 't'
     AsLongDouble, // 'L'
+    AsAllocate,    // for '%as', GNU extension to C90 scanf
     AsWideChar = AsLong // for '%ls', only makes sense for printf
   };
 
@@ -630,10 +631,10 @@
 };
 
 bool ParsePrintfString(FormatStringHandler &H,
-                       const char *beg, const char *end);
+                       const char *beg, const char *end, const LangOptions &LO);
 
 bool ParseScanfString(FormatStringHandler &H,
-                       const char *beg, const char *end);
+                      const char *beg, const char *end, const LangOptions &LO);
 
 } // end analyze_format_string namespace
 } // end clang namespace

Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td Thu Dec 15 05:54:03 2011
@@ -528,6 +528,10 @@
   "property's synthesized getter follows Cocoa naming"
   " convention for returning 'owned' objects">,
   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
+def warn_auto_synthesizing_protocol_property :Warning<
+  "auto property synthesis will not synthesize property"
+  " declared in a protocol">,
+  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
 def warn_property_getter_owning_mismatch : Warning<
   "property declared as returning non-retained objects"
   "; getter returning retained objects">;

Modified: cfe/branches/tooling/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Sema/Sema.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Sema/Sema.h (original)
+++ cfe/branches/tooling/include/clang/Sema/Sema.h Thu Dec 15 05:54:03 2011
@@ -6002,10 +6002,12 @@
   /// in the global scope.
   bool CheckObjCDeclScope(Decl *D);
 
-  /// VerifyIntegerConstantExpression - verifies that an expression is an ICE,
+  /// VerifyIntegerConstantExpression - Verifies that an expression is an ICE,
   /// and reports the appropriate diagnostics. Returns false on success.
   /// Can optionally return the value of the expression.
-  bool VerifyIntegerConstantExpression(const Expr *E, llvm::APSInt *Result = 0);
+  bool VerifyIntegerConstantExpression(const Expr *E, llvm::APSInt *Result = 0,
+                                       unsigned DiagId = 0,
+                                       bool AllowFold = true);
 
   /// VerifyBitField - verifies that a bit field expression is an ICE and has
   /// the correct width, and that the field type is valid.

Modified: cfe/branches/tooling/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Serialization/ASTReader.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Serialization/ASTReader.h (original)
+++ cfe/branches/tooling/include/clang/Serialization/ASTReader.h Thu Dec 15 05:54:03 2011
@@ -329,14 +329,16 @@
   /// haven't been loaded yet.
   DeclContextVisibleUpdatesPending PendingVisibleUpdates;
 
-  typedef SmallVector<CXXRecordDecl *, 4> ForwardRefs;
-  typedef llvm::DenseMap<const CXXRecordDecl *, ForwardRefs>
+  typedef SmallVector<Decl *, 4> ForwardRefs;
+  typedef llvm::DenseMap<const Decl *, ForwardRefs>
       PendingForwardRefsMap;
+  
   /// \brief Forward references that have a definition but the definition decl
   /// is still initializing. When the definition gets read it will update
   /// the DefinitionData pointer of all pending references.
   PendingForwardRefsMap PendingForwardRefs;
 
+
   typedef llvm::DenseMap<serialization::DeclID, serialization::DeclID>
       FirstLatestDeclIDMap;
   /// \brief Map of first declarations from a chained PCH that point to the

Modified: cfe/branches/tooling/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ASTContext.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ASTContext.cpp (original)
+++ cfe/branches/tooling/lib/AST/ASTContext.cpp Thu Dec 15 05:54:03 2011
@@ -5469,7 +5469,7 @@
   const ObjCObjectType *RHS = Rptr->getObjectType();
   const ObjCInterfaceDecl* LDecl = LHS->getInterface();
   const ObjCInterfaceDecl* RDecl = RHS->getInterface();
-  if (!LDecl || !RDecl || (LDecl == RDecl))
+  if (!LDecl || !RDecl || (declaresSameEntity(LDecl, RDecl)))
     return QualType();
   
   do {

Modified: cfe/branches/tooling/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ASTImporter.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ASTImporter.cpp (original)
+++ cfe/branches/tooling/lib/AST/ASTImporter.cpp Thu Dec 15 05:54:03 2011
@@ -3178,7 +3178,7 @@
   }
   
   ObjCInterfaceDecl *ToIface = MergeWithIface;
-  if (!ToIface || ToIface->isForwardDecl()) {
+  if (!ToIface || !ToIface->hasDefinition()) {
     if (!ToIface) {
       ToIface = ObjCInterfaceDecl::Create(Importer.getToContext(), DC,
                                           Importer.Import(D->getAtStartLoc()),
@@ -3187,88 +3187,98 @@
                                           D->isImplicitInterfaceDecl());
       ToIface->setLexicalDeclContext(LexicalDC);
       LexicalDC->addDeclInternal(ToIface);
-      if (D->isInitiallyForwardDecl() && !D->isForwardDecl())
-        ToIface->completedForwardDecl();
     }
     Importer.Imported(D, ToIface);
 
-    if (D->getSuperClass()) {
-      ObjCInterfaceDecl *Super
-        = cast_or_null<ObjCInterfaceDecl>(Importer.Import(D->getSuperClass()));
-      if (!Super)
-        return 0;
+    if (D->hasDefinition()) {
+      if (!ToIface->hasDefinition())
+        ToIface->startDefinition();
       
-      ToIface->setSuperClass(Super);
-      ToIface->setSuperClassLoc(Importer.Import(D->getSuperClassLoc()));
-    }
-    
-    // Import protocols
-    SmallVector<ObjCProtocolDecl *, 4> Protocols;
-    SmallVector<SourceLocation, 4> ProtocolLocs;
-    ObjCInterfaceDecl::protocol_loc_iterator 
-      FromProtoLoc = D->protocol_loc_begin();
-    
-    // FIXME: Should we be usng all_referenced_protocol_begin() here?
-    for (ObjCInterfaceDecl::protocol_iterator FromProto = D->protocol_begin(),
-                                           FromProtoEnd = D->protocol_end();
-       FromProto != FromProtoEnd;
-       ++FromProto, ++FromProtoLoc) {
-      ObjCProtocolDecl *ToProto
-        = cast_or_null<ObjCProtocolDecl>(Importer.Import(*FromProto));
-      if (!ToProto)
-        return 0;
-      Protocols.push_back(ToProto);
-      ProtocolLocs.push_back(Importer.Import(*FromProtoLoc));
+      if (D->getSuperClass()) {
+        ObjCInterfaceDecl *Super
+          = cast_or_null<ObjCInterfaceDecl>(
+              Importer.Import(D->getSuperClass()));
+        if (!Super)
+          return 0;
+        
+        ToIface->setSuperClass(Super);
+        ToIface->setSuperClassLoc(Importer.Import(D->getSuperClassLoc()));
+      }
+      
+      // Import protocols
+      SmallVector<ObjCProtocolDecl *, 4> Protocols;
+      SmallVector<SourceLocation, 4> ProtocolLocs;
+      ObjCInterfaceDecl::protocol_loc_iterator 
+        FromProtoLoc = D->protocol_loc_begin();
+      
+      for (ObjCInterfaceDecl::protocol_iterator FromProto = D->protocol_begin(),
+                                             FromProtoEnd = D->protocol_end();
+         FromProto != FromProtoEnd;
+         ++FromProto, ++FromProtoLoc) {
+        ObjCProtocolDecl *ToProto
+          = cast_or_null<ObjCProtocolDecl>(Importer.Import(*FromProto));
+        if (!ToProto)
+          return 0;
+        Protocols.push_back(ToProto);
+        ProtocolLocs.push_back(Importer.Import(*FromProtoLoc));
+      }
+      
+      // FIXME: If we're merging, make sure that the protocol list is the same.
+      ToIface->setProtocolList(Protocols.data(), Protocols.size(),
+                               ProtocolLocs.data(), Importer.getToContext());
     }
     
-    // FIXME: If we're merging, make sure that the protocol list is the same.
-    ToIface->setProtocolList(Protocols.data(), Protocols.size(),
-                             ProtocolLocs.data(), Importer.getToContext());
-    
     // Import @end range
     ToIface->setAtEndRange(Importer.Import(D->getAtEndRange()));
   } else {
     Importer.Imported(D, ToIface);
 
-    // Check for consistency of superclasses.
-    DeclarationName FromSuperName, ToSuperName;
-    
-    // If the superclass hasn't been imported yet, do so before checking.
-    ObjCInterfaceDecl *DSuperClass = D->getSuperClass();
-    ObjCInterfaceDecl *ToIfaceSuperClass = ToIface->getSuperClass();
-    
-    if (DSuperClass && !ToIfaceSuperClass) {
-      Decl *ImportedSuperClass = Importer.Import(DSuperClass);
-      ObjCInterfaceDecl *ImportedSuperIface = cast<ObjCInterfaceDecl>(ImportedSuperClass);
-      ToIface->setSuperClass(ImportedSuperIface);
-    }
-
-    if (D->getSuperClass())
-      FromSuperName = Importer.Import(D->getSuperClass()->getDeclName());
-    if (ToIface->getSuperClass())
-      ToSuperName = ToIface->getSuperClass()->getDeclName();
-    if (FromSuperName != ToSuperName) {
-      Importer.ToDiag(ToIface->getLocation(), 
-                      diag::err_odr_objc_superclass_inconsistent)
-        << ToIface->getDeclName();
+    if (D->hasDefinition()) {
+      // Check for consistency of superclasses.
+      DeclarationName FromSuperName, ToSuperName;
+      
+      // If the superclass hasn't been imported yet, do so before checking.
+      ObjCInterfaceDecl *DSuperClass = D->getSuperClass();
+      ObjCInterfaceDecl *ToIfaceSuperClass = ToIface->getSuperClass();
+      
+      if (DSuperClass && !ToIfaceSuperClass) {
+        Decl *ImportedSuperClass = Importer.Import(DSuperClass);
+        ObjCInterfaceDecl *ImportedSuperIface
+          = cast<ObjCInterfaceDecl>(ImportedSuperClass);
+        
+        ToIface->setSuperClass(ImportedSuperIface);
+      }
+
+      if (D->getSuperClass())
+        FromSuperName = Importer.Import(D->getSuperClass()->getDeclName());
       if (ToIface->getSuperClass())
-        Importer.ToDiag(ToIface->getSuperClassLoc(), 
-                        diag::note_odr_objc_superclass)
-          << ToIface->getSuperClass()->getDeclName();
-      else
+        ToSuperName = ToIface->getSuperClass()->getDeclName();
+      if (FromSuperName != ToSuperName) {
         Importer.ToDiag(ToIface->getLocation(), 
-                        diag::note_odr_objc_missing_superclass);
-      if (D->getSuperClass())
-        Importer.FromDiag(D->getSuperClassLoc(), 
+                        diag::err_odr_objc_superclass_inconsistent)
+          << ToIface->getDeclName();
+        if (ToIface->getSuperClass())
+          Importer.ToDiag(ToIface->getSuperClassLoc(), 
                           diag::note_odr_objc_superclass)
-          << D->getSuperClass()->getDeclName();
-      else
-        Importer.FromDiag(D->getLocation(), 
+            << ToIface->getSuperClass()->getDeclName();
+        else
+          Importer.ToDiag(ToIface->getLocation(), 
                           diag::note_odr_objc_missing_superclass);
-      return 0;
+        if (D->getSuperClass())
+          Importer.FromDiag(D->getSuperClassLoc(), 
+                            diag::note_odr_objc_superclass)
+            << D->getSuperClass()->getDeclName();
+        else
+          Importer.FromDiag(D->getLocation(), 
+                            diag::note_odr_objc_missing_superclass);
+        return 0;
+      }
     }
   }
   
+  if (!D->hasDefinition())
+    return ToIface;
+  
   // Import categories. When the categories themselves are imported, they'll
   // hook themselves into this interface.
   for (ObjCCategoryDecl *FromCat = D->getCategoryList(); FromCat;
@@ -3279,7 +3289,7 @@
   ImportDeclContext(D);
   
   // If we have an @implementation, import it as well.
-  if (D->getImplementation()) {
+  if ( D->getImplementation()) {
     ObjCImplementationDecl *Impl = cast_or_null<ObjCImplementationDecl>(
                                        Importer.Import(D->getImplementation()));
     if (!Impl)
@@ -3373,7 +3383,7 @@
     if ((Super && !Impl->getSuperClass()) ||
         (!Super && Impl->getSuperClass()) ||
         (Super && Impl->getSuperClass() && 
-         Super->getCanonicalDecl() != Impl->getSuperClass())) {
+         !declaresSameEntity(Super->getCanonicalDecl(), Impl->getSuperClass()))) {
         Importer.ToDiag(Impl->getLocation(), 
                         diag::err_odr_objc_superclass_inconsistent)
           << Iface->getDeclName();

Modified: cfe/branches/tooling/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/DeclObjC.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/DeclObjC.cpp (original)
+++ cfe/branches/tooling/lib/AST/DeclObjC.cpp Thu Dec 15 05:54:03 2011
@@ -154,7 +154,11 @@
 ObjCPropertyDecl *
 ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass(
                                             IdentifierInfo *PropertyId) const {
-  if (ExternallyCompleted)
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;
+  
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   if (ObjCPropertyDecl *PD =
@@ -175,11 +179,12 @@
                               ObjCProtocolDecl *const* ExtList, unsigned ExtNum,
                               ASTContext &C)
 {
-  if (ExternallyCompleted)
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
-  if (AllReferencedProtocols.empty() && ReferencedProtocols.empty()) {
-    AllReferencedProtocols.set(ExtList, ExtNum, C);
+  if (data().AllReferencedProtocols.empty() && 
+      data().ReferencedProtocols.empty()) {
+    data().AllReferencedProtocols.set(ExtList, ExtNum, C);
     return;
   }
   
@@ -214,12 +219,16 @@
     ProtocolRefs.push_back(*p);
   }
 
-  AllReferencedProtocols.set(ProtocolRefs.data(), ProtocolRefs.size(), C);
+  data().AllReferencedProtocols.set(ProtocolRefs.data(), ProtocolRefs.size(),C);
 }
 
-void ObjCInterfaceDecl::completedForwardDecl() {
-  assert(isForwardDecl() && "Only valid to call for forward refs");
-  ForwardDecl = false;
+void ObjCInterfaceDecl::allocateDefinitionData() {
+  assert(!hasDefinition() && "ObjC class already has a definition");
+  Definition = new (getASTContext()) DefinitionData();  
+}
+
+void ObjCInterfaceDecl::startDefinition() {
+  allocateDefinitionData();
   if (ASTMutationListener *L = getASTContext().getASTMutationListener())
     L->CompletedObjCForwardRef(this);
 }
@@ -244,7 +253,11 @@
 
 ObjCIvarDecl *ObjCInterfaceDecl::lookupInstanceVariable(IdentifierInfo *ID,
                                               ObjCInterfaceDecl *&clsDeclared) {
-  if (ExternallyCompleted)
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;  
+
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   ObjCInterfaceDecl* ClassDecl = this;
@@ -271,7 +284,11 @@
 /// the it returns NULL.
 ObjCInterfaceDecl *ObjCInterfaceDecl::lookupInheritedClass(
                                         const IdentifierInfo*ICName) {
-  if (ExternallyCompleted)
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;
+
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   ObjCInterfaceDecl* ClassDecl = this;
@@ -287,10 +304,14 @@
 /// the class, its categories, and its super classes (using a linear search).
 ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel,
                                                 bool isInstance) const {
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;
+
   const ObjCInterfaceDecl* ClassDecl = this;
   ObjCMethodDecl *MethodDecl = 0;
 
-  if (ExternallyCompleted)
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   while (ClassDecl != NULL) {
@@ -328,7 +349,11 @@
 ObjCMethodDecl *ObjCInterfaceDecl::lookupPrivateMethod(
                                    const Selector &Sel,
                                    bool Instance) {
-  if (ExternallyCompleted)
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;
+
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   ObjCMethodDecl *Method = 0;
@@ -651,16 +676,14 @@
 ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id,
                   SourceLocation CLoc, bool FD, bool isInternal)
   : ObjCContainerDecl(ObjCInterface, DC, Id, CLoc, atLoc),
-    TypeForDecl(0), SuperClass(0),
-    CategoryList(0), IvarList(0),
-    InitiallyForwardDecl(FD), ForwardDecl(FD),
-    ExternallyCompleted(false) {
+    TypeForDecl(0), Definition(), InitiallyForwardDecl(FD) 
+{
   setImplicit(isInternal);
 }
 
 void ObjCInterfaceDecl::LoadExternalDefinition() const {
-  assert(ExternallyCompleted && "Class is not externally completed");
-  ExternallyCompleted = false;
+  assert(data().ExternallyCompleted && "Class is not externally completed");
+  data().ExternallyCompleted = false;
   getASTContext().getExternalSource()->CompleteType(
                                         const_cast<ObjCInterfaceDecl *>(this));
 }
@@ -668,13 +691,17 @@
 void ObjCInterfaceDecl::setExternallyCompleted() {
   assert(getASTContext().getExternalSource() && 
          "Class can't be externally completed without an external source");
-  assert(!ForwardDecl && 
+  assert(hasDefinition() && 
          "Forward declarations can't be externally completed");
-  ExternallyCompleted = true;
+  data().ExternallyCompleted = true;
 }
 
 ObjCImplementationDecl *ObjCInterfaceDecl::getImplementation() const {
-  if (ExternallyCompleted)
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;
+      
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   return getASTContext().getObjCImplementation(
@@ -689,14 +716,18 @@
 /// its extensions and its implementation. Lazily build the list on first
 /// access.
 ObjCIvarDecl *ObjCInterfaceDecl::all_declared_ivar_begin() {
-  if (IvarList)
-    return IvarList;
+  // FIXME: Should make sure no callers ever do this.
+  if (!hasDefinition())
+    return 0;
+  
+  if (data().IvarList)
+    return data().IvarList;
   
   ObjCIvarDecl *curIvar = 0;
   if (!ivar_empty()) {
     ObjCInterfaceDecl::ivar_iterator I = ivar_begin(), E = ivar_end();
-    IvarList = (*I); ++I;
-    for (curIvar = IvarList; I != E; curIvar = *I, ++I)
+    data().IvarList = (*I); ++I;
+    for (curIvar = data().IvarList; I != E; curIvar = *I, ++I)
       curIvar->setNextIvar(*I);
   }
   
@@ -705,9 +736,9 @@
     if (!CDecl->ivar_empty()) {
       ObjCCategoryDecl::ivar_iterator I = CDecl->ivar_begin(),
                                           E = CDecl->ivar_end();
-      if (!IvarList) {
-        IvarList = (*I); ++I;
-        curIvar = IvarList;
+      if (!data().IvarList) {
+        data().IvarList = (*I); ++I;
+        curIvar = data().IvarList;
       }
       for ( ;I != E; curIvar = *I, ++I)
         curIvar->setNextIvar(*I);
@@ -718,15 +749,15 @@
     if (!ImplDecl->ivar_empty()) {
       ObjCImplementationDecl::ivar_iterator I = ImplDecl->ivar_begin(),
                                             E = ImplDecl->ivar_end();
-      if (!IvarList) {
-        IvarList = (*I); ++I;
-        curIvar = IvarList;
+      if (!data().IvarList) {
+        data().IvarList = (*I); ++I;
+        curIvar = data().IvarList;
       }
       for ( ;I != E; curIvar = *I, ++I)
         curIvar->setNextIvar(*I);
     }
   }
-  return IvarList;
+  return data().IvarList;
 }
 
 /// FindCategoryDeclaration - Finds category declaration in the list of
@@ -735,7 +766,7 @@
 ///
 ObjCCategoryDecl *
 ObjCInterfaceDecl::FindCategoryDeclaration(IdentifierInfo *CategoryId) const {
-  if (ExternallyCompleted)
+  if (data().ExternallyCompleted)
     LoadExternalDefinition();
 
   for (ObjCCategoryDecl *Category = getCategoryList();
@@ -770,6 +801,9 @@
 bool ObjCInterfaceDecl::ClassImplementsProtocol(ObjCProtocolDecl *lProto,
                                     bool lookupCategory,
                                     bool RHSIsQualifiedID) {
+  if (!hasDefinition())
+    return false;
+  
   ObjCInterfaceDecl *IDecl = this;
   // 1st, look up the class.
   const ObjCList<ObjCProtocolDecl> &Protocols =
@@ -997,9 +1031,11 @@
   if (IDecl) {
     // Link this category into its class's category list.
     CatDecl->NextClassCategory = IDecl->getCategoryList();
-    IDecl->setCategoryList(CatDecl);
-    if (ASTMutationListener *L = C.getASTMutationListener())
-      L->AddedObjCCategoryToInterface(CatDecl, IDecl);
+    if (IDecl->hasDefinition()) {
+      IDecl->setCategoryList(CatDecl);
+      if (ASTMutationListener *L = C.getASTMutationListener())
+        L->AddedObjCCategoryToInterface(CatDecl, IDecl);
+    }
   }
 
   return CatDecl;

Modified: cfe/branches/tooling/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/DeclPrinter.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/DeclPrinter.cpp (original)
+++ cfe/branches/tooling/lib/AST/DeclPrinter.cpp Thu Dec 15 05:54:03 2011
@@ -905,6 +905,11 @@
   else
     Out << "@interface " << I;
 
+  if (OID->isForwardDecl()) {
+    Out << "@end";
+    return;
+  }
+  
   // Protocols?
   const ObjCList<ObjCProtocolDecl> &Protocols = OID->getReferencedProtocols();
   if (!Protocols.empty()) {

Modified: cfe/branches/tooling/lib/Analysis/FormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/FormatString.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/FormatString.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/FormatString.cpp Thu Dec 15 05:54:03 2011
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "FormatStringParsing.h"
+#include "clang/Basic/LangOptions.h"
 
 using clang::analyze_format_string::ArgTypeResult;
 using clang::analyze_format_string::FormatStringHandler;
@@ -175,7 +176,9 @@
 bool
 clang::analyze_format_string::ParseLengthModifier(FormatSpecifier &FS,
                                                   const char *&I,
-                                                  const char *E) {
+                                                  const char *E,
+                                                  const LangOptions &LO,
+                                                  bool IsScanf) {
   LengthModifier::Kind lmKind = LengthModifier::None;
   const char *lmPosition = I;
   switch (*I) {
@@ -196,6 +199,19 @@
     case 't': lmKind = LengthModifier::AsPtrDiff;    ++I; break;
     case 'L': lmKind = LengthModifier::AsLongDouble; ++I; break;
     case 'q': lmKind = LengthModifier::AsLongLong;   ++I; break;
+    case 'a':
+      if (IsScanf && !LO.C99 && !LO.CPlusPlus) {
+        // For scanf in C90, look at the next character to see if this should
+        // be parsed as the GNU extension 'a' length modifier. If not, this
+        // will be parsed as a conversion specifier.
+        ++I;
+        if (I != E && (*I == 's' || *I == 'S' || *I == '[')) {
+          lmKind = LengthModifier::AsAllocate;
+          break;
+        }
+        --I;
+      }
+      return false;
   }
   LengthModifier lm(lmPosition, lmKind);
   FS.setLengthModifier(lm);
@@ -391,6 +407,8 @@
     return "t";
   case AsLongDouble:
     return "L";
+  case AsAllocate:
+    return "a";
   case None:
     return "";
   }
@@ -527,6 +545,15 @@
         default:
           return false;
       }
+
+    case LengthModifier::AsAllocate:
+      switch (CS.getKind()) {
+        case ConversionSpecifier::sArg:
+        case ConversionSpecifier::SArg:
+          return true;
+        default:
+          return false;
+      }
   }
   return false;
 }

Modified: cfe/branches/tooling/lib/Analysis/FormatStringParsing.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/FormatStringParsing.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/FormatStringParsing.h (original)
+++ cfe/branches/tooling/lib/Analysis/FormatStringParsing.h Thu Dec 15 05:54:03 2011
@@ -8,6 +8,8 @@
 
 namespace clang {
 
+class LangOptions;
+
 template <typename T>
 class UpdateOnReturn {
   T &ValueToUpdate;
@@ -42,7 +44,8 @@
 
 /// Returns true if a LengthModifier was parsed and installed in the
 /// FormatSpecifier& argument, and false otherwise.
-bool ParseLengthModifier(FormatSpecifier &FS, const char *&Beg, const char *E);
+bool ParseLengthModifier(FormatSpecifier &FS, const char *&Beg, const char *E,
+                         const LangOptions &LO, bool IsScanf = false);
   
 template <typename T> class SpecifierResult {
   T FS;
@@ -69,4 +72,3 @@
 } // end clang namespace
 
 #endif
-

Modified: cfe/branches/tooling/lib/Analysis/PrintfFormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/PrintfFormatString.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/PrintfFormatString.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/PrintfFormatString.cpp Thu Dec 15 05:54:03 2011
@@ -51,7 +51,8 @@
 static PrintfSpecifierResult ParsePrintfSpecifier(FormatStringHandler &H,
                                                   const char *&Beg,
                                                   const char *E,
-                                                  unsigned &argIndex) {
+                                                  unsigned &argIndex,
+                                                  const LangOptions &LO) {
 
   using namespace clang::analyze_format_string;
   using namespace clang::analyze_printf;
@@ -150,7 +151,7 @@
   }
 
   // Look for the length modifier.
-  if (ParseLengthModifier(FS, I, E) && I == E) {
+  if (ParseLengthModifier(FS, I, E, LO) && I == E) {
     // No more characters left?
     H.HandleIncompleteSpecifier(Start, E - Start);
     return true;
@@ -210,13 +211,15 @@
 
 bool clang::analyze_format_string::ParsePrintfString(FormatStringHandler &H,
                                                      const char *I,
-                                                     const char *E) {
+                                                     const char *E,
+                                                     const LangOptions &LO) {
 
   unsigned argIndex = 0;
 
   // Keep looking for a format specifier until we have exhausted the string.
   while (I != E) {
-    const PrintfSpecifierResult &FSR = ParsePrintfSpecifier(H, I, E, argIndex);
+    const PrintfSpecifierResult &FSR = ParsePrintfSpecifier(H, I, E, argIndex,
+                                                            LO);
     // Did a fail-stop error of any kind occur when parsing the specifier?
     // If so, don't do any more processing.
     if (FSR.shouldStop())
@@ -269,6 +272,8 @@
         return ArgTypeResult();
       case LengthModifier::AsPtrDiff:
         return ArgTypeResult(Ctx.getPointerDiffType(), "ptrdiff_t");
+      case LengthModifier::AsAllocate:
+        return ArgTypeResult::Invalid();
     }
 
   if (CS.isUIntArg())
@@ -288,6 +293,8 @@
         // FIXME: How to get the corresponding unsigned
         // version of ptrdiff_t?
         return ArgTypeResult();
+      case LengthModifier::AsAllocate:
+        return ArgTypeResult::Invalid();
     }
 
   if (CS.isDoubleArg()) {

Modified: cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp Thu Dec 15 05:54:03 2011
@@ -67,7 +67,8 @@
 static ScanfSpecifierResult ParseScanfSpecifier(FormatStringHandler &H,
                                                 const char *&Beg,
                                                 const char *E,
-                                                unsigned &argIndex) {
+                                                unsigned &argIndex,
+                                                const LangOptions &LO) {
   
   using namespace clang::analyze_scanf;
   const char *I = Beg;
@@ -132,7 +133,7 @@
   }
   
   // Look for the length modifier.
-  if (ParseLengthModifier(FS, I, E) && I == E) {
+  if (ParseLengthModifier(FS, I, E, LO, /*scanf=*/true) && I == E) {
       // No more characters left?
     H.HandleIncompleteSpecifier(Start, E - Start);
     return true;
@@ -218,6 +219,7 @@
         case LengthModifier::AsPtrDiff:
           return ScanfArgTypeResult(Ctx.getPointerDiffType(), "ptrdiff_t *");
         case LengthModifier::AsLongDouble: return ScanfArgTypeResult::Invalid();
+        case LengthModifier::AsAllocate: return ScanfArgTypeResult::Invalid();
       }
 
     // Unsigned int.
@@ -240,6 +242,7 @@
           // FIXME: Unsigned version of ptrdiff_t?
           return ScanfArgTypeResult();
         case LengthModifier::AsLongDouble: return ScanfArgTypeResult::Invalid();
+        case LengthModifier::AsAllocate: return ScanfArgTypeResult::Invalid();
       }
 
     // Float.
@@ -274,7 +277,9 @@
     case ConversionSpecifier::CArg:
     case ConversionSpecifier::SArg:
       // FIXME: Mac OS X specific?
-      return ScanfArgTypeResult(ScanfArgTypeResult::WCStrTy, "wchar_t *");
+      if (LM.getKind() == LengthModifier::None)
+        return ScanfArgTypeResult(ScanfArgTypeResult::WCStrTy, "wchar_t *");
+      return ScanfArgTypeResult::Invalid();
 
     // Pointer.
     case ConversionSpecifier::pArg:
@@ -401,13 +406,15 @@
 
 bool clang::analyze_format_string::ParseScanfString(FormatStringHandler &H,
                                                     const char *I,
-                                                    const char *E) {
+                                                    const char *E,
+                                                    const LangOptions &LO) {
   
   unsigned argIndex = 0;
   
   // Keep looking for a format specifier until we have exhausted the string.
   while (I != E) {
-    const ScanfSpecifierResult &FSR = ParseScanfSpecifier(H, I, E, argIndex);
+    const ScanfSpecifierResult &FSR = ParseScanfSpecifier(H, I, E, argIndex,
+                                                          LO);
     // Did a fail-stop error of any kind occur when parsing the specifier?
     // If so, don't do any more processing.
     if (FSR.shouldStop())

Modified: cfe/branches/tooling/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Basic/Targets.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Basic/Targets.cpp (original)
+++ cfe/branches/tooling/lib/Basic/Targets.cpp Thu Dec 15 05:54:03 2011
@@ -372,7 +372,26 @@
   }
 public:
   OpenBSDTargetInfo(const std::string &triple)
-    : OSTargetInfo<Target>(triple) {}
+    : OSTargetInfo<Target>(triple) {
+      this->UserLabelPrefix = "";
+
+      llvm::Triple Triple(triple);
+      switch (Triple.getArch()) {
+        default:
+        case llvm::Triple::x86:
+        case llvm::Triple::x86_64:
+        case llvm::Triple::arm:
+	case llvm::Triple::sparc:
+          this->MCountName = "__mcount";
+          break;
+        case llvm::Triple::mips64:
+        case llvm::Triple::mips64el:
+        case llvm::Triple::ppc:
+	case llvm::Triple::sparcv9:
+          this->MCountName = "_mcount";
+          break;
+      }
+  }
 };
 
 // PSP Target

Modified: cfe/branches/tooling/lib/CodeGen/CGObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGObjCRuntime.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGObjCRuntime.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGObjCRuntime.cpp Thu Dec 15 05:54:03 2011
@@ -41,7 +41,7 @@
   // If we know have an implementation (and the ivar is in it) then
   // look up in the implementation layout.
   const ASTRecordLayout *RL;
-  if (ID && ID->getClassInterface() == Container)
+  if (ID && declaresSameEntity(ID->getClassInterface(), Container))
     RL = &CGM.getContext().getASTObjCImplementationLayout(ID);
   else
     RL = &CGM.getContext().getASTObjCInterfaceLayout(Container);

Modified: cfe/branches/tooling/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Tools.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Tools.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Tools.cpp Thu Dec 15 05:54:03 2011
@@ -1201,7 +1201,7 @@
                                options::OPT_fomit_frame_pointer))
     return A->getOption().matches(options::OPT_fno_omit_frame_pointer);
 
-  // Don't use a frame poiter on liunx x86 and x86_64 if optimizing.
+  // Don't use a frame pointer on linux x86 and x86_64 if optimizing.
   if ((Triple.getArch() == llvm::Triple::x86_64 ||
        Triple.getArch() == llvm::Triple::x86) &&
       Triple.getOS() == llvm::Triple::Linux) {
@@ -4166,8 +4166,12 @@
   if (!Args.hasArg(options::OPT_nostdlib) &&
       !Args.hasArg(options::OPT_nostartfiles)) {
     if (!Args.hasArg(options::OPT_shared)) {
-      CmdArgs.push_back(Args.MakeArgString(
-                              getToolChain().GetFilePath("crt0.o")));
+      if (Args.hasArg(options::OPT_pg))  
+        CmdArgs.push_back(Args.MakeArgString(
+                                getToolChain().GetFilePath("gcrt0.o")));
+      else
+        CmdArgs.push_back(Args.MakeArgString(
+                                getToolChain().GetFilePath("crt0.o")));
       CmdArgs.push_back(Args.MakeArgString(
                               getToolChain().GetFilePath("crtbegin.o")));
     } else {
@@ -4192,7 +4196,10 @@
       !Args.hasArg(options::OPT_nodefaultlibs)) {
     if (D.CCCIsCXX) {
       getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
-      CmdArgs.push_back("-lm");
+      if (Args.hasArg(options::OPT_pg)) 
+        CmdArgs.push_back("-lm_p");
+      else
+        CmdArgs.push_back("-lm");
     }
 
     // FIXME: For some reason GCC passes -lgcc before adding
@@ -4202,7 +4209,10 @@
     if (Args.hasArg(options::OPT_pthread))
       CmdArgs.push_back("-lpthread");
     if (!Args.hasArg(options::OPT_shared))
-      CmdArgs.push_back("-lc");
+      if (Args.hasArg(options::OPT_pg)) 
+         CmdArgs.push_back("-lc_p");
+      else
+         CmdArgs.push_back("-lc");
     CmdArgs.push_back("-lgcc");
   }
 

Modified: cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp Thu Dec 15 05:54:03 2011
@@ -18,6 +18,8 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/raw_ostream.h"
+#include <climits>
+
 using namespace clang;
 
 VerifyDiagnosticConsumer::VerifyDiagnosticConsumer(DiagnosticsEngine &_Diags)
@@ -82,6 +84,9 @@
   static Directive* Create(bool RegexKind, const SourceLocation &Location,
                            const std::string &Text, unsigned Count);
 public:
+  /// Constant representing one or more matches aka regex "+".
+  static const unsigned OneOrMoreCount =  UINT_MAX;
+
   SourceLocation Location;
   const std::string Text;
   unsigned Count;
@@ -119,8 +124,7 @@
   }
 
   virtual bool Match(const std::string &S) {
-    return S.find(Text) != std::string::npos ||
-           Text.find(S) != std::string::npos;
+    return S.find(Text) != std::string::npos;
   }
 };
 
@@ -277,10 +281,14 @@
     // skip optional whitespace
     PH.SkipWhitespace();
 
-    // next optional token: positive integer
+    // next optional token: positive integer or a '+'.
     unsigned Count = 1;
     if (PH.Next(Count))
       PH.Advance();
+    else if (PH.Next("+")) {
+      Count = Directive::OneOrMoreCount;
+      PH.Advance();
+    }
 
     // skip optional whitespace
     PH.SkipWhitespace();
@@ -421,6 +429,7 @@
   for (DirectiveList::iterator I = Left.begin(), E = Left.end(); I != E; ++I) {
     Directive& D = **I;
     unsigned LineNo1 = SourceMgr.getPresumedLineNumber(D.Location);
+    bool FoundOnce = false;
 
     for (unsigned i = 0; i < D.Count; ++i) {
       DiagList::iterator II, IE;
@@ -434,11 +443,16 @@
           break;
       }
       if (II == IE) {
+        if (D.Count == D.OneOrMoreCount && FoundOnce) {
+          // We are only interested in at least one match and we found one.
+          break;
+        }
         // Not found.
         LeftOnly.push_back(*I);
       } else {
         // Found. The same cannot be found twice.
         Right.erase(II);
+        FoundOnce = true;
       }
     }
   }

Modified: cfe/branches/tooling/lib/Index/Analyzer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Index/Analyzer.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Index/Analyzer.cpp (original)
+++ cfe/branches/tooling/lib/Index/Analyzer.cpp Thu Dec 15 05:54:03 2011
@@ -205,7 +205,7 @@
     assert(MsgD);
 
     // Same interface ? We have a winner!
-    if (MsgD == IFace)
+    if (declaresSameEntity(MsgD, IFace))
       return true;
 
     // If the message interface is a superclass of the original interface,
@@ -220,7 +220,7 @@
     if (IFace) {
       Selector Sel = Msg->getSelector();
       for (ObjCInterfaceDecl *Cls = MsgD; Cls; Cls = Cls->getSuperClass()) {
-        if (Cls == IFace)
+        if (declaresSameEntity(Cls, IFace))
           return true;
         if (Cls->getMethod(Sel, IsInstanceMethod))
           return false;

Modified: cfe/branches/tooling/lib/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Rewrite/RewriteObjC.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Rewrite/RewriteObjC.cpp (original)
+++ cfe/branches/tooling/lib/Rewrite/RewriteObjC.cpp Thu Dec 15 05:54:03 2011
@@ -5938,7 +5938,7 @@
                                               OldRange.getEnd(),
                                               castExpr);
       if (IV->isFreeIvar() &&
-          CurMethodDef->getClassInterface() == iFaceDecl->getDecl()) {
+          declaresSameEntity(CurMethodDef->getClassInterface(), iFaceDecl->getDecl())) {
         MemberExpr *ME = new (Context) MemberExpr(PE, true, D,
                                                   IV->getLocation(),
                                                   D->getType(),

Modified: cfe/branches/tooling/lib/Sema/SemaAccess.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaAccess.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaAccess.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaAccess.cpp Thu Dec 15 05:54:03 2011
@@ -1701,7 +1701,7 @@
       return false;
     
     // If we're inside the same interface that owns the ivar, we're fine.
-    if (ClassOfMethodDecl == Ivar->getContainingInterface())
+    if (declaresSameEntity(ClassOfMethodDecl, Ivar->getContainingInterface()))
       return true;
     
     // If the ivar is private, it's inaccessible.

Modified: cfe/branches/tooling/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaChecking.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaChecking.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaChecking.cpp Thu Dec 15 05:54:03 2011
@@ -2442,7 +2442,8 @@
                          Str, HasVAListArg, TheCall, format_idx,
                          inFunctionCall);
   
-    if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen))
+    if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
+                                                  getLangOptions()))
       H.DoneProcessing();
   }
   else {
@@ -2451,7 +2452,8 @@
                         Str, HasVAListArg, TheCall, format_idx,
                         inFunctionCall);
     
-    if (!analyze_format_string::ParseScanfString(H, Str, Str + StrLen))
+    if (!analyze_format_string::ParseScanfString(H, Str, Str + StrLen,
+                                                 getLangOptions()))
       H.DoneProcessing();
   }
 }
@@ -3257,7 +3259,7 @@
   // user has an explicit widening cast, we should treat the value as
   // being of the new, wider type.
   if (ImplicitCastExpr *CE = dyn_cast<ImplicitCastExpr>(E)) {
-    if (CE->getCastKind() == CK_NoOp)
+    if (CE->getCastKind() == CK_NoOp || CE->getCastKind() == CK_LValueToRValue)
       return GetExprRange(C, CE->getSubExpr(), MaxWidth);
 
     IntRange OutputTypeRange = IntRange::forValueOfType(C, CE->getType());

Modified: cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp Thu Dec 15 05:54:03 2011
@@ -4558,7 +4558,7 @@
   }
   
   ObjCInterfaceDecl *IFace = dyn_cast<ObjCInterfaceDecl>(Container);
-  if (!IFace)
+  if (!IFace || !IFace->hasDefinition())
     return;
   
   // Add methods in protocols.
@@ -5783,6 +5783,9 @@
                                      bool InOriginalClass = true) {
   if (ObjCInterfaceDecl *IFace = dyn_cast<ObjCInterfaceDecl>(Container)) {
     // Recurse into protocols.
+    if (!IFace->hasDefinition())
+      return;
+    
     const ObjCList<ObjCProtocolDecl> &Protocols
       = IFace->getReferencedProtocols();
     for (ObjCList<ObjCProtocolDecl>::iterator I = Protocols.begin(),

Modified: cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp Thu Dec 15 05:54:03 2011
@@ -9636,18 +9636,15 @@
   StringLiteral *AssertMessage = cast<StringLiteral>(AssertMessageExpr_);
 
   if (!AssertExpr->isTypeDependent() && !AssertExpr->isValueDependent()) {
-    llvm::APSInt Value(32);
-    if (!AssertExpr->isIntegerConstantExpr(Value, Context)) {
-      Diag(StaticAssertLoc,
-           diag::err_static_assert_expression_is_not_constant) <<
-        AssertExpr->getSourceRange();
+    llvm::APSInt Cond;
+    if (VerifyIntegerConstantExpression(AssertExpr, &Cond,
+                             diag::err_static_assert_expression_is_not_constant,
+                                        /*AllowFold=*/false))
       return 0;
-    }
 
-    if (Value == 0) {
+    if (!Cond)
       Diag(StaticAssertLoc, diag::err_static_assert_failed)
         << AssertMessage->getString() << AssertExpr->getSourceRange();
-    }
   }
 
   if (DiagnoseUnexpandedParameterPack(AssertExpr, UPPC_StaticAssertExpression))

Modified: cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp Thu Dec 15 05:54:03 2011
@@ -368,10 +368,10 @@
   ObjCInterfaceDecl* IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
   if (IDecl) {
     // Class already seen. Is it a forward declaration?
-    if (!IDecl->isForwardDecl()) {
+    if (ObjCInterfaceDecl *Def = IDecl->getDefinition()) {
       IDecl->setInvalidDecl();
       Diag(AtInterfaceLoc, diag::err_duplicate_class_def)<<IDecl->getDeclName();
-      Diag(IDecl->getLocation(), diag::note_previous_definition);
+      Diag(Def->getLocation(), diag::note_previous_definition);
 
       // Create a new one; the other may be in a different DeclContex, (e.g.
       // this one may be in a LinkageSpecDecl while the other is not) which
@@ -392,8 +392,6 @@
       IDecl->setLexicalDeclContext(CurContext);
       CurContext->addDecl(IDecl);
 
-      IDecl->completedForwardDecl();
-
       if (AttrList)
         ProcessDeclAttributeList(TUScope, IDecl, AttrList);
     }
@@ -406,6 +404,9 @@
     PushOnScopeChains(IDecl, TUScope);
   }
 
+  if (!IDecl->hasDefinition())
+    IDecl->startDefinition();
+  
   if (SuperName) {
     // Check if a different kind of symbol declared in this scope.
     PrevDecl = LookupSingleName(TUScope, SuperName, SuperLoc,
@@ -417,7 +418,7 @@
           DeclarationNameInfo(SuperName, SuperLoc), LookupOrdinaryName, TUScope,
           NULL, NULL, false, CTC_NoKeywords);
       if ((PrevDecl = Corrected.getCorrectionDeclAs<ObjCInterfaceDecl>())) {
-        if (PrevDecl == IDecl) {
+        if (declaresSameEntity(PrevDecl, IDecl)) {
           // Don't correct to the class we're defining.
           PrevDecl = 0;
         } else {
@@ -429,7 +430,7 @@
       }
     }
 
-    if (PrevDecl == IDecl) {
+    if (declaresSameEntity(PrevDecl, IDecl)) {
       Diag(SuperLoc, diag::err_recursive_superclass)
         << SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc);
       IDecl->setLocEnd(ClassLoc);
@@ -924,7 +925,7 @@
       if (!SDecl)
         Diag(SuperClassLoc, diag::err_undef_superclass)
           << SuperClassname << ClassName;
-      else if (IDecl && IDecl->getSuperClass() != SDecl) {
+      else if (IDecl && !declaresSameEntity(IDecl->getSuperClass(), SDecl)) {
         // This implementation and its interface do not have the same
         // super class.
         Diag(SuperClassLoc, diag::err_conflicting_super_class)
@@ -942,6 +943,7 @@
     // copy them over.
     IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtClassImplLoc,
                                       ClassName, ClassLoc, false, true);
+    IDecl->startDefinition();
     IDecl->setSuperClass(SDecl);
     IDecl->setLocEnd(ClassLoc);
 
@@ -950,8 +952,8 @@
     // Mark the interface as being completed, even if it was just as
     //   @class ....;
     // declaration; the user cannot reopen it.
-    if (IDecl->isForwardDecl())
-      IDecl->completedForwardDecl();
+    if (!IDecl->hasDefinition())
+      IDecl->startDefinition();
   }
 
   ObjCImplementationDecl* IMPDecl =
@@ -2439,7 +2441,7 @@
       if (ObjCInterfaceDecl *ResultClass 
                                       = ResultObjectType->getInterfaceDecl()) {
         //   - it is the same as the method's class type, or
-        if (CurrentClass == ResultClass)
+        if (declaresSameEntity(CurrentClass, ResultClass))
           return RTC_Compatible;
         
         //   - it is a superclass of the method's class type
@@ -2540,7 +2542,9 @@
 
   void searchFrom(ObjCInterfaceDecl *iface) {
     // A method in a class declaration overrides declarations from
-
+    if (!iface->hasDefinition())
+      return;
+    
     //   - categories,
     for (ObjCCategoryDecl *category = iface->getCategoryList();
            category; category = category->getNextClassCategory())

Modified: cfe/branches/tooling/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExpr.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExpr.cpp Thu Dec 15 05:54:03 2011
@@ -1975,7 +1975,7 @@
 
       // Diagnose the use of an ivar outside of the declaring class.
       if (IV->getAccessControl() == ObjCIvarDecl::Private &&
-          ClassDeclared != IFace)
+          !declaresSameEntity(ClassDeclared, IFace))
         Diag(Loc, diag::error_private_ivar_access) << IV->getDeclName();
 
       // FIXME: This should use a new expr for a direct reference, don't
@@ -2005,7 +2005,7 @@
       ObjCInterfaceDecl *ClassDeclared;
       if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(II, ClassDeclared)) {
         if (IV->getAccessControl() != ObjCIvarDecl::Private ||
-            IFace == ClassDeclared)
+            declaresSameEntity(IFace, ClassDeclared))
           Diag(Loc, diag::warn_ivar_use_hidden) << IV->getDeclName();
       }
     }
@@ -9232,30 +9232,45 @@
   return isInvalid;
 }
 
-bool Sema::VerifyIntegerConstantExpression(const Expr *E, llvm::APSInt *Result){
-  // FIXME: In C++11, this evaluates the expression even if it's not an ICE.
-  //        Don't evaluate it a second time below just to get the diagnostics.
-  llvm::APSInt ICEResult;
-  if (E->isIntegerConstantExpr(ICEResult, Context)) {
-    if (Result)
-      *Result = ICEResult;
-    return false;
+bool Sema::VerifyIntegerConstantExpression(const Expr *E, llvm::APSInt *Result,
+                                           unsigned DiagID, bool AllowFold) {
+  // Circumvent ICE checking in C++11 to avoid evaluating the expression twice
+  // in the non-ICE case.
+  if (!getLangOptions().CPlusPlus0x) {
+    if (E->isIntegerConstantExpr(Context)) {
+      if (Result)
+        *Result = E->EvaluateKnownConstInt(Context);
+      return false;
+    }
   }
 
   Expr::EvalResult EvalResult;
   llvm::SmallVector<PartialDiagnosticAt, 8> Notes;
   EvalResult.Diag = &Notes;
 
-  if (!E->EvaluateAsRValue(EvalResult, Context) || !EvalResult.Val.isInt() ||
-      EvalResult.HasSideEffects) {
-    Diag(E->getExprLoc(), diag::err_expr_not_ice) << E->getSourceRange();
+  // Try to evaluate the expression, and produce diagnostics explaining why it's
+  // not a constant expression as a side-effect.
+  bool Folded = E->EvaluateAsRValue(EvalResult, Context) &&
+                EvalResult.Val.isInt() && !EvalResult.HasSideEffects;
+
+  // In C++11, we can rely on diagnostics being produced for any expression
+  // which is not a constant expression. If no diagnostics were produced, then
+  // this is a constant expression.
+  if (Folded && getLangOptions().CPlusPlus0x && Notes.empty()) {
+    if (Result)
+      *Result = EvalResult.Val.getInt();
+    return false;
+  }
+
+  if (!Folded || !AllowFold) {
+    Diag(E->getSourceRange().getBegin(),
+         DiagID ? DiagID : diag::err_expr_not_ice) << E->getSourceRange();
 
     // We only show the notes if they're not the usual "invalid subexpression"
     // or if they are actually in a subexpression.
-    if (!Notes.empty() &&
-        (Notes.size() != 1 ||
-         Notes[0].second.getDiagID() != diag::note_invalid_subexpr_in_const_expr
-         || Notes[0].first != E->IgnoreParens()->getExprLoc())) {
+    if (Notes.size() != 1 ||
+        Notes[0].second.getDiagID() != diag::note_invalid_subexpr_in_const_expr
+        || Notes[0].first != E->IgnoreParens()->getExprLoc()) {
       for (unsigned I = 0, N = Notes.size(); I != N; ++I)
         Diag(Notes[I].first, Notes[I].second);
     }
@@ -9263,10 +9278,10 @@
     return true;
   }
 
-  Diag(E->getExprLoc(), diag::ext_expr_not_ice) << E->getSourceRange();
+  Diag(E->getSourceRange().getBegin(), diag::ext_expr_not_ice)
+    << E->getSourceRange();
 
-  if (Notes.size() &&
-      Diags.getDiagnosticLevel(diag::ext_expr_not_ice, E->getExprLoc())
+  if (Diags.getDiagnosticLevel(diag::ext_expr_not_ice, E->getExprLoc())
           != DiagnosticsEngine::Ignored)
     for (unsigned I = 0, N = Notes.size(); I != N; ++I)
       Diag(Notes[I].first, Notes[I].second);

Modified: cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp Thu Dec 15 05:54:03 2011
@@ -4674,6 +4674,15 @@
   if (DiagnoseUnexpandedParameterPack(FullExpr.get()))
     return ExprError();
 
+  // Top-level message sends default to 'id' when we're in a debugger.
+  if (getLangOptions().DebuggerSupport &&
+      FullExpr.get()->getType() == Context.UnknownAnyTy &&
+      isa<ObjCMessageExpr>(FullExpr.get())) {
+    FullExpr = forceUnknownAnyToType(FullExpr.take(), Context.getObjCIdType());
+    if (FullExpr.isInvalid())
+      return ExprError();
+  }
+  
   FullExpr = CheckPlaceholderExpr(FullExpr.take());
   if (FullExpr.isInvalid())
     return ExprError();

Modified: cfe/branches/tooling/lib/Sema/SemaExprMember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprMember.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprMember.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprMember.cpp Thu Dec 15 05:54:03 2011
@@ -1150,8 +1150,8 @@
       }
 
       if (IV->getAccessControl() == ObjCIvarDecl::Private) {
-        if (ClassDeclared != IDecl ||
-            ClassOfMethodDecl != ClassDeclared)
+        if (!declaresSameEntity(ClassDeclared, IDecl) ||
+            !declaresSameEntity(ClassOfMethodDecl, ClassDeclared))
           Diag(MemberLoc, diag::error_private_ivar_access)
             << IV->getDeclName();
       } else if (!IDecl->isSuperClassOf(ClassOfMethodDecl))

Modified: cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp Thu Dec 15 05:54:03 2011
@@ -512,6 +512,9 @@
 
 ObjCMethodDecl *Sema::LookupPrivateInstanceMethod(Selector Sel,
                                               ObjCInterfaceDecl *ClassDecl) {
+  if (!ClassDecl->hasDefinition())
+    return 0;
+
   ObjCMethodDecl *Method = 0;
   while (ClassDecl && !Method) {
     // If we have implementations in scope, check "private" methods.
@@ -1339,12 +1342,10 @@
             return ExprError();
           
           forwardClass = OCIType->getInterfaceDecl();
+          Method = 0;
+        } else {
+          Method = ClassDecl->lookupInstanceMethod(Sel);
         }
-        
-        // FIXME: consider using LookupInstanceMethodInGlobalPool, since it will be
-        // faster than the following method (which can do *many* linear searches).
-        // The idea is to add class info to MethodPool.
-        Method = ClassDecl->lookupInstanceMethod(Sel);
 
         if (!Method)
           // Search protocol qualifiers.

Modified: cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp Thu Dec 15 05:54:03 2011
@@ -690,7 +690,7 @@
       // Note! I deliberately want it to fall thru so, we have a
       // a property implementation and to avoid future warnings.
     } else if (getLangOptions().ObjCNonFragileABI &&
-               ClassDeclared != IDecl) {
+               !declaresSameEntity(ClassDeclared, IDecl)) {
       Diag(PropertyLoc, diag::error_ivar_in_superclass_use)
       << property->getDeclName() << Ivar->getDeclName()
       << ClassDeclared->getDeclName();
@@ -870,7 +870,7 @@
       }
       // Issue diagnostics only if Ivar belongs to current class.
       if (Ivar && Ivar->getSynthesize() && 
-          IC->getClassInterface() == ClassDeclared) {
+          declaresSameEntity(IC->getClassInterface(), ClassDeclared)) {
         Diag(Ivar->getLocation(), diag::err_undeclared_var_use) 
         << PropertyId;
         Ivar->setInvalidDecl();
@@ -1328,7 +1328,13 @@
       if (IMPDecl->getInstanceMethod(Prop->getSetterName()))
         continue;
     }
-
+    if (isa<ObjCProtocolDecl>(Prop->getDeclContext())) {
+      // We won't auto-synthesize properties declared in protocols.
+      Diag(IMPDecl->getLocation(), 
+           diag::warn_auto_synthesizing_protocol_property);
+      Diag(Prop->getLocation(), diag::note_property_declare);
+      continue;
+    }
 
     // We use invalid SourceLocations for the synthesized ivars since they
     // aren't really synthesized at a particular location; they just exist.

Modified: cfe/branches/tooling/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaOverload.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaOverload.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaOverload.cpp Thu Dec 15 05:54:03 2011
@@ -2300,7 +2300,8 @@
                  ToType->getAs<ObjCObjectPointerType>()) {
         if (const ObjCObjectPointerType *PTFr =
               FromType->getAs<ObjCObjectPointerType>())
-          if (PTTo->getInterfaceDecl() == PTFr->getInterfaceDecl())
+          if (declaresSameEntity(PTTo->getInterfaceDecl(), 
+                                 PTFr->getInterfaceDecl()))
             continue;
       }
       if (ArgPos) *ArgPos = O - OldType->arg_type_begin();

Modified: cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp Thu Dec 15 05:54:03 2011
@@ -556,43 +556,80 @@
 void ASTDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) {
   VisitObjCContainerDecl(ID);
   ID->setTypeForDecl(Reader.readType(F, Record, Idx).getTypePtrOrNull());
-  ID->setSuperClass(ReadDeclAs<ObjCInterfaceDecl>(Record, Idx));
   
-  // Read the directly referenced protocols and their SourceLocations.
-  unsigned NumProtocols = Record[Idx++];
-  SmallVector<ObjCProtocolDecl *, 16> Protocols;
-  Protocols.reserve(NumProtocols);
-  for (unsigned I = 0; I != NumProtocols; ++I)
-    Protocols.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
-  SmallVector<SourceLocation, 16> ProtoLocs;
-  ProtoLocs.reserve(NumProtocols);
-  for (unsigned I = 0; I != NumProtocols; ++I)
-    ProtoLocs.push_back(ReadSourceLocation(Record, Idx));
-  ID->setProtocolList(Protocols.data(), NumProtocols, ProtoLocs.data(),
-                      Reader.getContext());
+  ObjCInterfaceDecl *Def = ReadDeclAs<ObjCInterfaceDecl>(Record, Idx);
+  if (ID == Def) {
+    // Read the definition.
+    ID->allocateDefinitionData();
+    
+    ObjCInterfaceDecl::DefinitionData &Data = ID->data();
+    
+    // Read the superclass.
+    Data.SuperClass = ReadDeclAs<ObjCInterfaceDecl>(Record, Idx);
+    Data.SuperClassLoc = ReadSourceLocation(Record, Idx);
+
+    // Read the directly referenced protocols and their SourceLocations.
+    unsigned NumProtocols = Record[Idx++];
+    SmallVector<ObjCProtocolDecl *, 16> Protocols;
+    Protocols.reserve(NumProtocols);
+    for (unsigned I = 0; I != NumProtocols; ++I)
+      Protocols.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
+    SmallVector<SourceLocation, 16> ProtoLocs;
+    ProtoLocs.reserve(NumProtocols);
+    for (unsigned I = 0; I != NumProtocols; ++I)
+      ProtoLocs.push_back(ReadSourceLocation(Record, Idx));
+    ID->setProtocolList(Protocols.data(), NumProtocols, ProtoLocs.data(),
+                        Reader.getContext());
   
-  // Read the transitive closure of protocols referenced by this class.
-  NumProtocols = Record[Idx++];
-  Protocols.clear();
-  Protocols.reserve(NumProtocols);
-  for (unsigned I = 0; I != NumProtocols; ++I)
-    Protocols.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
-  ID->AllReferencedProtocols.set(Protocols.data(), NumProtocols,
-                                 Reader.getContext());
+    // Read the transitive closure of protocols referenced by this class.
+    NumProtocols = Record[Idx++];
+    Protocols.clear();
+    Protocols.reserve(NumProtocols);
+    for (unsigned I = 0; I != NumProtocols; ++I)
+      Protocols.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
+    ID->data().AllReferencedProtocols.set(Protocols.data(), NumProtocols,
+                                          Reader.getContext());
   
-  // Read the ivars.
-  unsigned NumIvars = Record[Idx++];
-  SmallVector<ObjCIvarDecl *, 16> IVars;
-  IVars.reserve(NumIvars);
-  for (unsigned I = 0; I != NumIvars; ++I)
-    IVars.push_back(ReadDeclAs<ObjCIvarDecl>(Record, Idx));
-  ID->setCategoryList(ReadDeclAs<ObjCCategoryDecl>(Record, Idx));
+    // Read the ivars.
+    unsigned NumIvars = Record[Idx++];
+    SmallVector<ObjCIvarDecl *, 16> IVars;
+    IVars.reserve(NumIvars);
+    for (unsigned I = 0; I != NumIvars; ++I)
+      IVars.push_back(ReadDeclAs<ObjCIvarDecl>(Record, Idx));
+    
+    // Read the categories.
+    ID->setCategoryList(ReadDeclAs<ObjCCategoryDecl>(Record, Idx));
+  
+    // We will rebuild this list lazily.
+    ID->setIvarList(0);
+    
+    // If there are any pending forward references, make their definition data
+    // pointers point at the newly-allocated data.
+    ASTReader::PendingForwardRefsMap::iterator
+    FindI = Reader.PendingForwardRefs.find(ID);
+    if (FindI != Reader.PendingForwardRefs.end()) {
+      ASTReader::ForwardRefs &Refs = FindI->second;
+      for (ASTReader::ForwardRefs::iterator I = Refs.begin(), 
+                                            E = Refs.end(); 
+           I != E; ++I)
+        cast<ObjCInterfaceDecl>(*I)->Definition = ID->Definition;
+#ifndef NDEBUG
+      // We later check whether PendingForwardRefs is empty to make sure all
+      // pending references were linked.
+      Reader.PendingForwardRefs.erase(ID);
+#endif
+    
+    } else if (Def) {
+      if (Def->Definition) {
+        ID->Definition = Def->Definition;
+      } else {
+        // The definition is still initializing.
+        Reader.PendingForwardRefs[Def].push_back(ID);
+      }
+    }
+  }
   
-  // We will rebuild this list lazily.
-  ID->setIvarList(0);
   ID->InitiallyForwardDecl = Record[Idx++];
-  ID->ForwardDecl = Record[Idx++];
-  ID->setSuperClassLoc(ReadSourceLocation(Record, Idx));
   ID->setLocEnd(ReadSourceLocation(Record, Idx));
 }
 
@@ -972,7 +1009,7 @@
       ASTReader::ForwardRefs &Refs = FindI->second;
       for (ASTReader::ForwardRefs::iterator
              I = Refs.begin(), E = Refs.end(); I != E; ++I)
-        (*I)->DefinitionData = D->DefinitionData;
+        cast<CXXRecordDecl>(*I)->DefinitionData = D->DefinitionData;
 #ifndef NDEBUG
       // We later check whether PendingForwardRefs is empty to make sure all
       // pending references were linked.

Modified: cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp Thu Dec 15 05:54:03 2011
@@ -449,36 +449,46 @@
 void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {
   VisitObjCContainerDecl(D);
   Writer.AddTypeRef(QualType(D->getTypeForDecl(), 0), Record);
-  Writer.AddDeclRef(D->getSuperClass(), Record);
 
-  // Write out the protocols that are directly referenced by the @interface.
-  Record.push_back(D->ReferencedProtocols.size());
-  for (ObjCInterfaceDecl::protocol_iterator P = D->protocol_begin(),
-         PEnd = D->protocol_end();
-       P != PEnd; ++P)
-    Writer.AddDeclRef(*P, Record);
-  for (ObjCInterfaceDecl::protocol_loc_iterator PL = D->protocol_loc_begin(),
+  ObjCInterfaceDecl *Def = D->getDefinition();
+  Writer.AddDeclRef(Def, Record);
+  
+  if (D == Def) {
+    // Write the DefinitionData
+    ObjCInterfaceDecl::DefinitionData &Data = D->data();
+    
+    Writer.AddDeclRef(D->getSuperClass(), Record);
+    Writer.AddSourceLocation(D->getSuperClassLoc(), Record);
+    
+    // Write out the protocols that are directly referenced by the @interface.
+    Record.push_back(Data.ReferencedProtocols.size());
+    for (ObjCInterfaceDecl::protocol_iterator P = D->protocol_begin(),
+                                           PEnd = D->protocol_end();
+         P != PEnd; ++P)
+      Writer.AddDeclRef(*P, Record);
+    for (ObjCInterfaceDecl::protocol_loc_iterator PL = D->protocol_loc_begin(),
          PLEnd = D->protocol_loc_end();
-       PL != PLEnd; ++PL)
-    Writer.AddSourceLocation(*PL, Record);
-
-  // Write out the protocols that are transitively referenced.
-  Record.push_back(D->AllReferencedProtocols.size());
-  for (ObjCList<ObjCProtocolDecl>::iterator
-        P = D->AllReferencedProtocols.begin(),
-        PEnd = D->AllReferencedProtocols.end();
-       P != PEnd; ++P)
-    Writer.AddDeclRef(*P, Record);
+         PL != PLEnd; ++PL)
+      Writer.AddSourceLocation(*PL, Record);
+    
+    // Write out the protocols that are transitively referenced.
+    Record.push_back(Data.AllReferencedProtocols.size());
+    for (ObjCList<ObjCProtocolDecl>::iterator
+              P = Data.AllReferencedProtocols.begin(),
+           PEnd = Data.AllReferencedProtocols.end();
+         P != PEnd; ++P)
+      Writer.AddDeclRef(*P, Record);
+    
+    // Write out the ivars.
+    Record.push_back(D->ivar_size());
+    for (ObjCInterfaceDecl::ivar_iterator I = D->ivar_begin(),
+                                       IEnd = D->ivar_end(); I != IEnd; ++I)
+      Writer.AddDeclRef(*I, Record);
+    
+    Writer.AddDeclRef(D->getCategoryList(), Record);
+  }  
   
-  // Write out the ivars.
-  Record.push_back(D->ivar_size());
-  for (ObjCInterfaceDecl::ivar_iterator I = D->ivar_begin(),
-                                     IEnd = D->ivar_end(); I != IEnd; ++I)
-    Writer.AddDeclRef(*I, Record);
-  Writer.AddDeclRef(D->getCategoryList(), Record);
   Record.push_back(D->isInitiallyForwardDecl());
-  Record.push_back(D->isForwardDecl());
-  Writer.AddSourceLocation(D->getSuperClassLoc(), Record);
   Writer.AddSourceLocation(D->getLocEnd(), Record);
   Code = serialization::DECL_OBJC_INTERFACE;
 }

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerRegistry.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerRegistry.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerRegistry.cpp Thu Dec 15 05:54:03 2011
@@ -9,12 +9,13 @@
 
 #include "clang/StaticAnalyzer/Core/CheckerRegistry.h"
 #include "clang/StaticAnalyzer/Core/CheckerOptInfo.h"
+#include "llvm/ADT/SetVector.h"
 
 using namespace clang;
 using namespace ento;
 
 static const char PackageSeparator = '.';
-typedef llvm::DenseSet<const CheckerRegistry::CheckerInfo *> CheckerInfoSet;
+typedef llvm::SetVector<const CheckerRegistry::CheckerInfo *> CheckerInfoSet;
 
 
 static bool checkerNameLT(const CheckerRegistry::CheckerInfo &a,
@@ -72,7 +73,7 @@
     if (opt.isEnabled())
       collected.insert(&*i);
     else
-      collected.erase(&*i);
+      collected.remove(&*i);
   }
 }
 

Modified: cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m (original)
+++ cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m Thu Dec 15 05:54:03 2011
@@ -20,7 +20,7 @@
 void f2(NSString *s) {
   CFStringRef ref;
   ref = [(CFStringRef)[s string] retain]; // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast}} \
-    // expected-error {{ bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \
+    // expected-error {{bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \
     // expected-note{{use __bridge to convert directly (no change in ownership)}} \
     // expected-note{{use __bridge_retained to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}}
 }

Modified: cfe/branches/tooling/test/Analysis/CFDateGC.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/CFDateGC.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/CFDateGC.m (original)
+++ cfe/branches/tooling/test/Analysis/CFDateGC.m Thu Dec 15 05:54:03 2011
@@ -42,7 +42,7 @@
   [NSMakeCollectable(date) release];
   CFDateGetAbsoluteTime(date); // no-warning
   CFRelease(date);
-  t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released.}}
+  t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released}}
   return t;
 }
 
@@ -55,7 +55,7 @@
   [(id) CFMakeCollectable(date) release];
   CFDateGetAbsoluteTime(date); // no-warning
   CFRelease(date);
-  t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released.}}
+  t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released}}
   return t;
 }
 

Modified: cfe/branches/tooling/test/Analysis/NSString.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/NSString.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/NSString.m (original)
+++ cfe/branches/tooling/test/Analysis/NSString.m Thu Dec 15 05:54:03 2011
@@ -97,31 +97,31 @@
 
 NSComparisonResult f1(NSString* s) {
   NSString *aString = 0;
-  return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil.}}
+  return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil}}
 }
 
 NSComparisonResult f2(NSString* s) {
   NSString *aString = 0;
-  return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil.}}
+  return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil}}
 }
 
 NSComparisonResult f3(NSString* s, NSStringCompareOptions op) {
   NSString *aString = 0;
-  return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil.}}
+  return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil}}
 }
 
 NSComparisonResult f4(NSString* s, NSStringCompareOptions op, NSRange R) {
   NSString *aString = 0;
-  return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil.}}
+  return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil}}
 }
 
 NSComparisonResult f5(NSString* s, NSStringCompareOptions op, NSRange R) {
   NSString *aString = 0;
-  return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil.}}
+  return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil}}
 }
 
 NSArray *f6(NSString* s) {
-  return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil.}}
+  return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil}}
 }
 
 NSString* f7(NSString* s1, NSString* s2, NSString* s3) {
@@ -189,7 +189,7 @@
 @end
 
 void f14(MyString *s) {
-  [s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil.}}
+  [s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil}}
 }
 
 // Test regular use of -autorelease

Modified: cfe/branches/tooling/test/Analysis/method-arg-decay.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/method-arg-decay.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/method-arg-decay.m (original)
+++ cfe/branches/tooling/test/Analysis/method-arg-decay.m Thu Dec 15 05:54:03 2011
@@ -73,7 +73,7 @@
 - (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}}
 @end  
 @implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} \
-				    // expected-warning {{method in protocol not implemented [-Wprotocol]}}
+				    // expected-warning {{method in protocol not implemented}}
 + (void) openForProjectDocument:(PBXProjectDocument *)projectDocument {
 }
 - (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer  matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data {

Modified: cfe/branches/tooling/test/Analysis/retain-release-path-notes-gc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release-path-notes-gc.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release-path-notes-gc.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release-path-notes-gc.m Thu Dec 15 05:54:03 2011
@@ -45,9 +45,9 @@
 void makeCollectable () {
   CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count.  Core Foundation objects are not automatically garbage collected}}
   CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
-  CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1.}}
+  CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1}}
   NSMakeCollectable(leaked); // expected-note{{In GC mode a call to 'NSMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. Since it now has a 0 retain count the object can be automatically collected by the garbage collector}}
-  CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again.}}
+  CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again}}
   return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
 }
 
@@ -61,12 +61,12 @@
 
 @implementation Foo (FundamentalRuleUnderGC)
 - (id)getViolation {
-  id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count.  Core Foundation objects are not automatically garbage collected.}}
+  id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count.  Core Foundation objects are not automatically garbage collected}}
   return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'getViolation' is potentially leaked when using garbage collection.  Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
 }
 
 - (id)copyViolation {
-  id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count.  Core Foundation objects are not automatically garbage collected.}}
+  id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count.  Core Foundation objects are not automatically garbage collected}}
   return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'copyViolation' is potentially leaked when using garbage collection.  Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
 }
 @end

Modified: cfe/branches/tooling/test/Analysis/retain-release-path-notes.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release-path-notes.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release-path-notes.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release-path-notes.m Thu Dec 15 05:54:03 2011
@@ -104,12 +104,12 @@
 }
 
 CFTypeRef CFCopyRuleViolation () {
-  CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain counte}}
+  CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
   return object; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
 }
 
 CFTypeRef CFGetRuleViolation () {
-  CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain counte}}
+  CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
   return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is return from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'.  This violates the naming convention rules given the Memory Management Guide for Core Foundation}}
 }
 

Modified: cfe/branches/tooling/test/Analysis/retain-release-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release-region-store.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release-region-store.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release-region-store.m Thu Dec 15 05:54:03 2011
@@ -110,7 +110,7 @@
   CFDateGetAbsoluteTime(date); // no-warning
   x.f = (NSDate*) date;  
   [((NSDate*) date) release];
-  t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released.}}
+  t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released}}
   return t;
 }
 

Modified: cfe/branches/tooling/test/Analysis/taint-tester.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/taint-tester.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/taint-tester.c (original)
+++ cfe/branches/tooling/test/Analysis/taint-tester.c Thu Dec 15 05:54:03 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest %s
+// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest %s -verify
 
 #include <stdarg.h>
 
@@ -18,48 +18,48 @@
   int n;
   int *addr = &Buffer[0];
   scanf("%d", &n);
-  addr += n;// expected-warning 2 {{tainted}}
-  *addr = n; // expected-warning 3 {{tainted}}
+  addr += n;// expected-warning + {{tainted}}
+  *addr = n; // expected-warning + {{tainted}}
 
-  double tdiv = n / 30; // expected-warning 3 {{tainted}}
-  char *loc_cast = (char *) n; // expected-warning {{tainted}}
-  char tinc = tdiv++; // expected-warning {{tainted}}
-  int tincdec = (char)tinc--; // expected-warning 2 {{tainted}}
+  double tdiv = n / 30; // expected-warning+ {{tainted}}
+  char *loc_cast = (char *) n; // expected-warning +{{tainted}}
+  char tinc = tdiv++; // expected-warning + {{tainted}}
+  int tincdec = (char)tinc--; // expected-warning+{{tainted}}
 
   // Tainted ptr arithmetic/array element address.
-  int tprtarithmetic1 = *(addr+1); // expected-warning 2 {{tainted}}
+  int tprtarithmetic1 = *(addr+1); // expected-warning + {{tainted}}
 
   // Dereference.
   int *ptr;
   scanf("%p", &ptr);
-  int ptrDeref = *ptr; // expected-warning 2 {{tainted}}
-  int _ptrDeref = ptrDeref + 13; // expected-warning 2 {{tainted}}
+  int ptrDeref = *ptr; // expected-warning + {{tainted}}
+  int _ptrDeref = ptrDeref + 13; // expected-warning + {{tainted}}
 
   // Pointer arithmetic + dereferencing.
   // FIXME: We fail to propagate the taint here because RegionStore does not
   // handle ElementRegions with symbolic indexes.
-  int addrDeref = *addr; // expected-warning {{tainted}}
+  int addrDeref = *addr; // expected-warning + {{tainted}}
   int _addrDeref = addrDeref;
 
   // Tainted struct address, casts.
   struct XYStruct *xyPtr = 0;
   scanf("%p", &xyPtr);
-  void *tXYStructPtr = xyPtr; // expected-warning 2 {{tainted}}
-  struct XYStruct *xyPtrCopy = tXYStructPtr; // expected-warning 2 {{tainted}}
-  int ptrtx = xyPtr->x;// expected-warning 2 {{tainted}}
-  int ptrty = xyPtr->y;// expected-warning 2 {{tainted}}
+  void *tXYStructPtr = xyPtr; // expected-warning + {{tainted}}
+  struct XYStruct *xyPtrCopy = tXYStructPtr; // expected-warning + {{tainted}}
+  int ptrtx = xyPtr->x;// expected-warning + {{tainted}}
+  int ptrty = xyPtr->y;// expected-warning + {{tainted}}
 
   // Taint on fields of a struct.
   struct XYStruct xy = {2, 3, 11};
   scanf("%d", &xy.y);
   scanf("%d", &xy.x);
-  int tx = xy.x; // expected-warning {{tainted}}
+  int tx = xy.x; // expected-warning + {{tainted}}
   int ty = xy.y; // FIXME: This should be tainted as well.
   char ntz = xy.z;// no warning
   // Now, scanf scans both.
   scanf("%d %d", &xy.y, &xy.x);
-  int ttx = xy.x; // expected-warning {{tainted}}
-  int tty = xy.y; // expected-warning {{tainted}}
+  int ttx = xy.x; // expected-warning + {{tainted}}
+  int tty = xy.y; // expected-warning + {{tainted}}
 }
 
 void BitwiseOp(int in, char inn) {
@@ -67,22 +67,22 @@
   int m;
   int x = 0;
   scanf("%d", &x);
-  int y = (in << (x << in)) * 5;// expected-warning 4 {{tainted}}
+  int y = (in << (x << in)) * 5;// expected-warning + {{tainted}}
   // The next line tests integer to integer cast.
-  int z = y & inn; // expected-warning 2 {{tainted}}
-  if (y == 5) // expected-warning 2 {{tainted}}
-    m = z | z;// expected-warning 4 {{tainted}}
+  int z = y & inn; // expected-warning + {{tainted}}
+  if (y == 5) // expected-warning + {{tainted}}
+    m = z | z;// expected-warning + {{tainted}}
   else
     m = inn;
-  int mm = m; // expected-warning   {{tainted}}
+  int mm = m; // expected-warning + {{tainted}}
 }
 
 // Test getenv.
 char *getenv(const char *name);
 void getenvTest(char *home) {
-  home = getenv("HOME"); // expected-warning 2 {{tainted}}
-  if (home != 0) { // expected-warning 2 {{tainted}}
-      char d = home[0]; // expected-warning 2 {{tainted}}
+  home = getenv("HOME"); // expected-warning + {{tainted}}
+  if (home != 0) { // expected-warning + {{tainted}}
+      char d = home[0]; // expected-warning + {{tainted}}
     }
 }
 
@@ -104,21 +104,21 @@
   fscanf(stdin, "%s %d", s, &t);
   // Note, here, s is not tainted, but the data s points to is tainted.
   char *ts = s;
-  char tss = s[0]; // expected-warning 1 {{tainted}}
-  int tt = t; // expected-warning 1 {{tainted}}
-  if((fp=fopen("test", "w")) == 0) // expected-warning 3 {{tainted}}
+  char tss = s[0]; // expected-warning + {{tainted}}
+  int tt = t; // expected-warning + {{tainted}}
+  if((fp=fopen("test", "w")) == 0) // expected-warning + {{tainted}}
     return 1;
-  fprintf(fp, "%s %d", s, t); // expected-warning 2 {{tainted}}
-  fclose(fp); // expected-warning 1 {{tainted}}
+  fprintf(fp, "%s %d", s, t); // expected-warning + {{tainted}}
+  fclose(fp); // expected-warning + {{tainted}}
 
   // Check if we propagate taint from stdin when it's used in an assignment.
   FILE *pfstd = stdin;
   fscanf(pfstd, "%s %d", s, &t); // TODO: This should be tainted as well.
 
   // Test fscanf and fopen.
-  if((fp=fopen("test","r")) == 0) // expected-warning 3 {{tainted}}
+  if((fp=fopen("test","r")) == 0) // expected-warning + {{tainted}}
     return 1;
-  fscanf(fp, "%s%d", s, &t); // expected-warning 1 {{tainted}}
-  fprintf(stdout, "%s %d", s, t); // expected-warning 1 {{tainted}}
+  fscanf(fp, "%s%d", s, &t); // expected-warning + {{tainted}}
+  fprintf(stdout, "%s %d", s, t); // expected-warning + {{tainted}}
   return 0;
 }

Modified: cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp (original)
+++ cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp Thu Dec 15 05:54:03 2011
@@ -46,7 +46,7 @@
   int g(N::X); // expected-note{{candidate function}}
 
   void test(N::X x) {
-    g(x); // expected-error{{call to 'g' is ambiguous; candidates are:}}
+    g(x); // expected-error{{call to 'g' is ambiguous}}
     int i = (g)(x);
 
     int g(N::X);

Modified: cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp (original)
+++ cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp Thu Dec 15 05:54:03 2011
@@ -44,7 +44,7 @@
     A::A() + A::A();
     B::B() + B::B();
     C::C() + C::C();
-    D::D() + D::D(); // expected-error {{ invalid operands to binary expression ('D::D' and 'D::D') }}
+    D::D() + D::D(); // expected-error {{invalid operands to binary expression ('D::D' and 'D::D')}}
   }
 }
 

Modified: cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp Thu Dec 15 05:54:03 2011
@@ -36,7 +36,7 @@
     Value v;
     // The fact that the next line is a warning rather than an error is an
     // extension.
-    v.set<double>(3.2);  // expected-warning{{lookup of 'set' in member access expression is ambiguous; using member of 'Value' [-Wambiguous-member-template]}}
+    v.set<double>(3.2);  // expected-warning{{lookup of 'set' in member access expression is ambiguous; using member of 'Value'}}
   }
   {
     int set;  // Non-template.

Modified: cfe/branches/tooling/test/CXX/basic/basic.start/basic.start.main/p2f.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/basic/basic.start/basic.start.main/p2f.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/basic/basic.start/basic.start.main/p2f.cpp (original)
+++ cfe/branches/tooling/test/CXX/basic/basic.start/basic.start.main/p2f.cpp Thu Dec 15 05:54:03 2011
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s 
 
-void  // expected-error {{error: 'main' must return 'int'}}
-main( // expected-error {{error: first parameter of 'main' (argument count) must be of type 'int'}}
+void  // expected-error {{'main' must return 'int'}}
+main( // expected-error {{first parameter of 'main' (argument count) must be of type 'int'}}
      float a
 ) {
 }

Modified: cfe/branches/tooling/test/CXX/class.access/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class.access/p6.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class.access/p6.cpp (original)
+++ cfe/branches/tooling/test/CXX/class.access/p6.cpp Thu Dec 15 05:54:03 2011
@@ -150,7 +150,7 @@
   class B : A {
     public_inner a;
     protected_inner b;
-    private_inner c; // expected-error {{ 'private_inner' is a private member of 'test6::A'}}
+    private_inner c; // expected-error {{'private_inner' is a private member of 'test6::A'}}
   };
 }
 

Modified: cfe/branches/tooling/test/CXX/class.derived/class.member.lookup/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class.derived/class.member.lookup/p6.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class.derived/class.member.lookup/p6.cpp (original)
+++ cfe/branches/tooling/test/CXX/class.derived/class.member.lookup/p6.cpp Thu Dec 15 05:54:03 2011
@@ -29,7 +29,7 @@
   x++;
   f();
   y++; // expected-error{{member 'y' found in multiple base classes of different types}}
-  g(); // expected-error{{error: member 'g' found in multiple base classes of different types}}
+  g(); // expected-error{{member 'g' found in multiple base classes of different types}}
 }
 
 // PR6462

Modified: cfe/branches/tooling/test/CXX/class/class.friend/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/class.friend/p1.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/class.friend/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/class.friend/p1.cpp Thu Dec 15 05:54:03 2011
@@ -29,35 +29,35 @@
 
   friend class PreDeclared;
   friend class Outer::Inner;
-  friend int Outer::Inner::intfield; // expected-error {{ friends can only be classes or functions }}
-  friend int Outer::Inner::missing_field; //expected-error {{ friends can only be classes or functions }}
+  friend int Outer::Inner::intfield; // expected-error {{friends can only be classes or functions}}
+  friend int Outer::Inner::missing_field; //expected-error {{friends can only be classes or functions}}
   friend int myoperation(float); // okay
-  friend int myglobal;   // expected-error {{ friends can only be classes or functions }}
+  friend int myglobal;   // expected-error {{friends can only be classes or functions}}
 
   friend void global_function();
   friend void global_c_function();
 
   friend class UndeclaredSoFar;
-  UndeclaredSoFar x; // expected-error {{ unknown type name 'UndeclaredSoFar' }}
+  UndeclaredSoFar x; // expected-error {{unknown type name 'UndeclaredSoFar'}}
 
   void a_member();
-  friend void A::a_member(); // expected-error {{ friends cannot be members of the declaring class }}
+  friend void A::a_member(); // expected-error {{friends cannot be members of the declaring class}}
   friend void a_member(); // okay (because we ignore class scopes when looking up friends)
   friend class A::AInner; // this is okay as an extension
   friend class AInner; // okay, refers to ::AInner
 
-  friend void Derived::missing_member(); // expected-error {{ no function named 'missing_member' with type 'void ()' was found in the specified scope }}
+  friend void Derived::missing_member(); // expected-error {{no function named 'missing_member' with type 'void ()' was found in the specified scope}}
 
-  friend void Derived::base_member(); // expected-error {{ no function named 'base_member' with type 'void ()' was found in the specified scope }}
+  friend void Derived::base_member(); // expected-error {{no function named 'base_member' with type 'void ()' was found in the specified scope}}
 
   friend int Base::typedeffed_member(); // okay: should look through typedef
 
   // These test that the friend is properly not being treated as a
   // member function.
   friend A operator|(const A& l, const A& r); // okay
-  friend A operator|(const A& r); // expected-error {{ overloaded 'operator|' must be a binary operator (has 1 parameter) }}
+  friend A operator|(const A& r); // expected-error {{overloaded 'operator|' must be a binary operator (has 1 parameter)}}
 
-  friend operator bool() const; // expected-error {{ must use a qualified name when declaring a conversion operator as a friend }} \
+  friend operator bool() const; // expected-error {{must use a qualified name when declaring a conversion operator as a friend}} \
        // expected-error{{type qualifier is not allowed on this function}}
 
   typedef void ftypedef();

Modified: cfe/branches/tooling/test/CXX/class/class.mem/p13.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/class.mem/p13.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/class.mem/p13.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/class.mem/p13.cpp Thu Dec 15 05:54:03 2011
@@ -17,7 +17,7 @@
 };
 
 struct X2 {
-  typedef int X2; // expected-error{{member 'X2' has the same name as its class)}}
+  typedef int X2; // expected-error{{member 'X2' has the same name as its class}}
 };
 
 // - every enumerator of every member of class T that is an enumerated type; and

Modified: cfe/branches/tooling/test/CXX/class/class.nest/p1-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/class.nest/p1-cxx0x.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/class.nest/p1-cxx0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/class.nest/p1-cxx0x.cpp Thu Dec 15 05:54:03 2011
@@ -9,6 +9,6 @@
   class Inner {
     static char a[sizeof(x)]; // okay
     static char b[sizeof(sx)]; // okay
-    static char c[sizeof(f)]; // expected-error {{ call to non-static member function without an object argument }}
+    static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}}
   };
 };

Modified: cfe/branches/tooling/test/CXX/class/class.nest/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/class.nest/p1.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/class.nest/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/class.nest/p1.cpp Thu Dec 15 05:54:03 2011
@@ -7,8 +7,8 @@
 
   // C++0x does relax this rule (see 5.1.1.10) in the first case, but we need to enforce it in C++03 mode.
   class Inner {
-    static char a[sizeof(x)]; // expected-error {{ invalid use of nonstatic data member 'x' }}
+    static char a[sizeof(x)]; // expected-error {{invalid use of nonstatic data member 'x'}}
     static char b[sizeof(sx)]; // okay
-    static char c[sizeof(f)]; // expected-error {{ call to non-static member function without an object argument }}
+    static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}}
   };
 };

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp Thu Dec 15 05:54:03 2011
@@ -39,7 +39,7 @@
       test<2> _1 = (foo)(a);
 
       class Test0::foo b;
-      test<2> _2 = (foo)(b); // expected-error {{no viable conversion from 'class Test0::foo' to 'class ::foo' is possible}}
+      test<2> _2 = (foo)(b); // expected-error {{no viable conversion from 'class Test0::foo' to 'class ::foo'}}
     }
   }
 }
@@ -76,7 +76,7 @@
 
   class B : private A {
   protected:
-    using A::operator int; // expected-note {{'declared protected here'}}
+    using A::operator int; // expected-note {{declared protected here}}
   public:
     using A::operator bool;
   };

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp Thu Dec 15 05:54:03 2011
@@ -37,14 +37,14 @@
 
 // - the class shall not have any virtual base classes;
 struct T : virtual S { // expected-note {{here}}
-  constexpr T(); // expected-error {{constexpr constructor not allowed in struct with virtual base classes}}
+  constexpr T(); // expected-error {{constexpr constructor not allowed in struct with virtual base class}}
 };
 namespace IndirectVBase {
   struct A {};
   struct B : virtual A {}; // expected-note {{here}}
   class C : public B {
   public:
-    constexpr C(); // expected-error {{constexpr constructor not allowed in class with virtual base classes}}
+    constexpr C(); // expected-error {{constexpr constructor not allowed in class with virtual base class}}
   };
 }
 

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp Thu Dec 15 05:54:03 2011
@@ -8,7 +8,7 @@
 class K {
   virtual ~K();
   // FIXME: Diagnostic could use some work
-  operator struct S {} (); // expected-error{{ 'operator S' cannot be the name of a variable or data member}} \
+  operator struct S {} (); // expected-error{{'operator S' cannot be the name of a variable or data member}} \
   // expected-error{{expected ';' at end of declaration list}}
 };
 

Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp Thu Dec 15 05:54:03 2011
@@ -30,7 +30,7 @@
 T get_value_badly() {
   double *dp = 0;
   // The extension doesn't extend far enough to turn this error into a warning.
-  T *tp = dp; // expected-error{{ cannot initialize a variable of type 'int *' with an lvalue of type 'double *'}}
+  T *tp = dp; // expected-error{{cannot initialize a variable of type 'int *' with an lvalue of type 'double *'}}
   return T();
 }
 
@@ -54,7 +54,7 @@
 
 void test() {
   g1(X1());
-  g2(X2()); // expected-warning{{C++98 requires an accessible copy constructor for class 'X2' when binding a reference to a temporary; was private [-Wbind-to-temporary-copy]}}
+  g2(X2()); // expected-warning{{C++98 requires an accessible copy constructor for class 'X2' when binding a reference to a temporary; was private}}
   g3(X3()); // expected-warning{{no viable constructor copying parameter of type 'X3'}}
   g4(X4<int>());
   g5(X5());  // Generates a warning in the default argument.

Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp Thu Dec 15 05:54:03 2011
@@ -12,7 +12,7 @@
 template <class T> class RefMem { // expected-warning{{class 'RefMem<int &>' does not declare any constructor to initialize its non-modifiable members}}
   T
     &
-      member; // expected-note{{ reference member 'member' will never be initialized}}
+      member; // expected-note{{reference member 'member' will never be initialized}}
 };
 
 struct RefRef {

Modified: cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp Thu Dec 15 05:54:03 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -pedantic -verify -fcxx-exceptions %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -pedantic -verify -fcxx-exceptions %s -fconstexpr-depth 256
 
 // A conditional-expression is a core constant expression unless it involves one
 // of the following as a potentially evaluated subexpression [...]:
@@ -95,11 +95,11 @@
 //   exceed the implementation-defined recursion limits (see Annex B);
 namespace RecursionLimits {
   constexpr int RecurseForever(int n) {
-    return n + RecurseForever(n+1); // expected-note {{constexpr evaluation exceeded maximum depth of 512 calls}}
+    return n + RecurseForever(n+1); // expected-note {{constexpr evaluation exceeded maximum depth of 256 calls}}
   }
   struct AlsoRecurseForever {
     constexpr AlsoRecurseForever(int n) :
-      n(AlsoRecurseForever(n+1).n) // expected-note {{constexpr evaluation exceeded maximum depth of 512 calls}}
+      n(AlsoRecurseForever(n+1).n) // expected-note {{constexpr evaluation exceeded maximum depth of 256 calls}}
     {}
     int n;
   };

Modified: cfe/branches/tooling/test/CXX/over/over.over/p2-resolve-single-template-id.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/over/over.over/p2-resolve-single-template-id.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/over/over.over/p2-resolve-single-template-id.cpp (original)
+++ cfe/branches/tooling/test/CXX/over/over.over/p2-resolve-single-template-id.cpp Thu Dec 15 05:54:03 2011
@@ -116,7 +116,7 @@
   { ptrdiff_t x = (ptrdiff_t) &twoT<int,int>;
   x = (ptrdiff_t) &twoT<int>; }
 
-  { oneT<int>;   &oneT<int>; } //expected-warning 2{{ expression result unused }}
+  { oneT<int>;   &oneT<int>; } //expected-warning 2{{expression result unused}}
   { static_cast<void>(cant_resolve<int>); } // expected-error {{address of overload}}
   { bool b = cant_resolve<int>; } // expected-error {{address of overload}}
   { (void) cant_resolve<int>; } // expected-error {{address of overload}}

Modified: cfe/branches/tooling/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp Thu Dec 15 05:54:03 2011
@@ -128,7 +128,7 @@
     void *begin(); // expected-note {{selected 'begin' function with iterator type 'void *'}}
     void *end();
   };
-  for (auto u : NoIncr()) { // expected-error {{arithmetic on a pointer to void type}}
+  for (auto u : NoIncr()) { // expected-error {{arithmetic on a pointer to void}}
   }
 
   struct NoNotEq {

Modified: cfe/branches/tooling/test/FixIt/typo.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/FixIt/typo.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/FixIt/typo.c (original)
+++ cfe/branches/tooling/test/FixIt/typo.c Thu Dec 15 05:54:03 2011
@@ -30,7 +30,7 @@
   r1.top_left.x = 0;
 
   typedef struct Rectangle Rectangle; // expected-note{{'Rectangle' declared here}}
-  rectangle *r2 = &r1; // expected-error{{ unknown type name 'rectangle'; did you mean 'Rectangle'?}}
+  rectangle *r2 = &r1; // expected-error{{unknown type name 'rectangle'; did you mean 'Rectangle'?}}
   r2->top_left.y = 0;
   unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}}
   *ptr = 17;

Modified: cfe/branches/tooling/test/Index/index-suppress-refs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/index-suppress-refs.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/index-suppress-refs.h (original)
+++ cfe/branches/tooling/test/Index/index-suppress-refs.h Thu Dec 15 05:54:03 2011
@@ -1,3 +1,9 @@
 
 @interface I
 @end
+
+ at interface B
+ at end
+
+ at protocol P
+ at end

Modified: cfe/branches/tooling/test/Index/index-suppress-refs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/index-suppress-refs.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/index-suppress-refs.m (original)
+++ cfe/branches/tooling/test/Index/index-suppress-refs.m Thu Dec 15 05:54:03 2011
@@ -14,9 +14,17 @@
 
 @class I;
 
+ at interface S : B<P>
+-(void)meth:(B*)b :(id<P>)p;
+ at end
+
 // RUN: env CINDEXTEST_SUPPRESSREFS=1 c-index-test -index-file %s | FileCheck %s
 // CHECK:      [indexDeclaration]: kind: objc-class | name: I
 // CHECK-NEXT:      <ObjCContainerInfo>: kind: interface
+// CHECK-NEXT: [indexDeclaration]: kind: objc-class | name: B
+// CHECK-NEXT:      <ObjCContainerInfo>: kind: interface
+// CHECK-NEXT: [indexDeclaration]: kind: objc-protocol | name: P
+// CHECK-NEXT:      <ObjCContainerInfo>: kind: interface
 // CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt
 // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx
 // CHECK-NEXT: [indexDeclaration]: kind: objc-class | name: I
@@ -27,3 +35,10 @@
 // CHECK-NEXT: [indexDeclaration]: kind: objc-instance-method | name: meth
 // CHECK-NOT:  [indexEntityReference]: kind: objc-class | name: I
 // CHECK-NOT:  [indexDeclaration]: kind: objc-class | name: I
+// CHECK-NEXT: [indexDeclaration]: kind: objc-class | name: S
+// CHECK-NEXT:      <ObjCContainerInfo>: kind: interface
+// CHECK-NEXT:      <base>: kind: objc-class | name: B
+// CHECK-NEXT:      <protocol>: kind: objc-protocol | name: P
+// CHECK-NEXT: [indexDeclaration]: kind: objc-instance-method | name: meth::
+// CHECK-NOT:  [indexEntityReference]: kind: objc-class | name: B
+// CHECK-NOT:  [indexEntityReference]: kind: objc-protocol | name: P
\ No newline at end of file

Modified: cfe/branches/tooling/test/Lexer/rdr-6096838-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/rdr-6096838-2.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/rdr-6096838-2.c (original)
+++ cfe/branches/tooling/test/Lexer/rdr-6096838-2.c Thu Dec 15 05:54:03 2011
@@ -2,4 +2,4 @@
  rdar://6096838
  */
 
-long double d = 0x0.0000003ffffffff00000p-16357L; /* expected-warning {{ hexadecimal floating constants are a C99 feature }} */
+long double d = 0x0.0000003ffffffff00000p-16357L; /* expected-warning {{hexadecimal floating constants are a C99 feature}} */

Modified: cfe/branches/tooling/test/Lexer/string-literal-encoding.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/string-literal-encoding.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/string-literal-encoding.c (original)
+++ cfe/branches/tooling/test/Lexer/string-literal-encoding.c Thu Dec 15 05:54:03 2011
@@ -5,11 +5,11 @@
 // U+00F5 U+00FC
 
 void f() {
-    wchar_t const *a = L"Àéîõü"; // expected-error {{ illegal sequence in string literal }}
+    wchar_t const *a = L"Àéîõü"; // expected-error {{illegal sequence in string literal}}
 
-    char16_t const *b = u"Àéîõü"; // expected-error {{ illegal sequence in string literal }}
-    char32_t const *c = U"Àéîõü"; // expected-error {{ illegal sequence in string literal }}
-    wchar_t const *d = LR"(Àéîõü)"; // expected-error {{ illegal sequence in string literal }}
-    char16_t const *e = uR"(Àéîõü)"; // expected-error {{ illegal sequence in string literal }}
-    char32_t const *f = UR"(Àéîõü)"; // expected-error {{ illegal sequence in string literal }}
+    char16_t const *b = u"Àéîõü"; // expected-error {{illegal sequence in string literal}}
+    char32_t const *c = U"Àéîõü"; // expected-error {{illegal sequence in string literal}}
+    wchar_t const *d = LR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}}
+    char16_t const *e = uR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}}
+    char32_t const *f = UR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}}
 }

Modified: cfe/branches/tooling/test/Lexer/string_concat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/string_concat.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/string_concat.cpp (original)
+++ cfe/branches/tooling/test/Lexer/string_concat.cpp Thu Dec 15 05:54:03 2011
@@ -2,32 +2,32 @@
 
 void f() {
 
-  const char* a = u8"abc" u"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char* b = u8"abc" U"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char* c = u8"abc" L"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char* d = u8"abc" uR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char* e = u8"abc" UR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char* f = u8"abc" LR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-
-  const char16_t* g = u"abc" u8"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char16_t* h = u"abc" U"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char16_t* i = u"abc" L"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char16_t* j = u"abc" u8R"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char16_t* k = u"abc" UR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char16_t* l = u"abc" LR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-
-  const char32_t* m = U"abc" u8"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char32_t* n = U"abc" u"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char32_t* o = U"abc" L"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char32_t* p = U"abc" u8R"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char32_t* q = U"abc" uR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const char32_t* r = U"abc" LR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-
-  const wchar_t* s = L"abc" u8"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const wchar_t* t = L"abc" u"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const wchar_t* u = L"abc" U"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const wchar_t* v = L"abc" u8R"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const wchar_t* w = L"abc" uR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
-  const wchar_t* x = L"abc" UR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
+  const char* a = u8"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char* b = u8"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char* c = u8"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char* d = u8"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char* e = u8"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char* f = u8"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+
+  const char16_t* g = u"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char16_t* h = u"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char16_t* i = u"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char16_t* j = u"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char16_t* k = u"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char16_t* l = u"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+
+  const char32_t* m = U"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char32_t* n = U"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char32_t* o = U"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char32_t* p = U"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char32_t* q = U"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const char32_t* r = U"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+
+  const wchar_t* s = L"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const wchar_t* t = L"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const wchar_t* u = L"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const wchar_t* v = L"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const wchar_t* w = L"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
+  const wchar_t* x = L"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
 }
 

Modified: cfe/branches/tooling/test/Misc/diag-aka-types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Misc/diag-aka-types.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Misc/diag-aka-types.cpp (original)
+++ cfe/branches/tooling/test/Misc/diag-aka-types.cpp Thu Dec 15 05:54:03 2011
@@ -27,7 +27,7 @@
 }
 
 void test(Foo::foo* x) {
-  bar::f(x); // expected-error{{cannot initialize a parameter of type 'Foo::foo *' (aka 'bar::Foo::foo *') with an lvalue of type 'Foo::foo *')}}
+  bar::f(x); // expected-error{{cannot initialize a parameter of type 'Foo::foo *' (aka 'bar::Foo::foo *') with an lvalue of type 'Foo::foo *'}}
 }
 
 // PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'"

Modified: cfe/branches/tooling/test/Modules/macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/macros.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/macros.c (original)
+++ cfe/branches/tooling/test/Modules/macros.c Thu Dec 15 05:54:03 2011
@@ -21,7 +21,7 @@
 double d;
 DOUBLE *dp = &d;
 
-#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE' to export}}
+#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE'}}
 
 void f() {
   // CHECK-PREPROCESSED: int i = INTEGER;

Modified: cfe/branches/tooling/test/Modules/normal-module-map.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/normal-module-map.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/normal-module-map.cpp (original)
+++ cfe/branches/tooling/test/Modules/normal-module-map.cpp Thu Dec 15 05:54:03 2011
@@ -1,4 +1,4 @@
-// Note: inside the module. expected-note{{ 'nested_umbrella_a' declared here}}
+// Note: inside the module. expected-note{{'nested_umbrella_a' declared here}}
 
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/normal-module-map %s -verify

Modified: cfe/branches/tooling/test/PCH/typo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/typo.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/typo.cpp (original)
+++ cfe/branches/tooling/test/PCH/typo.cpp Thu Dec 15 05:54:03 2011
@@ -1,8 +1,8 @@
 
-// In header: expected-note{{ 'boost::function' declared here}}
+// In header: expected-note{{'boost::function' declared here}}
 
 
-// In header: expected-note{{ 'boost::graph::adjacency_list' declared here}}
+// In header: expected-note{{'boost::graph::adjacency_list' declared here}}
 
 
 

Modified: cfe/branches/tooling/test/Parser/attr-availability.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/attr-availability.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/attr-availability.c (original)
+++ cfe/branches/tooling/test/Parser/attr-availability.c Thu Dec 15 05:54:03 2011
@@ -16,7 +16,7 @@
 
 void f5() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}}
 
-void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{warning: 'unavailable' availability overrides all other availability information}}
+void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}}
 
 // rdar://10095131
 enum E{

Modified: cfe/branches/tooling/test/Parser/check-syntax-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/check-syntax-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/check-syntax-1.m (original)
+++ cfe/branches/tooling/test/Parser/check-syntax-1.m Thu Dec 15 05:54:03 2011
@@ -6,7 +6,7 @@
 typedef float CGFloat;
 @interface XNSNumber 
 + (XNSNumber *) numberWithCGFloat  : (CGFloat) float; // expected-error {{expected identifier}}  \
-                                                      // expected-error {{ expected ';' after method prototype}}
+                                                      // expected-error {{expected ';' after method prototype}}
 @end
 
 // rdar: // 7822196

Modified: cfe/branches/tooling/test/Parser/cxx-altivec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx-altivec.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx-altivec.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx-altivec.cpp Thu Dec 15 05:54:03 2011
@@ -67,7 +67,7 @@
 vector double v_d2;                  // expected-error {{cannot use 'double' with '__vector'}}
 __vector long double  vv_ld3;        // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
 vector long double  v_ld4;           // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
-vector bool v_b;                     // expected-error {{error: C++ requires a type specifier for all declarations}}
+vector bool v_b;                     // expected-error {{C++ requires a type specifier for all declarations}}
 vector bool float v_bf;              // expected-error {{cannot use 'float' with '__vector bool'}}
 vector bool double v_bd;             // expected-error {{cannot use 'double' with '__vector bool'}}
 vector bool pixel v_bp;              // expected-error {{cannot use '__pixel' with '__vector bool'}}

Modified: cfe/branches/tooling/test/Parser/cxx-typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx-typeid.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx-typeid.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx-typeid.cpp Thu Dec 15 05:54:03 2011
@@ -9,5 +9,5 @@
 {
   (void)typeid(int);
   (void)typeid(0);
-  (void)typeid 1; // expected-error {{error: expected '(' after 'typeid'}}
+  (void)typeid 1; // expected-error {{expected '(' after 'typeid'}}
 }

Modified: cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp Thu Dec 15 05:54:03 2011
@@ -10,8 +10,8 @@
     [foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
     [foo,&this] {}; // expected-error {{'this' cannot be captured by reference}}
     [&this] {}; // expected-error {{'this' cannot be captured by reference}}
-    [&,] {}; // expected-error {{ expected variable name or 'this' in lambda capture list}}
-    [=,] {}; // expected-error {{ expected variable name or 'this' in lambda capture list}}
+    [&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
+    [=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
     [] {};
     [=] (int i) {};
     [&] (int) mutable -> void {};

Modified: cfe/branches/tooling/test/Parser/objc-category-neg-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/objc-category-neg-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/objc-category-neg-1.m (original)
+++ cfe/branches/tooling/test/Parser/objc-category-neg-1.m Thu Dec 15 05:54:03 2011
@@ -3,6 +3,6 @@
 void __assert_rtn(const char *, const char *, int, const char *) __attribute__((__noreturn__));
 static __inline__ int __inline_isfinitef (float ) __attribute__ ((always_inline));
 
- at interface NSATSTypesetter (NSPantherCompatibility) // expected-error {{ "cannot find interface declaration for 'NSATSTypesetter'" }}
+ at interface NSATSTypesetter (NSPantherCompatibility) // expected-error {{cannot find interface declaration for 'NSATSTypesetter'}}
 - (id)lineFragmentRectForProposedRect:(id)proposedRect remainingRect:(id)remainingRect __attribute__((deprecated));
 @end

Modified: cfe/branches/tooling/test/Parser/objc-forcollection-neg-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/objc-forcollection-neg-2.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/objc-forcollection-neg-2.m (original)
+++ cfe/branches/tooling/test/Parser/objc-forcollection-neg-2.m Thu Dec 15 05:54:03 2011
@@ -30,7 +30,7 @@
         for (id el in self) 
            ++i;
 	MyList<P> ***p;
-        for (p in self)  // expected-error {{selector element type 'MyList<P> ***' is not a valid object type}}
+        for (p in self)  // expected-error {{selector element type 'MyList<P> ***' is not a valid object}}
            ++i;
 
 }

Modified: cfe/branches/tooling/test/Parser/objc-init.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/objc-init.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/objc-init.m (original)
+++ cfe/branches/tooling/test/Parser/objc-init.m Thu Dec 15 05:54:03 2011
@@ -15,7 +15,7 @@
 	id objects[] = {[NSNumber METH]};
 }
 
-void test2(NSNumber x) { // expected-error {{Objective-C interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
+void test2(NSNumber x) { // expected-error {{interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
 	id objects[] = {[x METH]};
 }
 

Modified: cfe/branches/tooling/test/Parser/recovery.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/recovery.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/recovery.c (original)
+++ cfe/branches/tooling/test/Parser/recovery.c Thu Dec 15 05:54:03 2011
@@ -49,7 +49,7 @@
 char ((((                       /* expected-note {{to match this '('}} */
          *X x ] ))));                    /* expected-error {{expected ')'}} */
 
-;   // expected-warning {{ISO C does not allow an extra ';' outside of a function}}
+;   // expected-warning {{extra ';' outside of a function}}
 
 
 

Modified: cfe/branches/tooling/test/Sema/attr-unavailable-message.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-unavailable-message.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-unavailable-message.c (original)
+++ cfe/branches/tooling/test/Sema/attr-unavailable-message.c Thu Dec 15 05:54:03 2011
@@ -40,8 +40,8 @@
     t = 3
 }__attribute__((unavailable()));  
 
-enum fee f() { // expected-error {{error: 'fee' is unavailable}}
-    int i = a; // expected-warning {{'a' is deprecated }}
+enum fee f() { // expected-error {{'fee' is unavailable}}
+    int i = a; // expected-warning {{'a' is deprecated}}
 
     i = b; // expected-warning {{'b' is deprecated}}
 

Modified: cfe/branches/tooling/test/Sema/block-misc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/block-misc.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/block-misc.c (original)
+++ cfe/branches/tooling/test/Sema/block-misc.c Thu Dec 15 05:54:03 2011
@@ -190,7 +190,7 @@
 
 // rdar://7072507
 int test19() {
-  goto L0;       // expected-error {{illegal goto into protected scope}}
+  goto L0;       // expected-error {{goto into protected scope}}
   
   __block int x; // expected-note {{jump bypasses setup of __block variable}}
 L0:

Modified: cfe/branches/tooling/test/Sema/builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/builtins.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/builtins.c (original)
+++ cfe/branches/tooling/test/Sema/builtins.c Thu Dec 15 05:54:03 2011
@@ -28,7 +28,7 @@
   const void *X;
   X = CFSTR("\242"); // expected-warning {{input conversion stopped}}
   X = CFSTR("\0"); // no-warning
-  X = CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}}
+  X = CFSTR(242); // expected-error {{CFString literal is not a string constant}} expected-warning {{incompatible integer to pointer conversion}}
   X = CFSTR("foo", "bar"); // expected-error {{too many arguments to function call}}
 }
 

Modified: cfe/branches/tooling/test/Sema/compare.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/compare.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/compare.c (original)
+++ cfe/branches/tooling/test/Sema/compare.c Thu Dec 15 05:54:03 2011
@@ -327,3 +327,9 @@
   b = (si == (ui = sl)); // expected-warning {{comparison of integers of different signs: 'int' and 'unsigned int'}}
   b = (si == (ui = sl&15));
 }
+
+// PR11572
+struct test11S { unsigned x : 30; };
+int test11(unsigned y, struct test11S *p) {
+  return y > (p->x >> 24); // no-warning
+}

Modified: cfe/branches/tooling/test/Sema/format-strings-scanf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-scanf.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-scanf.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-scanf.c Thu Dec 15 05:54:03 2011
@@ -67,3 +67,12 @@
   vfscanf(f, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
   vsscanf(buf, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
 }
+
+void test_alloc_extension(char **sp, wchar_t **lsp) {
+  /* Make sure "%a" gets parsed as a conversion specifier for float,
+   * even when followed by an 's', 'S' or '[', which would cause it to be
+   * parsed as a length modifier in C90. */
+  scanf("%as", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
+  scanf("%aS", lsp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'wchar_t **'}}
+  scanf("%a[bcd]", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
+}

Modified: cfe/branches/tooling/test/Sema/format-strings-size_t.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-size_t.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-size_t.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-size_t.c Thu Dec 15 05:54:03 2011
@@ -4,12 +4,12 @@
 
 void test(void) {
   // size_t
-  printf("%zu", (double)42); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double''}}
+  printf("%zu", (double)42); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double'}}
 
   // intmax_t / uintmax_t
-  printf("%jd", (double)42); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long') but the argument has type 'double''}}
-  printf("%ju", (double)42); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double''}}
+  printf("%jd", (double)42); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long') but the argument has type 'double'}}
+  printf("%ju", (double)42); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double'}}
 
   // ptrdiff_t
-  printf("%td", (double)42); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double''}}
+  printf("%td", (double)42); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double'}}
 }

Modified: cfe/branches/tooling/test/Sema/implicit-builtin-redecl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/implicit-builtin-redecl.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/implicit-builtin-redecl.c (original)
+++ cfe/branches/tooling/test/Sema/implicit-builtin-redecl.c Thu Dec 15 05:54:03 2011
@@ -6,7 +6,7 @@
   return ((void*)0); /*do not use heap in this file*/
 }
 
-void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc' will be ignored}} \
+void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc'}} \
 // expected-note{{'calloc' is a builtin with type 'void *}}
 
 void f1(void) { 

Modified: cfe/branches/tooling/test/Sema/overloadable-complex.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/overloadable-complex.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/overloadable-complex.c (original)
+++ cfe/branches/tooling/test/Sema/overloadable-complex.c Thu Dec 15 05:54:03 2011
@@ -31,8 +31,8 @@
 int *promote_or_convert(long double _Complex) __attribute__((__overloadable__)); // expected-note 2 {{candidate function}} 
 
 void test_promote_or_convert(float f, float _Complex fc) {
-  char *cp = promote_or_convert(fc); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
-  int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
+  char *cp = promote_or_convert(fc); // expected-error{{call to 'promote_or_convert' is ambiguous}}
+  int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous}}
 }
 
 char *promote_or_convert2(float) __attribute__((__overloadable__));

Modified: cfe/branches/tooling/test/Sema/overloadable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/overloadable.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/overloadable.c (original)
+++ cfe/branches/tooling/test/Sema/overloadable.c Thu Dec 15 05:54:03 2011
@@ -22,7 +22,7 @@
 void test_funcptr(int (*f1)(int, double),
                   int (*f2)(int, float)) {
   float *fp = accept_funcptr(f1);
-  accept_funcptr(f2); // expected-error{{no matching function for call to 'accept_funcptr'; candidates are:}}
+  accept_funcptr(f2); // expected-error{{no matching function for call to 'accept_funcptr'}}
 }
 
 struct X { int x; float y; };

Modified: cfe/branches/tooling/test/Sema/thread-specifier.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/thread-specifier.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/thread-specifier.c (original)
+++ cfe/branches/tooling/test/Sema/thread-specifier.c Thu Dec 15 05:54:03 2011
@@ -15,7 +15,7 @@
   __thread register int t13; // expected-error {{'__thread' variables must have global storage}}
 }
 __thread typedef int t14; // expected-error {{'__thread' is only allowed on variable declarations}}
-__thread int t15; // expected-note {{[previous definition is here}}
+__thread int t15; // expected-note {{previous definition is here}}
 int t15; // expected-error {{non-thread-local declaration of 't15' follows thread-local declaration}}
-int t16; // expected-note {{[previous definition is here}}
+int t16; // expected-note {{previous definition is here}}
 __thread int t16; // expected-error {{thread-local declaration of 't16' follows non-thread-local declaration}}

Modified: cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp Thu Dec 15 05:54:03 2011
@@ -23,7 +23,7 @@
 
   int jump_over_variable_init(bool b) {
     if (b)
-      goto foo; // expected-warning {{illegal goto into protected scope}}
+      goto foo; // expected-warning {{goto into protected scope}}
     C c; // expected-note {{jump bypasses variable initialization}}
   foo:
     return 1;
@@ -51,7 +51,7 @@
 
  
 void exception_jump() {
-  goto l2; // expected-error {{illegal goto into protected scope}}
+  goto l2; // expected-error {{goto into protected scope}}
   try { // expected-note {{jump bypasses initialization of try block}}
      l2: ;
   } catch(int) {

Modified: cfe/branches/tooling/test/SemaCXX/access.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/access.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/access.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/access.cpp Thu Dec 15 05:54:03 2011
@@ -28,7 +28,7 @@
   private:
     class X; // expected-note {{previously declared 'private' here}}
   public:
-    class X; // expected-error {{ 'X' redeclared with 'public' access}}
+    class X; // expected-error {{'X' redeclared with 'public' access}}
     class X {};
   };
 }

Modified: cfe/branches/tooling/test/SemaCXX/addr-of-overloaded-function.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/addr-of-overloaded-function.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/addr-of-overloaded-function.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/addr-of-overloaded-function.cpp Thu Dec 15 05:54:03 2011
@@ -13,9 +13,9 @@
 int (&rfi)(int) = f;     // selects f(int)
 int (&rfd)(double) = f;  // selects f(double)
 
-void g(int (*fp)(int));   // expected-note{{note: candidate function}}
+void g(int (*fp)(int));   // expected-note{{candidate function}}
 void g(int (*fp)(float));
-void g(int (*fp)(double)); // expected-note{{note: candidate function}}
+void g(int (*fp)(double)); // expected-note{{candidate function}}
 
 int g1(int);
 int g1(char);
@@ -29,7 +29,7 @@
 
 void g_test() {
   g(g1);
-  g(g2); // expected-error{{call to 'g' is ambiguous; candidates are:}}
+  g(g2); // expected-error{{call to 'g' is ambiguous}}
   g(g3);
 }
 
@@ -98,8 +98,10 @@
 }
 
 namespace PR8033 {
-  template <typename T1, typename T2> int f(T1 *, const T2 *); // expected-note 2{{candidate function [with T1 = const int, T2 = int]}}
-  template <typename T1, typename T2> int f(const T1 *, T2 *); // expected-note 2{{candidate function [with T1 = int, T2 = const int]}}
+  template <typename T1, typename T2> int f(T1 *, const T2 *); // expected-note {{candidate function [with T1 = const int, T2 = int]}} \
+  // expected-note{{candidate function}}
+  template <typename T1, typename T2> int f(const T1 *, T2 *); // expected-note {{candidate function [with T1 = int, T2 = const int]}} \
+  // expected-note{{candidate function}}
   int (*p)(const int *, const int *) = f; // expected-error{{address of overloaded function 'f' is ambiguous}} \
   // expected-error{{address of overloaded function 'f' is ambiguous}}
 

Modified: cfe/branches/tooling/test/SemaCXX/class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/class.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/class.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/class.cpp Thu Dec 15 05:54:03 2011
@@ -1,14 +1,14 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s 
 class C {
 public:
-  auto int errx; // expected-error {{error: storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}}
-  register int erry; // expected-error {{error: storage class specified for a member declaration}}
-  extern int errz; // expected-error {{error: storage class specified for a member declaration}}
+  auto int errx; // expected-error {{storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}}
+  register int erry; // expected-error {{storage class specified for a member declaration}}
+  extern int errz; // expected-error {{storage class specified for a member declaration}}
 
   static void sm() {
     sx = 0;
-    this->x = 0; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
-    x = 0; // expected-error {{error: invalid use of member 'x' in static member function}}
+    this->x = 0; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
+    x = 0; // expected-error {{invalid use of member 'x' in static member function}}
   }
 
   class NestedC {
@@ -46,7 +46,7 @@
     sx = 0;
     this->x = 0;
     y = 0;
-    this = 0; // expected-error {{error: expression is not assignable}}
+    this = 0; // expected-error {{expression is not assignable}}
   }
 
   int f1(int p) {
@@ -57,7 +57,7 @@
   typedef int A;
 
   virtual int viv; // expected-error {{'virtual' can only appear on non-static member functions}}
-  virtual static int vsif(); // expected-error {{error: 'virtual' can only appear on non-static member functions}}
+  virtual static int vsif(); // expected-error {{'virtual' can only appear on non-static member functions}}
   virtual int vif();
 
 private:
@@ -65,9 +65,9 @@
   static int sx;
 
   mutable int mi;
-  mutable int &mir; // expected-error {{error: 'mutable' cannot be applied to references}}
-  mutable void mfn(); // expected-error {{error: 'mutable' cannot be applied to functions}}
-  mutable const int mci; // expected-error {{error: 'mutable' and 'const' cannot be mixed}}
+  mutable int &mir; // expected-error {{'mutable' cannot be applied to references}}
+  mutable void mfn(); // expected-error {{'mutable' cannot be applied to functions}}
+  mutable const int mci; // expected-error {{'mutable' and 'const' cannot be mixed}}
 
   static const int number = 50;
   static int arr[number];
@@ -98,11 +98,11 @@
 }
 
 // Play with mutable a bit more, to make sure it doesn't crash anything.
-mutable int gi; // expected-error {{error: 'mutable' can only be applied to member variables}}
+mutable int gi; // expected-error {{'mutable' can only be applied to member variables}}
 mutable void gfn(); // expected-error {{illegal storage class on function}}
 void ogfn()
 {
-  mutable int ml; // expected-error {{error: 'mutable' can only be applied to member variables}}
+  mutable int ml; // expected-error {{'mutable' can only be applied to member variables}}
 
   // PR3020: This used to crash due to double ownership of C4.
   struct C4;

Modified: cfe/branches/tooling/test/SemaCXX/complex-overload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/complex-overload.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/complex-overload.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/complex-overload.cpp Thu Dec 15 05:54:03 2011
@@ -32,7 +32,7 @@
 
 void test_promote_or_convert(float f, float _Complex fc) {
   char *cp = promote_or_convert(fc);
-  int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
+  int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous}}
 }
 
 char *promote_or_convert2(float);

Modified: cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp Thu Dec 15 05:54:03 2011
@@ -141,7 +141,7 @@
 static_assert(F(2, "test") == 2, "");
 static_assert(F(3, &F) == 3, "");
 int k = 0;
-static_assert(F(4, k) == 3, ""); // expected-error {{constant expression}}
+static_assert(F(4, k) == 3, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 
 }
 
@@ -414,7 +414,9 @@
 
 constexpr int ZipFoldR(int (*F)(int x, int y, int c), int n,
                        const int *xs, const int *ys, int c) {
-  return n ? F(*xs, *ys, ZipFoldR(F, n-1, xs+1, ys+1, c)) : c;
+  return n ? F(
+               *xs, // expected-note {{subexpression not valid}}
+               *ys, ZipFoldR(F, n-1, xs+1, ys+1, c)) : c;
 }
 constexpr int MulAdd(int x, int y, int c) { return x * y + c; }
 constexpr int InnerProduct = ZipFoldR(MulAdd, 5, xs, ys, 0);
@@ -434,7 +436,7 @@
 constexpr int zs[2][2][2][2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
 static_assert(zs[0][0][0][0] == 1, "");
 static_assert(zs[1][1][1][1] == 16, "");
-static_assert(zs[0][0][0][2] == 3, ""); // expected-error {{constant expression}}
+static_assert(zs[0][0][0][2] == 3, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 static_assert((&zs[0][0][0][2])[-1] == 2, "");
 static_assert(**(**(zs + 1) + 1) == 11, "");
 static_assert(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][-1] + 1) == 11, "");
@@ -505,7 +507,7 @@
 // We notice this when evaluating an expression which uses it, but not when
 // checking its initializer.
 constexpr E e2 = E(); // unexpected-error {{constant expression}}
-static_assert(e2.p == &e2.p, ""); // unexpected-error {{constant expression}}
+static_assert(e2.p == &e2.p, ""); // unexpected-error {{constant expression}} unexpected-note {{subexpression}}
 // FIXME: We don't pass through the fact that 'this' is ::e3 when checking the
 // initializer of this declaration.
 constexpr E e3; // unexpected-error {{constant expression}}
@@ -533,10 +535,10 @@
   constexpr G() : t(&t) {}
 } constexpr g;
 
-static_assert(g.t.u1.a == 42, ""); // expected-error {{constant expression}}
+static_assert(g.t.u1.a == 42, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 static_assert(g.t.u1.b == 42, "");
 static_assert(g.t.u2.c == 42, "");
-static_assert(g.t.u2.d == 42, ""); // expected-error {{constant expression}}
+static_assert(g.t.u2.d == 42, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 
 struct S {
   int a, b;
@@ -580,10 +582,10 @@
 static_assert(strcmp_ce(&agg1.c, "hello") == 0, "");
 static_assert(agg1.n == 0, "");
 static_assert(agg1.d == 0.0, "");
-static_assert(agg1.arr[-1] == 0, ""); // expected-error {{constant expression}}
+static_assert(agg1.arr[-1] == 0, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 static_assert(agg1.arr[0] == 0, "");
 static_assert(agg1.arr[4] == 0, "");
-static_assert(agg1.arr[5] == 0, ""); // expected-error {{constant expression}}
+static_assert(agg1.arr[5] == 0, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 static_assert(agg1.p == nullptr, "");
 
 namespace SimpleDerivedClass {
@@ -706,8 +708,8 @@
 static_assert(u[0].a == 0, "");
 static_assert(u[0].b, ""); // expected-error {{constant expression}}
 static_assert(u[1].b == 1, "");
-static_assert((&u[1].b)[1] == 2, ""); // expected-error {{constant expression}}
-static_assert(*(&(u[1].b) + 1 + 1) == 3, ""); // expected-error {{constant expression}}
+static_assert((&u[1].b)[1] == 2, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert(*(&(u[1].b) + 1 + 1) == 3, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
 static_assert((&(u[1]) + 1 + 1)->b == 3, "");
 
 }

Modified: cfe/branches/tooling/test/SemaCXX/dcl_init_aggr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/dcl_init_aggr.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/dcl_init_aggr.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/dcl_init_aggr.cpp Thu Dec 15 05:54:03 2011
@@ -80,7 +80,7 @@
 };
 int global_int;
 HasReference r1 = { 1, global_int };
-HasReference r2 = { 1 } ; // expected-error{{initialization leaves reference member of type 'int &' uninitialized}}
+HasReference r2 = { 1 } ; // expected-error{{reference member of type 'int &' uninitialized}}
 
 // C++ [dcl.init.aggr]p10
 // Note: the behavior here is identical to C

Modified: cfe/branches/tooling/test/SemaCXX/exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/exceptions.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/exceptions.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/exceptions.cpp Thu Dec 15 05:54:03 2011
@@ -35,37 +35,37 @@
 void jumps() {
 l1:
   goto l5;
-  goto l4; // expected-error {{illegal goto into protected scope}}
-  goto l3; // expected-error {{illegal goto into protected scope}}
-  goto l2; // expected-error {{illegal goto into protected scope}}
+  goto l4; // expected-error {{goto into protected scope}}
+  goto l3; // expected-error {{goto into protected scope}}
+  goto l2; // expected-error {{goto into protected scope}}
   goto l1;
   try { // expected-note 4 {{jump bypasses initialization of try block}}
   l2:
     goto l5;
-    goto l4; // expected-error {{illegal goto into protected scope}}
-    goto l3; // expected-error {{illegal goto into protected scope}}
+    goto l4; // expected-error {{goto into protected scope}}
+    goto l3; // expected-error {{goto into protected scope}}
     goto l2;
     goto l1;
   } catch(int) { // expected-note 4 {{jump bypasses initialization of catch block}}
   l3:
     goto l5;
-    goto l4; // expected-error {{illegal goto into protected scope}}
+    goto l4; // expected-error {{goto into protected scope}}
     goto l3;
-    goto l2; // expected-error {{illegal goto into protected scope}}
+    goto l2; // expected-error {{goto into protected scope}}
     goto l1;
   } catch(...) { // expected-note 4 {{jump bypasses initialization of catch block}}
   l4:
     goto l5;
     goto l4;
-    goto l3; // expected-error {{illegal goto into protected scope}}
-    goto l2; // expected-error {{illegal goto into protected scope}}
+    goto l3; // expected-error {{goto into protected scope}}
+    goto l2; // expected-error {{goto into protected scope}}
     goto l1;
   }
 l5:
   goto l5;
-  goto l4; // expected-error {{illegal goto into protected scope}}
-  goto l3; // expected-error {{illegal goto into protected scope}}
-  goto l2; // expected-error {{illegal goto into protected scope}}
+  goto l4; // expected-error {{goto into protected scope}}
+  goto l3; // expected-error {{goto into protected scope}}
+  goto l2; // expected-error {{goto into protected scope}}
   goto l1;
 }
 

Modified: cfe/branches/tooling/test/SemaCXX/explicit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/explicit.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/explicit.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/explicit.cpp Thu Dec 15 05:54:03 2011
@@ -62,7 +62,7 @@
     // 13.3.1.4p1 & 8.5p16:
     Y y2 = z; // expected-error {{no viable conversion from 'Conversion::Z' to 'Conversion::Y'}}
     // FIXME: These are well-formed per C++0x 13.3.1.4p1 (see DR899).
-    Y y3 = (Y)z; // expected-error {{no matching conversion for C-style cast from 'Conversion::Z' to 'Conversion::Y''}}
+    Y y3 = (Y)z; // expected-error {{no matching conversion for C-style cast from 'Conversion::Z' to 'Conversion::Y'}}
     Y y4 = Y(z); // expected-error {{no matching conversion for functional-style cast from 'Conversion::Z' to 'Conversion::Y'}}
     Y y5 = static_cast<Y>(z); // expected-error {{no matching conversion for static_cast from 'Conversion::Z' to 'Conversion::Y'}}
     // 13.3.1.5p1 & 8.5p16:

Modified: cfe/branches/tooling/test/SemaCXX/incomplete-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/incomplete-call.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/incomplete-call.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/incomplete-call.cpp Thu Dec 15 05:54:03 2011
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 struct A; // expected-note 14 {{forward declaration of 'A'}}
 
-A f(); // expected-note {{note: 'f' declared here}}
+A f(); // expected-note {{'f' declared here}}
 
 struct B {
   A f(); // expected-note {{'f' declared here}}

Modified: cfe/branches/tooling/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp Thu Dec 15 05:54:03 2011
@@ -9,7 +9,7 @@
 namespace barstool { int toFoobar() { return 1; } } // expected-note 3 {{'barstool::toFoobar' declared here}}
 int Double(int x) { return x + x; }
 void empty() {
-  Double(toFoobar()); // expected-error{{{use of undeclared identifier 'toFoobar'; did you mean 'barstool::toFoobar'?}}
+  Double(toFoobar()); // expected-error{{use of undeclared identifier 'toFoobar'; did you mean 'barstool::toFoobar'?}}
 }
 
 namespace fizbin {
@@ -36,7 +36,7 @@
 }
 
 void Alt() {
-  Cleck(); // expected-error{{{use of undeclared identifier 'Cleck'; did you mean 'Check'?}}
+  Cleck(); // expected-error{{use of undeclared identifier 'Cleck'; did you mean 'Check'?}}
 }
 
 namespace N {

Modified: cfe/branches/tooling/test/SemaCXX/overload-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/overload-call.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/overload-call.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/overload-call.cpp Thu Dec 15 05:54:03 2011
@@ -8,10 +8,10 @@
   int* ip = f(iv);
 }
 
-int* g(int, float, int); // expected-note {{ candidate function }}
-float* g(int, int, int); // expected-note {{ candidate function }}
-double* g(int, float, float); // expected-note {{ candidate function }}
-char* g(int, float, ...); // expected-note {{ candidate function }}
+int* g(int, float, int); // expected-note {{candidate function}}
+float* g(int, int, int); // expected-note {{candidate function}}
+double* g(int, float, float); // expected-note {{candidate function}}
+char* g(int, float, ...); // expected-note {{candidate function}}
 void g();
 
 void test_g(int iv, float fv) {
@@ -21,7 +21,7 @@
   char* cp1 = g(0, 0);
   char* cp2 = g(0, 0, 0, iv, fv);
 
-  double* dp2 = g(0, fv, 1.5); // expected-error {{ call to 'g' is ambiguous; candidates are: }}
+  double* dp2 = g(0, fv, 1.5); // expected-error {{call to 'g' is ambiguous}}
 }
 
 double* h(double f);
@@ -126,9 +126,9 @@
   float* fp = bitfields(bits.uint_bitfield, 0u);
 }
 
-int* multiparm(long, int, long); // expected-note {{ candidate function }}
-float* multiparm(int, int, int); // expected-note {{ candidate function }}
-double* multiparm(int, int, short); // expected-note {{ candidate function }}
+int* multiparm(long, int, long); // expected-note {{candidate function}}
+float* multiparm(int, int, int); // expected-note {{candidate function}}
+double* multiparm(int, int, short); // expected-note {{candidate function}}
 
 void test_multiparm(long lv, short sv, int iv) {
   int* ip1 = multiparm(lv, iv, lv);
@@ -137,7 +137,7 @@
   float* fp2 = multiparm(sv, iv, iv);
   double* dp1 = multiparm(sv, sv, sv);
   double* dp2 = multiparm(iv, sv, sv);
-  multiparm(sv, sv, lv); // expected-error {{ call to 'multiparm' is ambiguous; candidates are: }}
+  multiparm(sv, sv, lv); // expected-error {{call to 'multiparm' is ambiguous}}
 }
 
 // Test overloading based on qualification vs. no qualification
@@ -183,9 +183,9 @@
 
   float* q6 = quals_rank2(pp);
 
-  quals_rank3(ppp); // expected-error {{call to 'quals_rank3' is ambiguous; candidates are:}}
+  quals_rank3(ppp); // expected-error {{call to 'quals_rank3' is ambiguous}}
 
-  quals_rank3(p); // expected-error {{call to 'quals_rank3' is ambiguous; candidates are:}}
+  quals_rank3(p); // expected-error {{call to 'quals_rank3' is ambiguous}}
   quals_rank3(pq);
 }
 
@@ -266,8 +266,8 @@
 Z get_Z();
 
 void cvqual_subsume_test(Z z) {
-  cvqual_subsume(z); // expected-error{{call to 'cvqual_subsume' is ambiguous; candidates are:}}
-  int& x = cvqual_subsume2(get_Z()); // expected-error{{call to 'cvqual_subsume2' is ambiguous; candidates are:}}
+  cvqual_subsume(z); // expected-error{{call to 'cvqual_subsume' is ambiguous}}
+  int& x = cvqual_subsume2(get_Z()); // expected-error{{call to 'cvqual_subsume2' is ambiguous}}
 }
 
 // Test overloading with cv-qualification differences in reference

Modified: cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp Thu Dec 15 05:54:03 2011
@@ -32,7 +32,7 @@
 
   static void test_member_static() {
     double& d1 = g(0.0);
-    g(0); // expected-error{{call to 'g' is ambiguous; candidates are:}}
+    g(0); // expected-error{{call to 'g' is ambiguous}}
   }
 };
 
@@ -41,8 +41,8 @@
   int& i2 = xcp->f(0);
   float& f1 = x.f(0);
   float& f2 = xp->f(0);
-  xv.f(0); // expected-error{{no matching member function for call to 'f'; candidates are:}}
-  xvp->f(0); // expected-error{{no matching member function for call to 'f'; candidates are:}}
+  xv.f(0); // expected-error{{no matching member function for call to 'f'}}
+  xvp->f(0); // expected-error{{no matching member function for call to 'f'}}
 
   int& i3 = xc.g(0);
   int& i4 = xcp->g(0);
@@ -50,7 +50,7 @@
   float& f4 = xp->g(0);
   double& d1 = xp->g(0.0);
   double& d2 = X::g(0.0);
-  X::g(0); // expected-error{{call to 'g' is ambiguous; candidates are:}}
+  X::g(0); // expected-error{{call to 'g' is ambiguous}}
   
   X::h(0); // expected-error{{call to non-static member function without an object argument}}
 }

Modified: cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp Thu Dec 15 05:54:03 2011
@@ -232,7 +232,7 @@
 void test_arrow(Arrow1 a1, Arrow2 a2, const Arrow2 a3) {
   int &i1 = a1->m;
   int &i2 = a2->m;
-  a3->m; // expected-error{{no viable overloaded 'operator->'; candidate is}}
+  a3->m; // expected-error{{no viable overloaded 'operator->'}}
 }
 
 struct CopyConBase {

Modified: cfe/branches/tooling/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp Thu Dec 15 05:54:03 2011
@@ -4,6 +4,6 @@
 {
   typedef void (*fnptr)();
   fnptr fp = 0;
-  void *vp = reinterpret_cast<void*>(fp); // expected-warning {{reinterpret_cast between pointer-to-function and pointer-to-object is an extension}}
-  (void)reinterpret_cast<fnptr>(vp); // expected-warning {{reinterpret_cast between pointer-to-function and pointer-to-object is an extension}}
+  void *vp = reinterpret_cast<void*>(fp); // expected-warning {{cast between pointer-to-function and pointer-to-object is an extension}}
+  (void)reinterpret_cast<fnptr>(vp); // expected-warning {{cast between pointer-to-function and pointer-to-object is an extension}}
 }

Modified: cfe/branches/tooling/test/SemaCXX/scope-check.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/scope-check.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/scope-check.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/scope-check.cpp Thu Dec 15 05:54:03 2011
@@ -20,7 +20,7 @@
 
   int f(bool b) {
     if (b)
-      goto foo; // expected-error {{illegal goto into protected scope}}
+      goto foo; // expected-error {{goto into protected scope}}
     C c; // expected-note {{jump bypasses variable initialization}}
   foo:
     return 1;

Modified: cfe/branches/tooling/test/SemaCXX/statements.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/statements.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/statements.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/statements.cpp Thu Dec 15 05:54:03 2011
@@ -10,7 +10,7 @@
 };
 
 void test2() {
-  goto later;  // expected-error {{illegal goto into protected scope}}
+  goto later;  // expected-error {{goto into protected scope}}
   X x;         // expected-note {{jump bypasses variable initialization}} 
 later:
   ;

Modified: cfe/branches/tooling/test/SemaCXX/static-assert.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/static-assert.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/static-assert.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/static-assert.cpp Thu Dec 15 05:54:03 2011
@@ -1,8 +1,8 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
 
-int f();
+int f(); // expected-note {{declared here}}
 
-static_assert(f(), "f"); // expected-error {{static_assert expression is not an integral constant expression}}
+static_assert(f(), "f"); // expected-error {{static_assert expression is not an integral constant expression}} expected-note {{non-constexpr function 'f' cannot be used in a constant expression}}
 static_assert(true, "true is not false");
 static_assert(false, "false is false"); // expected-error {{static_assert failed "false is false"}}
 
@@ -27,4 +27,3 @@
 
 S<char> s1; // expected-note {{in instantiation of template class 'S<char>' requested here}}
 S<int> s2;
-

Modified: cfe/branches/tooling/test/SemaCXX/this.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/this.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/this.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/this.cpp Thu Dec 15 05:54:03 2011
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s 
-int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
+int x = this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
 
 void f() {
-  int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
+  int x = this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
 }

Modified: cfe/branches/tooling/test/SemaCXX/typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/typeid.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/typeid.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/typeid.cpp Thu Dec 15 05:54:03 2011
@@ -2,7 +2,7 @@
 
 void f()
 {
-  (void)typeid(int); // expected-error {{error: you need to include <typeinfo> before using the 'typeid' operator}}
+  (void)typeid(int); // expected-error {{you need to include <typeinfo> before using the 'typeid' operator}}
 }
 
 namespace std {

Modified: cfe/branches/tooling/test/SemaCXX/uninit-variables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/uninit-variables.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/uninit-variables.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/uninit-variables.cpp Thu Dec 15 05:54:03 2011
@@ -27,7 +27,7 @@
 struct A { virtual ~A() {} };
 void polymorphic_test() {
   A *a; // expected-note{{initialize the variable 'a' to silence this warning}}
-  (void)typeid(*a); // expected-warning{{variable 'a' is uninitialized when used here }}
+  (void)typeid(*a); // expected-warning{{variable 'a' is uninitialized when used here}}
 }
 
 // Handle cases where the CFG may constant fold some branches, thus

Modified: cfe/branches/tooling/test/SemaCXX/warn-bool-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-bool-conversion.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-bool-conversion.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-bool-conversion.cpp Thu Dec 15 05:54:03 2011
@@ -1,18 +1,18 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-int* j = false; // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
+int* j = false; // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
 
-void foo(int* i, int *j=(false)) // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
+void foo(int* i, int *j=(false)) // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
 {
-  foo(false); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
+  foo(false); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
   foo((int*)false); // no-warning: explicit cast
   foo(0); // no-warning: not a bool, even though its convertible to bool
 
-  foo(false == true); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
-  foo((42 + 24) < 32); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
+  foo(false == true); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
+  foo((42 + 24) < 32); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
 
   const bool kFlag = false;
-  foo(kFlag); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
+  foo(kFlag); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
 }
 
 char f(struct Undefined*);

Modified: cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp Thu Dec 15 05:54:03 2011
@@ -173,7 +173,7 @@
 
 void sls_fun_bad_3() {
   sls_mu.Lock(); // \
-    // expected-warning{{mutex 'sls_mu' is still locked at the end of function 'sls_fun_bad_3'}}
+    // expected-warning{{mutex 'sls_mu' is still locked at the end of function}}
 }
 
 void sls_fun_bad_4() {
@@ -241,7 +241,7 @@
 
 void sls_fun_bad_10() {
   sls_mu.Lock(); // \
-    // expected-warning{{mutex 'sls_mu' is still locked at the end of function 'sls_fun_bad_10'}} \
+    // expected-warning{{mutex 'sls_mu' is still locked at the end of function}} \
     // expected-warning{{expecting mutex 'sls_mu' to be locked at start of each loop}}
   while(getBool()) {
     sls_mu.Unlock();
@@ -290,7 +290,7 @@
 
 void aa_fun_bad_3() {
   glock.globalLock(); // \
-    // expected-warning{{mutex 'aa_mu' is still locked at the end of function 'aa_fun_bad_3'}}
+    // expected-warning{{mutex 'aa_mu' is still locked at the end of function}}
 }
 
 //--------------------------------------------------//
@@ -303,19 +303,19 @@
 class WeirdMethods {
   WeirdMethods() {
     wmu.Lock(); // \
-      // expected-warning {{mutex 'wmu' is still locked at the end of function 'WeirdMethods'}}
+      // expected-warning {{mutex 'wmu' is still locked at the end of function}}
   }
   ~WeirdMethods() {
     wmu.Lock(); // \
-      // expected-warning {{mutex 'wmu' is still locked at the end of function '~WeirdMethods'}}
+      // expected-warning {{mutex 'wmu' is still locked at the end of function}}
   }
   void operator++() {
     wmu.Lock(); // \
-      // expected-warning {{mutex 'wmu' is still locked at the end of function 'operator++'}}
+      // expected-warning {{mutex 'wmu' is still locked at the end of function}}
   }
   operator int*() {
     wmu.Lock(); // \
-      // expected-warning {{mutex 'wmu' is still locked at the end of function 'operator int *'}}
+      // expected-warning {{mutex 'wmu' is still locked at the end of function}}
     return 0;
   }
 };

Modified: cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp Thu Dec 15 05:54:03 2011
@@ -686,7 +686,7 @@
 // plus an optional list of locks (vars/fields)
 
 void etf_function() __attribute__((exclusive_trylock_function));  // \
-  // expected-error {{attribute takes attribute takes at least 1 argument arguments}}
+  // expected-error {{attribute takes at least 1 argument}}
 
 void etf_function_args() __attribute__((exclusive_trylock_function(1, mu2)));
 

Modified: cfe/branches/tooling/test/SemaObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/arc.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/arc.m (original)
+++ cfe/branches/tooling/test/SemaObjC/arc.m Thu Dec 15 05:54:03 2011
@@ -189,13 +189,13 @@
 - (id) init50 { return 0; }
 
 - (void) init01 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}} \
-                   // expected-warning{{ method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
+                   // expected-warning{{method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
 - (void) init11 {}
 - (void) init21 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}}
 - (void) init31 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}} \
-                   // expected-warning{{ method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
+                   // expected-warning{{method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
 - (void) init41 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}} \
-                   // expected-warning{{ method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
+                   // expected-warning{{method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
 - (void) init51 {}
 
 - (Test8_incomplete*) init02 { return 0; } // expected-error {{init methods must return a type related to the receiver type}} \
@@ -403,7 +403,7 @@
 void test19(void) {
   id x;
   x = (id) test19a; // expected-error {{bridged cast}} \
-  // expected-note{{use __bridge to convert directly (no change in ownership))}} \
+  // expected-note{{use __bridge to convert directly (no change in ownership)}} \
   // expected-note{{use __bridge_transfer to transfer ownership of a +1 'struct Test19 *' into ARC}}
   x = (id) test19b; // expected-error {{bridged cast}} \
   // expected-note{{use __bridge to convert directly (no change in ownership)}} \

Modified: cfe/branches/tooling/test/SemaObjC/attr-deprecated.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/attr-deprecated.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/attr-deprecated.m (original)
+++ cfe/branches/tooling/test/SemaObjC/attr-deprecated.m Thu Dec 15 05:54:03 2011
@@ -77,8 +77,8 @@
 
 int t5() {
   Bar *f;
-  f.FooBar = 1;	   // expected-warning {{warning: 'FooBar' is deprecated}}
-  return f.FooBar; // expected-warning {{warning: 'FooBar' is deprecated}}
+  f.FooBar = 1;	   // expected-warning {{'FooBar' is deprecated}}
+  return f.FooBar; // expected-warning {{'FooBar' is deprecated}}
 }
 
 
@@ -99,10 +99,10 @@
 @interface DEPRECATED (Category2) // no warning.
 @end
 
- at implementation DEPRECATED (Category2) // expected-warning {{warning: 'DEPRECATED' is deprecated}}
+ at implementation DEPRECATED (Category2) // expected-warning {{'DEPRECATED' is deprecated}}
 @end
 
- at interface NS : DEPRECATED  // expected-warning {{warning: 'DEPRECATED' is deprecated}}
+ at interface NS : DEPRECATED  // expected-warning {{'DEPRECATED' is deprecated}}
 @end
 
 

Modified: cfe/branches/tooling/test/SemaObjC/blocks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/blocks.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/blocks.m (original)
+++ cfe/branches/tooling/test/SemaObjC/blocks.m Thu Dec 15 05:54:03 2011
@@ -45,10 +45,10 @@
 @end
 
 void foo8() {
-  void *P = ^(itf x) {};  // expected-error {{Objective-C interface type 'itf' cannot be passed by value; did you forget * in 'itf'}}
-  P = ^itf(int x) {};     // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
-  P = ^itf() {};          // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
-  P = ^itf{};             // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
+  void *P = ^(itf x) {};  // expected-error {{interface type 'itf' cannot be passed by value; did you forget * in 'itf'}}
+  P = ^itf(int x) {};     // expected-error {{interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
+  P = ^itf() {};          // expected-error {{interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
+  P = ^itf{};             // expected-error {{interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
 }
 
 

Modified: cfe/branches/tooling/test/SemaObjC/call-super-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/call-super-2.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/call-super-2.m (original)
+++ cfe/branches/tooling/test/SemaObjC/call-super-2.m Thu Dec 15 05:54:03 2011
@@ -68,8 +68,8 @@
 }
 - (int) instance_func1
 {
-   int i = (size_t)[self instance_func0];     // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id'))}}
-   return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0')}}
+   int i = (size_t)[self instance_func0];     // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id')}}
+   return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0'}}
 }
 - (int) instance_func2
 {

Modified: cfe/branches/tooling/test/SemaObjC/category-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/category-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/category-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/category-1.m Thu Dec 15 05:54:03 2011
@@ -72,7 +72,7 @@
 @interface MultipleCat_I() <MultipleCat_P>  @end
 
 @implementation MultipleCat_I // expected-warning {{incomplete implementation}} \
-                              // expected-warning {{method in protocol not implemented [-Wprotocol]}}
+                              // expected-warning {{method in protocol not implemented}}
 @end
 
 // <rdar://problem/7680391> - Handle nameless categories with no name that refer

Modified: cfe/branches/tooling/test/SemaObjC/class-extension-dup-methods.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/class-extension-dup-methods.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/class-extension-dup-methods.m (original)
+++ cfe/branches/tooling/test/SemaObjC/class-extension-dup-methods.m Thu Dec 15 05:54:03 2011
@@ -1,9 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
 @interface Foo
-- (int)  garf; // expected-note {{ previous declaration is here}}
+- (int)  garf; // expected-note {{previous declaration is here}}
 - (int) OK;
-+ (int)  cgarf; // expected-note {{ previous declaration is here}}
++ (int)  cgarf; // expected-note {{previous declaration is here}}
 - (int)  InstMeth;
 @end
 

Modified: cfe/branches/tooling/test/SemaObjC/compare-qualified-id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/compare-qualified-id.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/compare-qualified-id.m (original)
+++ cfe/branches/tooling/test/SemaObjC/compare-qualified-id.m Thu Dec 15 05:54:03 2011
@@ -24,7 +24,7 @@
 @end
 
 @implementation XCPropertyExpansionContext // expected-warning {{incomplete implementation}} \
-					   // expected-warning {{method in protocol not implemented [-Wprotocol]}}
+					   // expected-warning {{method in protocol not implemented}}
 - (NSString *)expandedValueForProperty:(NSString *)property {
   id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}
   if (cachedValueNode == ((void *)0)) { }

Modified: cfe/branches/tooling/test/SemaObjC/comptypes-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/comptypes-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/comptypes-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/comptypes-1.m Thu Dec 15 05:54:03 2011
@@ -42,7 +42,7 @@
      MyProtocol), but not from an 'id' or from a 'MyOtherClass *'
      (which implements MyProtocol).  */
   obj_p = obj;    /* Ok */
-  obj_p = obj_c;  // expected-warning {{ assigning to 'id<MyProtocol>' from incompatible type 'MyClass *'}}
+  obj_p = obj_c;  // expected-warning {{assigning to 'id<MyProtocol>' from incompatible type 'MyClass *'}}
   obj_p = obj_cp; /* Ok  */
   obj_p = obj_C;  // expected-warning {{incompatible pointer types assigning to 'id<MyProtocol>' from 'Class'}}
 

Modified: cfe/branches/tooling/test/SemaObjC/comptypes-7.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/comptypes-7.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/comptypes-7.m (original)
+++ cfe/branches/tooling/test/SemaObjC/comptypes-7.m Thu Dec 15 05:54:03 2011
@@ -28,7 +28,7 @@
   obj = j; // expected-warning {{incompatible pointer types assigning to 'id' from 'int *'}}
 
   obj_p = i; // expected-warning {{incompatible integer to pointer conversion assigning to 'id<MyProtocol>' from 'int'}}
-  obj_p = j; // expected-warning {{ incompatible pointer types assigning to 'id<MyProtocol>' from 'int *'}}
+  obj_p = j; // expected-warning {{incompatible pointer types assigning to 'id<MyProtocol>' from 'int *'}}
   
   obj_c = i; // expected-warning {{incompatible integer to pointer conversion assigning to 'MyClass *' from 'int'}}
   obj_c = j; // expected-warning {{incompatible pointer types assigning to 'MyClass *' from 'int *'}}
@@ -42,7 +42,7 @@
   i = obj_C; // expected-warning {{incompatible pointer to integer conversion assigning to 'int' from 'Class'}}
   
   j = obj;   // expected-warning {{incompatible pointer types assigning to 'int *' from 'id'}}
-  j = obj_p; // expected-warning {{ incompatible pointer types assigning to 'int *' from 'id<MyProtocol>'}}
+  j = obj_p; // expected-warning {{incompatible pointer types assigning to 'int *' from 'id<MyProtocol>'}}
   j = obj_c; // expected-warning {{incompatible pointer types assigning to 'int *' from 'MyClass *'}}
   j = obj_C; // expected-warning {{incompatible pointer types assigning to 'int *' from 'Class'}}
   

Modified: cfe/branches/tooling/test/SemaObjC/conditional-expr-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/conditional-expr-3.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/conditional-expr-3.m (original)
+++ cfe/branches/tooling/test/SemaObjC/conditional-expr-3.m Thu Dec 15 05:54:03 2011
@@ -31,7 +31,7 @@
 }
 
 void f3(A *a) {
-  id<P1> l = a; // expected-warning {{ initializing 'id<P1>' with an expression of incompatible type 'A *'}}
+  id<P1> l = a; // expected-warning {{initializing 'id<P1>' with an expression of incompatible type 'A *'}}
 }
 
 void f4(int cond, id x, A *a) {

Modified: cfe/branches/tooling/test/SemaObjC/conditional-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/conditional-expr.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/conditional-expr.m (original)
+++ cfe/branches/tooling/test/SemaObjC/conditional-expr.m Thu Dec 15 05:54:03 2011
@@ -21,7 +21,7 @@
 @end
 
 @interface DTFilterOutputStream2
-- nextOutputStream; // expected-note {{{{method definition for 'nextOutputStream' not found}}
+- nextOutputStream; // expected-note {{method definition for 'nextOutputStream' not found}}
 @end
 
 @implementation DTFilterOutputStream2 // expected-warning {{incomplete implementation}}
@@ -100,7 +100,7 @@
 }
 
 void f9(int a, A<P0> *x, A<P1> *y) {
-  id l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')'}}
+  id l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
   A<P0> *l1 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
   A<P1> *l2 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
   [ (a ? x : y ) intProp ]; // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}

Modified: cfe/branches/tooling/test/SemaObjC/default-synthesize.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/default-synthesize.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/default-synthesize.m (original)
+++ cfe/branches/tooling/test/SemaObjC/default-synthesize.m Thu Dec 15 05:54:03 2011
@@ -115,3 +115,16 @@
 @synthesize PROP=IVAR;
 @end
 
+// rdar://10567333
+ at protocol MyProtocol 
+ at property (nonatomic, strong) NSString *requiredString; // expected-note {{property declared here}}
+
+ at optional
+ at property (nonatomic, strong) NSString *optionalString;
+ at end
+ 
+ at interface MyClass <MyProtocol> 
+ at end
+ 
+ at implementation MyClass // expected-warning {{auto property synthesis will not synthesize property declared in a protocol}}
+ at end

Modified: cfe/branches/tooling/test/SemaObjC/gcc-cast-ext.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/gcc-cast-ext.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/gcc-cast-ext.m (original)
+++ cfe/branches/tooling/test/SemaObjC/gcc-cast-ext.m Thu Dec 15 05:54:03 2011
@@ -5,8 +5,8 @@
 @class PBXFileReference;
 
 @interface PBXDocBookmark
-+ alloc;	// expected-note {{{{method definition for 'alloc' not found}}
-- autorelease;	// expected-note {{{{method definition for 'autorelease' not found}}
++ alloc;	// expected-note {{method definition for 'alloc' not found}}
+- autorelease;	// expected-note {{method definition for 'autorelease' not found}}
 @end
 
 // GCC allows pointer expressions in integer constant expressions.

Modified: cfe/branches/tooling/test/SemaObjC/invalid-objc-decls-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/invalid-objc-decls-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/invalid-objc-decls-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/invalid-objc-decls-1.m Thu Dec 15 05:54:03 2011
@@ -27,8 +27,8 @@
 }
 @end
 
-Super foo( // expected-error{{interface interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
-          Super parm1) { // expected-error{{interface interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
+Super foo( // expected-error{{interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
+          Super parm1) { // expected-error{{interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
 	Super p1; // expected-error{{interface type cannot be statically allocated}}
 	return p1;
 }

Modified: cfe/branches/tooling/test/SemaObjC/ivar-lookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/ivar-lookup.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/ivar-lookup.m (original)
+++ cfe/branches/tooling/test/SemaObjC/ivar-lookup.m Thu Dec 15 05:54:03 2011
@@ -29,7 +29,7 @@
 
 @implementation A
 - (int*)method {
-  int *ip = [Ivar method]; // expected-warning{{warning: incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
+  int *ip = [Ivar method]; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
                            // Note that there is no warning in Objective-C++
   return 0;
 }

Modified: cfe/branches/tooling/test/SemaObjC/method-bad-param.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/method-bad-param.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/method-bad-param.m (original)
+++ cfe/branches/tooling/test/SemaObjC/method-bad-param.m Thu Dec 15 05:54:03 2011
@@ -7,21 +7,21 @@
 @end
 
 @interface bar
--(void) my_method:(foo) my_param; // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
-- (foo)cccccc:(long)ddddd;  // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
+-(void) my_method:(foo) my_param; // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
+- (foo)cccccc:(long)ddddd;  // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
 @end
 
 @implementation bar
--(void) my_method:(foo) my_param  // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
+-(void) my_method:(foo) my_param  // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
 {
 }
-- (foo)cccccc:(long)ddddd // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
+- (foo)cccccc:(long)ddddd // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
 {
 }
 @end
 
-void somefunc(foo x) {} // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
-foo somefunc2() {} // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
+void somefunc(foo x) {} // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
+foo somefunc2() {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
 
 // rdar://6780761
 void f0(foo *a0) {

Modified: cfe/branches/tooling/test/SemaObjC/method-not-defined.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/method-not-defined.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/method-not-defined.m (original)
+++ cfe/branches/tooling/test/SemaObjC/method-not-defined.m Thu Dec 15 05:54:03 2011
@@ -9,5 +9,5 @@
 
   [[Foo alloc] init]; // expected-warning {{class method '+alloc' not found (return type defaults to 'id')}} expected-warning {{instance method '-init' not found (return type defaults to 'id')}}
   [fooObj notdefined]; // expected-warning {{instance method '-notdefined' not found (return type defaults to 'id')}}
-  [obj whatever:1 :2 :3]; // expected-warning {{instance method '-whatever:::' not found (return type defaults to 'id'))}}
+  [obj whatever:1 :2 :3]; // expected-warning {{instance method '-whatever:::' not found (return type defaults to 'id')}}
 }

Modified: cfe/branches/tooling/test/SemaObjC/method-undef-category-warn-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/method-undef-category-warn-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/method-undef-category-warn-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/method-undef-category-warn-1.m Thu Dec 15 05:54:03 2011
@@ -4,8 +4,8 @@
 @end
 
 @protocol P
-- (void) Pmeth;	  // expected-note {{method declared here }}
-- (void) Pmeth1;    // expected-note {{method declared here }}
+- (void) Pmeth;	  // expected-note {{method declared here}}
+- (void) Pmeth1;    // expected-note {{method declared here}}
 @end
 
 @interface MyClass1(CAT) <P> // expected-note {{required for direct or indirect protocol 'P'}}
@@ -13,7 +13,7 @@
 @end
 
 @implementation MyClass1(CAT) // expected-warning {{incomplete implementation}}  \
-				// expected-warning {{method in protocol not implemented [-Wprotocol]}}
+				// expected-warning {{method in protocol not implemented}}
 - (void) Pmeth1{}
 @end
 
@@ -22,7 +22,7 @@
 @end
 
 @implementation MyClass1(DOG) // expected-warning {{incomplete implementation}} \
-		// expected-warning {{method in protocol not implemented [-Wprotocol]}}
+		// expected-warning {{method in protocol not implemented}}
 - (void) Pmeth {}
 @end
 

Modified: cfe/branches/tooling/test/SemaObjC/method-undef-extension-warn-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/method-undef-extension-warn-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/method-undef-extension-warn-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/method-undef-extension-warn-1.m Thu Dec 15 05:54:03 2011
@@ -19,6 +19,6 @@
 @end
 
 @implementation MyClass // expected-warning {{incomplete implementation}}  \
-			// expected-warning {{method in protocol not implemented [-Wprotocol]}}
+			// expected-warning {{method in protocol not implemented}}
 - (void)Pmeth {}
 @end

Modified: cfe/branches/tooling/test/SemaObjC/missing-method-return-type.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/missing-method-return-type.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/missing-method-return-type.m (original)
+++ cfe/branches/tooling/test/SemaObjC/missing-method-return-type.m Thu Dec 15 05:54:03 2011
@@ -2,10 +2,10 @@
 // rdar://9615045
 
 @interface I
--  initWithFoo:(id)foo; // expected-warning {{method has no return type specified; defaults to 'id' [-Wmissing-method-return-type]}}
+-  initWithFoo:(id)foo; // expected-warning {{method has no return type specified; defaults to 'id'}}
 @end
 
 @implementation I
-- initWithFoo:(id)foo { return 0; } // expected-warning {{method has no return type specified; defaults to 'id' [-Wmissing-method-return-type]}}
+- initWithFoo:(id)foo { return 0; } // expected-warning {{method has no return type specified; defaults to 'id'}}
 @end
 

Modified: cfe/branches/tooling/test/SemaObjC/no-protocol-option-tests.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/no-protocol-option-tests.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/no-protocol-option-tests.m (original)
+++ cfe/branches/tooling/test/SemaObjC/no-protocol-option-tests.m Thu Dec 15 05:54:03 2011
@@ -17,7 +17,7 @@
 // Test2
 @interface super - PMeth; @end
 @interface J : super <P>
-- PMeth;	// expected-note {{ method definition for 'PMeth' not found}}
+- PMeth;	// expected-note {{method definition for 'PMeth' not found}}
 @end
 @implementation J @end	// expected-warning {{incomplete implementation}}
 

Modified: cfe/branches/tooling/test/SemaObjC/property-9.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/property-9.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/property-9.m (original)
+++ cfe/branches/tooling/test/SemaObjC/property-9.m Thu Dec 15 05:54:03 2011
@@ -51,14 +51,14 @@
 
 // test parser recovery: rdar://6254579
 @property (                           // expected-note {{to match this '('}}
-           readonly getter=isAwesome) // expected-error {{error: expected ')'}}
+           readonly getter=isAwesome) // expected-error {{expected ')'}}
            
   int _awesome;
 @property (readonlyx) // expected-error {{unknown property attribute 'readonlyx'}}
   int _awesome2;
 
 @property (    // expected-note {{to match this '('}}
-           +)  // expected-error {{error: expected ')'}}
+           +)  // expected-error {{expected ')'}}
            
   int _awesome3;
 

Modified: cfe/branches/tooling/test/SemaObjC/property-lookup-in-id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/property-lookup-in-id.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/property-lookup-in-id.m (original)
+++ cfe/branches/tooling/test/SemaObjC/property-lookup-in-id.m Thu Dec 15 05:54:03 2011
@@ -25,7 +25,7 @@
 
 - (void)startFSEventGathering:(id)sender
 {
-  fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{warning: instance method '-delegate' not found (return type defaults to 'id')}} \
+  fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{instance method '-delegate' not found (return type defaults to 'id')}} \
                                                   // expected-error {{property 'fsEventStream' not found on object of type 'id'}}
 
 }

Modified: cfe/branches/tooling/test/SemaObjC/scope-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/scope-check.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/scope-check.m (original)
+++ cfe/branches/tooling/test/SemaObjC/scope-check.m Thu Dec 15 05:54:03 2011
@@ -3,9 +3,9 @@
 @class A, B, C;
 
 void test1() {
-  goto L; // expected-error{{illegal goto into protected scope}}
-  goto L2; // expected-error{{illegal goto into protected scope}}
-  goto L3; // expected-error{{illegal goto into protected scope}}
+  goto L; // expected-error{{goto into protected scope}}
+  goto L2; // expected-error{{goto into protected scope}}
+  goto L3; // expected-error{{goto into protected scope}}
   @try {   // expected-note {{jump bypasses initialization of @try block}}
 L: ;
   } @catch (A *x) { // expected-note {{jump bypasses initialization of @catch block}}
@@ -17,11 +17,11 @@
   }
   
   @try {
-    goto L4; // expected-error{{illegal goto into protected scope}}
-    goto L5; // expected-error{{illegal goto into protected scope}}
+    goto L4; // expected-error{{goto into protected scope}}
+    goto L5; // expected-error{{goto into protected scope}}
   } @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
   L5: ;
-    goto L6; // expected-error{{illegal goto into protected scope}}
+    goto L6; // expected-error{{goto into protected scope}}
   } @catch (B *c) { // expected-note {{jump bypasses initialization of @catch block}}
   L6: ;
   } @finally { // expected-note {{jump bypasses initialization of @finally block}}
@@ -32,12 +32,12 @@
   @try { // expected-note 2 {{jump bypasses initialization of @try block}}
   L7: ;
   } @catch (C *c) {
-    goto L7; // expected-error{{illegal goto into protected scope}}
+    goto L7; // expected-error{{goto into protected scope}}
   } @finally {
-    goto L7; // expected-error{{illegal goto into protected scope}}
+    goto L7; // expected-error{{goto into protected scope}}
   }
   
-  goto L8;  // expected-error{{illegal goto into protected scope}}
+  goto L8;  // expected-error{{goto into protected scope}}
   @try { 
   } @catch (A *c) {
   } @catch (B *c) {
@@ -47,7 +47,7 @@
   
   // rdar://6810106
   id X;
-  goto L9;    // expected-error{{illegal goto into protected scope}}
+  goto L9;    // expected-error{{goto into protected scope}}
   goto L10;   // ok
   @synchronized    // expected-note {{jump bypasses initialization of @synchronized block}}
   ( ({ L10: ; X; })) {
@@ -79,7 +79,7 @@
 + (void) hello {
 
   @try {
-    goto blargh;     // expected-error {{illegal goto into protected scope}}
+    goto blargh;     // expected-error {{goto into protected scope}}
   } @catch (...) {   // expected-note {{jump bypasses initialization of @catch block}}
   blargh: ;
   }
@@ -87,14 +87,14 @@
 
 + (void)meth2 {
     int n; void *P;
-    goto L0;     // expected-error {{illegal goto into protected scope}}
+    goto L0;     // expected-error {{goto into protected scope}}
     typedef int A[n];  // expected-note {{jump bypasses initialization of VLA typedef}}
   L0:
     
-    goto L1;      // expected-error {{illegal goto into protected scope}}
+    goto L1;      // expected-error {{goto into protected scope}}
     A b, c[10];        // expected-note 2 {{jump bypasses initialization of variable length array}}
   L1:
-    goto L2;     // expected-error {{illegal goto into protected scope}}
+    goto L2;     // expected-error {{goto into protected scope}}
     A d[n];      // expected-note {{jump bypasses initialization of variable length array}}
   L2:
     return;

Modified: cfe/branches/tooling/test/SemaObjC/special-dep-unavail-warning.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/special-dep-unavail-warning.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/special-dep-unavail-warning.m (original)
+++ cfe/branches/tooling/test/SemaObjC/special-dep-unavail-warning.m Thu Dec 15 05:54:03 2011
@@ -50,6 +50,6 @@
 @end
 
 void foo() {
-  [DEPRECATED new]; // expected-warning {{warning: 'DEPRECATED' is deprecated}}
+  [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}}
 }
 

Modified: cfe/branches/tooling/test/SemaObjC/super.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/super.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/super.m (original)
+++ cfe/branches/tooling/test/SemaObjC/super.m Thu Dec 15 05:54:03 2011
@@ -21,7 +21,7 @@
 @implementation B
 
 - (void)instanceMethod {
-  [super iMethod]; // expected-warning{{'A' may not respond to 'iMethod')}}
+  [super iMethod]; // expected-warning{{'A' may not respond to 'iMethod'}}
   
   // Use of super in a block is ok and does codegen to the right thing.
   // rdar://7852959

Modified: cfe/branches/tooling/test/SemaObjC/try-catch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/try-catch.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/try-catch.m (original)
+++ cfe/branches/tooling/test/SemaObjC/try-catch.m Thu Dec 15 05:54:03 2011
@@ -40,7 +40,7 @@
 int foo() {
   struct s { int a, b; } agg, *pagg;
 
-  @throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid))}}
+  @throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}}
   @throw agg; // expected-error {{@throw requires an Objective-C object type ('struct s' invalid)}}
   @throw pagg; // expected-error {{@throw requires an Objective-C object type ('struct s *' invalid)}}
   @throw; // expected-error {{@throw (rethrow) used outside of a @catch block}}

Modified: cfe/branches/tooling/test/SemaObjC/undef-protocol-methods-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/undef-protocol-methods-1.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/undef-protocol-methods-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/undef-protocol-methods-1.m Thu Dec 15 05:54:03 2011
@@ -29,7 +29,7 @@
 @end
 
 @implementation INTF   // expected-warning {{incomplete implementation}} \
-                       // expected-warning 9 {{method in protocol not implemented [-Wprotocol}}
+                       // expected-warning 9 {{method in protocol not implemented}}
 - (void) DefP1proto{}
 
 + (void) DefClsP3Proto{}

Modified: cfe/branches/tooling/test/SemaObjC/unknown-anytype.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/unknown-anytype.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/unknown-anytype.m (original)
+++ cfe/branches/tooling/test/SemaObjC/unknown-anytype.m Thu Dec 15 05:54:03 2011
@@ -17,8 +17,13 @@
   int *ip = [test0 getIntPtr];
   float *fp = [test1() getFloatPtr];
   double *dp = [test1() getSomePtr]; // okay: picks first method found
-  [[test0 unknownMethod] otherUnknownMethod]; // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+  [[test0 unknownMethod] otherUnknownMethod]; 
   (void)(int)[[test0 unknownMethod] otherUnknownMethod];;
-  [[test1() unknownMethod] otherUnknownMethod]; // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+  [[test1() unknownMethod] otherUnknownMethod];
   (void)(id)[[test1() unknownMethod] otherUnknownMethod];
+
+  if ([[test0 unknownMethod] otherUnknownMethod]) { // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+  }
+  if ([[test1() unknownMethod] otherUnknownMethod]) { // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+  }
 }

Modified: cfe/branches/tooling/test/SemaObjC/warn-implicit-atomic-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/warn-implicit-atomic-property.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/warn-implicit-atomic-property.m (original)
+++ cfe/branches/tooling/test/SemaObjC/warn-implicit-atomic-property.m Thu Dec 15 05:54:03 2011
@@ -8,6 +8,6 @@
 @property int P3; // expected-note {{property declared here}}
 @end
 
- at implementation Super // expected-warning {{property is assumed atomic when auto-synthesizing the property [-Wimplicit-atomic-properties]}}
- at synthesize P,P1,P2; // expected-warning {{property is assumed atomic by default [-Wimplicit-atomic-properties]}}
+ at implementation Super // expected-warning {{property is assumed atomic when auto-synthesizing the property}}
+ at synthesize P,P1,P2; // expected-warning {{property is assumed atomic by default}}
 @end

Modified: cfe/branches/tooling/test/SemaObjC/warn-strict-selector-match.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/warn-strict-selector-match.m?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/warn-strict-selector-match.m (original)
+++ cfe/branches/tooling/test/SemaObjC/warn-strict-selector-match.m Thu Dec 15 05:54:03 2011
@@ -8,7 +8,7 @@
 -(float) method;	// expected-note {{also found}}
 @end
 
-int main() { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found [-Wstrict-selector-match]}}
+int main() { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found}}
 
 @interface Object @end
 
@@ -24,7 +24,7 @@
   Object *obj = 0;
   id obj2 = obj;
   [obj setWindow:0]; 	// expected-warning {{Object' may not respond to 'setWindow:'}}
-  [obj2 setWindow:0]; // expected-warning {{multiple methods named 'setWindow:' found [-Wstrict-selector-match]}}
+  [obj2 setWindow:0]; // expected-warning {{multiple methods named 'setWindow:' found}}
   return obj;
 }
 
@@ -54,7 +54,7 @@
 }
 + (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data
 {
-    NTGridDataObject *result = [(id)0 initWithData:data]; // expected-warning {{multiple methods named 'initWithData:' found [-Wstrict-selector-match]}} \
+    NTGridDataObject *result = [(id)0 initWithData:data]; // expected-warning {{multiple methods named 'initWithData:' found}} \
     expected-warning {{sending 'id<MyObject,MyCoding>' to parameter of incompatible type 'Object *'}}
     return result;
 }

Modified: cfe/branches/tooling/test/SemaObjCXX/unknown-anytype.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/unknown-anytype.mm?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/unknown-anytype.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/unknown-anytype.mm Thu Dec 15 05:54:03 2011
@@ -3,6 +3,7 @@
 // rdar://problem/9416370
 namespace test0 {
   void test(id x) {
-    [x foo]; // expected-error {{no known method '-foo'; cast the message send to the method's return type}}
+    if ([x foo]) {} // expected-error {{no known method '-foo'; cast the message send to the method's return type}}
+    [x foo];
   }
 }

Modified: cfe/branches/tooling/test/SemaObjCXX/warn-strict-selector-match.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/warn-strict-selector-match.mm?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/warn-strict-selector-match.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/warn-strict-selector-match.mm Thu Dec 15 05:54:03 2011
@@ -13,6 +13,6 @@
 void foo(void) {
   id r;
 
-  [r meth1:r];	// expected-warning {{multiple methods named 'meth1:' found [-Wstrict-selector-match]}}
-  [r window]; 	// expected-warning {{multiple methods named 'window' found [-Wstrict-selector-match]}}
+  [r meth1:r];	// expected-warning {{multiple methods named 'meth1:' found}}
+  [r window]; 	// expected-warning {{multiple methods named 'window' found}}
 }

Modified: cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp Thu Dec 15 05:54:03 2011
@@ -94,6 +94,6 @@
 
   template<typename,typename>
   struct basic_streambuf{friend bob<>()}; // expected-error{{unknown type name 'bob'}} \
-  // expected-error{{ expected member name or ';' after declaration specifiers}}
+  // expected-error{{expected member name or ';' after declaration specifiers}}
   template struct basic_streambuf<int>;
 }

Modified: cfe/branches/tooling/test/SemaTemplate/friend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/friend.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/friend.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/friend.cpp Thu Dec 15 05:54:03 2011
@@ -28,6 +28,6 @@
   template <class T>
   void f() {
     friend class f; // expected-error{{'friend' used outside of class}}
-    friend class f1; // expected-error{{ 'friend' used outside of class}}
+    friend class f1; // expected-error{{'friend' used outside of class}}
   }
 }

Modified: cfe/branches/tooling/test/SemaTemplate/instantiate-expr-5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/instantiate-expr-5.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/instantiate-expr-5.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/instantiate-expr-5.cpp Thu Dec 15 05:54:03 2011
@@ -6,7 +6,7 @@
 namespace PR5880 {
   template<typename T>
   struct A { 
-    static const int a  = __builtin_offsetof(T, a.array[5].m); // expected-error{{error: no member named 'a' in 'HasM'}}
+    static const int a  = __builtin_offsetof(T, a.array[5].m); // expected-error{{no member named 'a' in 'HasM'}}
   };
   struct HasM {
     float m;

Modified: cfe/branches/tooling/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/c-index-test/c-index-test.c?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/tools/c-index-test/c-index-test.c (original)
+++ cfe/branches/tooling/tools/c-index-test/c-index-test.c Thu Dec 15 05:54:03 2011
@@ -1684,6 +1684,7 @@
                             const CXIdxEntityInfo *info) {
   const char *name;
   IndexData *index_data;
+  unsigned i;
   index_data = (IndexData *)client_data;
   printCheck(index_data);
 
@@ -1701,6 +1702,12 @@
   printf(" | name: %s", name);
   printf(" | USR: %s", info->USR);
   printf(" | lang: %s", getEntityLanguageString(info->lang));
+
+  for (i = 0; i != info->numAttributes; ++i) {
+    const CXIdxAttrInfo *Attr = info->attributes[i];
+    printf("     <attribute>: ");
+    PrintCursor(Attr->cursor);
+  }
 }
 
 static void printBaseClassInfo(CXClientData client_data,

Modified: cfe/branches/tooling/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndex.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndex.cpp Thu Dec 15 05:54:03 2011
@@ -2336,6 +2336,13 @@
 static llvm::sys::Mutex EnableMultithreadingMutex;
 static bool EnabledMultithreading;
 
+static void fatal_error_handler(void *user_data, const std::string& reason) {
+  // Write the result out to stderr avoiding errs() because raw_ostreams can
+  // call report_fatal_error.
+  fprintf(stderr, "LIBCLANG FATAL ERROR: %s\n", reason.c_str());
+  ::abort();
+}
+
 extern "C" {
 CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
                           int displayDiagnostics) {
@@ -2351,6 +2358,7 @@
   {
     llvm::sys::ScopedLock L(EnableMultithreadingMutex);
     if (!EnabledMultithreading) {
+      llvm::install_fatal_error_handler(fatal_error_handler, 0);
       llvm::llvm_start_multithreaded();
       EnabledMultithreading = true;
     }

Modified: cfe/branches/tooling/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexingContext.cpp?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexingContext.cpp (original)
+++ cfe/branches/tooling/tools/libclang/IndexingContext.cpp Thu Dec 15 05:54:03 2011
@@ -22,7 +22,7 @@
 IndexingContext::ObjCProtocolListInfo::ObjCProtocolListInfo(
                                     const ObjCProtocolList &ProtList,
                                     IndexingContext &IdxCtx,
-                                    StrAdapter &SA) {
+                                    ScratchAlloc &SA) {
   ObjCInterfaceDecl::protocol_loc_iterator LI = ProtList.loc_begin();
   for (ObjCInterfaceDecl::protocol_iterator
          I = ProtList.begin(), E = ProtList.end(); I != E; ++I, ++LI) {
@@ -34,6 +34,9 @@
                                 MakeCursorObjCProtocolRef(PD, Loc, IdxCtx.CXTU),
                                 IdxCtx.getIndexLoc(Loc) };
     ProtInfos.push_back(ProtInfo);
+
+    if (IdxCtx.suppressRefs())
+      IdxCtx.markEntityOccurrenceInFile(PD, Loc);
   }
 
   for (unsigned i = 0, e = ProtInfos.size(); i != e; ++i)
@@ -43,9 +46,27 @@
     Prots.push_back(&ProtInfos[i]);
 }
 
-IndexingContext::AttrListInfo::AttrListInfo(const Decl *D,
-                                            IndexingContext &IdxCtx,
-                                            StrAdapter &SA) {
+
+IBOutletCollectionInfo::IBOutletCollectionInfo(
+                                          const IBOutletCollectionInfo &other)
+  : AttrInfo(CXIdxAttr_IBOutletCollection, other.cursor, other.loc, A) {
+
+  IBCollInfo.attrInfo = this;
+  IBCollInfo.classCursor = other.IBCollInfo.classCursor;
+  IBCollInfo.classLoc = other.IBCollInfo.classLoc;
+  if (other.IBCollInfo.objcClass) {
+    ClassInfo = other.ClassInfo;
+    IBCollInfo.objcClass = &ClassInfo;
+  } else
+    IBCollInfo.objcClass = 0;
+}
+
+AttrListInfo::AttrListInfo(const Decl *D,
+                           IndexingContext &IdxCtx,
+                           ScratchAlloc &SA) : ref_cnt(0) {
+  if (!D->hasAttrs())
+    return;
+
   for (AttrVec::const_iterator AttrI = D->attr_begin(), AttrE = D->attr_end();
          AttrI != AttrE; ++AttrI) {
     const Attr *A = *AttrI;
@@ -92,9 +113,24 @@
     CXAttrs.push_back(&Attrs[i]);
 }
 
+AttrListInfo::AttrListInfo(const AttrListInfo &other) {
+  assert(other.ref_cnt == 0 &&
+         "Should not copy an AttrListInfo that is ref-counted");
+  ref_cnt = 0;
+
+  Attrs = other.Attrs;
+  IBCollAttrs = other.IBCollAttrs;
+
+  for (unsigned i = 0, e = IBCollAttrs.size(); i != e; ++i)
+    CXAttrs.push_back(&IBCollAttrs[i]);
+
+  for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
+    CXAttrs.push_back(&Attrs[i]);
+}
+
 IndexingContext::CXXBasesListInfo::CXXBasesListInfo(const CXXRecordDecl *D,
                                    IndexingContext &IdxCtx,
-                                   IndexingContext::StrAdapter &SA) {
+                                   ScratchAlloc &SA) {
   for (CXXRecordDecl::base_class_const_iterator
          I = D->bases_begin(), E = D->bases_end(); I != E; ++I) {
     const CXXBaseSpecifier &Base = *I;
@@ -152,7 +188,7 @@
   return Loc;
 }
 
-const char *IndexingContext::StrAdapter::toCStr(StringRef Str) {
+const char *ScratchAlloc::toCStr(StringRef Str) {
   if (Str.empty())
     return "";
   if (Str.data()[Str.size()] == '\0')
@@ -160,7 +196,7 @@
   return copyCStr(Str);
 }
 
-const char *IndexingContext::StrAdapter::copyCStr(StringRef Str) {
+const char *ScratchAlloc::copyCStr(StringRef Str) {
   char *buf = IdxCtx.StrScratch.Allocate<char>(Str.size() + 1);
   std::uninitialized_copy(Str.begin(), Str.end(), buf);
   buf[Str.size()] = '\0';
@@ -192,7 +228,7 @@
   if (!CB.ppIncludedFile)
     return;
 
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
   CXIdxIncludedFileInfo Info = { getIndexLoc(hashLoc),
                                  SA.toCStr(filename),
                                  (CXFile)File,
@@ -223,7 +259,7 @@
   if (D->isImplicit() && shouldIgnoreIfImplicit(D))
     return false;
 
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
   getEntityInfo(D, DInfo.EntInfo, SA);
   if (!DInfo.EntInfo.USR || Loc.isInvalid())
     return false;
@@ -317,7 +353,7 @@
 }
 
 bool IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) {
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
 
   CXIdxBaseClassInfo BaseClass;
   EntityInfo BaseEntity;
@@ -328,9 +364,15 @@
     BaseClass.base = &BaseEntity;
     BaseClass.cursor = MakeCursorObjCSuperClassRef(SuperD, SuperLoc, CXTU);
     BaseClass.loc = getIndexLoc(SuperLoc);
+
+    if (suppressRefs())
+      markEntityOccurrenceInFile(SuperD, SuperLoc);
   }
   
-  ObjCProtocolListInfo ProtInfo(D->getReferencedProtocols(), *this, SA);
+  ObjCProtocolList EmptyProtoList;
+  ObjCProtocolListInfo ProtInfo(D->hasDefinition()? D->getReferencedProtocols()
+                                                  : EmptyProtoList, 
+                                *this, SA);
   
   ObjCInterfaceDeclInfo InterInfo(D);
   InterInfo.ObjCProtoListInfo = ProtInfo.getListInfo();
@@ -360,7 +402,7 @@
 }
 
 bool IndexingContext::handleObjCProtocol(const ObjCProtocolDecl *D) {
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
   ObjCProtocolListInfo ProtListInfo(D->getReferencedProtocols(), *this, SA);
   
   ObjCProtocolDeclInfo ProtInfo(D);
@@ -372,7 +414,7 @@
 bool IndexingContext::handleObjCCategory(const ObjCCategoryDecl *D) {
   ObjCCategoryDeclInfo CatDInfo(/*isImplementation=*/false);
   EntityInfo ClassEntity;
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
   const ObjCInterfaceDecl *IFaceD = D->getClassInterface();
   SourceLocation ClassLoc = D->getLocation();
   SourceLocation CategoryLoc = D->IsClassExtension() ? ClassLoc
@@ -404,7 +446,7 @@
   const ObjCCategoryDecl *CatD = D->getCategoryDecl();
   ObjCCategoryDeclInfo CatDInfo(/*isImplementation=*/true);
   EntityInfo ClassEntity;
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
   const ObjCInterfaceDecl *IFaceD = CatD->getClassInterface();
   SourceLocation ClassLoc = D->getLocation();
   SourceLocation CategoryLoc = D->getCategoryNameLoc();
@@ -513,7 +555,7 @@
       return false; // already occurred.
   }
 
-  StrAdapter SA(*this);
+  ScratchAlloc SA(*this);
   EntityInfo RefEntity, ParentEntity;
   getEntityInfo(D, RefEntity, SA);
   if (!RefEntity.USR)
@@ -580,7 +622,7 @@
 bool IndexingContext::handleCXXRecordDecl(const CXXRecordDecl *RD,
                                           const NamedDecl *OrigD) {
   if (RD->isThisDeclarationADefinition()) {
-    StrAdapter SA(*this);
+    ScratchAlloc SA(*this);
     CXXClassDeclInfo CXXDInfo(/*isRedeclaration=*/!OrigD->isCanonicalDecl(),
                            /*isDefinition=*/RD->isThisDeclarationADefinition());
     CXXBasesListInfo BaseList(RD, *this, SA);
@@ -725,7 +767,7 @@
 
 void IndexingContext::getEntityInfo(const NamedDecl *D,
                                     EntityInfo &EntityInfo,
-                                    StrAdapter &SA) {
+                                    ScratchAlloc &SA) {
   if (!D)
     return;
 
@@ -737,6 +779,14 @@
   EntityInfo.templateKind = CXIdxEntity_NonTemplate;
   EntityInfo.lang = CXIdxEntityLang_C;
 
+  if (D->hasAttrs()) {
+    AttrListInfo *attrs = SA.allocate<AttrListInfo>();
+    new (attrs) AttrListInfo(D, *this, SA);
+    EntityInfo.AttrList = attrs;
+    EntityInfo.attributes = attrs->getAttrs();
+    EntityInfo.numAttributes = attrs->getNumAttrs();
+  }
+
   if (const TagDecl *TD = dyn_cast<TagDecl>(D)) {
     switch (TD->getTagKind()) {
     case TTK_Struct:

Modified: cfe/branches/tooling/tools/libclang/IndexingContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexingContext.h?rev=146654&r1=146653&r2=146654&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexingContext.h (original)
+++ cfe/branches/tooling/tools/libclang/IndexingContext.h Thu Dec 15 05:54:03 2011
@@ -24,13 +24,18 @@
 
 namespace cxindex {
   class IndexingContext;
+  class ScratchAlloc;
+  class AttrListInfo;
 
 struct EntityInfo : public CXIdxEntityInfo {
   const NamedDecl *Dcl;
   IndexingContext *IndexCtx;
+  llvm::IntrusiveRefCntPtr<AttrListInfo> AttrList;
 
   EntityInfo() {
     name = USR = 0;
+    attributes = 0;
+    numAttributes = 0;
   }
 };
 
@@ -195,14 +200,49 @@
   IBOutletCollectionInfo(CXCursor C, CXIdxLoc Loc, const Attr *A) :
     AttrInfo(CXIdxAttr_IBOutletCollection, C, Loc, A) {
     assert(C.kind == CXCursor_IBOutletCollectionAttr);
+    IBCollInfo.objcClass = 0;
   }
 
+  IBOutletCollectionInfo(const IBOutletCollectionInfo &other);
+
   static bool classof(const AttrInfo *A) {
     return A->kind == CXIdxAttr_IBOutletCollection;
   }
   static bool classof(const IBOutletCollectionInfo *D) { return true; }
 };
 
+class AttrListInfo {
+  SmallVector<AttrInfo, 2> Attrs;
+  SmallVector<IBOutletCollectionInfo, 2> IBCollAttrs;
+  SmallVector<CXIdxAttrInfo *, 2> CXAttrs;
+  unsigned ref_cnt;
+
+public:
+  AttrListInfo(const Decl *D,
+               IndexingContext &IdxCtx,
+               ScratchAlloc &SA);
+  AttrListInfo(const AttrListInfo &other);
+
+  const CXIdxAttrInfo *const *getAttrs() const {
+    if (CXAttrs.empty())
+      return 0;
+    return CXAttrs.data();
+  }
+  unsigned getNumAttrs() const { return (unsigned)CXAttrs.size(); }
+
+  /// \brief Retain/Release only useful when we allocate a AttrListInfo from the
+  /// BumpPtrAllocator, and not from the stack; so that we keep a pointer
+  // in the EntityInfo
+  void Retain() { ++ref_cnt; }
+  void Release() {
+    assert (ref_cnt > 0 && "Reference count is already zero.");
+    if (--ref_cnt == 0) {
+      // Memory is allocated from a BumpPtrAllocator, no need to delete it.
+      this->~AttrListInfo();
+    }
+  }
+};
+
 struct RefFileOccurence {
   const FileEntry *File;
   const Decl *Dcl;
@@ -233,24 +273,7 @@
   
   llvm::BumpPtrAllocator StrScratch;
   unsigned StrAdapterCount;
-
-  class StrAdapter {
-    IndexingContext &IdxCtx;
-
-  public:
-    StrAdapter(IndexingContext &indexCtx) : IdxCtx(indexCtx) {
-      ++IdxCtx.StrAdapterCount;
-    }
-
-    ~StrAdapter() {
-      --IdxCtx.StrAdapterCount;
-      if (IdxCtx.StrAdapterCount == 0)
-        IdxCtx.StrScratch.Reset();
-    }
-
-    const char *toCStr(StringRef Str);
-    const char *copyCStr(StringRef Str);
-  };
+  friend class ScratchAlloc;
 
   struct ObjCProtocolListInfo {
     SmallVector<CXIdxObjCProtocolRefInfo, 4> ProtInfos;
@@ -265,22 +288,7 @@
 
     ObjCProtocolListInfo(const ObjCProtocolList &ProtList,
                          IndexingContext &IdxCtx,
-                         IndexingContext::StrAdapter &SA);
-  };
-
-  struct AttrListInfo {
-    SmallVector<AttrInfo, 2> Attrs;
-    SmallVector<IBOutletCollectionInfo, 2> IBCollAttrs;
-    SmallVector<CXIdxAttrInfo *, 2> CXAttrs;
-
-    const CXIdxAttrInfo *const *getAttrs() const {
-      return CXAttrs.data();
-    }
-    unsigned getNumAttrs() const { return (unsigned)CXAttrs.size(); }
-
-    AttrListInfo(const Decl *D,
-                 IndexingContext &IdxCtx,
-                 IndexingContext::StrAdapter &SA);
+                         ScratchAlloc &SA);
   };
 
   struct CXXBasesListInfo {
@@ -294,12 +302,14 @@
     unsigned getNumBases() const { return (unsigned)CXBases.size(); }
 
     CXXBasesListInfo(const CXXRecordDecl *D,
-                     IndexingContext &IdxCtx, IndexingContext::StrAdapter &SA);
+                     IndexingContext &IdxCtx, ScratchAlloc &SA);
 
   private:
     SourceLocation getBaseLoc(const CXXBaseSpecifier &Base) const;
   };
 
+  friend class AttrListInfo;
+
 public:
   IndexingContext(CXClientData clientData, IndexerCallbacks &indexCallbacks,
                   unsigned indexOptions, CXTranslationUnit cxTU)
@@ -440,7 +450,7 @@
 
   void getEntityInfo(const NamedDecl *D,
                      EntityInfo &EntityInfo,
-                     StrAdapter &SA);
+                     ScratchAlloc &SA);
 
   void getContainerInfo(const DeclContext *DC, ContainerInfo &ContInfo);
 
@@ -453,6 +463,29 @@
   static bool shouldIgnoreIfImplicit(const NamedDecl *D);
 };
 
+class ScratchAlloc {
+  IndexingContext &IdxCtx;
+
+public:
+  explicit ScratchAlloc(IndexingContext &indexCtx) : IdxCtx(indexCtx) {
+    ++IdxCtx.StrAdapterCount;
+  }
+
+  ~ScratchAlloc() {
+    --IdxCtx.StrAdapterCount;
+    if (IdxCtx.StrAdapterCount == 0)
+      IdxCtx.StrScratch.Reset();
+  }
+
+  const char *toCStr(StringRef Str);
+  const char *copyCStr(StringRef Str);
+
+  template <typename T>
+  T *allocate() {
+    return IdxCtx.StrScratch.Allocate<T>();
+  }
+};
+
 }} // end clang::cxindex
 
 namespace llvm {





More information about the llvm-branch-commits mailing list