Commit Graph

641 Commits

Author SHA1 Message Date
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 2abeb12df6 Fix building after the pure virtual function name changed.
llvm-svn: 39075
2006-10-28 19:51:26 +00:00
Steve Naroff b419d3a80e - Added basic structure for parsing top level Objective-C forms.
- Extended the typedef mechanism for classes, improved performance of the common case.
- Implemented @class in the parser.

llvm-svn: 39074
2006-10-27 23:18:49 +00:00
Chris Lattner 21b691d573 add some of the smaller test inputs I use.
llvm-svn: 39073
2006-10-27 18:15:56 +00:00
Chris Lattner 00a6be6f7b test again
llvm-svn: 39072
2006-10-27 18:09:32 +00:00
Chris Lattner a0ed5fe382 test
llvm-svn: 39071
2006-10-27 18:03:57 +00:00
Chris Lattner 91e911ad75 test
llvm-svn: 39070
2006-10-27 18:00:23 +00:00
Chris Lattner bcb416bbd5 Implement test/Preprocessor/comment_save_if.c
llvm-svn: 39069
2006-10-27 05:43:50 +00:00
Chris Lattner ce999c490a new testcase
llvm-svn: 39068
2006-10-27 05:43:33 +00:00
Chris Lattner 9916c5ca7e Remove GNU C++ min/max operator extension support, they have been removed
from gcc mainline.

llvm-svn: 39067
2006-10-27 05:24:37 +00:00
Chris Lattner ffda89611f Change DirectoryEntry::getName() to return a const char *
llvm-svn: 39066
2006-10-27 05:15:55 +00:00
Chris Lattner 480434865d change FileEntry::getName to return a const char*.
llvm-svn: 39065
2006-10-27 05:12:36 +00:00
Chris Lattner 1eb290b2e9 remove namelen field, it is now dead
llvm-svn: 39064
2006-10-27 05:07:16 +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 089e51923e remove todo
llvm-svn: 39061
2006-10-27 04:53:38 +00:00
Chris Lattner aded4a977d Implement an sse2 version of the block comment scanner.
llvm-svn: 39060
2006-10-27 04:42:31 +00:00
Chris Lattner 6cc3e36cd7 Speed up block comment skipping by 35%.
llvm-svn: 39059
2006-10-27 04:12:35 +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 05646c7f0e Fix these to allow clang to be in any dir.
llvm-svn: 39055
2006-10-26 04:56:55 +00:00
Chris Lattner a32cda40b5 make this harder
llvm-svn: 39054
2006-10-25 06:21:19 +00:00
Chris Lattner 1178cbd941 new testcase
llvm-svn: 39053
2006-10-25 06:18:35 +00:00
Chris Lattner ece49761a3 update comment
llvm-svn: 39052
2006-10-25 05:55:51 +00:00
Chris Lattner 5f84a0648d add ast node for ifstmt
llvm-svn: 39051
2006-10-25 05:55:20 +00:00
Chris Lattner c52b118676 Handle __extension__ as a unary operator if requested.
llvm-svn: 39050
2006-10-25 05:45:55 +00:00
Chris Lattner 0535ebb3bd only add to LastInGroupList if at the top-level.
llvm-svn: 39049
2006-10-25 05:28:22 +00:00
Chris Lattner 6d9a685d75 Make the driver print function bodies at -parse-print-ast
llvm-svn: 39048
2006-10-25 05:11:20 +00:00
Chris Lattner b19f796e97 llvm has no EH by default, no need for these flags.
llvm-svn: 39047
2006-10-25 05:09:05 +00:00
Chris Lattner e5cca06829 Make AST nodes for ReturnStmt's and CompoundStmts
llvm-svn: 39046
2006-10-25 04:29:46 +00:00
Chris Lattner f42cce7a8e Add new Stmt class
llvm-svn: 39045
2006-10-25 04:09:21 +00:00
Chris Lattner ae31969ad2 Finish removing LexerToken from actions interface
llvm-svn: 39044
2006-10-25 03:49:28 +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 64408c7107 Compoundstmts imply a scope, track it. This implements
test/Parser/CompoundStmtScope.c

