r209209 - None of these attributes require FunctionTemplate to be explicitly listed as part of their subject definition. FunctionTemplateDecls are not what the attribute appertains to in the first place -- it attaches to the underlying FunctionDecl.

Aaron Ballman aaron at aaronballman.com
Tue May 20 07:10:53 PDT 2014


Author: aaronballman
Date: Tue May 20 09:10:53 2014
New Revision: 209209

URL: http://llvm.org/viewvc/llvm-project?rev=209209&view=rev
Log:
None of these attributes require FunctionTemplate to be explicitly listed as part of their subject definition. FunctionTemplateDecls are not what the attribute appertains to in the first place -- it attaches to the underlying FunctionDecl.

The attribute emitter was using FunctionTemplate to map the diagnostic to "functions or methods", but that isn't a particularly clear diagnostic in these cases anyway (since they do not apply to ObjC methods). Updated the attribute emitter to remove custom logic for FunctionTemplateDecl, and updated the test cases for the change in diagnostic wording.

Modified:
    cfe/trunk/include/clang/Basic/Attr.td
    cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp
    cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp
    cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp
    cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp
    cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=209209&r1=209208&r2=209209&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Tue May 20 09:10:53 2014
@@ -1262,21 +1262,21 @@ def X86ForceAlignArgPointer : Inheritabl
 def NoSanitizeAddress : InheritableAttr {
   let Spellings = [GCC<"no_address_safety_analysis">,
                    GCC<"no_sanitize_address">];
-  let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+  let Subjects = SubjectList<[Function], ErrorDiag>;
   let Documentation = [NoSanitizeAddressDocs];
 }
 
 // Attribute to disable ThreadSanitizer checks.
 def NoSanitizeThread : InheritableAttr {
   let Spellings = [GNU<"no_sanitize_thread">];
-  let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+  let Subjects = SubjectList<[Function], ErrorDiag>;
   let Documentation = [NoSanitizeThreadDocs];
 }
 
 // Attribute to disable MemorySanitizer checks.
 def NoSanitizeMemory : InheritableAttr {
   let Spellings = [GNU<"no_sanitize_memory">];
-  let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+  let Subjects = SubjectList<[Function], ErrorDiag>;
   let Documentation = [NoSanitizeMemoryDocs];
 }
 
@@ -1331,7 +1331,7 @@ def AssertCapability : InheritableAttr {
                    CXX11<"clang", "assert_capability">,
                    GNU<"assert_shared_capability">,
                    CXX11<"clang", "assert_shared_capability">];
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let LateParsed = 1;
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
@@ -1350,7 +1350,7 @@ def AcquireCapability : InheritableAttr
                    CXX11<"clang", "acquire_shared_capability">,
                    GNU<"exclusive_lock_function">,
                    GNU<"shared_lock_function">];
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let LateParsed = 1;
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
@@ -1368,7 +1368,7 @@ def TryAcquireCapability : InheritableAt
                    CXX11<"clang", "try_acquire_capability">,
                    GNU<"try_acquire_shared_capability">,
                    CXX11<"clang", "try_acquire_shared_capability">];
-  let Subjects = SubjectList<[Function, FunctionTemplate],
+  let Subjects = SubjectList<[Function],
                              ErrorDiag>;
   let LateParsed = 1;
   let TemplateDependent = 1;
@@ -1389,7 +1389,7 @@ def ReleaseCapability : InheritableAttr
                    GNU<"release_generic_capability">,
                    CXX11<"clang", "release_generic_capability">,
                    GNU<"unlock_function">];
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let LateParsed = 1;
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
@@ -1417,7 +1417,7 @@ def RequiresCapability : InheritableAttr
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Accessors = [Accessor<"isShared", [GNU<"requires_shared_capability">,
                                          GNU<"shared_locks_required">,
                                 CXX11<"clang","requires_shared_capability">]>];
