summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/IdentifierTable.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-111-2/+27
| | | | | | Recommit of r223114, reverted in r223120. llvm-svn: 224012
* Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.Serge Pavlov2014-12-021-27/+2
| | | | llvm-svn: 223120
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-021-2/+27
| | | | | | | | | | | | | | | | | | | | | Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 llvm-svn: 223114
* Use enumerators instead of hardcoded integers when we decide if keyword is ↵Serge Pavlov2014-10-291-28/+38
| | | | | | enabled. llvm-svn: 220849
* Objective-C. Under a special flag, -Wcstring-format-directive,Fariborz Jahanian2014-09-091-0/+27
| | | | | | | | off by default, issue a warning if %s directive is used in certain CF/NS formatting APIs, to assist user in deprecating use of such %s in these APIs. rdar://18182443 llvm-svn: 217467
* Objective-C. Warn if user has made explicit callFariborz Jahanian2014-08-221-0/+1
| | | | | | | to +initilize as this results in an extra call to this method. rdar://16628028 llvm-svn: 216271
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-1/+3
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* [C++11] Use 'nullptr'.Craig Topper2014-05-081-4/+4
| | | | llvm-svn: 208280
* Fix a typo in r204164 that made *all* keywords available in OpenCL mode.Richard Smith2014-03-181-1/+1
| | | | llvm-svn: 204196
* Creating a printing policy for "half":Yunzhong Gao2014-03-181-0/+2
| | | | | | | | | | | | Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for other languages, error messages and metadata (and hence debug info) should refer to the half-precision floating point as "__fp16" instead of "half" when compiling for non-OpenCL languages. This patch creates a new printing policy for half in a similar manner to what is done for bool and wchar_t. Differential Revision: http://llvm-reviews.chandlerc.com/D2952 llvm-svn: 204164
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-111-1/+1
| | | | | | class. llvm-svn: 203537
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. llvm-svn: 199209
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Fixed a FIXME; created a print method for Selectors that accepts a ↵Aaron Ballman2014-01-031-0/+4
| | | | | | | | raw_ostream, and started using it in places it made sense. No functional changes intended, just API cleanliness. llvm-svn: 198428
* ObjectiveC migrator: For 'default' and 'shared' family ofFariborz Jahanian2013-10-101-3/+3
| | | | | | | methods, infer their self's type as their result type. // rdar://15145218 llvm-svn: 192377
* ObjectiveC migrator: A typical implementation ofFariborz Jahanian2013-10-071-1/+0
| | | | | | | | 'default' methods in Foundation does not infer 'instancetype' for methods' result type. // rdar://15145218 llvm-svn: 192129
* ObjectiveC migrator: For consistency, also inferFariborz Jahanian2013-09-181-0/+2
| | | | | | | | 'instancetype' for known family of methods with related result type; such as 'init' methods. // rdar://14987948 llvm-svn: 190956
* ObjectiveC migrator: remove dead code.Fariborz Jahanian2013-08-291-9/+1
| | | | llvm-svn: 189592
* ObjectiveC migrator: Add another family of factory Fariborz Jahanian2013-08-021-0/+5
| | | | | | methods which can be migrated to instancetype. llvm-svn: 187672
* ObjectiveC migrator: Fixes public buildbot failures,Fariborz Jahanian2013-08-021-8/+0
| | | | | | in my previous patch which was reverted in r187657 llvm-svn: 187661
* revert patch I added in r187655. It still breaks publicFariborz Jahanian2013-08-021-0/+8
| | | | | | buildbot. llvm-svn: 187657
* ObjectiveC migration. Check-in patch reverted in r187634.Fariborz Jahanian2013-08-021-8/+0
| | | | | | Also removed check for "NS" prefix for class name. llvm-svn: 187655
* Revert "ObjectiveC migrator. Migrate to instancetype return type for mehods ↵Rafael Espindola2013-08-021-0/+8
| | | | | | | | | | with certain prefix selector matching their class names' suffix." This reverts commit r187626. It is breaking the bots. llvm-svn: 187634
* ObjectiveC migrator. Migrate to instancetype return typeFariborz Jahanian2013-08-011-8/+0
| | | | | | | for mehods with certain prefix selector matching their class names' suffix. llvm-svn: 187626
* Objective-C migrator: some cleanup.Fariborz Jahanian2013-07-241-0/+3
| | | | | | | | Expose static type of init/alloc/retain with instance type as well. Ad-hoc cases are coming next. llvm-svn: 187068
* ObjC migrator: more knobs toward doingFariborz Jahanian2013-07-231-1/+1
| | | | | | instancetype migration. llvm-svn: 187000
* ObjC migrator: Define family of methodsFariborz Jahanian2013-07-231-0/+33
| | | | | | | which are candidate for migrating to 'instancetype'. wip. llvm-svn: 186981
* cleanup (address some more review comments for r183474):Adrian Prantl2013-06-101-6/+6
| | | | | | | | - reduce default buffer size to 64, which will still be large enough to hold any property names found in the wild. - get rid of the /*static*/ comments. llvm-svn: 183697
* address some comments on r183474:Adrian Prantl2013-06-071-10/+14
| | | | | | | | | | - factor the name construction part out from constructSetterName - rename constructSetterName to the more appropriate constructSetterSelector no functionality change intended. rdar://problem/14035789 llvm-svn: 183582
* [Modules] Use global index to improve typo correction performanceArgyrios Kyrtzidis2013-04-171-1/+1
| | | | | | | | | Typo correction for an unqualified name needs to walk through all of the identifier tables of all modules. When we have a global index, just walk its identifier table only. rdar://13425732 llvm-svn: 179730
* Remove some stray uses of <ctype.h> functions.Jordan Rose2013-02-091-1/+1
| | | | | | These are causing assertions on some MSVC builds. llvm-svn: 174805
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-4/+3
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* 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
OpenPOWER on IntegriCloud