r328688 - Fix some handling of AST nodes with diagnostics.

Richard Trieu via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 21:16:14 PDT 2018


Author: rtrieu
Date: Tue Mar 27 21:16:13 2018
New Revision: 328688

URL: http://llvm.org/viewvc/llvm-project?rev=328688&view=rev
Log:
Fix some handling of AST nodes with diagnostics.

The diagnostic system for Clang can already handle many AST nodes.  Instead
of converting them to strings first, just hand the AST node directly to
the diagnostic system and let it handle the output.  Minor changes in some
diagnostic output.


Modified:
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp
    cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
    cfe/trunk/lib/Sema/SemaCUDA.cpp
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp
    cfe/trunk/lib/Sema/TreeTransform.h
    cfe/trunk/test/Preprocessor/has_include.c
    cfe/trunk/test/Sema/warn-duplicate-enum.c
    cfe/trunk/test/SemaCUDA/function-overload.cu
    cfe/trunk/test/SemaCUDA/kernel-call.cu
    cfe/trunk/test/SemaCXX/ms-interface.cpp
    cfe/trunk/test/SemaCXX/typo-correction.cpp
    cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp
    cfe/trunk/test/SemaObjC/comptypes-legal.m
    cfe/trunk/test/SemaObjC/protocol-expr-neg-1.m
    cfe/trunk/test/SemaTemplate/warn-thread-safety-analysis.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Mar 27 21:16:13 2018
@@ -575,7 +575,7 @@ def err_cxx11_attribute_forbids_argument
 def err_attribute_requires_arguments : Error<
   "parentheses must be omitted if %0 attribute's argument list is empty">;
 def err_cxx11_attribute_forbids_ellipsis : Error<
-  "attribute '%0' cannot be used as an attribute pack">;
+  "attribute %0 cannot be used as an attribute pack">;
 def err_cxx11_attribute_repeated : Error<
   "attribute %0 cannot appear multiple times in an attribute specifier">;
 def warn_cxx14_compat_using_attribute_ns : Warning<

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Mar 27 21:16:13 2018
@@ -1329,7 +1329,7 @@ def err_invalid_member_in_interface : Er
           "nested class }0%1 is not permitted within an interface type">;
 def err_invalid_base_in_interface : Error<
   "interface type cannot inherit from "
-  "%select{'struct|non-public 'interface|'class}0 %1'">;
+  "%select{struct|non-public interface|class}0 %1">;
 
 def err_abstract_type_in_decl : Error<
   "%select{return|parameter|variable|field|instance variable|"
@@ -1629,7 +1629,7 @@ def err_missing_default_ctor : Error<
   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
   "does not have a default constructor">;
 def note_due_to_dllexported_class : Note<
-  "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
+  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
 
 def err_illegal_union_or_anon_struct_member : Error<
   "%select{anonymous struct|union}0 member %1 has a non-trivial "
@@ -2986,11 +2986,11 @@ def warn_lock_exclusive_and_shared : War
 def note_lock_exclusive_and_shared : Note<
   "the other acquisition of %0 '%1' is here">;
 def warn_variable_requires_any_lock : Warning<
-  "%select{reading|writing}1 variable '%0' requires holding "
+  "%select{reading|writing}1 variable %0 requires holding "
   "%select{any mutex|any mutex exclusively}1">,
   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_var_deref_requires_any_lock : Warning<
-  "%select{reading|writing}1 the value pointed to by '%0' requires holding "
+  "%select{reading|writing}1 the value pointed to by %0 requires holding "
   "%select{any mutex|any mutex exclusively}1">,
   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_fun_excludes_mutex : Warning<
@@ -3014,25 +3014,25 @@ def warn_acquire_requires_negative_cap :
 
 // Thread safety warnings on pass by reference
 def warn_guarded_pass_by_reference : Warning<
-  "passing variable '%1' by reference requires holding %0 "
+  "passing variable %1 by reference requires holding %0 "
   "%select{'%2'|'%2' exclusively}3">,
   InGroup<ThreadSafetyReference>, DefaultIgnore;
 def warn_pt_guarded_pass_by_reference : Warning<
