summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/MacroArgs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Audit all Preprocessor::getSpelling() callers, improving failureDouglas Gregor2010-03-161-12/+19
| | | | | | recovery for those that need it. llvm-svn: 98689
* use best-fit instead of first-fit when reusing a MacroArgs object,Chris Lattner2009-12-281-7/+16
| | | | | | this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s llvm-svn: 92203
* The PreExpArgTokens array is indexed with an argument #,Chris Lattner2009-12-281-5/+6
| | | | | | | not a token number. Fix the reserve logic to get the right amount of space. llvm-svn: 92202
* fix the microsoft "charify" extension to return the charified token Chris Lattner2009-12-231-1/+1
| | | | | | | as a character literal, not a string literal. This might fix rdar://7486575 llvm-svn: 92025
* enable reuse of MacroArgs objects. This is a small (2.5%) win Chris Lattner2009-12-151-10/+32
| | | | | | | | | | 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
* set up the machinery for a MacroArgs cache hanging off Preprocessor.Chris Lattner2009-12-151-0/+13
| | | | | | | | | 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
* move the VarargsElided member of MacrosArgs to shrink the MacroArgs structChris Lattner2009-12-141-2/+3
| | | | | | | on 64-bit targets. Pass Preprocessor into create/destroy methods of MacroArgs even though it isn't used yet. llvm-svn: 91345
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-17/+17
| | | | llvm-svn: 81346
* When we expect two arguments but have zero, make sure to addChris Lattner2009-05-131-0/+1
| | | | | | | | | two empty arguments. Also, add an assert so that this bug manifests as an assertion failure, not a valgrind problem. This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion llvm-svn: 71616
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* remove my hacks that aggressively threw away multiple Chris Lattner2009-01-261-6/+0
| | | | | | | | | | | 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
* This change refactors some of the low-level lexer interfaces a bit.Chris Lattner2009-01-261-2/+1
| | | | | | | | | | | | | 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
* eagerly resolve the spelling locations of macro argument preexpansions.Chris Lattner2009-01-261-2/+9
| | | | | | | | | | | | | | | 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
* Optimize stringification a bit to avoid std::string thrashing andChris Lattner2009-01-051-10/+24
| | | | | | | avoid the version of Preprocessor::getSpelling that returns an std::string. llvm-svn: 61769
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+225
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
OpenPOWER on IntegriCloud