History log of /external/clang/lib/Lex/MacroArgs.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a08529cc3f00e0b47a3c028823634129ac46847b 03-Oct-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed exapnsion range for # and ##.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
d7bb6a014afec8c8e2962d8282db412e664dc2f9 22-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying MacroArgs::create's arguments argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
8e85e85b8c3dbbc7e9863fe88f0992d825fd0e32 04-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle a code-completion token being passed to the macro stringify operator.
Fixes http://llvm.org/PR10826.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
b73377eeb3eff76be134203aebb6068244b177f3 07-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make the Preprocessor more memory efficient and improve macro instantiation diagnostics.

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)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
75c4064932d481ac710a80aa88b3370ad8a6af1d 28-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Silence more -Wnon-pod-memset given its current implementation. I may be
able to revert these based on a patch I'm working on, but no reason for
people to be spammed with warnings in the interim.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
453091cc2082e207ea2c2dda645a9bc01b37fb0c 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
4fe739f293057516e70b15a3e852f36614e07e73 28-Dec-2009 Chris Lattner <sabre@nondot.org> use best-fit instead of first-fit when reusing a MacroArgs object,
this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
f5809a7b76fd5a86ae737d9b525a1eddb9339ee7 28-Dec-2009 Chris Lattner <sabre@nondot.org> The PreExpArgTokens array is indexed with an argument #,
not a token number. Fix the reserve logic to get the right
amount of space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
6633522aaea663ebb18044a997b963bf92cd1a74 23-Dec-2009 Chris Lattner <sabre@nondot.org> fix the microsoft "charify" extension to return the charified token
as a character literal, not a string literal. This might fix
rdar://7486575


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
4608459d918261275af147b4c22351469f7ebea1 15-Dec-2009 Chris Lattner <sabre@nondot.org> enable reuse of MacroArgs objects. This is a small (2.5%) win
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
23f77e59718385512984d4e2a021bef52b9f6ddf 15-Dec-2009 Chris Lattner <sabre@nondot.org> set up the machinery for a MacroArgs cache hanging off Preprocessor.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
561395bead16b9dc9b0d5bfb6b257a9ed4545db6 14-Dec-2009 Chris Lattner <sabre@nondot.org> move the VarargsElided member of MacrosArgs to shrink the MacroArgs struct
on 64-bit targets. Pass Preprocessor into create/destroy methods of MacroArgs
even though it isn't used yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
9fc9e77c2fd15a88bd19ff3fdc9eb9716742f720 13-May-2009 Chris Lattner <sabre@nondot.org> When we expect two arguments but have zero, make sure to add
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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
500d3297d2a21edeac4d46cbcbe21bc2352c2a28 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
20c6b3b85e186cd52d5d99489132d71d498159eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.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!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
e7689886d6a68507ae90ca330bd24bf89d4d6df1 26-Jan-2009 Chris Lattner <sabre@nondot.org> remove my hacks that aggressively threw away multiple
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
47246be8ac5b0ddde6c402b8fc6946b6135487b5 26-Jan-2009 Chris Lattner <sabre@nondot.org> This change refactors some of the low-level lexer interfaces a bit.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
7c35122df2998d9f615c3ebd4b71a91a2c6287d6 26-Jan-2009 Chris Lattner <sabre@nondot.org> eagerly resolve the spelling locations of macro argument preexpansions.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
c19e8a2b92f5ab50d1d0da064ae078760cab369f 06-Jan-2009 Chris Lattner <sabre@nondot.org> Optimize stringification a bit to avoid std::string thrashing and
avoid the version of Preprocessor::getSpelling that returns an
std::string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/MacroArgs.cpp