[cfe-commits] r135135 - in /cfe/trunk: lib/Frontend/TextDiagnosticPrinter.cpp test/Misc/caret-diags-macros.c test/Misc/include-stack-for-note-flag.cpp test/Misc/macro-backtrace-limit.c

Chandler Carruth chandlerc at gmail.com
Thu Jul 14 01:20:29 PDT 2011


Author: chandlerc
Date: Thu Jul 14 03:20:28 2011
New Revision: 135135

URL: http://llvm.org/viewvc/llvm-project?rev=135135&view=rev
Log:
Switch the diagnostic messages about macros to use the terms 'expanded'
and 'expansions' rather than 'instantiated' and 'contexts'.

This is the first of several patches migrating Clang's terminology
surrounding macros from 'instantiation' to 'expansion'.

Modified:
    cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
    cfe/trunk/test/Misc/caret-diags-macros.c
    cfe/trunk/test/Misc/include-stack-for-note-flag.cpp
    cfe/trunk/test/Misc/macro-backtrace-limit.c

Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=135135&r1=135134&r2=135135&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Thu Jul 14 03:20:28 2011
@@ -410,7 +410,7 @@
           OS << PLoc.getColumn() << ':';
         OS << ' ';
       }
-      OS << "note: instantiated from:\n";
+      OS << "note: expanded from:\n";
 
       EmitCaretDiagnostic(Loc, Ranges, NumRanges, SM, 0, 0,
                           Columns, OnMacroInst + 1, MacroSkipStart,
@@ -421,7 +421,7 @@
     if (OnMacroInst == MacroSkipStart) {
       // Tell the user that we've skipped contexts.
       OS << "note: (skipping " << (MacroSkipEnd - MacroSkipStart) 
-      << " contexts in backtrace; use -fmacro-backtrace-limit=0 to see "
+      << " expansions in backtrace; use -fmacro-backtrace-limit=0 to see "
       "all)\n";
     }
     

Modified: cfe/trunk/test/Misc/caret-diags-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/caret-diags-macros.c?rev=135135&r1=135134&r2=135135&view=diff
==============================================================================
--- cfe/trunk/test/Misc/caret-diags-macros.c (original)
+++ cfe/trunk/test/Misc/caret-diags-macros.c Thu Jul 14 03:20:28 2011
@@ -6,8 +6,8 @@
   M1(
     M2);
   // CHECK: :7:{{[0-9]+}}: warning: expression result unused
-  // CHECK: :4:{{[0-9]+}}: note: instantiated from:
-  // CHECK: :3:{{[0-9]+}}: note: instantiated from:
+  // CHECK: :4:{{[0-9]+}}: note: expanded from:
+  // CHECK: :3:{{[0-9]+}}: note: expanded from:
 }
 
 #define A 1
@@ -16,9 +16,9 @@
 void bar() {
   C;
   // CHECK: :17:3: warning: expression result unused
-  // CHECK: :15:11: note: instantiated from:
-  // CHECK: :14:11: note: instantiated from:
-  // CHECK: :13:11: note: instantiated from:
+  // CHECK: :15:11: note: expanded from:
+  // CHECK: :14:11: note: expanded from:
+  // CHECK: :13:11: note: expanded from:
 }
 
 // rdar://7597492
@@ -46,28 +46,28 @@
   // its easy to FileCheck.
   // CHECK-NEXT: macro_args3(1);
   // CHECK-NEXT: ~~~~~~~~~~~~^~
-  // CHECK: {{.*}}:36:36: note: instantiated from:
-  // CHECK: {{.*}}:35:36: note: instantiated from:
-  // CHECK: {{.*}}:34:24: note: instantiated from:
+  // CHECK: {{.*}}:36:36: note: expanded from:
+  // CHECK: {{.*}}:35:36: note: expanded from:
+  // CHECK: {{.*}}:34:24: note: expanded from:
 
   macro_many_args3(
     1,
     2,
     3);
   // CHECK: {{.*}}:55:5: warning: expression result unused
-  // CHECK: {{.*}}:40:55: note: instantiated from:
-  // CHECK: {{.*}}:39:55: note: instantiated from:
-  // CHECK: {{.*}}:38:35: note: instantiated from:
+  // CHECK: {{.*}}:40:55: note: expanded from:
+  // CHECK: {{.*}}:39:55: note: expanded from:
+  // CHECK: {{.*}}:38:35: note: expanded from:
 
   macro_many_args3(
     1,
     M2,
     3);
   // CHECK: {{.*}}:64:5: warning: expression result unused
-  // CHECK: {{.*}}:4:12: note: instantiated from:
-  // CHECK: {{.*}}:40:55: note: instantiated from:
-  // CHECK: {{.*}}:39:55: note: instantiated from:
-  // CHECK: {{.*}}:38:35: note: instantiated from:
+  // CHECK: {{.*}}:4:12: note: expanded from:
+  // CHECK: {{.*}}:40:55: note: expanded from:
+  // CHECK: {{.*}}:39:55: note: expanded from:
+  // CHECK: {{.*}}:38:35: note: expanded from:
 
   macro_many_args3(
     1,
@@ -78,11 +78,11 @@
   // arguments.
   // CHECK-NEXT: macro_args2(2),
   // CHECK-NEXT: ~~~~~~~~~~~~^~~
-  // CHECK: {{.*}}:35:36: note: instantiated from:
-  // CHECK: {{.*}}:34:24: note: instantiated from:
-  // CHECK: {{.*}}:40:55: note: instantiated from:
-  // CHECK: {{.*}}:39:55: note: instantiated from:
-  // CHECK: {{.*}}:38:35: note: instantiated from:
+  // CHECK: {{.*}}:35:36: note: expanded from:
+  // CHECK: {{.*}}:34:24: note: expanded from:
+  // CHECK: {{.*}}:40:55: note: expanded from:
+  // CHECK: {{.*}}:39:55: note: expanded from:
+  // CHECK: {{.*}}:38:35: note: expanded from:
 }
 
 #define variadic_args1(x, y, ...) y