-  "passing the value that '%1' points to by reference requires holding %0 "
+  "passing the value that %1 points to by reference requires holding %0 "
   "%select{'%2'|'%2' exclusively}3">,
   InGroup<ThreadSafetyReference>, DefaultIgnore;
 
 // Imprecise thread safety warnings
 def warn_variable_requires_lock : Warning<
-  "%select{reading|writing}3 variable '%1' requires holding %0 "
+  "%select{reading|writing}3 variable %1 requires holding %0 "
   "%select{'%2'|'%2' exclusively}3">,
   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_var_deref_requires_lock : Warning<
-  "%select{reading|writing}3 the value pointed to by '%1' requires "
+  "%select{reading|writing}3 the value pointed to by %1 requires "
   "holding %0 %select{'%2'|'%2' exclusively}3">,
   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_fun_requires_lock : Warning<
-  "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
+  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 
 // Precise thread safety warnings
@@ -3050,7 +3050,7 @@ def note_found_mutex_near_match : Note<"
 // Verbose thread safety warnings
 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, 
   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
-def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
+def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
 
 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
@@ -6186,9 +6186,9 @@ def err_objc_object_catch : Error<
 def err_incomplete_type_objc_at_encode : Error<
   "'@encode' of incomplete type %0">;
 def warn_objc_circular_container : Warning<
-  "adding '%0' to '%1' might cause circular dependency in container">,
+  "adding %0 to %1 might cause circular dependency in container">,
   InGroup<DiagGroup<"objc-circular-container">>;
-def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
+def note_objc_circular_container_declared_here : Note<"%0 declared here">;
 def warn_objc_unsafe_perform_selector : Warning<
   "%0 is incompatible with selectors that return a "
   "%select{struct|union|vector}1 type">,
@@ -7137,7 +7137,7 @@ def err_va_arg_in_device : Error<
   "CUDA device code does not support va_arg">;
 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
-  "constexpr function '%0' without __host__ or __device__ attributes cannot "
+  "constexpr function %0 without __host__ or __device__ attributes cannot "
   "overload __device__ function with same signature.  Add a __host__ "
   "attribute, or build with -fno-cuda-host-device-constexpr.">;
 def note_cuda_conflicting_device_function_declared_here : Note<
@@ -9336,7 +9336,8 @@ def ext_warn_gnu_final : ExtWarn<
   InGroup<GccCompat>;
 
 def warn_shadow_field :
-  Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">,
+  Warning<"non-static data member %0 of %1 shadows member inherited from "
+  "type %2">,
   InGroup<ShadowField>, DefaultIgnore;
 def note_shadow_field : Note<"declared here">;
 

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue Mar 27 21:16:13 2018
@@ -1344,7 +1344,7 @@ static bool EvaluateHasIncludeCommon(Tok
 
   // These expressions are only allowed within a preprocessor directive.
   if (!PP.isParsingIfOrElifDirective()) {
-    PP.Diag(LParenLoc, diag::err_pp_directive_required) << II->getName();
+    PP.Diag(LParenLoc, diag::err_pp_directive_required) << II;
     // Return a valid identifier token.
     assert(Tok.is(tok::identifier));
     Tok.setIdentifierInfo(II);

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Tue Mar 27 21:16:13 2018
@@ -4036,7 +4036,7 @@ void Parser::ParseCXX11AttributeSpecifie
 
     if (TryConsumeToken(tok::ellipsis))
       Diag(Tok, diag::err_cxx11_attribute_forbids_ellipsis)
-        << AttrName->getName();
+        << AttrName;
   }
 
   if (ExpectAndConsume(tok::r_square))

Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Tue Mar 27 21:16:13 2018
@@ -1601,7 +1601,7 @@ class ThreadSafetyReporter : public clan
     if (Verbose && CurrentFunction) {
       PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(),
                                 S.PDiag(diag::note_thread_warning_in_fun)
-                                    << CurrentFunction->getNameAsString());
+                                    << CurrentFunction);
       return OptionalNotes(1, FNote);
     }
     return OptionalNotes();
