summaryrefslogtreecommitdiffstats
path: root/clang/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Sink getName into DirectoryLookup to simplify the client in clang.Chris Lattner2007-12-171-0/+12
| | | | llvm-svn: 45106
* add headermap.cppChris Lattner2007-12-171-0/+29
| | | | llvm-svn: 45095
* finish stubbing out support for HeaderMap. Now we just need an implementation!Chris Lattner2007-12-171-1/+2
| | | | llvm-svn: 45094
* refactor an better comment framework lookup code. This moves it from Chris Lattner2007-12-171-42/+53
| | | | | | | HeaderSearch into DirectoryLookup, as a particular framework lookup is specific to the directory we are currently querying. llvm-svn: 45093
* as it turns out, frameworks and headermaps are orthogonal. Make this so inChris Lattner2007-12-171-15/+33
| | | | | | | the internal representation. This also fixes a bug where -I foo -F foo would not search foo as both a normal and framework include dir. llvm-svn: 45092
* Step #1 in adding headermap support to clang.Chris Lattner2007-12-171-0/+28
| | | | llvm-svn: 45089
* add a helper method.Chris Lattner2007-12-131-0/+7
| | | | llvm-svn: 44976
* TargetInfo no longer includes a reference to SourceManager.Ted Kremenek2007-12-123-25/+37
| | | | | | | | | | | | | | | Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. llvm-svn: 44957
* Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek2007-12-111-2/+2
| | | | | | | | | | | | | | | | | | SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. llvm-svn: 44878
* Add dumping support for locations, make -dumptokens print out the locationChris Lattner2007-12-091-1/+20
| | | | | | info of each token. llvm-svn: 44741
* start partitioning the diagnostics into two classes: thoseChris Lattner2007-11-301-2/+2
| | | | | | | | that are builtin and those that are aren't. This is a bunch of API refactoring that will make this possible, but there is no functionality change yet. llvm-svn: 44473
* Support floating point literals of the form "1e-16f" which specify an ↵Christopher Lamb2007-11-291-2/+2
| | | | | | exponent but no decimal point. llvm-svn: 44431
* Removed potential buffer overrun (spotted by Neil Booth) when ↵Ted Kremenek2007-11-291-13/+8
| | | | | | | | | | | | | NumericLiteralParser converts a parsed literal into an APFloat. We are still performing a copy of the string, which hopefully will be removed eventually for performance reasons. This version now is at least safe. Changed rounding in APFloat construction in NumericLiteralParser from rmTowardsZero to rmNearestTiesToEven. llvm-svn: 44422
* Added optional pass-by-reference argument "isExact" toTed Kremenek2007-11-261-6/+16
| | | | | | | | | | | NumericLiteralParser::GetFloatValue(). Upon method return, this flag has the value true if the returned APFloat can exactly represent the number in the parsed text, and false otherwise. Modified the implementation of GetFloatValue() to parse literals using APFloat's convertFromString method (which allows us to set the value of isExact). llvm-svn: 44339
* Fix PR1820, an incredibly subtle macro expansion bug that Neil discovered.Chris Lattner2007-11-231-0/+10
| | | | | | Neil, please review this fix. llvm-svn: 44285
* fix a bug Steve noticed, where a #import of the main file itself would fail.Chris Lattner2007-11-151-1/+6
| | | | llvm-svn: 44178
* Fix a bug handling hex floats in c90 mode, pointed out by Neil.Chris Lattner2007-11-141-1/+1
| | | | llvm-svn: 44120
* Since we are all working on Leopard, change the built-in MacOS X version ↵Steve Naroff2007-11-101-1/+1
| | | | | | number (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) to target Leopard. This is only a short term solution, until the clang driver implements the "-mmacosx-version-min" flag (which will compute this value based on the target). llvm-svn: 43981
* Implement a more sensible strategy for ObjC built-in types (addressing a ↵Steve Naroff2007-10-311-27/+1
| | | | | | | | | | | | long standing FIXME in Sema::GetObjcIdType()). This removes several gross hacks to work around the previous "lazy" behavior. Two notes: - MinimalActions still needs to be taught about the built-in types (This breaks one of the -noop test cases). I started this, then added a FIXME. - I didn't convert Sema::GetObjcProtoType() yet. llvm-svn: 43567
* Checking in some code that is still under construction.Steve Naroff2007-10-311-1/+0
| | | | | | I need to (finally) change the way Class/id/SEL/IMP are built-in...the current approach of doing it in the preprocessor is "broken". The other problem is Sema::GetObjcIdType/GetObjcSelType/GetObjcClassType, the hooks that initialize ASTContext lazily. These built-in types need to be done up front... llvm-svn: 43557
* Add some plumbing to help cope with rewriting "id<p>", "Class<p>*".Steve Naroff2007-10-311-1/+1
| | | | llvm-svn: 43543
* Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I ↵Steve Naroff2007-10-301-15/+1
| | | | | | generate these declaration on the fly when rewriting a message expression. llvm-svn: 43529
* Avoid using macro expansions, which causes these to come out in -E mode.Chris Lattner2007-10-301-6/+6
| | | | llvm-svn: 43505
* Incorporate some feedback from Chris...Steve Naroff2007-10-241-1/+1
| | | | llvm-svn: 43285
* - Add rewrite rule for @class.Steve Naroff2007-10-231-0/+17
| | | | | | | - Add setter/getter to ObjcClassDecl. - Predefined key runtime functions. llvm-svn: 43257
* Silenced a couple of VC++ warnings.Hartmut Kaiser2007-10-181-4/+5
| | | | llvm-svn: 43125
* Move token length calculation out of the diagnostics machinery into Chris Lattner2007-10-171-0/+33
| | | | | | the lexer, where it can be shared. llvm-svn: 43090
* Add a new type of lexer: a raw lexer, which does not require a preprocessorChris Lattner2007-10-171-22/+63
| | | | | | object in order to do its thing. llvm-svn: 43084
* Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC ↵Steve Naroff2007-10-171-3/+21
| | | | | | goodies from the respective test files. Moving forward, it will be very nice to assume these builtin! llvm-svn: 43077
* Add support for Pascal strings.Anders Carlsson2007-10-151-0/+18
| | | | llvm-svn: 42974
* resolve a fixme, by moving __builtin_va_list to a more logicalChris Lattner2007-10-101-0/+6
| | | | | | place and making it correctly parameterized on the target. llvm-svn: 42830
* Add a dummy for the id typedef. Steve, plz fill this in. :)Chris Lattner2007-10-091-0/+7
| | | | llvm-svn: 42819
* Make a significant change to invert the control flow handlingChris Lattner2007-10-092-8/+131
| | | | | | | | | | | | | | | | | | | | | | predefined macros. Previously, these were handled by the driver, now they are handled by the preprocessor. Some fallout of this: 1. Instead of preprocessing two buffers (the predefines, then the main source file) we now start preprocessing the main source file and inject the predefines as a "psuedo #include" from the main source file. 2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify Preprocessor::isInPrimaryFile. 3. The driver doesn't have to know about standard #defines, the preprocessor knows, which is nice for people wanting to define their own drivers. 4. This allows us to put normal tokens in the predefine buffer, for example a definition for __builtin_va_list that is target-specific, and a typedef for id in objc. llvm-svn: 42818
* Switch lexer/pp over to new Token::is/isNot apiChris Lattner2007-10-096-82/+80
| | | | llvm-svn: 42799
* move IdentifierTable.h from liblex to libbasic.Chris Lattner2007-10-072-376/+2
| | | | llvm-svn: 42730
* implement the Token class in the Lexer.cpp file instead of IdentifierInfo.cppChris Lattner2007-10-072-23/+25
| | | | llvm-svn: 42728
* improve layering:Chris Lattner2007-10-074-50/+52
| | | | | | | | | Now instead of IdentifierInfo knowing anything about MacroInfo, only the preprocessor knows. This makes MacroInfo truly private to the Lex library (and its direct clients) instead of being accessed in the Basic library. llvm-svn: 42727
* change calls to getMacroInfo into hasMacroDefinition() where possible.Chris Lattner2007-10-073-8/+9
| | | | llvm-svn: 42726
* add a hasMacroDefinition() method to IdentifierInfo, strength reduce aChris Lattner2007-10-071-1/+2
| | | | | | call to getMacroInfo to call it. llvm-svn: 42725
* Remove the PPID bitfield from IdentifierInfo, shrinking it by a word Chris Lattner2007-10-071-11/+45
| | | | | | | | (because all bitfields now fit in 32 bits). This shrinks the identifier table for carbon.h from 1634428 to 1451424 bytes (12%) and has no impact on compile time. llvm-svn: 42723
* First step to fixing a long lived layering violation: thisChris Lattner2007-10-071-2/+21
| | | | | | | | | | moves the MacroInfo pointer to a side hash table (which currently lives in IdentifierTable.cpp). This removes a pointer from Identifier info, but doesn't shrink it, as it requires a new bit be added. This strange approach with the 'hasmacro' bit is needed to not lose preprocessor performance. llvm-svn: 42722
* simplify the interfaces to create selectors: getSelector can take any Chris Lattner2007-10-071-12/+3
| | | | | | | | number of arguments now and does the right thing, but the nullary/unary accessors are preserved as convenience functions. This allows us to slightly simplify clients. llvm-svn: 42716
* simplify some Selector interfaces.Chris Lattner2007-10-071-44/+46
| | | | llvm-svn: 42715
* Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet ofChris Lattner2007-10-051-0/+8
| | | | | | | | Selector's instead of requiring void* to be used. I converted one use of DenseSet<void*> over to use DenseSet<Selector> but the others should change as well. llvm-svn: 42645
* Layering refinements for selectors (suggested by Chris). Specifics...Steve Naroff2007-10-051-0/+148
| | | | | | | | | | | - Add SelectorTable, which enables us to remove MultiKeywordSelector from the public header. - Remove FoldingSet from IdentifierInfo.h and Preprocessor.h. - Remove Parser::ObjcGetUnarySelector and Parser::ObjcGetKeywordSelector, they are subsumed by SelectorTable. - Add MultiKeywordSelector to IdentifierInfo.cpp. - Move a bunch of selector related methods from ParseObjC.cpp to IdentifierInfo.cpp. - Added some comments. llvm-svn: 42643
* Add some comments to MultiKeywordSelector, make all methods private, add a ↵Steve Naroff2007-09-281-30/+0
| | | | | | friend, move some methods around. llvm-svn: 42456
* Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.Steve Naroff2007-09-281-18/+24
| | | | | | | | | | | | This motivated implementing a devious clattner inspired solution:-) This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema). This change was critical to make now, before we have too many clients. I still need to add some comments to the Selector class...will likely add later today/tomorrow. llvm-svn: 42452
* Fix bug in SelectorInfo::getName() - method buffer needs to be passed by ↵Steve Naroff2007-09-271-6/+8
| | | | | | reference. llvm-svn: 42411
* Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference ↵Steve Naroff2007-09-271-0/+23
| | | | | | | | | | | | | | | | | | | | is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set). SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits: #1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable. #2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%. #3: It results in many API simplifications. Here are some highlights: - Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages). - Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo). - Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured). I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later. Thanks to Chris for talking this through with me and suggesting this approach. llvm-svn: 42395
* If we see an invalid #ifdef directive, enter a conditional compilation regionChris Lattner2007-09-241-1/+6
| | | | | | so that we don't emit an error on the #endif. Suggestion by Neil. llvm-svn: 42258
OpenPOWER on IntegriCloud