@@ -94,9 +94,9 @@
   // CHECK: {{.*}}:93:21: warning: expression result unused
   // CHECK-NEXT: variadic_args3(1, 2, 3, 4);
   // CHECK-NEXT: ~~~~~~~~~~~~~~~~~~^~~~~~~~
-  // CHECK: {{.*}}:90:53: note: instantiated from:
-  // CHECK: {{.*}}:89:50: note: instantiated from:
-  // CHECK: {{.*}}:88:35: note: instantiated from:
+  // CHECK: {{.*}}:90:53: note: expanded from:
+  // CHECK: {{.*}}:89:50: note: expanded from:
+  // CHECK: {{.*}}:88:35: note: expanded from:
 }
 
 #define variadic_pasting_args1(x, y, z) y
@@ -108,16 +108,16 @@
 void test3() {
   variadic_pasting_args3(1, 2, 3, 4);
   // CHECK: {{.*}}:109:32: warning: expression result unused
-  // CHECK: {{.*}}:105:72: note: instantiated from:
-  // CHECK: {{.*}}:103:68: note: instantiated from:
-  // CHECK: {{.*}}:102:41: note: instantiated from:
+  // CHECK: {{.*}}:105:72: note: expanded from:
+  // CHECK: {{.*}}:103:68: note: expanded from:
+  // CHECK: {{.*}}:102:41: note: expanded from:
 
   variadic_pasting_args3a(1, 2, 3, 4);
   // FIXME: It'd be really nice to retain the start location of the first token
   // involved in the token paste instead of falling back on the full macro
   // location in the first two locations here.
   // CHECK: {{.*}}:115:3: warning: expression result unused
-  // CHECK: {{.*}}:106:44: note: instantiated from:
-  // CHECK: {{.*}}:104:72: note: instantiated from:
-  // CHECK: {{.*}}:102:41: note: instantiated from:
+  // CHECK: {{.*}}:106:44: note: expanded from:
+  // CHECK: {{.*}}:104:72: note: expanded from:
+  // CHECK: {{.*}}:102:41: note: expanded from:
 }

Modified: cfe/trunk/test/Misc/include-stack-for-note-flag.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/include-stack-for-note-flag.cpp?rev=135135&r1=135134&r2=135135&view=diff
==============================================================================
--- cfe/trunk/test/Misc/include-stack-for-note-flag.cpp (original)
+++ cfe/trunk/test/Misc/include-stack-for-note-flag.cpp Thu Jul 14 03:20:28 2011
@@ -18,11 +18,11 @@
 // STACK: note: candidate function not viable
 // STACK: error: comparison between pointer and integer
 // STACK:  In file included from
-// STACK: note: instantiated from:
+// STACK: note: expanded from:
 
 // STACKLESS: error: no matching function for call to 'foo'
 // STACKLESS-NOT:  In file included from
 // STACKLESS: note: candidate function not viable
 // STACKLESS: error: comparison between pointer and integer
 // STACKLESS-NOT:  In file included from
-// STACKLESS: note: instantiated from:
+// STACKLESS: note: expanded from:

Modified: cfe/trunk/test/Misc/macro-backtrace-limit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/macro-backtrace-limit.c?rev=135135&r1=135134&r2=135135&view=diff
==============================================================================
--- cfe/trunk/test/Misc/macro-backtrace-limit.c (original)
+++ cfe/trunk/test/Misc/macro-backtrace-limit.c Thu Jul 14 03:20:28 2011
@@ -17,16 +17,16 @@
 void f(int *ip, float *fp) {
   // CHECK: macro-backtrace-limit.c:31:7: warning: comparison of distinct pointer types ('int *' and 'float *')
   // CHECK: if (M12(ip, fp)) { }
-  // CHECK: macro-backtrace-limit.c:15:19: note: instantiated from:
+  // CHECK: macro-backtrace-limit.c:15:19: note: expanded from:
   // CHECK: #define M12(A, B) M11(A, B)
-  // CHECK: macro-backtrace-limit.c:14:19: note: instantiated from:
+  // CHECK: macro-backtrace-limit.c:14:19: note: expanded from:
   // CHECK: #define M11(A, B) M10(A, B)
-  // CHECK: note: (skipping 7 contexts in backtrace; use -fmacro-backtrace-limit=0 to see all)
-  // CHECK: macro-backtrace-limit.c:6:18: note: instantiated from:
+  // CHECK: note: (skipping 7 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
+  // CHECK: macro-backtrace-limit.c:6:18: note: expanded from:
   // CHECK: #define M3(A, B) M2(A, B)
-  // CHECK: macro-backtrace-limit.c:5:18: note: instantiated from:
+  // CHECK: macro-backtrace-limit.c:5:18: note: expanded from:
   // CHECK: #define M2(A, B) M1(A, B)
-  // CHECK: macro-backtrace-limit.c:4:23: note: instantiated from:
+  // CHECK: macro-backtrace-limit.c:4:23: note: expanded from:
   // CHECK: #define M1(A, B) ((A) < (B))
   if (M12(ip, fp)) { }
 }





More information about the cfe-commits mailing list