Skip to content
  1. Jul 27, 2011
  2. Jul 07, 2011
    • 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
  3. Apr 28, 2011
  4. Mar 16, 2010
  5. Dec 28, 2009
  6. Dec 23, 2009
  7. Dec 15, 2009
    • Chris Lattner's avatar
      enable reuse of MacroArgs objects. This is a small (2.5%) win · 1316249a
      Chris Lattner authored
      on PR5610 (2.185 -> 2.130s).  The big issue is that this is making
      insanely huge macro argument lists with over a million tokens in it.
      The reason that mallco and free are so expensive is that we are 
      actually going to the kernel to get it, and switching to a bump 
      pointer allocator won't change this in an interesting way.
      
      llvm-svn: 91449
      1316249a
    • Chris Lattner's avatar
      set up the machinery for a MacroArgs cache hanging off Preprocessor. · d19564b1
      Chris Lattner authored
      We creating and free thousands of MacroArgs objects (and the related
      std::vectors hanging off them) for the testcase in PR5610 even though
      there are only ~20 live at a time.  This doesn't actually use the 
      cache yet.
      
      llvm-svn: 91391
      d19564b1
  8. Dec 14, 2009
  9. Sep 09, 2009
  10. May 13, 2009
  11. Jan 29, 2009
  12. Jan 27, 2009
  13. Jan 26, 2009
    • Chris Lattner's avatar
      remove my hacks that aggressively threw away multiple · 357b57d7
      Chris Lattner authored
      instantiation history in an effort to speed up c99-intconst-1.c.
      Now that multiple nested instantiations are allowed, we just
      make them and don't pay the cost of lookups.  With the other
      changes that went in before this, reverting this is actually
      a speedup for c99-intconst-1.c, speeding it up from 1.96s to 1.80s,
      and preserves much better loc info.
      
      llvm-svn: 63036
      357b57d7
    • Chris Lattner's avatar
      This change refactors some of the low-level lexer interfaces a bit. · 5a7971e0
      Chris Lattner authored
      Token now has a class of kinds for "literals", which include 
      numeric constants, strings, etc.  These tokens can optionally have
      a pointer to the start of the token in the lexer buffer.  This 
      makes it faster to get spelling and do other gymnastics, because we
      don't have to go through source locations.
      
      This change is performance neutral, but will make other changes
      more feasible down the road.
      
      llvm-svn: 63028
      5a7971e0
    • Chris Lattner's avatar
      eagerly resolve the spelling locations of macro argument preexpansions. · ad13cf4e
      Chris Lattner authored
      This reduces fsyntax-only time on c99-intconst-1.c from 2.43s down to 
      2.01s (20%), reducing the number of fileid lookups from 2529040 linear 
      and 64771121 binary to 5625902 linear and 4151182 binary.
      
      This knocks getFileID down to only 4.6% of compile time on this testcase.
      At this point, malloc/free is over 35% of compile time, primarily allocating
      MacroArgs objects and their argument preexpansion vectors.
      
      I don't feel like malloc avoiding right now, so I'm just going to call
      this good.
      
      llvm-svn: 62994
      ad13cf4e
  14. Jan 06, 2009
  15. Mar 16, 2008
    • Chris Lattner's avatar
      Make a major restructuring of the clang tree: introduce a top-level · 7a51313d
      Chris Lattner authored
      lib dir and move all the libraries into it.  This follows the main
      llvm tree, and allows the libraries to be built in parallel.  The
      top level now enforces that all the libs are built before Driver,
      but we don't care what order the libs are built in.  This speeds
      up parallel builds, particularly incremental ones.
      
      llvm-svn: 48402
      7a51313d
  16. Mar 10, 2008
  17. Mar 09, 2008
Loading