llvm-svn: 39042
2006-10-25 03:15:33 +00:00
Chris Lattner 911d0fef03 Return an error code if an error occurs.
llvm-svn: 39041
2006-10-25 03:15:08 +00:00
Chris Lattner 19f4440f5b new testcase
llvm-svn: 39040
2006-10-25 03:14:54 +00:00
Chris Lattner b1072a3df5 remove empty file
llvm-svn: 39039
2006-10-25 03:07:01 +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 13175483d5 framework searching more efficient now
llvm-svn: 39037
2006-10-22 07:35:33 +00:00
Chris Lattner ca1a1ed4cb Add -F option
llvm-svn: 39036
2006-10-22 07:34:56 +00:00
Chris Lattner 5c3ac11bf5 Reduce amount #included
llvm-svn: 39035
2006-10-22 07:29:01 +00:00
Chris Lattner 07b019a1bc add #include
llvm-svn: 39034
2006-10-22 07:28:56 +00:00
Chris Lattner 25246dfeb0 Split the DirectoryLookup class out to its own header.
llvm-svn: 39033
2006-10-22 07:26:52 +00:00
Chris Lattner 8120bc7e4a add new DirectoryLookup.h file
llvm-svn: 39032
2006-10-22 07:26:43 +00:00
Chris Lattner 5ed76da296 Implement framework filesystem caching.
llvm-svn: 39031
2006-10-22 07:24:13 +00:00
Chris Lattner 6cd618c3e8 update
llvm-svn: 39030
2006-10-22 06:34:13 +00:00
Chris Lattner 762d21b254 increase number of file ID's so we can preprocess carbon.h
llvm-svn: 39029
2006-10-22 06:34:00 +00:00
Chris Lattner 2a904d0aba Add assertions for out-of-fileid error case
llvm-svn: 39028
2006-10-22 06:33:42 +00:00
Chris Lattner 0b9bdd9a74 Use read to open small files so we don't run out of file descriptors as easily.
llvm-svn: 39027
2006-10-20 06:53:51 +00:00
Chris Lattner 641a0be31b count # framework lookups
llvm-svn: 39026
2006-10-20 06:23:14 +00:00
Chris Lattner 7949310b49 Enable these keywords as extensions in c90
llvm-svn: 39025
2006-10-20 06:13:36 +00:00
Chris Lattner a4271e4a51 rename
llvm-svn: 39024
2006-10-20 06:13:26 +00:00
Chris Lattner b84f986f45 gnu90 is default again
llvm-svn: 39023
2006-10-20 06:13:18 +00:00
Chris Lattner 5c683b2b4b Fix a regression introduced when adding subframework support
llvm-svn: 39022
2006-10-20 05:12:14 +00:00
Chris Lattner 62aa0d4c9f Implement test/Preprocessor/macro_arg_keyword.c
llvm-svn: 39021
2006-10-20 05:08:24 +00:00
Chris Lattner 2bda2df3dc new testcase
llvm-svn: 39020
2006-10-20 05:08:12 +00:00
Chris Lattner 2f9888e2ca switch to gnu99 by default
llvm-svn: 39019
2006-10-20 05:03:55 +00:00
Chris Lattner 4daa077a5c accept the __extension__ prefix expr
llvm-svn: 39018
2006-10-20 05:03:44 +00:00
Chris Lattner 577377e847 Speed up [sub]framework searching
llvm-svn: 39017
2006-10-20 04:55:45 +00:00
Chris Lattner 38681d7d81 Add intel include path
llvm-svn: 39016
2006-10-20 04:55:39 +00:00
Chris Lattner 63dd32b656 Implement subframework lookup
llvm-svn: 39015
2006-10-20 04:42:40 +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 9f547a4fdd Fix regression in my last commit
llvm-svn: 39013
2006-10-18 06:06:41 +00:00
Chris Lattner 59a9ebdb17 refactor header searching stuff out of the main Preprocessor object into
it's own HeaderSearch object.  This makes Preprocessor simpler and easier
to understand.

