Skip to content
  1. Oct 20, 2009
    • Chris Lattner's avatar
      Implement PR5242: don't desugar a type more than once in a diagnostic. This · bd19b181
      Chris Lattner authored
      implements a framework that allows us to use information about previously
      substituted values to simplify subsequent ones.  Maybe this would be useful
      for C++'y stuff, who knows.  We now get:
      
      t.c:4:21: error: invalid operands to binary expression ('size_t' (aka 'unsigned long *') and 'size_t')
        return (size_t) 0 + (size_t) 0;
               ~~~~~~~~~~ ^ ~~~~~~~~~~
      
      on the testcase.  Note that size_t is only aka'd once.
      
      llvm-svn: 84604
      bd19b181
  2. Sep 15, 2009
  3. Jul 08, 2009
  4. May 22, 2009
  5. Apr 28, 2009
    • Eli Friedman's avatar
      Simplify the scheme used for keywords, and change the classification · 2b680b43
      Eli Friedman authored
      scheme to be more useful.
      
      The new scheme introduces a set of categories that should be more 
      readable, and also reflects what we want to consider as an extension 
      more accurately.  Specifically, it makes the "what is a keyword" 
      determination accurately reflect whether the keyword is a GNU or 
      Microsoft extension.
      
      I also introduced separate flags for keyword aliases; this is useful 
      because the classification of the aliases is mostly unrelated to the 
      classification of the original keyword.
      
      This patch treats anything that's in the implementation 
      namespace (prefixed with "__", or "_X" where "X" is any upper-case 
      letter) as a keyword without marking it as an extension.  This is 
      consistent with the standards in that an implementation is allowed to define 
      arbitrary extensions in the implementation namespace without violating 
      the standard. This gets rid of all the nasty "extension used" warnings 
      for stuff like __attribute__ in -pedantic mode.  We still warn for 
      extensions outside of the the implementation namespace, like typeof.
      If someone wants to implement -Wextensions or something like that, we 
      could add additional information to the keyword table.
      
      This also removes processing for the unused "Boolean" language option; 
      such an extension isn't supported on any other C implementation, so I 
      don't see any point to adding it.
      
      The changes to test/CodeGen/inline.c are required because previously, we 
      weren't actually disabling the "inline" keyword in -std=c89 mode.
      
      I'll remove Boolean and NoExtensions from LangOptions in a follow-up 
      commit.
      
      llvm-svn: 70281
      2b680b43
  6. Apr 15, 2009
    • Daniel Dunbar's avatar
      Improve "assignment to cast" diagnostic. · c2223ab2
      Daniel Dunbar authored
       - Strip off extra parens when looking for casts.
       - Change the location info to point at the cast (instead of the
         assignment).
      
      For example, on
        
        int *b;
        #define a ((void*) b)
        void f0() {
          a = 10;
        }
        
      we now emit:
        
        /tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
          a = 10;
          ^ ~
        /tmp/t.c:2:12: note: instantiated from:
        #define a ((void*) b)
                  ~^~~~~~~~~~
        
      instead of:
        
        /tmp/t.c:4:5: error: expression is not assignable
          a = 10;
          ~ ^
      
      llvm-svn: 69114
      c2223ab2
    • Daniel Dunbar's avatar
      Strip paren expressions when trying to diagnose "cast as lvalue" · 9351c02b
      Daniel Dunbar authored
      extension.
      
      llvm-svn: 69100
      9351c02b
  7. Apr 07, 2009
  8. Mar 31, 2009
  9. Mar 27, 2009
  10. Mar 24, 2009
  11. Mar 09, 2009
  12. Mar 08, 2009
  13. Feb 20, 2009
    • Chris Lattner's avatar
      Fix a long standard problem with clang retaining "too much" sugar · 810d330c
      Chris Lattner authored
      information about types.  We often print diagnostics where we say 
      "foo_t" is bad, but the user doesn't know how foo_t is declared 
      (because it is a typedef).  Fix this by expanding sugar when present
      in a diagnostic (and not one of a few special cases, like vectors).
      
      Before:
      t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
       MAX(P, F);
       ^~~~~~~~~
      t.m:1:78: note: instantiated from:
      #define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                                   ^
      
      After:
      t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
       MAX(P, F);
       ^~~~~~~~~
      t.m:1:78: note: instantiated from:
      #define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                                   ^
      
      llvm-svn: 65081
      810d330c
  14. Feb 13, 2009
  15. Jan 24, 2009
  16. Dec 12, 2008
  17. Nov 22, 2008
  18. Nov 21, 2008
  19. Nov 17, 2008
  20. Aug 21, 2008
  21. Jul 25, 2008
  22. Feb 02, 2008
Loading