Commit Graph

35 Commits

Author SHA1 Message Date
Steve Naroff 7c34817902 Add helper functions Token::isObjCAtKeyword() and Token::getObjCKeywordID().
Convert all clients to the new cleaner, more robust API.

llvm-svn: 41330
2007-08-23 18:16:40 +00:00
Chris Lattner 5e62929fed Make sure to initialize an ivar, patch by Benoit Boissinot.
llvm-svn: 40027
2007-07-19 00:11:19 +00:00
Chris Lattner 539007a78a Add support for C++'0x keywords, patch by Doug Gregor
llvm-svn: 39897
2007-07-16 04:18:29 +00:00
Chris Lattner 23b7eb677d Finally bite the bullet and make the major change: split the clang namespace
out of the llvm namespace.  This makes the clang namespace be a sibling of
llvm instead of being a child.

The good thing about this is that it makes many things unambiguous.  The
bad things is that many things in the llvm namespace (notably data structures
like smallvector) now require an llvm:: qualifier.  IMO, libsystem and libsupport
should be split out of llvm into their own namespace in the future, which will fix
this issue.

llvm-svn: 39659
2007-06-15 23:05:46 +00:00
Chris Lattner e8b2724017 Fix a bug steve noticed where we warned that __attribute is an extension,
but where we didn't warn about __attribute__.

llvm-svn: 39607
2007-06-08 17:27:55 +00:00
Chris Lattner b055f2ddfc switch to using iterators instead of stringmap visitors.
llvm-svn: 39336
2007-02-11 08:19:57 +00:00
Chris Lattner 54d032bb76 CStringMap -> StringMap.
llvm-svn: 39334
2007-02-08 19:24:25 +00:00
Chris Lattner 34d1f5a8de adjust to CStringMap interface change.
llvm-svn: 39333
2007-02-08 19:08:49 +00:00
Chris Lattner 9561a0b3e7 Add support for target-independent builtin functions (like __builtin_abs),
whose decl objects are lazily created the first time they are referenced.
Builtin functions are described by the clang/AST/Builtins.def file, which
makes it easy to add new ones.

This is missing two important pieces:
1. Support for the rest of the gcc builtins.
2. Support for target-specific builtins (e.g. __builtin_ia32_emms).

Just adding this builtins reduces the number of implicit function definitions
by 6, reducing the # diagnostics from 550 to 544 when parsing carbon.h.

I need to add all the i386-specific ones to eliminate several hundred more.
ugh.

llvm-svn: 39327
2007-01-28 08:20:04 +00:00
Chris Lattner 3e7592ea78 Add support for -fno-operator-names, patch by Bill.
llvm-svn: 39245
2006-12-04 07:48:37 +00:00
Chris Lattner 5b9f4891d7 Add support for C++ operator keywords. Patch by Bill Wendling.
llvm-svn: 39214
2006-11-21 17:23:33 +00:00
Chris Lattner da933aac0c remove some temporary testing code
llvm-svn: 39080
2006-10-29 23:49:15 +00:00
Chris Lattner 2b9e19be87 Pull the string hashtable out of the IdentifierTable, moving into LLVM's
libsupport.  Now it can be used for other things besides identifier hashing.

llvm-svn: 39079
2006-10-29 23:43:13 +00:00
Chris Lattner ec659fce46 move memory allocation abstraction stuff out into LLVM's libsupport
llvm-svn: 39078
2006-10-29 22:09:44 +00:00
Chris Lattner 3bc804ed3d genericize IdentifierInfo interface to make it work more naturally.
llvm-svn: 39076
2006-10-28 23:46:24 +00:00
Chris Lattner 56bdb9a9a1 Remove identifier length field from IdentifierInfo, it is now dead.
llvm-svn: 39063
2006-10-27 05:06:38 +00:00
Chris Lattner a883116ece fix bug reprobing.
llvm-svn: 39062
2006-10-27 04:54:47 +00:00
Chris Lattner f2e3ac3b54 reimplement identifier hash table in terms of a probed table instead of a chained
table.  This is about 25% faster for identifier lookup.  This also implements
resizing of the hash table.

llvm-svn: 39058
2006-10-27 03:59:10 +00:00
Chris Lattner 341fd06d3c Use the full hash as a filter to reduce # strcmps
llvm-svn: 39057
2006-10-26 05:18:38 +00:00
Chris Lattner 893f272c39 Track the full (not mod the hash table size) hash value for each token.
This lets us find interesting properties of the hash distribution.

llvm-svn: 39056
2006-10-26 05:12:31 +00:00
Chris Lattner 0ba3dc4ec3 Start removing LexerToken from the actions interface.
llvm-svn: 39043
2006-10-25 03:38:23 +00:00
Chris Lattner 3c98fd3af3 Switch to using a bitwise and instead of modulus.
llvm-svn: 39038
2006-10-22 17:48:27 +00:00
Chris Lattner a4271e4a51 rename
llvm-svn: 39024
2006-10-20 06:13:26 +00:00
Chris Lattner 25e0d54a0e Move keyword setup from the preprocessor into the IdentifierTable class.
llvm-svn: 39014
2006-10-18 06:07:05 +00:00
Chris Lattner 720f2700b1 Make the identifier table track objc keywords
llvm-svn: 39003
2006-10-17 04:03:44 +00:00
Chris Lattner 87d3bec423 Make preprocessor keywords like 'define' first class citizens in the
IdentifierTable, instead of making them resort to strcmp'ing.

llvm-svn: 39002
2006-10-17 03:44:32 +00:00
Chris Lattner 063400e46e Implement the #define_other_target directive.
llvm-svn: 38984
2006-10-14 19:54:15 +00:00
Chris Lattner c653246bfb Eliminate the IdentifierInfo::IsMacroArg flag.
llvm-svn: 38715
2006-07-15 06:55:18 +00:00
Chris Lattner d0a96ba38a Add a simple but useful optimization for identifier lookup. Each time we
query the hash table, when we look up an identifier that isn't at the head
of it's bucket's list, move it there.  This reduces the number of list
traversals in the common case where identifiers are used in bursts.

llvm-svn: 38689
2006-07-10 06:10:51 +00:00
Chris Lattner 6e0d42c6f8 Add identifiers for macro arguments to MacroInfo, check for duplicates,
enhance macro equality testing to verify argument lists match.

llvm-svn: 38682
2006-07-08 20:32:52 +00:00
Chris Lattner 0e1cf1f588 Fix indentation
llvm-svn: 38655
2006-07-04 18:53:52 +00:00
Chris Lattner c79f6fb108 Rename IdentifierTokenInfo -> IdentifierInfo.
llvm-svn: 38650
2006-07-04 17:53:21 +00:00
Chris Lattner 91cbf11c10 Add a new IdentifierVisitor class and a new IdentifierTable::VisitIdentifiers
method to support iteration over all identifiers.

llvm-svn: 38628
2006-07-03 04:28:52 +00:00
Chris Lattner 1786217e0b Finish implementation of #pragma once. Implement #pragma GCC poison.
llvm-svn: 38568
2006-06-24 22:12:56 +00:00
Chris Lattner 22eb972f38 Initial checkin of c-language parser
llvm-svn: 38539
2006-06-18 05:43:12 +00:00