@@ -1612,7 +1612,7 @@ class ThreadSafetyReporter : public clan
     if (Verbose && CurrentFunction) {
       PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(),
                                 S.PDiag(diag::note_thread_warning_in_fun)
-                                    << CurrentFunction->getNameAsString());
+                                    << CurrentFunction);
       ONS.push_back(std::move(FNote));
     }
     return ONS;
@@ -1626,7 +1626,7 @@ class ThreadSafetyReporter : public clan
     if (Verbose && CurrentFunction) {
       PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(),
                                 S.PDiag(diag::note_thread_warning_in_fun)
-                                    << CurrentFunction->getNameAsString());
+                                    << CurrentFunction);
       ONS.push_back(std::move(FNote));
     }
     return ONS;
@@ -1742,7 +1742,7 @@ class ThreadSafetyReporter : public clan
                         diag::warn_variable_requires_any_lock:
                         diag::warn_var_deref_requires_any_lock;
     PartialDiagnosticAt Warning(Loc, S.PDiag(DiagID)
-      << D->getNameAsString() << getLockKindFromAccessKind(AK));
+      << D << getLockKindFromAccessKind(AK));
     Warnings.emplace_back(std::move(Warning), getNotes());
   }
 
@@ -1770,7 +1770,7 @@ class ThreadSafetyReporter : public clan
           break;
       }
       PartialDiagnosticAt Warning(Loc, S.PDiag(DiagID) << Kind
-                                                       << D->getNameAsString()
+                                                       << D
                                                        << LockName << LK);
       PartialDiagnosticAt Note(Loc, S.PDiag(diag::note_found_mutex_near_match)
                                         << *PossibleMatch);
@@ -1800,12 +1800,11 @@ class ThreadSafetyReporter : public clan
           break;
       }
       PartialDiagnosticAt Warning(Loc, S.PDiag(DiagID) << Kind
-                                                       << D->getNameAsString()
+                                                       << D
                                                        << LockName << LK);
       if (Verbose && POK == POK_VarAccess) {
         PartialDiagnosticAt Note(D->getLocation(),
-                                 S.PDiag(diag::note_guarded_by_declared_here)
-                                     << D->getNameAsString());
+                                 S.PDiag(diag::note_guarded_by_declared_here));
         Warnings.emplace_back(std::move(Warning), getNotes(Note));
       } else
         Warnings.emplace_back(std::move(Warning), getNotes());

Modified: cfe/trunk/lib/Sema/SemaCUDA.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCUDA.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCUDA.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCUDA.cpp Tue Mar 27 21:16:13 2018
@@ -521,7 +521,7 @@ void Sema::maybeAddCUDAHostDeviceAttrs(F
     if (!getSourceManager().isInSystemHeader(Match->getLocation())) {
       Diag(NewD->getLocation(),
            diag::err_cuda_unattributed_constexpr_cannot_overload_device)
-          << NewD->getName();
+          << NewD;
       Diag(Match->getLocation(),
            diag::note_cuda_conflicting_device_function_declared_here);
     }

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Mar 27 21:16:13 2018
@@ -11521,7 +11521,7 @@ void Sema::CheckObjCCircularContainer(Ob
       if (ArgRE->isObjCSelfExpr()) {
         Diag(Message->getSourceRange().getBegin(),
              diag::warn_objc_circular_container)
-          << ArgRE->getDecl()->getName() << StringRef("super");
+          << ArgRE->getDecl() << StringRef("'super'");
       }
     }
   } else {
@@ -11537,11 +11537,11 @@ void Sema::CheckObjCCircularContainer(Ob
           ValueDecl *Decl = ReceiverRE->getDecl();
           Diag(Message->getSourceRange().getBegin(),
                diag::warn_objc_circular_container)
-            << Decl->getName() << Decl->getName();
+            << Decl << Decl;
           if (!ArgRE->isObjCSelfExpr()) {
             Diag(Decl->getLocation(),
                  diag::note_objc_circular_container_declared_here)
-              << Decl->getName();
+              << Decl;
           }
         }
       }
