Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson fb5e5ba3c7 Add __builtin_va_list definitions for x86_64 and ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42943 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 00:45:48 +00:00
Chris Lattner 8a12c2777c Push the rewriting APIs along. Build a trivial client that replaces tabs
with x's for now.  The APIs are all unimplemented, so it doesn't do 
anything yet! :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:38:32 +00:00
Chris Lattner a31f030d5c avoid accessing off the end of identifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:59:57 +00:00
Chris Lattner c7229c338c move IdentifierTable.h from liblex to libbasic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:58:51 +00:00
Chris Lattner d15fa82aeb speed up clang startup another 28% by avoiding std::vector<std::string>
for holding builtin target-specific macros.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 06:57:34 +00:00
Chris Lattner eab7792031 speed up clang startup time by about 23% by avoiding lots of
stringmap operations when there are no secondary targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 06:29:41 +00:00
Chris Lattner 1c9bdaef20 work around bugs and missing features in apfloat.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22 18:38:30 +00:00
Chris Lattner 525a05093a Use APFloat for the representation of FP immediates, ask the target
for *which* apfloat to use for a particular type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22 18:29:59 +00:00
Hartmut Kaiser 34947250ce Removed clang solution file for VC++, which didn't work properly because of hard coded paths in the llvm project files.
Changed windows detection to use LLVM pp constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-12 15:39:04 +00:00
Chris Lattner f3a031f47d remove the FATAL classifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 00:16:35 +00:00
Chris Lattner a8c11c6a78 VC++ doesn't define S_ISDIR
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-03 18:37:14 +00:00
Chris Lattner 6a4545ed8b Add #ifdefs to make the source portable to windows. Patch contributed
by Hartmut Kaiser!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41684 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-03 18:24:56 +00:00
Chris Lattner 8b6ca8866f constify a method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-30 05:59:30 +00:00
Chris Lattner c1e50fc734 Fix a bug in my previous commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40719 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:22:39 +00:00
Chris Lattner 991ae518e9 Increase the macro id cache to look up several recent entries, not just the last one.
This is important in insane cases like the one dannyb sent me recently:

#define F0(a) void a(){}
#define F1(a) F0(a##0) F0(a##1) F0(a##2) F0(a##3) F0(a##4) F0(a##5) F0(a##6) F0(a##7)
#define F2(a) F1(a##0) F1(a##1) F1(a##2) F1(a##3) F1(a##4) F1(a##5) F1(a##6) F1(a##7)
#define F3(a) F2(a##0) F2(a##1) F2(a##2) F2(a##3) F2(a##4) F2(a##5) F2(a##6) F2(a##7)
#define F4(a) F3(a##0) F3(a##1) F3(a##2) F3(a##3) F3(a##4) F3(a##5) F3(a##6) F3(a##7)
#define F5(a) F4(a##0) F4(a##1) F4(a##2) F4(a##3) F4(a##4) F4(a##5) F4(a##6) F4(a##7)
#define F6(a) F5(a##0) F5(a##1) F5(a##2) F5(a##3) F5(a##4) F5(a##5) F5(a##6) F5(a##7)
F6(f)

cpp is great.  :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 03:55:37 +00:00
Chris Lattner d8e3083840 Use a smallstring instead of an std::string in FileChanged to avoid some malloc traffic.
This speeds up -E on xalancbmk by 2.4%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24 06:57:14 +00:00
Chris Lattner 1cf12bfa80 check in an experiment that didn't work out, to allow for future investigation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24 06:43:46 +00:00
Chris Lattner 5e36a7a89d Add a cache to SourceManager to accellerate line # lookup. This is a
bottleneck for -E computation, because every token that starts a line needs
to determine *which* line it is on (so -E mode can insert the appropriate 
vertical whitespace).  This optimization improves this common case where
it is striding through the line # table.

This speeds up -E on xalancbmk by 3.2%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24 05:57:19 +00:00
Chris Lattner e36751b12c Switch TargetInfo::getTargetDefines from using an std::map<std::string, ...> to using
a llvm::StringMap.  This dramatically reduces the startup time of the preprocessor,
speeding up -Eonly on xalankbmk by 2.2%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40396 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-22 20:11:46 +00:00
Chris Lattner d1623a8199 Add support for reusing macroid's with negative physical loc deltas. This
keeps the MacroInfo table more compact.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40281 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-21 06:41:57 +00:00
Chris Lattner 45011cf25e remove some old cruft
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20 18:26:45 +00:00
Chris Lattner 31bb8be680 improve comments, implement a trivial single-entry cache in
SourceManager::getInstantiationLoc.  With this change, every token
expanded from a macro doesn't get its own MacroID.  :)

This reduces # macro IDs in carbon.h from 16805 to 9197



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20 18:00:12 +00:00
Chris Lattner 9dc1f530c0 Reimplement SourceLocation. Instead of having a
fileid/offset pair, it now contains a bit discriminating between
mapped locations and file locations.  This separates the tables for
macros and files in SourceManager, and allows better separation of
concepts in the rest of the compiler.  This allows us to have *many*
macro instantiations before running out of 'addressing space'.

This is also more efficient, because testing whether something is a
macro expansion is now a bit test instead of a table lookup (which
also used to require having a srcmgr around, now it doesn't).

This is fully functional, but there are several refinements and
optimizations left.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20 16:37:10 +00:00
Chris Lattner 136f93a2b6 Make octal constant lexing use AdvanceToTokenCharacter to give more
accurate diagnostics.  For test/Lexer/comments.c we now emit:

int x = 000000080;  /* expected-error {{invalid digit}} */
               ^
constants.c:7:4: error: invalid digit '8' in octal constant
00080;             /* expected-error {{invalid digit}} */
   ^


The last line is due to an escaped newline.  The full line looks like:

int y = 0000\
00080;             /* expected-error {{invalid digit}} */


Previously, we emitted:
constants.c:4:9: error: invalid digit '8' in octal constant
int x = 000000080;  /* expected-error {{invalid digit}} */
        ^
constants.c:6:9: error: invalid digit '8' in octal constant
int y = 0000\
        ^

which isn't too bad, but the new way is better for the user,
regardless of whether there is an escaped newline or not.

All the other lexer-related diagnostics should switch over 
to using AdvanceToTokenCharacter where appropriate.  Help
wanted :).

This implements test/Lexer/constants.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 06:55:01 +00:00
Chris Lattner abca2bba54 Change SourceManager::getInstantiationLoc to take virtual locations, doing its
virtual->physical mapping explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 06:35:27 +00:00
Chris Lattner d2d2a11a91 A significant refactoring of the type size stuff to also
compute type alignment.  This info is needed for struct layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 01:29:45 +00:00
Gabor Greif 1501218865 add missing header
(needed on Solaris)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-12 16:00:00 +00:00
Reid Spencer 5f016e2cb5 Stage two of getting CFE top correct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-11 17:01:13 +00:00