llvm-svn: 39012
2006-10-18 05:34:33 +00:00
Chris Lattner ff777c38dc silence warning, add hacky patch for framework lookup
llvm-svn: 39011
2006-10-18 04:03:13 +00:00
Chris Lattner 1ff0ed1d24 update
llvm-svn: 39010
2006-10-18 04:02:58 +00:00
Chris Lattner 8fd6ee1f2f silence warning
llvm-svn: 39009
2006-10-18 04:02:50 +00:00
Chris Lattner 964202dac0 add note
llvm-svn: 39008
2006-10-18 04:02:41 +00:00
Chris Lattner 1f496804d5 silence a warning
llvm-svn: 39007
2006-10-18 04:02:28 +00:00
Chris Lattner 04d1f3f75f track whether DirectoryLookup dirs are framework dirs.
llvm-svn: 39006
2006-10-17 06:20:32 +00:00
Chris Lattner 110da6979e add a note
llvm-svn: 39005
2006-10-17 05:20:30 +00:00
Chris Lattner ff43821d53 Implement -std, -x, -ObjC and -ObjC++ options.
llvm-svn: 39004
2006-10-17 05:16:26 +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 b95cca0d33 fix test/Parser/attributes.c
llvm-svn: 39001
2006-10-17 03:01:08 +00:00
Chris Lattner 43ec2ce473 new testcase
llvm-svn: 39000
2006-10-17 03:00:45 +00:00
Chris Lattner ae986d5ac7 Remove temporary code
llvm-svn: 38999
2006-10-17 02:54:07 +00:00
Chris Lattner dd0b7cbf0b Oversight: fixes test/Lexer/number.c
llvm-svn: 38998
2006-10-17 02:53:51 +00:00
Chris Lattner 6e5b2a084e ignore '#line' and '# 123' for now.
llvm-svn: 38997
2006-10-17 02:53:32 +00:00
Chris Lattner dee9b26fb8 new testcase
llvm-svn: 38996
2006-10-17 02:53:13 +00:00
Chris Lattner 04132371bb Make ConsumeFoo methods return the location of the consumed token.
llvm-svn: 38995
2006-10-16 06:12:55 +00:00
Chris Lattner af63531ac3 Make ConsumeToken return the loc of the consumed token to simplify clients
llvm-svn: 38994
2006-10-16 06:06:51 +00:00
Chris Lattner 30f910e88e implement action callbacks for almost all the stmts.
llvm-svn: 38993
2006-10-16 05:52:41 +00:00
Chris Lattner 2dacc3ff2e Changes through out the parser and actions/ast interface to return top-level
declarations through the asm streamer.  For a testcase like:

int G;
int H, I, *J;
int func() {}

'clang -parse-print-ast' prints:

Read top-level decl: G
Read top-level decl: H
Read top-level decl: I
Read top-level decl: J
Read top-level decl: func

llvm-svn: 38992
2006-10-16 00:33:54 +00:00
Chris Lattner a11999d83a start creating proper ast nodes for variables and functions
llvm-svn: 38991
2006-10-15 22:34:45 +00:00
Chris Lattner 4856a42489 add notes
llvm-svn: 38990
2006-10-15 22:34:29 +00:00
Chris Lattner 14a1b64418 create an ast node for &&label
llvm-svn: 38989
2006-10-15 22:33:58 +00:00
Chris Lattner dad3c45adc update portability notes
llvm-svn: 38988
2006-10-15 01:13:14 +00:00
Chris Lattner 9c837537ad Sink target-specific #define info into the target descriptions. Add x86-32/64 and ppc64.
llvm-svn: 38987
2006-10-15 01:05:46 +00:00
Chris Lattner 2ddda73d40 add some notes.
llvm-svn: 38986
2006-10-15 01:05:06 +00:00
Chris Lattner 2ba425ea95 Get target-specific #defines from TargetInfo.
llvm-svn: 38985
2006-10-14 19:54:37 +00:00
Chris Lattner 063400e46e Implement the #define_other_target directive.
llvm-svn: 38984
2006-10-14 19:54:15 +00:00
Chris Lattner 58360339bd define extensions
llvm-svn: 38983
2006-10-14 19:53:48 +00:00
Chris Lattner 02846975da new testcase
llvm-svn: 38982
2006-10-14 19:53:37 +00:00
Chris Lattner 3e8b4d2854 new testcase for #define_target.
llvm-svn: 38981
2006-10-14 19:09:13 +00:00
Chris Lattner 81278c6356 Implement the #define_target preprocessor directive.
llvm-svn: 38980
2006-10-14 19:03:49 +00:00
Chris Lattner 2194ddc83d Add new TargetInfo hooks for getting the set of target-specific #defines.
llvm-svn: 38979
2006-10-14 18:32:26 +00:00
Chris Lattner 1f5ad11409 Implement TargetInfo hooks for #defines
llvm-svn: 38978
2006-10-14 18:32:12 +00:00
Chris Lattner bfe9860bec add some notes about the portability model
llvm-svn: 38977
2006-10-14 17:39:56 +00:00
Chris Lattner aecc057c64 new testcase
llvm-svn: 38976
2006-10-14 07:54:12 +00:00
Chris Lattner 02dffbda3b Write up TargetInfo so that use of wchar_t strings results in a warning if
used in a target set where the size is not identical.