@@ -11551,10 +11551,10 @@ void Sema::CheckObjCCircularContainer(Ob
           ObjCIvarDecl *Decl = IvarRE->getDecl();
           Diag(Message->getSourceRange().getBegin(),
                diag::warn_objc_circular_container)
-            << Decl->getName() << Decl->getName();
+            << Decl << Decl;
           Diag(Decl->getLocation(),
                diag::note_objc_circular_container_declared_here)
-            << Decl->getName();
+            << Decl;
         }
       }
     }

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Mar 27 21:16:13 2018
@@ -10336,7 +10336,7 @@ namespace {
 
       S.DiagRuntimeBehavior(DRE->getLocStart(), DRE,
                             S.PDiag(diag)
-                              << DRE->getNameInfo().getName()
+                              << DRE->getDecl()
                               << OrigDecl->getLocation()
                               << DRE->getSourceRange());
     }
@@ -16147,7 +16147,7 @@ static void CheckForDuplicateEnumValues(
     // Emit warning for one enum constant.
     ECDVector::iterator I = Vec->begin();
     S.Diag((*I)->getLocation(), diag::warn_duplicate_enum_values)
-      << (*I)->getName() << (*I)->getInitVal().toString(10)
+      << (*I) << (*I)->getInitVal().toString(10)
       << (*I)->getSourceRange();
     ++I;
 
@@ -16155,7 +16155,7 @@ static void CheckForDuplicateEnumValues(
     // the same value.
     for (ECDVector::iterator E = Vec->end(); I != E; ++I)
       S.Diag((*I)->getLocation(), diag::note_duplicate_element)
-        << (*I)->getName() << (*I)->getInitVal().toString(10)
+        << (*I) << (*I)->getInitVal().toString(10)
         << (*I)->getSourceRange();
     delete Vec;
   }

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Mar 27 21:16:13 2018
@@ -2404,7 +2404,7 @@ bool Sema::AttachBaseSpecifiers(CXXRecor
           // The Microsoft extension __interface does not permit bases that
           // are not themselves public interfaces.
           Diag(KnownBase->getLocStart(), diag::err_invalid_base_in_interface)
-            << getRecordDiagFromTagKind(RD->getTagKind()) << RD->getName()
+            << getRecordDiagFromTagKind(RD->getTagKind()) << RD
             << RD->getSourceRange();
           Invalid = true;
         }
@@ -2862,7 +2862,7 @@ void Sema::CheckShadowInheritedFields(co
     if (AS_none !=
         CXXRecordDecl::MergeAccess(P.Access, BaseField->getAccess())) {
       Diag(Loc, diag::warn_shadow_field)
-        << FieldName.getAsString() << RD->getName() << Base->getName();
+        << FieldName << RD << Base;
       Diag(BaseField->getLocation(), diag::note_shadow_field);
       Bases.erase(It);
     }
@@ -5528,7 +5528,7 @@ static void ReferenceDllExportedMembers(
         S.MarkFunctionReferenced(Class->getLocation(), MD);
         if (Trap.hasErrorOccurred()) {
           S.Diag(ClassAttr->getLocation(), diag::note_due_to_dllexported_class)
-              << Class->getName() << !S.getLangOpts().CPlusPlus11;
+              << Class << !S.getLangOpts().CPlusPlus11;
           break;
         }
 

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Mar 27 21:16:13 2018
@@ -5511,7 +5511,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, Na
       // CUDA: Kernel calls must be to global functions
       if (FDecl && !FDecl->hasAttr<CUDAGlobalAttr>())
         return ExprError(Diag(LParenLoc,diag::err_kern_call_not_global_function)
-            << FDecl->getName() << Fn->getSourceRange());
+            << FDecl << Fn->getSourceRange());
 
       // CUDA: Kernel function must have 'void' return type
       if (!FuncT->getReturnType()->isVoidType())
@@ -5521,7 +5521,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, Na
       // CUDA: Calls to global functions must be configured
       if (FDecl && FDecl->hasAttr<CUDAGlobalAttr>())
         return ExprError(Diag(LParenLoc, diag::err_global_call_not_config)
-            << FDecl->getName() << Fn->getSourceRange());
+            << FDecl << Fn->getSourceRange());
     }
   }
 