@@ -1426,7 +1426,7 @@ def RequiresCapability : InheritableAttr
 
 def NoThreadSafetyAnalysis : InheritableAttr {
   let Spellings = [GNU<"no_thread_safety_analysis">];
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 
@@ -1485,7 +1485,7 @@ def AssertExclusiveLock : InheritableAtt
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 
@@ -1496,7 +1496,7 @@ def AssertSharedLock : InheritableAttr {
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 
@@ -1509,7 +1509,7 @@ def ExclusiveTrylockFunction : Inheritab
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 
@@ -1522,7 +1522,7 @@ def SharedTrylockFunction : InheritableA
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 
@@ -1532,7 +1532,7 @@ def LockReturned : InheritableAttr {
   let LateParsed = 1;
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 
@@ -1543,7 +1543,7 @@ def LocksExcluded : InheritableAttr {
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Subjects = SubjectList<[Function]>;
   let Documentation = [Undocumented];
 }
 

Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp?rev=209209&r1=209208&r2=209209&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp Tue May 20 09:10:53 2014
@@ -15,23 +15,23 @@ int noanal_testfn(int y) NO_SANITIZE_ADD
 
 int noanal_testfn(int y) {
   int x NO_SANITIZE_ADDRESS = y; // \
-    // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+    // expected-error {{'no_sanitize_address' attribute only applies to functions}}
   return x;
 }
 
 int noanal_test_var NO_SANITIZE_ADDRESS; // \
-  // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_address' attribute only applies to functions}}
 
 class NoanalFoo {
  private:
   int test_field NO_SANITIZE_ADDRESS; // \
-    // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+    // expected-error {{'no_sanitize_address' attribute only applies to functions}}
   void test_method() NO_SANITIZE_ADDRESS;
 };
 
 class NO_SANITIZE_ADDRESS NoanalTestClass { // \
-  // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_address' attribute only applies to functions}}
 };
 
 void noanal_fun_params(int lvar NO_SANITIZE_ADDRESS); // \
-  // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_address' attribute only applies to functions}}

Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp?rev=209209&r1=209208&r2=209209&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp Tue May 20 09:10:53 2014
@@ -15,23 +15,23 @@ int noanal_testfn(int y) NO_SANITIZE_MEM
 
 int noanal_testfn(int y) {
   int x NO_SANITIZE_MEMORY = y; // \
-    // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+    // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
   return x;
 }
 
 int noanal_test_var NO_SANITIZE_MEMORY; // \
-  // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
 
 class NoanalFoo {
  private:
   int test_field NO_SANITIZE_MEMORY; // \
-    // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+    // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
   void test_method() NO_SANITIZE_MEMORY;
 };
 
 class NO_SANITIZE_MEMORY NoanalTestClass { // \
-  // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
 };
 
 void noanal_fun_params(int lvar NO_SANITIZE_MEMORY); // \
-  // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_memory' attribute only applies to functions}}

Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp?rev=209209&r1=209208&r2=209209&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp Tue May 20 09:10:53 2014
@@ -15,23 +15,23 @@ int noanal_testfn(int y) NO_SANITIZE_THR
 
 int noanal_testfn(int y) {
   int x NO_SANITIZE_THREAD = y; // \
-    // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+    // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
   return x;
 }
 
 int noanal_test_var NO_SANITIZE_THREAD; // \
-  // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
 
 class NoanalFoo {
  private:
   int test_field NO_SANITIZE_THREAD; // \
-    // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+    // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
   void test_method() NO_SANITIZE_THREAD;
 };
 
 class NO_SANITIZE_THREAD NoanalTestClass { // \
-  // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
 };
 
 void noanal_fun_params(int lvar NO_SANITIZE_THREAD); // \
-  // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+  // expected-error {{'no_sanitize_thread' attribute only applies to functions}}

Modified: cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp?rev=209209&r1=209208&r2=209209&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp Tue May 20 09:10:53 2014
@@ -109,26 +109,26 @@ int noanal_testfn(int y) NO_THREAD_SAFET
 
 int noanal_testfn(int y) {
   int x NO_THREAD_SAFETY_ANALYSIS = y; // \
-    // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+    // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
   return x;
 };
 
 int noanal_test_var NO_THREAD_SAFETY_ANALYSIS; // \
-  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
 
 class NoanalFoo {
  private:
   int test_field NO_THREAD_SAFETY_ANALYSIS; // \
-    // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+    // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
   void test_method() NO_THREAD_SAFETY_ANALYSIS;
 };
 
 class NO_THREAD_SAFETY_ANALYSIS NoanalTestClass { // \
-  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
 };
 
 void noanal_fun_params(int lvar NO_THREAD_SAFETY_ANALYSIS); // \
-  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
 
 
 //-----------------------------------------//
@@ -577,26 +577,26 @@ int elf_testfn(int y) EXCLUSIVE_LOCK_FUN
 
 int elf_testfn(int y) {
   int x EXCLUSIVE_LOCK_FUNCTION() = y; // \
-    // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
   return x;
 };
 
 int elf_test_var EXCLUSIVE_LOCK_FUNCTION(); // \
-  // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
 
 class ElfFoo {
  private:
   int test_field EXCLUSIVE_LOCK_FUNCTION(); // \
-    // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
   void test_method() EXCLUSIVE_LOCK_FUNCTION();
 };
 
 class EXCLUSIVE_LOCK_FUNCTION() ElfTestClass { // \
-  // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
 };
 
 void elf_fun_params(int lvar EXCLUSIVE_LOCK_FUNCTION()); // \
-  // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
 
 // Check argument parsing.
 
@@ -649,25 +649,25 @@ int slf_testfn(int y) SHARED_LOCK_FUNCTI
 
 int slf_testfn(int y) {
   int x SHARED_LOCK_FUNCTION() = y; // \
-    // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_lock_function' attribute only applies to functions}}
   return x;
 };
 
 int slf_test_var SHARED_LOCK_FUNCTION(); // \
-  // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_lock_function' attribute only applies to functions}}
 
 void slf_fun_params(int lvar SHARED_LOCK_FUNCTION()); // \
-  // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_lock_function' attribute only applies to functions}}
 
 class SlfFoo {
  private:
   int test_field SHARED_LOCK_FUNCTION(); // \
-    // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_lock_function' attribute only applies to functions}}
   void test_method() SHARED_LOCK_FUNCTION();
 };
 
 class SHARED_LOCK_FUNCTION() SlfTestClass { // \
-  // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_lock_function' attribute only applies to functions}}
 };
 
 // Check argument parsing.
@@ -725,26 +725,26 @@ int etf_testfn(int y) EXCLUSIVE_TRYLOCK_
 
 int etf_testfn(int y) {
   int x EXCLUSIVE_TRYLOCK_FUNCTION(1) = y; // \
-    // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
   return x;
 };
 
 int etf_test_var EXCLUSIVE_TRYLOCK_FUNCTION(1); // \
-  // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
 
 class EtfFoo {
  private:
   int test_field EXCLUSIVE_TRYLOCK_FUNCTION(1); // \
-    // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
   void test_method() EXCLUSIVE_TRYLOCK_FUNCTION(1);
 };
 
 class EXCLUSIVE_TRYLOCK_FUNCTION(1) EtfTestClass { // \
-  // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
 };
 
 void etf_fun_params(int lvar EXCLUSIVE_TRYLOCK_FUNCTION(1)); // \
-  // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
 
 // Check argument parsing.
 
@@ -798,26 +798,26 @@ int stf_testfn(int y) SHARED_TRYLOCK_FUN
 
 int stf_testfn(int y) {
   int x SHARED_TRYLOCK_FUNCTION(1) = y; // \
-    // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
   return x;
 };
 
 int stf_test_var SHARED_TRYLOCK_FUNCTION(1); // \
-  // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
 
 void stf_fun_params(int lvar SHARED_TRYLOCK_FUNCTION(1)); // \
-  // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
 
 
 class StfFoo {
  private:
   int test_field SHARED_TRYLOCK_FUNCTION(1); // \
-    // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
   void test_method() SHARED_TRYLOCK_FUNCTION(1);
 };
 
 class SHARED_TRYLOCK_FUNCTION(1) StfTestClass { // \
-    // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
 };
 
 // Check argument parsing.
@@ -868,26 +868,26 @@ int uf_testfn(int y) UNLOCK_FUNCTION();
 
 int uf_testfn(int y) {
   int x UNLOCK_FUNCTION() = y; // \
-    // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'unlock_function' attribute only applies to functions}}
   return x;
 };
 
 int uf_test_var UNLOCK_FUNCTION(); // \
-  // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'unlock_function' attribute only applies to functions}}
 
 class UfFoo {
  private:
   int test_field UNLOCK_FUNCTION(); // \
-    // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+    // expected-warning {{'unlock_function' attribute only applies to functions}}
   void test_method() UNLOCK_FUNCTION();
 };
 
 class NO_THREAD_SAFETY_ANALYSIS UfTestClass { // \
-  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+  // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
 };
 
 void uf_fun_params(int lvar UNLOCK_FUNCTION()); // \
-  // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+  // expected-warning {{'unlock_function' attribute only applies to functions}}
 
 // Check argument parsing.
 
@@ -944,25 +944,25 @@ int lr_testfn(int y) LOCK_RETURNED(mu1);
 
 int lr_testfn(int y) {
   int x LOCK_RETURNED(mu1) = y; // \
-    // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+    // expected-warning {{'lock_returned' attribute only applies to functions}}
   return x;
 };
 
 int lr_test_var LOCK_RETURNED(mu1); // \
-  // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+  // expected-warning {{'lock_returned' attribute only applies to functions}}
 
 void lr_fun_params(int lvar LOCK_RETURNED(mu1)); // \
-  // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+  // expected-warning {{'lock_returned' attribute only applies to functions}}
 
 class LrFoo {
  private:
   int test_field LOCK_RETURNED(mu1); // \
-    // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+    // expected-warning {{'lock_returned' attribute only applies to functions}}
   void test_method() LOCK_RETURNED(mu1);
 };
 
 class LOCK_RETURNED(mu1) LrTestClass { // \
-    // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+    // expected-warning {{'lock_returned' attribute only applies to functions}}
 };
 
 // Check argument parsing.
@@ -1011,25 +1011,25 @@ int le_testfn(int y) LOCKS_EXCLUDED(mu1)
 
 int le_testfn(int y) {
   int x LOCKS_EXCLUDED(mu1) = y; // \
-    // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+    // expected-warning {{'locks_excluded' attribute only applies to functions}}
   return x;
 };
 
 int le_test_var LOCKS_EXCLUDED(mu1); // \
-  // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+  // expected-warning {{'locks_excluded' attribute only applies to functions}}
 
 void le_fun_params(int lvar LOCKS_EXCLUDED(mu1)); // \
-  // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+  // expected-warning {{'locks_excluded' attribute only applies to functions}}
 
 class LeFoo {
  private:
   int test_field LOCKS_EXCLUDED(mu1); // \
-    // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+    // expected-warning {{'locks_excluded' attribute only applies to functions}}
   void test_method() LOCKS_EXCLUDED(mu1);
 };
 
 class LOCKS_EXCLUDED(mu1) LeTestClass { // \
-  // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+  // expected-warning {{'locks_excluded' attribute only applies to functions}}
 };
 
 // Check argument parsing.
@@ -1078,25 +1078,25 @@ int elr_testfn(int y) EXCLUSIVE_LOCKS_RE
 
 int elr_testfn(int y) {
   int x EXCLUSIVE_LOCKS_REQUIRED(mu1) = y; // \
-    // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+    // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
   return x;
 };
 
 int elr_test_var EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
-  // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
 
 void elr_fun_params(int lvar EXCLUSIVE_LOCKS_REQUIRED(mu1)); // \
-  // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
 
 class ElrFoo {
  private:
   int test_field EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
-    // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+    // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
   void test_method() EXCLUSIVE_LOCKS_REQUIRED(mu1);
 };
 
 class EXCLUSIVE_LOCKS_REQUIRED(mu1) ElrTestClass { // \
-  // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+  // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
 };
 
 // Check argument parsing.
@@ -1146,25 +1146,25 @@ int slr_testfn(int y) SHARED_LOCKS_REQUI
 
 int slr_testfn(int y) {
   int x SHARED_LOCKS_REQUIRED(mu1) = y; // \
-    // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_locks_required' attribute only applies to functions}}
   return x;
 };
 
 int slr_test_var SHARED_LOCKS_REQUIRED(mu1); // \
-  // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_locks_required' attribute only applies to functions}}
 
 void slr_fun_params(int lvar SHARED_LOCKS_REQUIRED(mu1)); // \
-  // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_locks_required' attribute only applies to functions}}
 
 class SlrFoo {
  private:
   int test_field SHARED_LOCKS_REQUIRED(mu1); // \
-    // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+    // expected-warning {{'shared_locks_required' attribute only applies to functions}}
   void test_method() SHARED_LOCKS_REQUIRED(mu1);
 };
 
 class SHARED_LOCKS_REQUIRED(mu1) SlrTestClass { // \
-  // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+  // expected-warning {{'shared_locks_required' attribute only applies to functions}}
 };
 
 // Check argument parsing.

Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=209209&r1=209208&r2=209209&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Tue May 20 09:10:53 2014
@@ -2047,10 +2047,9 @@ static std::string CalculateDiagnostic(c
     ObjCInterface = 1U << 9,
     Block = 1U << 10,
     Namespace = 1U << 11,
-    FuncTemplate = 1U << 12,
-    Field = 1U << 13,
-    CXXMethod = 1U << 14,
-    ObjCProtocol = 1U << 15
+    Field = 1U << 12,
+    CXXMethod = 1U << 13,
+    ObjCProtocol = 1U << 14
   };
   uint32_t SubMask = 0;
 
@@ -2082,7 +2081,6 @@ static std::string CalculateDiagnostic(c
                    .Case("Block", Block)
                    .Case("CXXRecord", Class)
                    .Case("Namespace", Namespace)
-                   .Case("FunctionTemplate", FuncTemplate)
                    .Case("Field", Field)
                    .Case("CXXMethod", CXXMethod)
                    .Default(0);
@@ -2121,7 +2119,6 @@ static std::string CalculateDiagnostic(c
     case Func | ObjCMethod | Class: return "ExpectedFunctionMethodOrClass";
     case Func | Param:
     case Func | ObjCMethod | Param: return "ExpectedFunctionMethodOrParameter";
-    case Func | FuncTemplate:
     case Func | ObjCMethod: return "ExpectedFunctionOrMethod";
     case Func | Var: return "ExpectedVariableOrFunction";
 





More information about the cfe-commits mailing list