llvm-svn: 38975
2006-10-14 07:50:21 +00:00
Chris Lattner bc525438f7 Mark stuff const.
llvm-svn: 38974
2006-10-14 07:39:48 +00:00
Chris Lattner 2cbe715b79 Add Targets.cpp.
llvm-svn: 38973
2006-10-14 07:39:38 +00:00
Chris Lattner 5ba61f0e10 Add Targets.cpp, which implements the -arch command line option in terms of
TargetInfo.

llvm-svn: 38972
2006-10-14 07:39:34 +00:00
Chris Lattner 1e27fe165c Add new TargetInfo class to clang.
llvm-svn: 38971
2006-10-14 07:06:20 +00:00
Chris Lattner 509d3c00ed Rename LexerToken methods to be more consistent
llvm-svn: 38970
2006-10-14 05:19:39 +00:00
Chris Lattner 8c2048710d Rename LexerToken methods to be more consistent.
llvm-svn: 38969
2006-10-14 05:19:21 +00:00
Chris Lattner 56c7a5549c Minor edits
llvm-svn: 38968
2006-10-14 05:19:00 +00:00
Chris Lattner d504f7d6c2 add notes
llvm-svn: 38967
2006-10-06 05:56:14 +00:00
Chris Lattner 8c76f87810 change default mode
llvm-svn: 38966
2006-10-06 05:56:09 +00:00
Chris Lattner 94b4ce3eae don't abort
llvm-svn: 38965
2006-10-06 05:51:35 +00:00
Chris Lattner ea2f706262 add notes
llvm-svn: 38964
2006-10-06 05:40:42 +00:00
Chris Lattner 65de4b6a6d make this a bit nicer
llvm-svn: 38963
2006-10-06 05:40:30 +00:00
Chris Lattner 6f433fd2d3 add accessor
llvm-svn: 38962
2006-10-06 05:40:22 +00:00
Chris Lattner b5600a6aa8 Parse ?:'s right
llvm-svn: 38961
2006-10-06 05:40:05 +00:00
Chris Lattner d3e9895b9a Initial support for semantic analysis and AST building for StringExpr nodes.
llvm-svn: 38960
2006-10-06 05:22:26 +00:00
Chris Lattner 19acaadc2b more notes
llvm-svn: 38959
2006-10-06 05:20:10 +00:00
Chris Lattner e1f4e21756 mention clang
llvm-svn: 38958
2006-10-06 04:16:41 +00:00
Chris Lattner 940edd4cff Move clang driver into Driver subdir
llvm-svn: 38957
2006-10-06 04:16:30 +00:00
Chris Lattner 50f4f07ce5 move driver to new subdir
llvm-svn: 38956
2006-10-06 04:15:14 +00:00
Chris Lattner a81fb94997 build in a new dir
llvm-svn: 38955
2006-10-06 04:15:06 +00:00
Chris Lattner 87d229a3ce Significant extensions, write intro
llvm-svn: 38954
2006-10-06 04:10:25 +00:00
Chris Lattner 8f46a38503 new testcase
llvm-svn: 38953
2006-10-06 02:59:40 +00:00
Chris Lattner 051df7bfc4 Make this work with llvm cvs
llvm-svn: 38952
2006-08-27 07:12:21 +00:00
Chris Lattner 26da7302ce Build AST's for sizeof/alignof with type operands.
llvm-svn: 38951
2006-08-24 06:49:19 +00:00
Chris Lattner e550a4ea12 Build CastExpr AST nodes
llvm-svn: 38950
2006-08-24 06:37:51 +00:00
Chris Lattner 26115acb1c Build AST's for sizeof/alignof an expr.
llvm-svn: 38949
2006-08-24 06:10:04 +00:00
Chris Lattner 6f3a117f81 switch MemberExpr to holding a field decl instead of a raw identifier.
llvm-svn: 38948
2006-08-24 05:19:28 +00:00
Chris Lattner 98286a4551 Allow expression actions to fail
llvm-svn: 38947
2006-08-24 05:02:11 +00:00
Chris Lattner e1598f0184 Move the ExprResult struct from the Parser to the Actions.
llvm-svn: 38946
2006-08-24 04:56:36 +00:00
Chris Lattner 0eedafed1d more comments.
llvm-svn: 38945
2006-08-24 04:56:27 +00:00
Chris Lattner 879b9ad083 Add initial support for simple-primary exprs, including DeclExprs.
llvm-svn: 38944
2006-08-24 04:53:44 +00:00
Chris Lattner e165d944c2 Add AST nodes for array, call, . and ->.
llvm-svn: 38943
2006-08-24 04:40:38 +00:00
Chris Lattner 6d28d9b428 Invoke actions for postfix exprs
llvm-svn: 38942
2006-08-24 03:51:22 +00:00
Chris Lattner de648186eb Add actions for postfix exprs
llvm-svn: 38941
2006-08-24 03:51:14 +00:00
Chris Lattner 1b92649857 Add AST nodes and actions for paren exprs and simple unary ops.
llvm-svn: 38940
2006-08-23 06:42:10 +00:00
Chris Lattner 9b6d4cb90e Add (basic) expression AST representation capabilities for int/fp/binops/condexpr.
Add callbacks for same.
Add "full locinfo" mode.