@@ -8030,7 +8030,7 @@ Sema::CheckSingleAssignmentConstraints(Q
   if (Diagnose && isa<ObjCProtocolExpr>(PRE)) {
     ObjCProtocolDecl *PDecl = cast<ObjCProtocolExpr>(PRE)->getProtocol();
     if (PDecl && !PDecl->hasDefinition()) {
-      Diag(PRE->getExprLoc(), diag::warn_atprotocol_protocol) << PDecl->getName();
+      Diag(PRE->getExprLoc(), diag::warn_atprotocol_protocol) << PDecl;
       Diag(PDecl->getLocation(), diag::note_entity_declared_at) << PDecl;
     }
   }
@@ -13516,7 +13516,7 @@ bool Sema::DiagnoseAssignmentResult(Assi
   if (DiagKind == diag::warn_incompatible_qualified_id &&
       PDecl && IFace && !IFace->hasDefinition())
       Diag(IFace->getLocation(), diag::note_incomplete_class_and_qualified_id)
-        << IFace->getName() << PDecl->getName();
+        << IFace << PDecl;
     
   if (SecondType == Context.OverloadTy)
     NoteAllOverloadCandidates(OverloadExpr::find(SrcExpr).Expression,

Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue Mar 27 21:16:13 2018
@@ -10388,7 +10388,7 @@ bool TreeTransform<Derived>::TransformOv
   //   the corresponding pack is empty
   if (AllEmptyPacks && !RequiresADL) {
     getSema().Diag(Old->getNameLoc(), diag::err_using_pack_expansion_empty)
-        << isa<UnresolvedMemberExpr>(Old) << Old->getNameInfo().getName();
+        << isa<UnresolvedMemberExpr>(Old) << Old->getName();
     return true;
   }
 

Modified: cfe/trunk/test/Preprocessor/has_include.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/has_include.c?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/has_include.c (original)
+++ cfe/trunk/test/Preprocessor/has_include.c Tue Mar 27 21:16:13 2018
@@ -93,19 +93,19 @@
 
 // Try as non-preprocessor directives
 void foo( void ) {
-  __has_include_next("stdint.h")  // expected-warning {{#include_next in primary source file}} expected-error {{__has_include_next must be used within a preprocessing directive}}
-  __has_include("stdint.h")  // expected-error {{__has_include must be used within a preprocessing directive}}
+  __has_include_next("stdint.h")  // expected-warning {{#include_next in primary source file}} expected-error {{'__has_include_next' must be used within a preprocessing directive}}
+  __has_include("stdint.h")  // expected-error {{'__has_include' must be used within a preprocessing directive}}
 }
 
-MACRO1  // expected-error {{__has_include must be used within a preprocessing directive}}
+MACRO1  // expected-error {{'__has_include' must be used within a preprocessing directive}}
 
 #if 1
-MACRO1  // expected-error {{__has_include must be used within a preprocessing directive}}
+MACRO1  // expected-error {{'__has_include' must be used within a preprocessing directive}}
 #endif
 
 #if 0
 #elif 1
-MACRO1  // expected-error {{__has_include must be used within a preprocessing directive}}
+MACRO1  // expected-error {{'__has_include' must be used within a preprocessing directive}}
 #endif
 
 #if 0
@@ -148,7 +148,7 @@ MACRO1  // This should be fine because i
 #if __has_include(stdint.h>)
 #endif
 
-// expected-error at +1 {{__has_include must be used within a preprocessing directive}}
+// expected-error at +1 {{'__has_include' must be used within a preprocessing directive}}
 __has_include
 
 // expected-error at +1 {{missing ')' after '__has_include'}} // expected-error at +1 {{expected value in expression}}  // expected-note at +1 {{to match this '('}}

Modified: cfe/trunk/test/Sema/warn-duplicate-enum.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-duplicate-enum.c?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-duplicate-enum.c (original)
+++ cfe/trunk/test/Sema/warn-duplicate-enum.c Tue Mar 27 21:16:13 2018
@@ -1,29 +1,29 @@
 // RUN: %clang_cc1 %s -fsyntax-only -verify -Wduplicate-enum
 // RUN: %clang_cc1 %s -x c++ -fsyntax-only -verify -Wduplicate-enum
 enum A {
-  A1 = 0,  // expected-note {{element A1 also has value 0}}
+  A1 = 0,  // expected-note {{element 'A1' also has value 0}}
   A2 = -1,
-  A3,  // expected-warning {{element A3 has been implicitly assigned 0 which another element has been assigned}}
+  A3,  // expected-warning {{element 'A3' has been implicitly assigned 0 which another element has been assigned}}
   A4};
 
 enum B {
-  B1 = -1,  // expected-note {{element B1 also has value -1}}
-  B2,       // expected-warning {{element B2 has been implicitly assigned 0 which another element has been assigned}}
+  B1 = -1,  // expected-note {{element 'B1' also has value -1}}
+  B2,       // expected-warning {{element 'B2' has been implicitly assigned 0 which another element has been assigned}}
   B3,
   B4 = -2,
-  B5,  // expected-warning {{element B5 has been implicitly assigned -1 which another element has been assigned}}
-  B6   // expected-note {{element B6 also has value 0}}
+  B5,  // expected-warning {{element 'B5' has been implicitly assigned -1 which another element has been assigned}}
+  B6   // expected-note {{element 'B6' also has value 0}}
 };
 
-enum C { C1, C2 = -1, C3 }; // expected-warning{{element C1 has been implicitly assigned 0 which another element has been assigned}} \
-  // expected-note {{element C3 also has value 0}}
+enum C { C1, C2 = -1, C3 }; // expected-warning{{element 'C1' has been implicitly assigned 0 which another element has been assigned}} \
+  // expected-note {{element 'C3' also has value 0}}
 
 enum D {
   D1,
   D2,
-  D3,  // expected-warning{{element D3 has been implicitly assigned 2 which another element has been assigned}}
+  D3,  // expected-warning{{element 'D3' has been implicitly assigned 2 which another element has been assigned}}
   D4 = D2,  // no warning
-  D5 = 2  // expected-note {{element D5 also has value 2}}
+  D5 = 2  // expected-note {{element 'D5' also has value 2}}
 };
 
 enum E {

Modified: cfe/trunk/test/SemaCUDA/function-overload.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/function-overload.cu?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/function-overload.cu (original)
+++ cfe/trunk/test/SemaCUDA/function-overload.cu Tue Mar 27 21:16:13 2018
@@ -119,7 +119,7 @@ __host__ void hostf() {
   HostReturnTy ret_cdh = cdh();
 
   GlobalFnPtr fp_g = g;
-  g(); // expected-error {{call to global function g not configured}}
+  g(); // expected-error {{call to global function 'g' not configured}}
   g<<<0, 0>>>();
 }
 
@@ -202,7 +202,7 @@ __host__ __device__ void hostdevicef() {
 #if defined (__CUDA_ARCH__)
   // expected-error at -2 {{reference to __global__ function 'g' in __host__ __device__ function}}
 #else
-  // expected-error at -4 {{call to global function g not configured}}
+  // expected-error at -4 {{call to global function 'g' not configured}}
 #endif
 
   g<<<0,0>>>();

Modified: cfe/trunk/test/SemaCUDA/kernel-call.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/kernel-call.cu?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/kernel-call.cu (original)
+++ cfe/trunk/test/SemaCUDA/kernel-call.cu Tue Mar 27 21:16:13 2018
@@ -13,13 +13,13 @@ int h2(int x) { return 1; }
 
 int main(void) {
   g1<<<1, 1>>>(42);
-  g1(42); // expected-error {{call to global function g1 not configured}}
+  g1(42); // expected-error {{call to global function 'g1' not configured}}
   g1<<<1>>>(42); // expected-error {{too few execution configuration arguments to kernel function call}}
   g1<<<1, 1, 0, 0, 0>>>(42); // expected-error {{too many execution configuration arguments to kernel function call}}
 
   t1(1);
 
-  h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function h1}}
+  h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function 'h1'}}
 
   int (*fp)(int) = h2;
   fp<<<1, 1>>>(42); // expected-error {{must have void return type}}

Modified: cfe/trunk/test/SemaCXX/ms-interface.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ms-interface.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/ms-interface.cpp (original)
+++ cfe/trunk/test/SemaCXX/ms-interface.cpp Tue Mar 27 21:16:13 2018
@@ -47,7 +47,7 @@ __interface I4 : I1, I2 {
   void fn2() final;
 };
 
-// expected-error at +1 {{interface type cannot inherit from non-public 'interface I1'}}
+// expected-error at +1 {{interface type cannot inherit from non-public interface 'I1'}}
 __interface I5 : private I1 {
 };
 
@@ -65,12 +65,12 @@ static_assert(!__is_interface_class(C),
 static_assert(!__is_interface_class(I), "oops");
 static_assert(!__is_interface_class(U), "oops");
 
-// expected-error at 55 {{interface type cannot inherit from 'struct S'}}
+// expected-error at 55 {{interface type cannot inherit from struct 'S'}}
 // expected-note at +1 {{in instantiation of template class 'I6<S>' requested here}}
 struct S1 : I6<S> {
 };
 
-// expected-error at 55 {{interface type cannot inherit from 'class C'}}
+// expected-error at 55 {{interface type cannot inherit from class 'C'}}
 // expected-note at +1 {{in instantiation of template class 'I6<C>' requested here}}
 class C1 : I6<C> {
 };

Modified: cfe/trunk/test/SemaCXX/typo-correction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/typo-correction.cpp (original)
+++ cfe/trunk/test/SemaCXX/typo-correction.cpp Tue Mar 27 21:16:13 2018
@@ -647,7 +647,7 @@ namespace testArraySubscriptIndex {
 
 namespace crash_has_include {
 int has_include(int); // expected-note {{'has_include' declared here}}
-// expected-error at +1 {{__has_include must be used within a preprocessing directive}}
+// expected-error at +1 {{'__has_include' must be used within a preprocessing directive}}
 int foo = __has_include(42); // expected-error {{use of undeclared identifier '__has_include'; did you mean 'has_include'?}}
 }
 

Modified: cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp Tue Mar 27 21:16:13 2018
@@ -1933,7 +1933,7 @@ void test() {
 
   f1.mu_.Unlock();
   bt.barTD(&f1);  // \
-    // expected-warning {{calling function 'barTD' requires holding mutex 'f1.mu_' exclusively}} \
+    // expected-warning {{calling function 'barTD<TestTemplateAttributeInstantiation::Foo1>' requires holding mutex 'f1.mu_' exclusively}} \
     // expected-note {{found near match 'bt.fooBase.mu_'}}
 
   bt.fooBase.mu_.Unlock();
@@ -2130,10 +2130,10 @@ void test() {
   myFoo.foo3(&myFoo);  // \
     // expected-warning {{calling function 'foo3' requires holding mutex 'myFoo.mu_' exclusively}}
   myFoo.fooT1(dummy);  // \
-    // expected-warning {{calling function 'fooT1' requires holding mutex 'myFoo.mu_' exclusively}}
+    // expected-warning {{calling function 'fooT1<int>' requires holding mutex 'myFoo.mu_' exclusively}}
 
   myFoo.fooT2(dummy);  // \
-    // expected-warning {{calling function 'fooT2' requires holding mutex 'myFoo.mu_' exclusively}}
+    // expected-warning {{calling function 'fooT2<int>' requires holding mutex 'myFoo.mu_' exclusively}}
 
   fooF1(&myFoo);  // \
     // expected-warning {{calling function 'fooF1' requires holding mutex 'myFoo.mu_' exclusively}}
@@ -3565,7 +3565,7 @@ void Foo::elr(Cell<T>* c1) { }
 void Foo::test() {
   Cell<int> cell;
   elr(&cell); // \
-    // expected-warning {{calling function 'elr' requires holding mutex 'cell.mu_' exclusively}}
+    // expected-warning {{calling function 'elr<int>' requires holding mutex 'cell.mu_' exclusively}}
 }
 
 
@@ -3578,7 +3578,7 @@ void globalELR(Cell<T>* c1) { }
 void globalTest() {
   Cell<int> cell;
   globalELR(&cell); // \
-    // expected-warning {{calling function 'globalELR' requires holding mutex 'cell.mu_' exclusively}}
+    // expected-warning {{calling function 'globalELR<int>' requires holding mutex 'cell.mu_' exclusively}}
 }
 
 
@@ -3599,7 +3599,7 @@ void globalELR2(Cell<T>* c4);
 void globalTest2() {
   Cell<int> cell;
   globalELR2(&cell); // \
-    // expected-warning {{calling function 'globalELR2' requires holding mutex 'cell.mu_' exclusively}}
+    // expected-warning {{calling function 'globalELR2<int>' requires holding mutex 'cell.mu_' exclusively}}
 }
 
 

Modified: cfe/trunk/test/SemaObjC/comptypes-legal.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/comptypes-legal.m?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/comptypes-legal.m (original)
+++ cfe/trunk/test/SemaObjC/comptypes-legal.m Tue Mar 27 21:16:13 2018
@@ -42,7 +42,7 @@ void foo(void)
 - (void) Meth : (id <NSCopying>)aKey; // expected-note {{passing argument to parameter 'aKey' here}}
 @end
 
- at class ForwarClass; // expected-note 3 {{conformance of forward class ForwarClass to protocol NSCopying can not be confirmed}}
+ at class ForwarClass; // expected-note 3 {{conformance of forward class 'ForwarClass' to protocol 'NSCopying' can not be confirmed}}
 
 ForwarClass *Test10751015 (I* pi, ForwarClass *ns_forward) {
 

Modified: cfe/trunk/test/SemaObjC/protocol-expr-neg-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-expr-neg-1.m?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/protocol-expr-neg-1.m (original)
+++ cfe/trunk/test/SemaObjC/protocol-expr-neg-1.m Tue Mar 27 21:16:13 2018
@@ -12,7 +12,7 @@
 int main()
 {
 	Protocol *proto = @protocol(p1);
-        Protocol *fproto = @protocol(fproto); // expected-warning {{@protocol is using a forward protocol declaration of fproto}}
+        Protocol *fproto = @protocol(fproto); // expected-warning {{@protocol is using a forward protocol declaration of 'fproto'}}
 	Protocol *pp = @protocol(i); // expected-error {{cannot find protocol declaration for 'i'}}
 	Protocol *p1p = @protocol(cl); // expected-error {{cannot find protocol declaration for 'cl'}}
 }
@@ -26,9 +26,9 @@ int main()
 @end
 
 int doesConform(id foo) {
-  return [foo conformsToProtocol:@protocol(TestProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of TestProtocol}}
+  return [foo conformsToProtocol:@protocol(TestProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of 'TestProtocol'}}
 }
 
 int doesConformSuper(id foo) {
-  return [foo conformsToProtocol:@protocol(SuperProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of SuperProtocol}}
+  return [foo conformsToProtocol:@protocol(SuperProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of 'SuperProtocol'}}
 }

Modified: cfe/trunk/test/SemaTemplate/warn-thread-safety-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/warn-thread-safety-analysis.cpp?rev=328688&r1=328687&r2=328688&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/warn-thread-safety-analysis.cpp (original)
+++ cfe/trunk/test/SemaTemplate/warn-thread-safety-analysis.cpp Tue Mar 27 21:16:13 2018
@@ -23,8 +23,8 @@ void f() {
   a.mu2.Lock();
   a.bar<int>();
   a.mu2.Unlock();
-  a.bar<int>(); // expected-warning {{calling function 'bar' requires holding mutex 'a.mu2' exclusively}}
+  a.bar<int>(); // expected-warning {{calling function 'bar<int>' requires holding mutex 'a.mu2' exclusively}}
   a.mu1.Unlock();
-  a.bar<int>(); // expected-warning {{calling function 'bar' requires holding mutex 'a.mu1' exclusively}} \
-                   expected-warning {{calling function 'bar' requires holding mutex 'a.mu2' exclusively}}
+  a.bar<int>(); // expected-warning {{calling function 'bar<int>' requires holding mutex 'a.mu1' exclusively}} \
+                   expected-warning {{calling function 'bar<int>' requires holding mutex 'a.mu2' exclusively}}
 }




More information about the cfe-commits mailing list