summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/IdentifierTable.cpp
Commit message (Collapse)AuthorAgeFilesLines
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-3/+3
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-1/+1
| | | | llvm-svn: 171367
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-111-1/+1
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Remove unneeded includes from IdentifierTableNico Weber2012-11-111-1/+0
| | | | llvm-svn: 167694
* Macro history (de-)serialization. Deserialization currently reads only the ↵Alexander Kornienko2012-09-251-0/+1
| | | | | | | | | | | | | | | | latest macro definition. Needs more work. Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules. Reviewers: doug.gregor Reviewed By: alexfh CC: cfe-commits, rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D41 llvm-svn: 164610
* Allow disabling of wchar_t type.Abramo Bagnara2012-09-051-0/+2
| | | | llvm-svn: 163221
* Add missing cctype includes.Joerg Sonnenberger2012-08-101-0/+1
| | | | llvm-svn: 161660
* Change the way KEYNOMS is defined to be more comprehensible. Francois Pichet2012-07-241-2/+2
| | | | llvm-svn: 160663
* char16_t and char32_t are defined via typedef in MSVC 11 RC. So introduce a ↵Francois Pichet2012-07-221-1/+5
| | | | | | way to disable keywords under Microsoft mode. llvm-svn: 160612
* Documentation cleanup: escape @ in a Doxygen comment.James Dennett2012-06-151-2/+2
| | | | llvm-svn: 158548
* Synchronize the representations of DeclarationName and Selector soDouglas Gregor2012-05-041-9/+9
| | | | | | | | that bridging between the two is free. Saves ~4k of code size, although I don't see any measurable performance difference (unfortunately). llvm-svn: 156187
* Fix typo in comment, 'langauge' -> 'language'.Nick Lewycky2012-03-111-1/+1
| | | | llvm-svn: 152547
* Moving tagging of '__experimental_modules_import' IdentifierInfo out ofTed Kremenek2012-03-011-0/+4
| | | | | | | | | IndentifierTable::get() and into IdentifierTable's constructor. This gets a 0.7% reducing on lexing time for Cocoa.h, and about the same for PCH generation. llvm-svn: 151854
* Change @import to @__experimental_modules_import. We are not ready to ↵Ted Kremenek2012-03-011-1/+1
| | | | | | | | commit to a particular syntax for modules, and don't have time to push it forward in the near future. llvm-svn: 151841
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-1/+13
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-1/+2
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Re-uglify #public and #private to #__public_macro and #__private_macro.Douglas Gregor2012-01-031-2/+4
| | | | llvm-svn: 147469
* Eliminate the uglified keyword __import_module__ for importingDouglas Gregor2012-01-031-0/+1
| | | | | | | | | | | | | modules. This leaves us without an explicit syntax for importing modules in C/C++, because such a syntax needs to be discussed first. In Objective-C/Objective-C++, the @import syntax is used to import modules. Note that, under -fmodules, C/C++ programs can import modules via the #include mechanism when a module map is in place for that header. This allows us to work with modules in C/C++ without committing to a syntax. llvm-svn: 147467
* Under -fmodules, accept #public <macroname> and #private <macroname>Douglas Gregor2012-01-031-4/+3
| | | | | | | to make a macro public (the default for headers) or private, respectively. llvm-svn: 147455
* Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" ↵Benjamin Kramer2011-12-231-2/+2
| | | | | | | | so this patch is surprisingly small. Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility. llvm-svn: 147221
* objc-arc: bridge casts in non-objc-arc mode are ignord.Fariborz Jahanian2011-12-191-1/+3
| | | | | | But, warn too. // rdar://10597832 llvm-svn: 146904
* Make the loading of information attached to an IdentifierInfo from anDouglas Gregor2011-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AST file more lazy, so that we don't eagerly load that information for all known identifiers each time a new AST file is loaded. The eager reloading made some sense in the context of precompiled headers, since very few identifiers were defined before PCH load time. With modules, however, a huge amount of code can get parsed before we see an @import, so laziness becomes important here. The approach taken to make this information lazy is fairly simple: when we load a new AST file, we mark all of the existing identifiers as being out-of-date. Whenever we want to access information that may come from an AST (e.g., whether the identifier has a macro definition, or what top-level declarations have that name), we check the out-of-date bit and, if it's set, ask the AST reader to update the IdentifierInfo from the AST files. The update is a merge, and we now take care to merge declarations before/after imports with declarations from multiple imports. The results of this optimization are fairly dramatic. On a small application that brings in 14 non-trivial modules, this takes modules from being > 3x slower than a "perfect" PCH file down to 30% slower for a full rebuild. A partial rebuild (where the PCH file or modules can be re-used) is down to 7% slower. Making the PCH file just a little imperfect (e.g., adding two smallish modules used by a bunch of .m files that aren't in the PCH file) tips the scales in favor of the modules approach, with 24% faster partial rebuilds. This is just a first step; the lazy scheme could possibly be improved by adding versioning, so we don't search into modules we already searched. Moreover, we'll need similar lazy schemes for all of the other lookup data structures, such as DeclContexts. llvm-svn: 143100
* For modules, all macros that aren't include guards are implicitlyDouglas Gregor2011-10-171-0/+2
| | | | | | | public. Add a __private_macro__ directive to hide a macro, similar to the __module_private__ declaration specifier. llvm-svn: 142188
* Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when inRichard Smith2011-10-111-7/+10
| | | | | | C++98 mode. Only the first occurrence of each keyword will produce a warning. llvm-svn: 141700
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-1/+1
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Modules hide macro definitions by default, so that silly things likeDouglas Gregor2011-09-011-0/+1
| | | | | | | | | | | include guards don't show up as macro definitions in every translation unit that imports a module. Macro definitions can, however, be exported with the intentionally-ugly #__export_macro__ directive. Implement this feature by not even bothering to serialize non-exported macros to a module, because clients of that module need not (should not) know that these macros even exist. llvm-svn: 138943
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+1
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-13/+13
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* objc-arc: enforce performSelector rules in rejecting retaining selectorsFariborz Jahanian2011-07-051-0/+2
| | | | | | | passed to it, and unknown selectors causing potential leak. // rdar://9659270 llvm-svn: 134449
* Automatic Reference Counting.John McCall2011-06-151-2/+5
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
* Add SelectorTable::getTotalMemory() to allow clients to query how much ↵Ted Kremenek2011-04-181-0/+4
| | | | | | memory is used by selectors. llvm-svn: 129728
* C1X: add a language standardPeter Collingbourne2011-04-151-1/+3
| | | | llvm-svn: 129553
* Fix a bunch of major problems with __unknown_anytype and properly testJohn McCall2011-04-091-0/+5
| | | | | | for them. The only major missing feature is references. llvm-svn: 129234
* refactor flags for TokenKinds.defDylan Noblesmith2011-04-091-12/+12
| | | | | | | | Make KEYALL a combination of all other flags instead of its own separate flag. Also rewrite the enum definitions in hex instead of decimal. llvm-svn: 129213
* Move some of the logic about classifying Objective-C methods intoJohn McCall2011-03-021-0/+50
| | | | | | | | conventional categories into Basic and AST. Update the self-init checker to use this logic; CFRefCountChecker is complicated enough that I didn't want to touch it. llvm-svn: 126817
* Selector::getIdentifierInfoForSlot() can return NULL values, a factDouglas Gregor2011-02-181-0/+5
| | | | | | | | | | | | that was ignored in a few places (most notably, code completion). Introduce Selector::getNameForSlot() for the common case where we only care about the name. Audit all uses of getIdentifierInfoForSlot(), switching many over to getNameForSlot(), fixing a few crashers. Fixed <rdar://problem/8939352>, a code-completion crasher. llvm-svn: 125977
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-141-1/+3
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-301-1/+1
| | | | | | PR8423 llvm-svn: 117775
* When performing typo correction, look through the set of knownDouglas Gregor2010-10-141-0/+16
| | | | | | | | | | | | | | | | | | | | identifiers to determine good typo-correction candidates. Once we've identified those candidates, we perform name lookup on each of them and the consider the results. This optimization makes typo correction > 2x faster on a benchmark example using a single typo (NSstring) in a tiny file that includes Cocoa.h from a precompiled header, since we are deserializing far less information now during typo correction. There is a semantic change here, which is interesting. The presence of a similarly-named entity that is not visible can now affect typo correction. This is both good (you won't get weird corrections if the thing you wanted isn't in scope) and bad (you won't get good corrections if there is a similarly-named-but-completely-unrelated thing). Time will tell whether it was a good choice or not. llvm-svn: 116528
* _Bool is not a keyword in C++. Fixes PR7388 and PR8349.Douglas Gregor2010-10-131-2/+2
| | | | llvm-svn: 116422
* Add symantic support for the Pascal calling convention viaDawn Perchik2010-09-031-1/+3
| | | | | | | "__attribute((pascal))" or "__pascal" (and "_pascal" under -fborland-extensions). Support still needs to be added to llvm. llvm-svn: 112939
* More PCH -> AST renaming.Sebastian Redl2010-08-181-1/+1
| | | | llvm-svn: 111472
* -Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis2010-08-111-4/+3
| | | | | | | | -There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility. To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods. Store the bitfield in PCH. llvm-svn: 110868
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-301-0/+1
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* don't make _Bool be a keyword in -fms-extensions mode, patch byChris Lattner2010-05-211-1/+3
| | | | | | Steven Watanabe! llvm-svn: 104373
* Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are notChandler Carruth2010-04-171-3/+3
| | | | | | | | implemented precisely the same as GCC, but the distinction GCC makes isn't useful to represent. This allows parsing code which uses GCC-specific keywords ('asm', etc.) without parsing in a fully GNU mode. llvm-svn: 101667
* Reintroduce r98340 and r98341 now without copy/paste errors.Kovarththanan Rajaratnam2010-03-121-14/+15
| | | | | | Thanks to Ben for pointing this out. llvm-svn: 98345
OpenPOWER on IntegriCloud