llvm-svn: 38939
2006-08-23 05:17:46 +00:00
Chris Lattner c11438cee1 Implement first cut of ASTBuilder class.
llvm-svn: 38938
2006-08-18 05:17:52 +00:00
Chris Lattner 01b0f1be80 xcode 2.4
llvm-svn: 38937
2006-08-18 03:44:41 +00:00
Chris Lattner 38ba3363ef Hook up more of the ASTStreamer
llvm-svn: 38936
2006-08-17 07:04:37 +00:00
Chris Lattner 73709eda2b Stub out the ASTStreamer
llvm-svn: 38935
2006-08-17 06:28:25 +00:00
Chris Lattner 769044337a add ast library
llvm-svn: 38934
2006-08-17 05:55:28 +00:00
Chris Lattner 3e7bd4ed44 Start adding support for printing out parser callbacks and adding ast building
llvm-svn: 38933
2006-08-17 05:51:27 +00:00
Chris Lattner eb401b1bc7 updates
llvm-svn: 38932
2006-08-17 05:20:50 +00:00
Chris Lattner d0745a08b6 New file
llvm-svn: 38931
2006-08-17 05:18:35 +00:00
Chris Lattner 3242dfdd55 move to AST
llvm-svn: 38930
2006-08-17 05:18:27 +00:00
Chris Lattner 0116c478e6 Implement asm statement parsing.
llvm-svn: 38929
2006-08-15 06:03:28 +00:00
Chris Lattner 5646b3e21c Fix test/Parser/types.c
llvm-svn: 38928
2006-08-15 05:12:01 +00:00
Chris Lattner 3ca67ba67f new testcase
llvm-svn: 38927
2006-08-15 05:11:49 +00:00