Skip to content
  1. Jul 23, 2011
  2. Jul 21, 2011
  3. Jul 19, 2011
    • Chad Rosier's avatar
    • Chad Rosier's avatar
      Clang asserts "Invalid environment!" when using -ccc-host-triple · dcf77320
      Chad Rosier authored
      arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false
      positive.
      rdar://9786307
      
      llvm-svn: 135502
      dcf77320
    • Douglas Gregor's avatar
      Revamp the SourceManager to separate the representation of parsed · 925296b4
      Douglas Gregor authored
      source locations from source locations loaded from an AST/PCH file.
      
      Previously, loading an AST/PCH file involved carefully pre-allocating
      space at the beginning of the source manager for the source locations
      and FileIDs that correspond to the prefix, and then appending the
      source locations/FileIDs used for parsing the remaining translation
      unit. This design forced us into loading PCH files early, as a prefix,
      whic has become a rather significant limitation.
      
      This patch splits the SourceManager space into two parts: for source
      location "addresses", the lower values (growing upward) are used to
      describe parsed code, while upper values (growing downward) are used
      for source locations loaded from AST/PCH files. Similarly, positive
      FileIDs are used to describe parsed code while negative FileIDs are
      used to file/macro locations loaded from AST/PCH files. As a result,
      we can load PCH/AST files even during parsing, making various
      improvemnts in the future possible, e.g., teaching #include <foo.h> to
      look for and load <foo.h.gch> if it happens to be already available.
      
      This patch was originally written by Sebastian Redl, then brought
      forward to the modern age by Jonathan Turner, and finally
      polished/finished by me to be committed.
      
      llvm-svn: 135484
      925296b4
  4. Jul 14, 2011
  5. Jul 12, 2011
  6. Jul 11, 2011
    • Chandler Carruth's avatar
      Apply patch from Richard Trieu to fix PR9548: · d5173952
      Chandler Carruth authored
      When two different types has the same text representation in the same
      diagnostic message, print an a.k.a. after the type if the a.k.a. gives extra
      information about the type.
      
      class versa_string;
      
      typedef versa_string string;
      
      namespace std {template <typename T> class vector;}
      
      using std::vector;
      
      void f(vector<string> v);
      
      namespace std {
      class basic_string;
      typedef basic_string string;
      template <typename T> class vector {};
      void g() {
        vector<string> v;
        f(v);
      }
      }
      
      Old message:
      ----------------
      test.cc:15:3: error: no matching function for call to 'f'
        f(&v);
        ^
      test.cc:7:6: note: candidate function not viable: no known conversion from
            'vector<string>' to 'vector<string>' for 1st argument
      void f(vector<string> v);
           ^
      1 error generated.
      
      New message:
      ---------------
      test.cc:15:3: error: no matching function for call to 'f'
        f(v);
        ^
      test.cc:7:6: note: candidate function not viable: no known conversion from
            'vector<string>' (aka 'std::vector<std::basic_string>') to
            'vector<string>' (aka 'std::vector<versa_string>') for 1st argument
      void f(vector<string> v);
           ^
      1 error generated.
      
      llvm-svn: 134904
      d5173952
  7. Jul 09, 2011
  8. Jul 08, 2011
    • Evan Cheng's avatar
      Fix a FIXME in clang ARM driver that was exposed as a bug with ARM backend · 491f56d4
      Evan Cheng authored
      change.
      
      Previously clang was passing the following feature strings to the ARM backend
      when CPU is cortex-a8: +neon,-vfp2,-vfp3
      
      This used to work because -vfp2,-vfp3 had no effect after +neon. Now that the
      features are controlled by individual bits (with implied hierarchy), the net
      effect is all three features will be turned off.
      
      llvm-svn: 134691
      491f56d4
    • Chandler Carruth's avatar
      Keep track of which source locations are part of a macro argument · 402bb388
      Chandler Carruth authored
      instantiation and improve diagnostics which are stem from macro
      arguments to trace the argument itself back through the layers of macro
      expansion.
      
      This requires some tricky handling of the source locations, as the
      argument appears to be expanded in the opposite direction from the
      surrounding macro. This patch provides helper routines that encapsulate
      the logic and explain the reasoning behind how we step through macros
      during diagnostic printing.
      
      This fixes the rest of the test cases originially in PR9279, and later
      split out into PR10214 and PR10215.
      
      There is still some more work we can do here to improve the macro
      backtrace, but those will follow as separate patches.
      
      llvm-svn: 134660
      402bb388
    • Eric Christopher's avatar
      Fix a typo in the fpsr register and add the fpcr register. · 0c912c5f
      Eric Christopher authored
      Fixes PR10299 and rdar://9740322
      
      llvm-svn: 134654
      0c912c5f
  9. Jul 07, 2011
    • Argyrios Kyrtzidis's avatar
      Move SourceManager::isAt[Start/End]OfMacroInstantiation functions to the... · 61c58f7f
      Argyrios Kyrtzidis authored
      Move SourceManager::isAt[Start/End]OfMacroInstantiation functions to the Lexer, since they depend on it now.
      
      llvm-svn: 134644
      61c58f7f
    • Joerg Sonnenberger's avatar
      FreeBSD gets FreeBSD target, just mipsel. · c46e3ce5
      Joerg Sonnenberger authored
      llvm-svn: 134619
      c46e3ce5
    • Argyrios Kyrtzidis's avatar
      Make the Preprocessor more memory efficient and improve macro instantiation diagnostics. · 41fb2d95
      Argyrios Kyrtzidis authored
      When a macro instantiation occurs, reserve a SLocEntry chunk with length the
      full length of the macro definition source. Set the spelling location of this chunk
      to point to the start of the macro definition and any tokens that are lexed directly
      from the macro definition will get a location from this chunk with the appropriate offset.
      
      For any tokens that come from argument expansion, '##' paste operator, etc. have their
      instantiation location point at the appropriate place in the instantiated macro definition
      (the argument identifier and the '##' token respectively).
      This improves macro instantiation diagnostics:
      
      Before:
      
      t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
      int y = M(/);
              ^~~~
      t.c:5:11: note: instantiated from:
      int y = M(/);
                ^
      
      After:
      
      t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
      int y = M(/);
              ^~~~
      t.c:3:20: note: instantiated from:
      \#define M(op) (foo op 3);
                      ~~~ ^  ~
      t.c:5:11: note: instantiated from:
      int y = M(/);
                ^
      
      The memory savings for a candidate boost library that abuses the preprocessor are:
      
      - 32% less SLocEntries (37M -> 25M)
      - 30% reduction in PCH file size (900M -> 635M)
      - 50% reduction in memory usage for the SLocEntry table (1.6G -> 800M)
      
      llvm-svn: 134587
      41fb2d95
    • Argyrios Kyrtzidis's avatar
      Fix bug in SourceManager::getDecomposedInstantiationLocSlowCase. · c8f7e213
      Argyrios Kyrtzidis authored
      It would add up relative (decomposed) offsets like in getDecomposedSpellingLocSlowCase, but while
      it makes sense to preserve the offset among lexed spelling locations, it doesn't make
      sense to add anything to the offset of the instantiation location. The instantiation
      location will be the same regardless of the relative offset in the tokens that were
      instantiated.
      
      This bug didn't actually affect anything because, currently, in practice we never create macro
      locations with relative offset greater than 0.
      
      llvm-svn: 134586
      c8f7e213
    • Argyrios Kyrtzidis's avatar
      2cc62093
  10. Jul 06, 2011
  11. Jul 05, 2011
  12. Jul 04, 2011
  13. Jul 02, 2011
  14. Jun 29, 2011
  15. Jun 28, 2011
  16. Jun 24, 2011
  17. Jun 21, 2011
  18. Jun 17, 2011
Loading